@aws-sdk/client-application-auto-scaling 3.180.0 → 3.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist-cjs/protocols/Aws_json1_1.js +16 -10
  3. package/dist-es/ApplicationAutoScaling.js +42 -49
  4. package/dist-es/ApplicationAutoScalingClient.js +22 -28
  5. package/dist-es/commands/DeleteScalingPolicyCommand.js +21 -28
  6. package/dist-es/commands/DeleteScheduledActionCommand.js +21 -28
  7. package/dist-es/commands/DeregisterScalableTargetCommand.js +21 -28
  8. package/dist-es/commands/DescribeScalableTargetsCommand.js +21 -28
  9. package/dist-es/commands/DescribeScalingActivitiesCommand.js +21 -28
  10. package/dist-es/commands/DescribeScalingPoliciesCommand.js +21 -28
  11. package/dist-es/commands/DescribeScheduledActionsCommand.js +21 -28
  12. package/dist-es/commands/PutScalingPolicyCommand.js +21 -28
  13. package/dist-es/commands/PutScheduledActionCommand.js +21 -28
  14. package/dist-es/commands/RegisterScalableTargetCommand.js +21 -28
  15. package/dist-es/endpoints.js +8 -8
  16. package/dist-es/models/ApplicationAutoScalingServiceException.js +5 -10
  17. package/dist-es/models/models_0.js +183 -118
  18. package/dist-es/pagination/DescribeScalableTargetsPaginator.js +25 -68
  19. package/dist-es/pagination/DescribeScalingActivitiesPaginator.js +25 -68
  20. package/dist-es/pagination/DescribeScalingPoliciesPaginator.js +25 -68
  21. package/dist-es/pagination/DescribeScheduledActionsPaginator.js +25 -68
  22. package/dist-es/protocols/Aws_json1_1.js +848 -991
  23. package/dist-es/runtimeConfig.browser.js +26 -12
  24. package/dist-es/runtimeConfig.js +30 -12
  25. package/dist-es/runtimeConfig.native.js +8 -5
  26. package/dist-es/runtimeConfig.shared.js +8 -11
  27. package/package.json +33 -33
@@ -1,936 +1,803 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { ApplicationAutoScalingServiceException as __BaseException } from "../models/ApplicationAutoScalingServiceException";
5
4
  import { ConcurrentUpdateException, FailedResourceAccessException, InternalServiceException, InvalidNextTokenException, LimitExceededException, ObjectNotFoundException, ValidationException, } from "../models/models_0";
6
- export var serializeAws_json1_1DeleteScalingPolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var headers, body;
8
- return __generator(this, function (_a) {
9
- headers = {
10
- "content-type": "application/x-amz-json-1.1",
11
- "x-amz-target": "AnyScaleFrontendService.DeleteScalingPolicy",
12
- };
13
- body = JSON.stringify(serializeAws_json1_1DeleteScalingPolicyRequest(input, context));
14
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
- });
16
- }); };
17
- export var serializeAws_json1_1DeleteScheduledActionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
- var headers, body;
19
- return __generator(this, function (_a) {
20
- headers = {
21
- "content-type": "application/x-amz-json-1.1",
22
- "x-amz-target": "AnyScaleFrontendService.DeleteScheduledAction",
23
- };
24
- body = JSON.stringify(serializeAws_json1_1DeleteScheduledActionRequest(input, context));
25
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
- });
27
- }); };
28
- export var serializeAws_json1_1DeregisterScalableTargetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
- var headers, body;
30
- return __generator(this, function (_a) {
31
- headers = {
32
- "content-type": "application/x-amz-json-1.1",
33
- "x-amz-target": "AnyScaleFrontendService.DeregisterScalableTarget",
34
- };
35
- body = JSON.stringify(serializeAws_json1_1DeregisterScalableTargetRequest(input, context));
36
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
- });
38
- }); };
39
- export var serializeAws_json1_1DescribeScalableTargetsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
40
- var headers, body;
41
- return __generator(this, function (_a) {
42
- headers = {
43
- "content-type": "application/x-amz-json-1.1",
44
- "x-amz-target": "AnyScaleFrontendService.DescribeScalableTargets",
45
- };
46
- body = JSON.stringify(serializeAws_json1_1DescribeScalableTargetsRequest(input, context));
47
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
48
- });
49
- }); };
50
- export var serializeAws_json1_1DescribeScalingActivitiesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
51
- var headers, body;
52
- return __generator(this, function (_a) {
53
- headers = {
54
- "content-type": "application/x-amz-json-1.1",
55
- "x-amz-target": "AnyScaleFrontendService.DescribeScalingActivities",
56
- };
57
- body = JSON.stringify(serializeAws_json1_1DescribeScalingActivitiesRequest(input, context));
58
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
59
- });
60
- }); };
61
- export var serializeAws_json1_1DescribeScalingPoliciesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
62
- var headers, body;
63
- return __generator(this, function (_a) {
64
- headers = {
65
- "content-type": "application/x-amz-json-1.1",
66
- "x-amz-target": "AnyScaleFrontendService.DescribeScalingPolicies",
67
- };
68
- body = JSON.stringify(serializeAws_json1_1DescribeScalingPoliciesRequest(input, context));
69
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
70
- });
71
- }); };
72
- export var serializeAws_json1_1DescribeScheduledActionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
73
- var headers, body;
74
- return __generator(this, function (_a) {
75
- headers = {
76
- "content-type": "application/x-amz-json-1.1",
77
- "x-amz-target": "AnyScaleFrontendService.DescribeScheduledActions",
78
- };
79
- body = JSON.stringify(serializeAws_json1_1DescribeScheduledActionsRequest(input, context));
80
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
81
- });
82
- }); };
83
- export var serializeAws_json1_1PutScalingPolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
84
- var headers, body;
85
- return __generator(this, function (_a) {
86
- headers = {
87
- "content-type": "application/x-amz-json-1.1",
88
- "x-amz-target": "AnyScaleFrontendService.PutScalingPolicy",
89
- };
90
- body = JSON.stringify(serializeAws_json1_1PutScalingPolicyRequest(input, context));
91
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
92
- });
93
- }); };
94
- export var serializeAws_json1_1PutScheduledActionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
95
- var headers, body;
96
- return __generator(this, function (_a) {
97
- headers = {
98
- "content-type": "application/x-amz-json-1.1",
99
- "x-amz-target": "AnyScaleFrontendService.PutScheduledAction",
100
- };
101
- body = JSON.stringify(serializeAws_json1_1PutScheduledActionRequest(input, context));
102
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
103
- });
104
- }); };
105
- export var serializeAws_json1_1RegisterScalableTargetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
106
- var headers, body;
107
- return __generator(this, function (_a) {
108
- headers = {
109
- "content-type": "application/x-amz-json-1.1",
110
- "x-amz-target": "AnyScaleFrontendService.RegisterScalableTarget",
111
- };
112
- body = JSON.stringify(serializeAws_json1_1RegisterScalableTargetRequest(input, context));
113
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
114
- });
115
- }); };
116
- export var deserializeAws_json1_1DeleteScalingPolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
117
- var data, contents, response;
118
- return __generator(this, function (_a) {
119
- switch (_a.label) {
120
- case 0:
121
- if (output.statusCode >= 300) {
122
- return [2, deserializeAws_json1_1DeleteScalingPolicyCommandError(output, context)];
123
- }
124
- return [4, parseBody(output.body, context)];
125
- case 1:
126
- data = _a.sent();
127
- contents = {};
128
- contents = deserializeAws_json1_1DeleteScalingPolicyResponse(data, context);
129
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
130
- return [2, Promise.resolve(response)];
131
- }
132
- });
133
- }); };
134
- var deserializeAws_json1_1DeleteScalingPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
135
- var parsedOutput, _a, errorCode, _b, parsedBody;
136
- var _c;
137
- return __generator(this, function (_d) {
138
- switch (_d.label) {
139
- case 0:
140
- _a = [__assign({}, output)];
141
- _c = {};
142
- return [4, parseBody(output.body, context)];
143
- case 1:
144
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
145
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
146
- _b = errorCode;
147
- switch (_b) {
148
- case "ConcurrentUpdateException": return [3, 2];
149
- case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": return [3, 2];
150
- case "InternalServiceException": return [3, 4];
151
- case "com.amazonaws.applicationautoscaling#InternalServiceException": return [3, 4];
152
- case "ObjectNotFoundException": return [3, 6];
153
- case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": return [3, 6];
154
- case "ValidationException": return [3, 8];
155
- case "com.amazonaws.applicationautoscaling#ValidationException": return [3, 8];
156
- }
157
- return [3, 10];
158
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
159
- case 3: throw _d.sent();
160
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
161
- case 5: throw _d.sent();
162
- case 6: return [4, deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)];
163
- case 7: throw _d.sent();
164
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
165
- case 9: throw _d.sent();
166
- case 10:
167
- parsedBody = parsedOutput.body;
168
- throwDefaultError({
169
- output: output,
170
- parsedBody: parsedBody,
171
- exceptionCtor: __BaseException,
172
- errorCode: errorCode,
173
- });
174
- _d.label = 11;
175
- case 11: return [2];
176
- }
177
- });
178
- }); };
179
- export var deserializeAws_json1_1DeleteScheduledActionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
180
- var data, contents, response;
181
- return __generator(this, function (_a) {
182
- switch (_a.label) {
183
- case 0:
184
- if (output.statusCode >= 300) {
185
- return [2, deserializeAws_json1_1DeleteScheduledActionCommandError(output, context)];
186
- }
187
- return [4, parseBody(output.body, context)];
188
- case 1:
189
- data = _a.sent();
190
- contents = {};
191
- contents = deserializeAws_json1_1DeleteScheduledActionResponse(data, context);
192
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
193
- return [2, Promise.resolve(response)];
194
- }
195
- });
196
- }); };
197
- var deserializeAws_json1_1DeleteScheduledActionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
198
- var parsedOutput, _a, errorCode, _b, parsedBody;
199
- var _c;
200
- return __generator(this, function (_d) {
201
- switch (_d.label) {
202
- case 0:
203
- _a = [__assign({}, output)];
204
- _c = {};
205
- return [4, parseBody(output.body, context)];
206
- case 1:
207
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
208
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
209
- _b = errorCode;
210
- switch (_b) {
211
- case "ConcurrentUpdateException": return [3, 2];
212
- case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": return [3, 2];
213
- case "InternalServiceException": return [3, 4];
214
- case "com.amazonaws.applicationautoscaling#InternalServiceException": return [3, 4];
215
- case "ObjectNotFoundException": return [3, 6];
216
- case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": return [3, 6];
217
- case "ValidationException": return [3, 8];
218
- case "com.amazonaws.applicationautoscaling#ValidationException": return [3, 8];
219
- }
220
- return [3, 10];
221
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
222
- case 3: throw _d.sent();
223
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
224
- case 5: throw _d.sent();
225
- case 6: return [4, deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)];
226
- case 7: throw _d.sent();
227
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
228
- case 9: throw _d.sent();
229
- case 10:
230
- parsedBody = parsedOutput.body;
231
- throwDefaultError({
232
- output: output,
233
- parsedBody: parsedBody,
234
- exceptionCtor: __BaseException,
235
- errorCode: errorCode,
236
- });
237
- _d.label = 11;
238
- case 11: return [2];
239
- }
240
- });
241
- }); };
242
- export var deserializeAws_json1_1DeregisterScalableTargetCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
243
- var data, contents, response;
244
- return __generator(this, function (_a) {
245
- switch (_a.label) {
246
- case 0:
247
- if (output.statusCode >= 300) {
248
- return [2, deserializeAws_json1_1DeregisterScalableTargetCommandError(output, context)];
249
- }
250
- return [4, parseBody(output.body, context)];
251
- case 1:
252
- data = _a.sent();
253
- contents = {};
254
- contents = deserializeAws_json1_1DeregisterScalableTargetResponse(data, context);
255
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
256
- return [2, Promise.resolve(response)];
257
- }
258
- });
259
- }); };
260
- var deserializeAws_json1_1DeregisterScalableTargetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
261
- var parsedOutput, _a, errorCode, _b, parsedBody;
262
- var _c;
263
- return __generator(this, function (_d) {
264
- switch (_d.label) {
265
- case 0:
266
- _a = [__assign({}, output)];
267
- _c = {};
268
- return [4, parseBody(output.body, context)];
269
- case 1:
270
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
271
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
272
- _b = errorCode;
273
- switch (_b) {
274
- case "ConcurrentUpdateException": return [3, 2];
275
- case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": return [3, 2];
276
- case "InternalServiceException": return [3, 4];
277
- case "com.amazonaws.applicationautoscaling#InternalServiceException": return [3, 4];
278
- case "ObjectNotFoundException": return [3, 6];
279
- case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": return [3, 6];
280
- case "ValidationException": return [3, 8];
281
- case "com.amazonaws.applicationautoscaling#ValidationException": return [3, 8];
282
- }
283
- return [3, 10];
284
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
285
- case 3: throw _d.sent();
286
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
287
- case 5: throw _d.sent();
288
- case 6: return [4, deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)];
289
- case 7: throw _d.sent();
290
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
291
- case 9: throw _d.sent();
292
- case 10:
293
- parsedBody = parsedOutput.body;
294
- throwDefaultError({
295
- output: output,
296
- parsedBody: parsedBody,
297
- exceptionCtor: __BaseException,
298
- errorCode: errorCode,
299
- });
300
- _d.label = 11;
301
- case 11: return [2];
302
- }
303
- });
304
- }); };
305
- export var deserializeAws_json1_1DescribeScalableTargetsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
306
- var data, contents, response;
307
- return __generator(this, function (_a) {
308
- switch (_a.label) {
309
- case 0:
310
- if (output.statusCode >= 300) {
311
- return [2, deserializeAws_json1_1DescribeScalableTargetsCommandError(output, context)];
312
- }
313
- return [4, parseBody(output.body, context)];
314
- case 1:
315
- data = _a.sent();
316
- contents = {};
317
- contents = deserializeAws_json1_1DescribeScalableTargetsResponse(data, context);
318
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
319
- return [2, Promise.resolve(response)];
320
- }
321
- });
322
- }); };
323
- var deserializeAws_json1_1DescribeScalableTargetsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
324
- var parsedOutput, _a, errorCode, _b, parsedBody;
325
- var _c;
326
- return __generator(this, function (_d) {
327
- switch (_d.label) {
328
- case 0:
329
- _a = [__assign({}, output)];
330
- _c = {};
331
- return [4, parseBody(output.body, context)];
332
- case 1:
333
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
334
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
335
- _b = errorCode;
336
- switch (_b) {
337
- case "ConcurrentUpdateException": return [3, 2];
338
- case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": return [3, 2];
339
- case "InternalServiceException": return [3, 4];
340
- case "com.amazonaws.applicationautoscaling#InternalServiceException": return [3, 4];
341
- case "InvalidNextTokenException": return [3, 6];
342
- case "com.amazonaws.applicationautoscaling#InvalidNextTokenException": return [3, 6];
343
- case "ValidationException": return [3, 8];
344
- case "com.amazonaws.applicationautoscaling#ValidationException": return [3, 8];
345
- }
346
- return [3, 10];
347
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
348
- case 3: throw _d.sent();
349
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
350
- case 5: throw _d.sent();
351
- case 6: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
352
- case 7: throw _d.sent();
353
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
354
- case 9: throw _d.sent();
355
- case 10:
356
- parsedBody = parsedOutput.body;
357
- throwDefaultError({
358
- output: output,
359
- parsedBody: parsedBody,
360
- exceptionCtor: __BaseException,
361
- errorCode: errorCode,
362
- });
363
- _d.label = 11;
364
- case 11: return [2];
365
- }
366
- });
367
- }); };
368
- export var deserializeAws_json1_1DescribeScalingActivitiesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
369
- var data, contents, response;
370
- return __generator(this, function (_a) {
371
- switch (_a.label) {
372
- case 0:
373
- if (output.statusCode >= 300) {
374
- return [2, deserializeAws_json1_1DescribeScalingActivitiesCommandError(output, context)];
375
- }
376
- return [4, parseBody(output.body, context)];
377
- case 1:
378
- data = _a.sent();
379
- contents = {};
380
- contents = deserializeAws_json1_1DescribeScalingActivitiesResponse(data, context);
381
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
382
- return [2, Promise.resolve(response)];
383
- }
384
- });
385
- }); };
386
- var deserializeAws_json1_1DescribeScalingActivitiesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
387
- var parsedOutput, _a, errorCode, _b, parsedBody;
388
- var _c;
389
- return __generator(this, function (_d) {
390
- switch (_d.label) {
391
- case 0:
392
- _a = [__assign({}, output)];
393
- _c = {};
394
- return [4, parseBody(output.body, context)];
395
- case 1:
396
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
397
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
398
- _b = errorCode;
399
- switch (_b) {
400
- case "ConcurrentUpdateException": return [3, 2];
401
- case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": return [3, 2];
402
- case "InternalServiceException": return [3, 4];
403
- case "com.amazonaws.applicationautoscaling#InternalServiceException": return [3, 4];
404
- case "InvalidNextTokenException": return [3, 6];
405
- case "com.amazonaws.applicationautoscaling#InvalidNextTokenException": return [3, 6];
406
- case "ValidationException": return [3, 8];
407
- case "com.amazonaws.applicationautoscaling#ValidationException": return [3, 8];
408
- }
409
- return [3, 10];
410
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
411
- case 3: throw _d.sent();
412
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
413
- case 5: throw _d.sent();
414
- case 6: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
415
- case 7: throw _d.sent();
416
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
417
- case 9: throw _d.sent();
418
- case 10:
419
- parsedBody = parsedOutput.body;
420
- throwDefaultError({
421
- output: output,
422
- parsedBody: parsedBody,
423
- exceptionCtor: __BaseException,
424
- errorCode: errorCode,
425
- });
426
- _d.label = 11;
427
- case 11: return [2];
428
- }
429
- });
430
- }); };
431
- export var deserializeAws_json1_1DescribeScalingPoliciesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
432
- var data, contents, response;
433
- return __generator(this, function (_a) {
434
- switch (_a.label) {
435
- case 0:
436
- if (output.statusCode >= 300) {
437
- return [2, deserializeAws_json1_1DescribeScalingPoliciesCommandError(output, context)];
438
- }
439
- return [4, parseBody(output.body, context)];
440
- case 1:
441
- data = _a.sent();
442
- contents = {};
443
- contents = deserializeAws_json1_1DescribeScalingPoliciesResponse(data, context);
444
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
445
- return [2, Promise.resolve(response)];
446
- }
447
- });
448
- }); };
449
- var deserializeAws_json1_1DescribeScalingPoliciesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
450
- var parsedOutput, _a, errorCode, _b, parsedBody;
451
- var _c;
452
- return __generator(this, function (_d) {
453
- switch (_d.label) {
454
- case 0:
455
- _a = [__assign({}, output)];
456
- _c = {};
457
- return [4, parseBody(output.body, context)];
458
- case 1:
459
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
460
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
461
- _b = errorCode;
462
- switch (_b) {
463
- case "ConcurrentUpdateException": return [3, 2];
464
- case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": return [3, 2];
465
- case "FailedResourceAccessException": return [3, 4];
466
- case "com.amazonaws.applicationautoscaling#FailedResourceAccessException": return [3, 4];
467
- case "InternalServiceException": return [3, 6];
468
- case "com.amazonaws.applicationautoscaling#InternalServiceException": return [3, 6];
469
- case "InvalidNextTokenException": return [3, 8];
470
- case "com.amazonaws.applicationautoscaling#InvalidNextTokenException": return [3, 8];
471
- case "ValidationException": return [3, 10];
472
- case "com.amazonaws.applicationautoscaling#ValidationException": return [3, 10];
473
- }
474
- return [3, 12];
475
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
476
- case 3: throw _d.sent();
477
- case 4: return [4, deserializeAws_json1_1FailedResourceAccessExceptionResponse(parsedOutput, context)];
478
- case 5: throw _d.sent();
479
- case 6: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
480
- case 7: throw _d.sent();
481
- case 8: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
482
- case 9: throw _d.sent();
483
- case 10: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
484
- case 11: throw _d.sent();
485
- case 12:
486
- parsedBody = parsedOutput.body;
487
- throwDefaultError({
488
- output: output,
489
- parsedBody: parsedBody,
490
- exceptionCtor: __BaseException,
491
- errorCode: errorCode,
492
- });
493
- _d.label = 13;
494
- case 13: return [2];
495
- }
496
- });
497
- }); };
498
- export var deserializeAws_json1_1DescribeScheduledActionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
499
- var data, contents, response;
500
- return __generator(this, function (_a) {
501
- switch (_a.label) {
502
- case 0:
503
- if (output.statusCode >= 300) {
504
- return [2, deserializeAws_json1_1DescribeScheduledActionsCommandError(output, context)];
505
- }
506
- return [4, parseBody(output.body, context)];
507
- case 1:
508
- data = _a.sent();
509
- contents = {};
510
- contents = deserializeAws_json1_1DescribeScheduledActionsResponse(data, context);
511
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
512
- return [2, Promise.resolve(response)];
513
- }
514
- });
515
- }); };
516
- var deserializeAws_json1_1DescribeScheduledActionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
517
- var parsedOutput, _a, errorCode, _b, parsedBody;
518
- var _c;
519
- return __generator(this, function (_d) {
520
- switch (_d.label) {
521
- case 0:
522
- _a = [__assign({}, output)];
523
- _c = {};
524
- return [4, parseBody(output.body, context)];
525
- case 1:
526
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
527
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
528
- _b = errorCode;
529
- switch (_b) {
530
- case "ConcurrentUpdateException": return [3, 2];
531
- case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": return [3, 2];
532
- case "InternalServiceException": return [3, 4];
533
- case "com.amazonaws.applicationautoscaling#InternalServiceException": return [3, 4];
534
- case "InvalidNextTokenException": return [3, 6];
535
- case "com.amazonaws.applicationautoscaling#InvalidNextTokenException": return [3, 6];
536
- case "ValidationException": return [3, 8];
537
- case "com.amazonaws.applicationautoscaling#ValidationException": return [3, 8];
538
- }
539
- return [3, 10];
540
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
541
- case 3: throw _d.sent();
542
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
543
- case 5: throw _d.sent();
544
- case 6: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
545
- case 7: throw _d.sent();
546
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
547
- case 9: throw _d.sent();
548
- case 10:
549
- parsedBody = parsedOutput.body;
550
- throwDefaultError({
551
- output: output,
552
- parsedBody: parsedBody,
553
- exceptionCtor: __BaseException,
554
- errorCode: errorCode,
555
- });
556
- _d.label = 11;
557
- case 11: return [2];
558
- }
559
- });
560
- }); };
561
- export var deserializeAws_json1_1PutScalingPolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
562
- var data, contents, response;
563
- return __generator(this, function (_a) {
564
- switch (_a.label) {
565
- case 0:
566
- if (output.statusCode >= 300) {
567
- return [2, deserializeAws_json1_1PutScalingPolicyCommandError(output, context)];
568
- }
569
- return [4, parseBody(output.body, context)];
570
- case 1:
571
- data = _a.sent();
572
- contents = {};
573
- contents = deserializeAws_json1_1PutScalingPolicyResponse(data, context);
574
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
575
- return [2, Promise.resolve(response)];
576
- }
577
- });
578
- }); };
579
- var deserializeAws_json1_1PutScalingPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
580
- var parsedOutput, _a, errorCode, _b, parsedBody;
581
- var _c;
582
- return __generator(this, function (_d) {
583
- switch (_d.label) {
584
- case 0:
585
- _a = [__assign({}, output)];
586
- _c = {};
587
- return [4, parseBody(output.body, context)];
588
- case 1:
589
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
590
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
591
- _b = errorCode;
592
- switch (_b) {
593
- case "ConcurrentUpdateException": return [3, 2];
594
- case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": return [3, 2];
595
- case "FailedResourceAccessException": return [3, 4];
596
- case "com.amazonaws.applicationautoscaling#FailedResourceAccessException": return [3, 4];
597
- case "InternalServiceException": return [3, 6];
598
- case "com.amazonaws.applicationautoscaling#InternalServiceException": return [3, 6];
599
- case "LimitExceededException": return [3, 8];
600
- case "com.amazonaws.applicationautoscaling#LimitExceededException": return [3, 8];
601
- case "ObjectNotFoundException": return [3, 10];
602
- case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": return [3, 10];
603
- case "ValidationException": return [3, 12];
604
- case "com.amazonaws.applicationautoscaling#ValidationException": return [3, 12];
605
- }
606
- return [3, 14];
607
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
608
- case 3: throw _d.sent();
609
- case 4: return [4, deserializeAws_json1_1FailedResourceAccessExceptionResponse(parsedOutput, context)];
610
- case 5: throw _d.sent();
611
- case 6: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
612
- case 7: throw _d.sent();
613
- case 8: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
614
- case 9: throw _d.sent();
615
- case 10: return [4, deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)];
616
- case 11: throw _d.sent();
617
- case 12: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
618
- case 13: throw _d.sent();
619
- case 14:
620
- parsedBody = parsedOutput.body;
621
- throwDefaultError({
622
- output: output,
623
- parsedBody: parsedBody,
624
- exceptionCtor: __BaseException,
625
- errorCode: errorCode,
626
- });
627
- _d.label = 15;
628
- case 15: return [2];
629
- }
630
- });
631
- }); };
632
- export var deserializeAws_json1_1PutScheduledActionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
633
- var data, contents, response;
634
- return __generator(this, function (_a) {
635
- switch (_a.label) {
636
- case 0:
637
- if (output.statusCode >= 300) {
638
- return [2, deserializeAws_json1_1PutScheduledActionCommandError(output, context)];
639
- }
640
- return [4, parseBody(output.body, context)];
641
- case 1:
642
- data = _a.sent();
643
- contents = {};
644
- contents = deserializeAws_json1_1PutScheduledActionResponse(data, context);
645
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
646
- return [2, Promise.resolve(response)];
647
- }
648
- });
649
- }); };
650
- var deserializeAws_json1_1PutScheduledActionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
651
- var parsedOutput, _a, errorCode, _b, parsedBody;
652
- var _c;
653
- return __generator(this, function (_d) {
654
- switch (_d.label) {
655
- case 0:
656
- _a = [__assign({}, output)];
657
- _c = {};
658
- return [4, parseBody(output.body, context)];
659
- case 1:
660
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
661
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
662
- _b = errorCode;
663
- switch (_b) {
664
- case "ConcurrentUpdateException": return [3, 2];
665
- case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": return [3, 2];
666
- case "InternalServiceException": return [3, 4];
667
- case "com.amazonaws.applicationautoscaling#InternalServiceException": return [3, 4];
668
- case "LimitExceededException": return [3, 6];
669
- case "com.amazonaws.applicationautoscaling#LimitExceededException": return [3, 6];
670
- case "ObjectNotFoundException": return [3, 8];
671
- case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": return [3, 8];
672
- case "ValidationException": return [3, 10];
673
- case "com.amazonaws.applicationautoscaling#ValidationException": return [3, 10];
674
- }
675
- return [3, 12];
676
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
677
- case 3: throw _d.sent();
678
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
679
- case 5: throw _d.sent();
680
- case 6: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
681
- case 7: throw _d.sent();
682
- case 8: return [4, deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)];
683
- case 9: throw _d.sent();
684
- case 10: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
685
- case 11: throw _d.sent();
686
- case 12:
687
- parsedBody = parsedOutput.body;
688
- throwDefaultError({
689
- output: output,
690
- parsedBody: parsedBody,
691
- exceptionCtor: __BaseException,
692
- errorCode: errorCode,
693
- });
694
- _d.label = 13;
695
- case 13: return [2];
696
- }
697
- });
698
- }); };
699
- export var deserializeAws_json1_1RegisterScalableTargetCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
700
- var data, contents, response;
701
- return __generator(this, function (_a) {
702
- switch (_a.label) {
703
- case 0:
704
- if (output.statusCode >= 300) {
705
- return [2, deserializeAws_json1_1RegisterScalableTargetCommandError(output, context)];
706
- }
707
- return [4, parseBody(output.body, context)];
708
- case 1:
709
- data = _a.sent();
710
- contents = {};
711
- contents = deserializeAws_json1_1RegisterScalableTargetResponse(data, context);
712
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
713
- return [2, Promise.resolve(response)];
714
- }
715
- });
716
- }); };
717
- var deserializeAws_json1_1RegisterScalableTargetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
718
- var parsedOutput, _a, errorCode, _b, parsedBody;
719
- var _c;
720
- return __generator(this, function (_d) {
721
- switch (_d.label) {
722
- case 0:
723
- _a = [__assign({}, output)];
724
- _c = {};
725
- return [4, parseBody(output.body, context)];
726
- case 1:
727
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
728
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
729
- _b = errorCode;
730
- switch (_b) {
731
- case "ConcurrentUpdateException": return [3, 2];
732
- case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": return [3, 2];
733
- case "InternalServiceException": return [3, 4];
734
- case "com.amazonaws.applicationautoscaling#InternalServiceException": return [3, 4];
735
- case "LimitExceededException": return [3, 6];
736
- case "com.amazonaws.applicationautoscaling#LimitExceededException": return [3, 6];
737
- case "ValidationException": return [3, 8];
738
- case "com.amazonaws.applicationautoscaling#ValidationException": return [3, 8];
739
- }
740
- return [3, 10];
741
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
742
- case 3: throw _d.sent();
743
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
744
- case 5: throw _d.sent();
745
- case 6: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
746
- case 7: throw _d.sent();
747
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
748
- case 9: throw _d.sent();
749
- case 10:
750
- parsedBody = parsedOutput.body;
751
- throwDefaultError({
752
- output: output,
753
- parsedBody: parsedBody,
754
- exceptionCtor: __BaseException,
755
- errorCode: errorCode,
756
- });
757
- _d.label = 11;
758
- case 11: return [2];
759
- }
760
- });
761
- }); };
762
- var deserializeAws_json1_1ConcurrentUpdateExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
763
- var body, deserialized, exception;
764
- return __generator(this, function (_a) {
765
- body = parsedOutput.body;
766
- deserialized = deserializeAws_json1_1ConcurrentUpdateException(body, context);
767
- exception = new ConcurrentUpdateException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
768
- return [2, __decorateServiceException(exception, body)];
5
+ export const serializeAws_json1_1DeleteScalingPolicyCommand = async (input, context) => {
6
+ const headers = {
7
+ "content-type": "application/x-amz-json-1.1",
8
+ "x-amz-target": "AnyScaleFrontendService.DeleteScalingPolicy",
9
+ };
10
+ let body;
11
+ body = JSON.stringify(serializeAws_json1_1DeleteScalingPolicyRequest(input, context));
12
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
+ };
14
+ export const serializeAws_json1_1DeleteScheduledActionCommand = async (input, context) => {
15
+ const headers = {
16
+ "content-type": "application/x-amz-json-1.1",
17
+ "x-amz-target": "AnyScaleFrontendService.DeleteScheduledAction",
18
+ };
19
+ let body;
20
+ body = JSON.stringify(serializeAws_json1_1DeleteScheduledActionRequest(input, context));
21
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
+ };
23
+ export const serializeAws_json1_1DeregisterScalableTargetCommand = async (input, context) => {
24
+ const headers = {
25
+ "content-type": "application/x-amz-json-1.1",
26
+ "x-amz-target": "AnyScaleFrontendService.DeregisterScalableTarget",
27
+ };
28
+ let body;
29
+ body = JSON.stringify(serializeAws_json1_1DeregisterScalableTargetRequest(input, context));
30
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
+ };
32
+ export const serializeAws_json1_1DescribeScalableTargetsCommand = async (input, context) => {
33
+ const headers = {
34
+ "content-type": "application/x-amz-json-1.1",
35
+ "x-amz-target": "AnyScaleFrontendService.DescribeScalableTargets",
36
+ };
37
+ let body;
38
+ body = JSON.stringify(serializeAws_json1_1DescribeScalableTargetsRequest(input, context));
39
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
+ };
41
+ export const serializeAws_json1_1DescribeScalingActivitiesCommand = async (input, context) => {
42
+ const headers = {
43
+ "content-type": "application/x-amz-json-1.1",
44
+ "x-amz-target": "AnyScaleFrontendService.DescribeScalingActivities",
45
+ };
46
+ let body;
47
+ body = JSON.stringify(serializeAws_json1_1DescribeScalingActivitiesRequest(input, context));
48
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
+ };
50
+ export const serializeAws_json1_1DescribeScalingPoliciesCommand = async (input, context) => {
51
+ const headers = {
52
+ "content-type": "application/x-amz-json-1.1",
53
+ "x-amz-target": "AnyScaleFrontendService.DescribeScalingPolicies",
54
+ };
55
+ let body;
56
+ body = JSON.stringify(serializeAws_json1_1DescribeScalingPoliciesRequest(input, context));
57
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
+ };
59
+ export const serializeAws_json1_1DescribeScheduledActionsCommand = async (input, context) => {
60
+ const headers = {
61
+ "content-type": "application/x-amz-json-1.1",
62
+ "x-amz-target": "AnyScaleFrontendService.DescribeScheduledActions",
63
+ };
64
+ let body;
65
+ body = JSON.stringify(serializeAws_json1_1DescribeScheduledActionsRequest(input, context));
66
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
+ };
68
+ export const serializeAws_json1_1PutScalingPolicyCommand = async (input, context) => {
69
+ const headers = {
70
+ "content-type": "application/x-amz-json-1.1",
71
+ "x-amz-target": "AnyScaleFrontendService.PutScalingPolicy",
72
+ };
73
+ let body;
74
+ body = JSON.stringify(serializeAws_json1_1PutScalingPolicyRequest(input, context));
75
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
+ };
77
+ export const serializeAws_json1_1PutScheduledActionCommand = async (input, context) => {
78
+ const headers = {
79
+ "content-type": "application/x-amz-json-1.1",
80
+ "x-amz-target": "AnyScaleFrontendService.PutScheduledAction",
81
+ };
82
+ let body;
83
+ body = JSON.stringify(serializeAws_json1_1PutScheduledActionRequest(input, context));
84
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
85
+ };
86
+ export const serializeAws_json1_1RegisterScalableTargetCommand = async (input, context) => {
87
+ const headers = {
88
+ "content-type": "application/x-amz-json-1.1",
89
+ "x-amz-target": "AnyScaleFrontendService.RegisterScalableTarget",
90
+ };
91
+ let body;
92
+ body = JSON.stringify(serializeAws_json1_1RegisterScalableTargetRequest(input, context));
93
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
+ };
95
+ export const deserializeAws_json1_1DeleteScalingPolicyCommand = async (output, context) => {
96
+ if (output.statusCode >= 300) {
97
+ return deserializeAws_json1_1DeleteScalingPolicyCommandError(output, context);
98
+ }
99
+ const data = await parseBody(output.body, context);
100
+ let contents = {};
101
+ contents = deserializeAws_json1_1DeleteScalingPolicyResponse(data, context);
102
+ const response = {
103
+ $metadata: deserializeMetadata(output),
104
+ ...contents,
105
+ };
106
+ return Promise.resolve(response);
107
+ };
108
+ const deserializeAws_json1_1DeleteScalingPolicyCommandError = async (output, context) => {
109
+ const parsedOutput = {
110
+ ...output,
111
+ body: await parseErrorBody(output.body, context),
112
+ };
113
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
114
+ switch (errorCode) {
115
+ case "ConcurrentUpdateException":
116
+ case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
117
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
118
+ case "InternalServiceException":
119
+ case "com.amazonaws.applicationautoscaling#InternalServiceException":
120
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
121
+ case "ObjectNotFoundException":
122
+ case "com.amazonaws.applicationautoscaling#ObjectNotFoundException":
123
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
124
+ case "ValidationException":
125
+ case "com.amazonaws.applicationautoscaling#ValidationException":
126
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
127
+ default:
128
+ const parsedBody = parsedOutput.body;
129
+ throwDefaultError({
130
+ output,
131
+ parsedBody,
132
+ exceptionCtor: __BaseException,
133
+ errorCode,
134
+ });
135
+ }
136
+ };
137
+ export const deserializeAws_json1_1DeleteScheduledActionCommand = async (output, context) => {
138
+ if (output.statusCode >= 300) {
139
+ return deserializeAws_json1_1DeleteScheduledActionCommandError(output, context);
140
+ }
141
+ const data = await parseBody(output.body, context);
142
+ let contents = {};
143
+ contents = deserializeAws_json1_1DeleteScheduledActionResponse(data, context);
144
+ const response = {
145
+ $metadata: deserializeMetadata(output),
146
+ ...contents,
147
+ };
148
+ return Promise.resolve(response);
149
+ };
150
+ const deserializeAws_json1_1DeleteScheduledActionCommandError = async (output, context) => {
151
+ const parsedOutput = {
152
+ ...output,
153
+ body: await parseErrorBody(output.body, context),
154
+ };
155
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
156
+ switch (errorCode) {
157
+ case "ConcurrentUpdateException":
158
+ case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
159
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
160
+ case "InternalServiceException":
161
+ case "com.amazonaws.applicationautoscaling#InternalServiceException":
162
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
163
+ case "ObjectNotFoundException":
164
+ case "com.amazonaws.applicationautoscaling#ObjectNotFoundException":
165
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
166
+ case "ValidationException":
167
+ case "com.amazonaws.applicationautoscaling#ValidationException":
168
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
169
+ default:
170
+ const parsedBody = parsedOutput.body;
171
+ throwDefaultError({
172
+ output,
173
+ parsedBody,
174
+ exceptionCtor: __BaseException,
175
+ errorCode,
176
+ });
177
+ }
178
+ };
179
+ export const deserializeAws_json1_1DeregisterScalableTargetCommand = async (output, context) => {
180
+ if (output.statusCode >= 300) {
181
+ return deserializeAws_json1_1DeregisterScalableTargetCommandError(output, context);
182
+ }
183
+ const data = await parseBody(output.body, context);
184
+ let contents = {};
185
+ contents = deserializeAws_json1_1DeregisterScalableTargetResponse(data, context);
186
+ const response = {
187
+ $metadata: deserializeMetadata(output),
188
+ ...contents,
189
+ };
190
+ return Promise.resolve(response);
191
+ };
192
+ const deserializeAws_json1_1DeregisterScalableTargetCommandError = async (output, context) => {
193
+ const parsedOutput = {
194
+ ...output,
195
+ body: await parseErrorBody(output.body, context),
196
+ };
197
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
198
+ switch (errorCode) {
199
+ case "ConcurrentUpdateException":
200
+ case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
201
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
202
+ case "InternalServiceException":
203
+ case "com.amazonaws.applicationautoscaling#InternalServiceException":
204
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
205
+ case "ObjectNotFoundException":
206
+ case "com.amazonaws.applicationautoscaling#ObjectNotFoundException":
207
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
208
+ case "ValidationException":
209
+ case "com.amazonaws.applicationautoscaling#ValidationException":
210
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
211
+ default:
212
+ const parsedBody = parsedOutput.body;
213
+ throwDefaultError({
214
+ output,
215
+ parsedBody,
216
+ exceptionCtor: __BaseException,
217
+ errorCode,
218
+ });
219
+ }
220
+ };
221
+ export const deserializeAws_json1_1DescribeScalableTargetsCommand = async (output, context) => {
222
+ if (output.statusCode >= 300) {
223
+ return deserializeAws_json1_1DescribeScalableTargetsCommandError(output, context);
224
+ }
225
+ const data = await parseBody(output.body, context);
226
+ let contents = {};
227
+ contents = deserializeAws_json1_1DescribeScalableTargetsResponse(data, context);
228
+ const response = {
229
+ $metadata: deserializeMetadata(output),
230
+ ...contents,
231
+ };
232
+ return Promise.resolve(response);
233
+ };
234
+ const deserializeAws_json1_1DescribeScalableTargetsCommandError = async (output, context) => {
235
+ const parsedOutput = {
236
+ ...output,
237
+ body: await parseErrorBody(output.body, context),
238
+ };
239
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
240
+ switch (errorCode) {
241
+ case "ConcurrentUpdateException":
242
+ case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
243
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
244
+ case "InternalServiceException":
245
+ case "com.amazonaws.applicationautoscaling#InternalServiceException":
246
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
247
+ case "InvalidNextTokenException":
248
+ case "com.amazonaws.applicationautoscaling#InvalidNextTokenException":
249
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
250
+ case "ValidationException":
251
+ case "com.amazonaws.applicationautoscaling#ValidationException":
252
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
253
+ default:
254
+ const parsedBody = parsedOutput.body;
255
+ throwDefaultError({
256
+ output,
257
+ parsedBody,
258
+ exceptionCtor: __BaseException,
259
+ errorCode,
260
+ });
261
+ }
262
+ };
263
+ export const deserializeAws_json1_1DescribeScalingActivitiesCommand = async (output, context) => {
264
+ if (output.statusCode >= 300) {
265
+ return deserializeAws_json1_1DescribeScalingActivitiesCommandError(output, context);
266
+ }
267
+ const data = await parseBody(output.body, context);
268
+ let contents = {};
269
+ contents = deserializeAws_json1_1DescribeScalingActivitiesResponse(data, context);
270
+ const response = {
271
+ $metadata: deserializeMetadata(output),
272
+ ...contents,
273
+ };
274
+ return Promise.resolve(response);
275
+ };
276
+ const deserializeAws_json1_1DescribeScalingActivitiesCommandError = async (output, context) => {
277
+ const parsedOutput = {
278
+ ...output,
279
+ body: await parseErrorBody(output.body, context),
280
+ };
281
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
282
+ switch (errorCode) {
283
+ case "ConcurrentUpdateException":
284
+ case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
285
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
286
+ case "InternalServiceException":
287
+ case "com.amazonaws.applicationautoscaling#InternalServiceException":
288
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
289
+ case "InvalidNextTokenException":
290
+ case "com.amazonaws.applicationautoscaling#InvalidNextTokenException":
291
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
292
+ case "ValidationException":
293
+ case "com.amazonaws.applicationautoscaling#ValidationException":
294
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
295
+ default:
296
+ const parsedBody = parsedOutput.body;
297
+ throwDefaultError({
298
+ output,
299
+ parsedBody,
300
+ exceptionCtor: __BaseException,
301
+ errorCode,
302
+ });
303
+ }
304
+ };
305
+ export const deserializeAws_json1_1DescribeScalingPoliciesCommand = async (output, context) => {
306
+ if (output.statusCode >= 300) {
307
+ return deserializeAws_json1_1DescribeScalingPoliciesCommandError(output, context);
308
+ }
309
+ const data = await parseBody(output.body, context);
310
+ let contents = {};
311
+ contents = deserializeAws_json1_1DescribeScalingPoliciesResponse(data, context);
312
+ const response = {
313
+ $metadata: deserializeMetadata(output),
314
+ ...contents,
315
+ };
316
+ return Promise.resolve(response);
317
+ };
318
+ const deserializeAws_json1_1DescribeScalingPoliciesCommandError = async (output, context) => {
319
+ const parsedOutput = {
320
+ ...output,
321
+ body: await parseErrorBody(output.body, context),
322
+ };
323
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
324
+ switch (errorCode) {
325
+ case "ConcurrentUpdateException":
326
+ case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
327
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
328
+ case "FailedResourceAccessException":
329
+ case "com.amazonaws.applicationautoscaling#FailedResourceAccessException":
330
+ throw await deserializeAws_json1_1FailedResourceAccessExceptionResponse(parsedOutput, context);
331
+ case "InternalServiceException":
332
+ case "com.amazonaws.applicationautoscaling#InternalServiceException":
333
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
334
+ case "InvalidNextTokenException":
335
+ case "com.amazonaws.applicationautoscaling#InvalidNextTokenException":
336
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
337
+ case "ValidationException":
338
+ case "com.amazonaws.applicationautoscaling#ValidationException":
339
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
340
+ default:
341
+ const parsedBody = parsedOutput.body;
342
+ throwDefaultError({
343
+ output,
344
+ parsedBody,
345
+ exceptionCtor: __BaseException,
346
+ errorCode,
347
+ });
348
+ }
349
+ };
350
+ export const deserializeAws_json1_1DescribeScheduledActionsCommand = async (output, context) => {
351
+ if (output.statusCode >= 300) {
352
+ return deserializeAws_json1_1DescribeScheduledActionsCommandError(output, context);
353
+ }
354
+ const data = await parseBody(output.body, context);
355
+ let contents = {};
356
+ contents = deserializeAws_json1_1DescribeScheduledActionsResponse(data, context);
357
+ const response = {
358
+ $metadata: deserializeMetadata(output),
359
+ ...contents,
360
+ };
361
+ return Promise.resolve(response);
362
+ };
363
+ const deserializeAws_json1_1DescribeScheduledActionsCommandError = async (output, context) => {
364
+ const parsedOutput = {
365
+ ...output,
366
+ body: await parseErrorBody(output.body, context),
367
+ };
368
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
369
+ switch (errorCode) {
370
+ case "ConcurrentUpdateException":
371
+ case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
372
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
373
+ case "InternalServiceException":
374
+ case "com.amazonaws.applicationautoscaling#InternalServiceException":
375
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
376
+ case "InvalidNextTokenException":
377
+ case "com.amazonaws.applicationautoscaling#InvalidNextTokenException":
378
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
379
+ case "ValidationException":
380
+ case "com.amazonaws.applicationautoscaling#ValidationException":
381
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
382
+ default:
383
+ const parsedBody = parsedOutput.body;
384
+ throwDefaultError({
385
+ output,
386
+ parsedBody,
387
+ exceptionCtor: __BaseException,
388
+ errorCode,
389
+ });
390
+ }
391
+ };
392
+ export const deserializeAws_json1_1PutScalingPolicyCommand = async (output, context) => {
393
+ if (output.statusCode >= 300) {
394
+ return deserializeAws_json1_1PutScalingPolicyCommandError(output, context);
395
+ }
396
+ const data = await parseBody(output.body, context);
397
+ let contents = {};
398
+ contents = deserializeAws_json1_1PutScalingPolicyResponse(data, context);
399
+ const response = {
400
+ $metadata: deserializeMetadata(output),
401
+ ...contents,
402
+ };
403
+ return Promise.resolve(response);
404
+ };
405
+ const deserializeAws_json1_1PutScalingPolicyCommandError = async (output, context) => {
406
+ const parsedOutput = {
407
+ ...output,
408
+ body: await parseErrorBody(output.body, context),
409
+ };
410
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
411
+ switch (errorCode) {
412
+ case "ConcurrentUpdateException":
413
+ case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
414
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
415
+ case "FailedResourceAccessException":
416
+ case "com.amazonaws.applicationautoscaling#FailedResourceAccessException":
417
+ throw await deserializeAws_json1_1FailedResourceAccessExceptionResponse(parsedOutput, context);
418
+ case "InternalServiceException":
419
+ case "com.amazonaws.applicationautoscaling#InternalServiceException":
420
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
421
+ case "LimitExceededException":
422
+ case "com.amazonaws.applicationautoscaling#LimitExceededException":
423
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
424
+ case "ObjectNotFoundException":
425
+ case "com.amazonaws.applicationautoscaling#ObjectNotFoundException":
426
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
427
+ case "ValidationException":
428
+ case "com.amazonaws.applicationautoscaling#ValidationException":
429
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
430
+ default:
431
+ const parsedBody = parsedOutput.body;
432
+ throwDefaultError({
433
+ output,
434
+ parsedBody,
435
+ exceptionCtor: __BaseException,
436
+ errorCode,
437
+ });
438
+ }
439
+ };
440
+ export const deserializeAws_json1_1PutScheduledActionCommand = async (output, context) => {
441
+ if (output.statusCode >= 300) {
442
+ return deserializeAws_json1_1PutScheduledActionCommandError(output, context);
443
+ }
444
+ const data = await parseBody(output.body, context);
445
+ let contents = {};
446
+ contents = deserializeAws_json1_1PutScheduledActionResponse(data, context);
447
+ const response = {
448
+ $metadata: deserializeMetadata(output),
449
+ ...contents,
450
+ };
451
+ return Promise.resolve(response);
452
+ };
453
+ const deserializeAws_json1_1PutScheduledActionCommandError = async (output, context) => {
454
+ const parsedOutput = {
455
+ ...output,
456
+ body: await parseErrorBody(output.body, context),
457
+ };
458
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
459
+ switch (errorCode) {
460
+ case "ConcurrentUpdateException":
461
+ case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
462
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
463
+ case "InternalServiceException":
464
+ case "com.amazonaws.applicationautoscaling#InternalServiceException":
465
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
466
+ case "LimitExceededException":
467
+ case "com.amazonaws.applicationautoscaling#LimitExceededException":
468
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
469
+ case "ObjectNotFoundException":
470
+ case "com.amazonaws.applicationautoscaling#ObjectNotFoundException":
471
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
472
+ case "ValidationException":
473
+ case "com.amazonaws.applicationautoscaling#ValidationException":
474
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
475
+ default:
476
+ const parsedBody = parsedOutput.body;
477
+ throwDefaultError({
478
+ output,
479
+ parsedBody,
480
+ exceptionCtor: __BaseException,
481
+ errorCode,
482
+ });
483
+ }
484
+ };
485
+ export const deserializeAws_json1_1RegisterScalableTargetCommand = async (output, context) => {
486
+ if (output.statusCode >= 300) {
487
+ return deserializeAws_json1_1RegisterScalableTargetCommandError(output, context);
488
+ }
489
+ const data = await parseBody(output.body, context);
490
+ let contents = {};
491
+ contents = deserializeAws_json1_1RegisterScalableTargetResponse(data, context);
492
+ const response = {
493
+ $metadata: deserializeMetadata(output),
494
+ ...contents,
495
+ };
496
+ return Promise.resolve(response);
497
+ };
498
+ const deserializeAws_json1_1RegisterScalableTargetCommandError = async (output, context) => {
499
+ const parsedOutput = {
500
+ ...output,
501
+ body: await parseErrorBody(output.body, context),
502
+ };
503
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
504
+ switch (errorCode) {
505
+ case "ConcurrentUpdateException":
506
+ case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
507
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
508
+ case "InternalServiceException":
509
+ case "com.amazonaws.applicationautoscaling#InternalServiceException":
510
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
511
+ case "LimitExceededException":
512
+ case "com.amazonaws.applicationautoscaling#LimitExceededException":
513
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
514
+ case "ValidationException":
515
+ case "com.amazonaws.applicationautoscaling#ValidationException":
516
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
517
+ default:
518
+ const parsedBody = parsedOutput.body;
519
+ throwDefaultError({
520
+ output,
521
+ parsedBody,
522
+ exceptionCtor: __BaseException,
523
+ errorCode,
524
+ });
525
+ }
526
+ };
527
+ const deserializeAws_json1_1ConcurrentUpdateExceptionResponse = async (parsedOutput, context) => {
528
+ const body = parsedOutput.body;
529
+ const deserialized = deserializeAws_json1_1ConcurrentUpdateException(body, context);
530
+ const exception = new ConcurrentUpdateException({
531
+ $metadata: deserializeMetadata(parsedOutput),
532
+ ...deserialized,
769
533
  });
770
- }); };
771
- var deserializeAws_json1_1FailedResourceAccessExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
772
- var body, deserialized, exception;
773
- return __generator(this, function (_a) {
774
- body = parsedOutput.body;
775
- deserialized = deserializeAws_json1_1FailedResourceAccessException(body, context);
776
- exception = new FailedResourceAccessException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
777
- return [2, __decorateServiceException(exception, body)];
534
+ return __decorateServiceException(exception, body);
535
+ };
536
+ const deserializeAws_json1_1FailedResourceAccessExceptionResponse = async (parsedOutput, context) => {
537
+ const body = parsedOutput.body;
538
+ const deserialized = deserializeAws_json1_1FailedResourceAccessException(body, context);
539
+ const exception = new FailedResourceAccessException({
540
+ $metadata: deserializeMetadata(parsedOutput),
541
+ ...deserialized,
778
542
  });
779
- }); };
780
- var deserializeAws_json1_1InternalServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
781
- var body, deserialized, exception;
782
- return __generator(this, function (_a) {
783
- body = parsedOutput.body;
784
- deserialized = deserializeAws_json1_1InternalServiceException(body, context);
785
- exception = new InternalServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
786
- return [2, __decorateServiceException(exception, body)];
543
+ return __decorateServiceException(exception, body);
544
+ };
545
+ const deserializeAws_json1_1InternalServiceExceptionResponse = async (parsedOutput, context) => {
546
+ const body = parsedOutput.body;
547
+ const deserialized = deserializeAws_json1_1InternalServiceException(body, context);
548
+ const exception = new InternalServiceException({
549
+ $metadata: deserializeMetadata(parsedOutput),
550
+ ...deserialized,
787
551
  });
788
- }); };
789
- var deserializeAws_json1_1InvalidNextTokenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
790
- var body, deserialized, exception;
791
- return __generator(this, function (_a) {
792
- body = parsedOutput.body;
793
- deserialized = deserializeAws_json1_1InvalidNextTokenException(body, context);
794
- exception = new InvalidNextTokenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
795
- return [2, __decorateServiceException(exception, body)];
552
+ return __decorateServiceException(exception, body);
553
+ };
554
+ const deserializeAws_json1_1InvalidNextTokenExceptionResponse = async (parsedOutput, context) => {
555
+ const body = parsedOutput.body;
556
+ const deserialized = deserializeAws_json1_1InvalidNextTokenException(body, context);
557
+ const exception = new InvalidNextTokenException({
558
+ $metadata: deserializeMetadata(parsedOutput),
559
+ ...deserialized,
796
560
  });
797
- }); };
798
- var deserializeAws_json1_1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
799
- var body, deserialized, exception;
800
- return __generator(this, function (_a) {
801
- body = parsedOutput.body;
802
- deserialized = deserializeAws_json1_1LimitExceededException(body, context);
803
- exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
804
- return [2, __decorateServiceException(exception, body)];
561
+ return __decorateServiceException(exception, body);
562
+ };
563
+ const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
564
+ const body = parsedOutput.body;
565
+ const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
566
+ const exception = new LimitExceededException({
567
+ $metadata: deserializeMetadata(parsedOutput),
568
+ ...deserialized,
805
569
  });
806
- }); };
807
- var deserializeAws_json1_1ObjectNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
808
- var body, deserialized, exception;
809
- return __generator(this, function (_a) {
810
- body = parsedOutput.body;
811
- deserialized = deserializeAws_json1_1ObjectNotFoundException(body, context);
812
- exception = new ObjectNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
813
- return [2, __decorateServiceException(exception, body)];
570
+ return __decorateServiceException(exception, body);
571
+ };
572
+ const deserializeAws_json1_1ObjectNotFoundExceptionResponse = async (parsedOutput, context) => {
573
+ const body = parsedOutput.body;
574
+ const deserialized = deserializeAws_json1_1ObjectNotFoundException(body, context);
575
+ const exception = new ObjectNotFoundException({
576
+ $metadata: deserializeMetadata(parsedOutput),
577
+ ...deserialized,
814
578
  });
815
- }); };
816
- var deserializeAws_json1_1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
817
- var body, deserialized, exception;
818
- return __generator(this, function (_a) {
819
- body = parsedOutput.body;
820
- deserialized = deserializeAws_json1_1ValidationException(body, context);
821
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
822
- return [2, __decorateServiceException(exception, body)];
579
+ return __decorateServiceException(exception, body);
580
+ };
581
+ const deserializeAws_json1_1ValidationExceptionResponse = async (parsedOutput, context) => {
582
+ const body = parsedOutput.body;
583
+ const deserialized = deserializeAws_json1_1ValidationException(body, context);
584
+ const exception = new ValidationException({
585
+ $metadata: deserializeMetadata(parsedOutput),
586
+ ...deserialized,
823
587
  });
824
- }); };
825
- var serializeAws_json1_1CustomizedMetricSpecification = function (input, context) {
826
- return __assign(__assign(__assign(__assign(__assign({}, (input.Dimensions != null && { Dimensions: serializeAws_json1_1MetricDimensions(input.Dimensions, context) })), (input.MetricName != null && { MetricName: input.MetricName })), (input.Namespace != null && { Namespace: input.Namespace })), (input.Statistic != null && { Statistic: input.Statistic })), (input.Unit != null && { Unit: input.Unit }));
588
+ return __decorateServiceException(exception, body);
589
+ };
590
+ const serializeAws_json1_1CustomizedMetricSpecification = (input, context) => {
591
+ return {
592
+ ...(input.Dimensions != null && { Dimensions: serializeAws_json1_1MetricDimensions(input.Dimensions, context) }),
593
+ ...(input.MetricName != null && { MetricName: input.MetricName }),
594
+ ...(input.Namespace != null && { Namespace: input.Namespace }),
595
+ ...(input.Statistic != null && { Statistic: input.Statistic }),
596
+ ...(input.Unit != null && { Unit: input.Unit }),
597
+ };
827
598
  };
828
- var serializeAws_json1_1DeleteScalingPolicyRequest = function (input, context) {
829
- return __assign(__assign(__assign(__assign({}, (input.PolicyName != null && { PolicyName: input.PolicyName })), (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }));
599
+ const serializeAws_json1_1DeleteScalingPolicyRequest = (input, context) => {
600
+ return {
601
+ ...(input.PolicyName != null && { PolicyName: input.PolicyName }),
602
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
603
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
604
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
605
+ };
830
606
  };
831
- var serializeAws_json1_1DeleteScheduledActionRequest = function (input, context) {
832
- return __assign(__assign(__assign(__assign({}, (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ScheduledActionName != null && { ScheduledActionName: input.ScheduledActionName })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }));
607
+ const serializeAws_json1_1DeleteScheduledActionRequest = (input, context) => {
608
+ return {
609
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
610
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
611
+ ...(input.ScheduledActionName != null && { ScheduledActionName: input.ScheduledActionName }),
612
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
613
+ };
833
614
  };
834
- var serializeAws_json1_1DeregisterScalableTargetRequest = function (input, context) {
835
- return __assign(__assign(__assign({}, (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }));
615
+ const serializeAws_json1_1DeregisterScalableTargetRequest = (input, context) => {
616
+ return {
617
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
618
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
619
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
620
+ };
836
621
  };
837
- var serializeAws_json1_1DescribeScalableTargetsRequest = function (input, context) {
838
- return __assign(__assign(__assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ResourceIds != null && {
839
- ResourceIds: serializeAws_json1_1ResourceIdsMaxLen1600(input.ResourceIds, context),
840
- })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }));
622
+ const serializeAws_json1_1DescribeScalableTargetsRequest = (input, context) => {
623
+ return {
624
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
625
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
626
+ ...(input.ResourceIds != null && {
627
+ ResourceIds: serializeAws_json1_1ResourceIdsMaxLen1600(input.ResourceIds, context),
628
+ }),
629
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
630
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
631
+ };
841
632
  };
842
- var serializeAws_json1_1DescribeScalingActivitiesRequest = function (input, context) {
843
- return __assign(__assign(__assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }));
633
+ const serializeAws_json1_1DescribeScalingActivitiesRequest = (input, context) => {
634
+ return {
635
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
636
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
637
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
638
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
639
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
640
+ };
844
641
  };
845
- var serializeAws_json1_1DescribeScalingPoliciesRequest = function (input, context) {
846
- return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.PolicyNames != null && {
847
- PolicyNames: serializeAws_json1_1ResourceIdsMaxLen1600(input.PolicyNames, context),
848
- })), (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }));
642
+ const serializeAws_json1_1DescribeScalingPoliciesRequest = (input, context) => {
643
+ return {
644
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
645
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
646
+ ...(input.PolicyNames != null && {
647
+ PolicyNames: serializeAws_json1_1ResourceIdsMaxLen1600(input.PolicyNames, context),
648
+ }),
649
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
650
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
651
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
652
+ };
849
653
  };
850
- var serializeAws_json1_1DescribeScheduledActionsRequest = function (input, context) {
851
- return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ScheduledActionNames != null && {
852
- ScheduledActionNames: serializeAws_json1_1ResourceIdsMaxLen1600(input.ScheduledActionNames, context),
853
- })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }));
654
+ const serializeAws_json1_1DescribeScheduledActionsRequest = (input, context) => {
655
+ return {
656
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
657
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
658
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
659
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
660
+ ...(input.ScheduledActionNames != null && {
661
+ ScheduledActionNames: serializeAws_json1_1ResourceIdsMaxLen1600(input.ScheduledActionNames, context),
662
+ }),
663
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
664
+ };
854
665
  };
855
- var serializeAws_json1_1MetricDimension = function (input, context) {
856
- return __assign(__assign({}, (input.Name != null && { Name: input.Name })), (input.Value != null && { Value: input.Value }));
666
+ const serializeAws_json1_1MetricDimension = (input, context) => {
667
+ return {
668
+ ...(input.Name != null && { Name: input.Name }),
669
+ ...(input.Value != null && { Value: input.Value }),
670
+ };
857
671
  };
858
- var serializeAws_json1_1MetricDimensions = function (input, context) {
672
+ const serializeAws_json1_1MetricDimensions = (input, context) => {
859
673
  return input
860
- .filter(function (e) { return e != null; })
861
- .map(function (entry) {
674
+ .filter((e) => e != null)
675
+ .map((entry) => {
862
676
  return serializeAws_json1_1MetricDimension(entry, context);
863
677
  });
864
678
  };
865
- var serializeAws_json1_1PredefinedMetricSpecification = function (input, context) {
866
- return __assign(__assign({}, (input.PredefinedMetricType != null && { PredefinedMetricType: input.PredefinedMetricType })), (input.ResourceLabel != null && { ResourceLabel: input.ResourceLabel }));
679
+ const serializeAws_json1_1PredefinedMetricSpecification = (input, context) => {
680
+ return {
681
+ ...(input.PredefinedMetricType != null && { PredefinedMetricType: input.PredefinedMetricType }),
682
+ ...(input.ResourceLabel != null && { ResourceLabel: input.ResourceLabel }),
683
+ };
867
684
  };
868
- var serializeAws_json1_1PutScalingPolicyRequest = function (input, context) {
869
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.PolicyName != null && { PolicyName: input.PolicyName })), (input.PolicyType != null && { PolicyType: input.PolicyType })), (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace })), (input.StepScalingPolicyConfiguration != null && {
870
- StepScalingPolicyConfiguration: serializeAws_json1_1StepScalingPolicyConfiguration(input.StepScalingPolicyConfiguration, context),
871
- })), (input.TargetTrackingScalingPolicyConfiguration != null && {
872
- TargetTrackingScalingPolicyConfiguration: serializeAws_json1_1TargetTrackingScalingPolicyConfiguration(input.TargetTrackingScalingPolicyConfiguration, context),
873
- }));
685
+ const serializeAws_json1_1PutScalingPolicyRequest = (input, context) => {
686
+ return {
687
+ ...(input.PolicyName != null && { PolicyName: input.PolicyName }),
688
+ ...(input.PolicyType != null && { PolicyType: input.PolicyType }),
689
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
690
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
691
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
692
+ ...(input.StepScalingPolicyConfiguration != null && {
693
+ StepScalingPolicyConfiguration: serializeAws_json1_1StepScalingPolicyConfiguration(input.StepScalingPolicyConfiguration, context),
694
+ }),
695
+ ...(input.TargetTrackingScalingPolicyConfiguration != null && {
696
+ TargetTrackingScalingPolicyConfiguration: serializeAws_json1_1TargetTrackingScalingPolicyConfiguration(input.TargetTrackingScalingPolicyConfiguration, context),
697
+ }),
698
+ };
874
699
  };
875
- var serializeAws_json1_1PutScheduledActionRequest = function (input, context) {
876
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.EndTime != null && { EndTime: Math.round(input.EndTime.getTime() / 1000) })), (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ScalableTargetAction != null && {
877
- ScalableTargetAction: serializeAws_json1_1ScalableTargetAction(input.ScalableTargetAction, context),
878
- })), (input.Schedule != null && { Schedule: input.Schedule })), (input.ScheduledActionName != null && { ScheduledActionName: input.ScheduledActionName })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace })), (input.StartTime != null && { StartTime: Math.round(input.StartTime.getTime() / 1000) })), (input.Timezone != null && { Timezone: input.Timezone }));
700
+ const serializeAws_json1_1PutScheduledActionRequest = (input, context) => {
701
+ return {
702
+ ...(input.EndTime != null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }),
703
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
704
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
705
+ ...(input.ScalableTargetAction != null && {
706
+ ScalableTargetAction: serializeAws_json1_1ScalableTargetAction(input.ScalableTargetAction, context),
707
+ }),
708
+ ...(input.Schedule != null && { Schedule: input.Schedule }),
709
+ ...(input.ScheduledActionName != null && { ScheduledActionName: input.ScheduledActionName }),
710
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
711
+ ...(input.StartTime != null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }),
712
+ ...(input.Timezone != null && { Timezone: input.Timezone }),
713
+ };
879
714
  };
880
- var serializeAws_json1_1RegisterScalableTargetRequest = function (input, context) {
881
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.MaxCapacity != null && { MaxCapacity: input.MaxCapacity })), (input.MinCapacity != null && { MinCapacity: input.MinCapacity })), (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.RoleARN != null && { RoleARN: input.RoleARN })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace })), (input.SuspendedState != null && {
882
- SuspendedState: serializeAws_json1_1SuspendedState(input.SuspendedState, context),
883
- }));
715
+ const serializeAws_json1_1RegisterScalableTargetRequest = (input, context) => {
716
+ return {
717
+ ...(input.MaxCapacity != null && { MaxCapacity: input.MaxCapacity }),
718
+ ...(input.MinCapacity != null && { MinCapacity: input.MinCapacity }),
719
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
720
+ ...(input.RoleARN != null && { RoleARN: input.RoleARN }),
721
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
722
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
723
+ ...(input.SuspendedState != null && {
724
+ SuspendedState: serializeAws_json1_1SuspendedState(input.SuspendedState, context),
725
+ }),
726
+ };
884
727
  };
885
- var serializeAws_json1_1ResourceIdsMaxLen1600 = function (input, context) {
728
+ const serializeAws_json1_1ResourceIdsMaxLen1600 = (input, context) => {
886
729
  return input
887
- .filter(function (e) { return e != null; })
888
- .map(function (entry) {
730
+ .filter((e) => e != null)
731
+ .map((entry) => {
889
732
  return entry;
890
733
  });
891
734
  };
892
- var serializeAws_json1_1ScalableTargetAction = function (input, context) {
893
- return __assign(__assign({}, (input.MaxCapacity != null && { MaxCapacity: input.MaxCapacity })), (input.MinCapacity != null && { MinCapacity: input.MinCapacity }));
735
+ const serializeAws_json1_1ScalableTargetAction = (input, context) => {
736
+ return {
737
+ ...(input.MaxCapacity != null && { MaxCapacity: input.MaxCapacity }),
738
+ ...(input.MinCapacity != null && { MinCapacity: input.MinCapacity }),
739
+ };
894
740
  };
895
- var serializeAws_json1_1StepAdjustment = function (input, context) {
896
- return __assign(__assign(__assign({}, (input.MetricIntervalLowerBound != null && {
897
- MetricIntervalLowerBound: __serializeFloat(input.MetricIntervalLowerBound),
898
- })), (input.MetricIntervalUpperBound != null && {
899
- MetricIntervalUpperBound: __serializeFloat(input.MetricIntervalUpperBound),
900
- })), (input.ScalingAdjustment != null && { ScalingAdjustment: input.ScalingAdjustment }));
741
+ const serializeAws_json1_1StepAdjustment = (input, context) => {
742
+ return {
743
+ ...(input.MetricIntervalLowerBound != null && {
744
+ MetricIntervalLowerBound: __serializeFloat(input.MetricIntervalLowerBound),
745
+ }),
746
+ ...(input.MetricIntervalUpperBound != null && {
747
+ MetricIntervalUpperBound: __serializeFloat(input.MetricIntervalUpperBound),
748
+ }),
749
+ ...(input.ScalingAdjustment != null && { ScalingAdjustment: input.ScalingAdjustment }),
750
+ };
901
751
  };
902
- var serializeAws_json1_1StepAdjustments = function (input, context) {
752
+ const serializeAws_json1_1StepAdjustments = (input, context) => {
903
753
  return input
904
- .filter(function (e) { return e != null; })
905
- .map(function (entry) {
754
+ .filter((e) => e != null)
755
+ .map((entry) => {
906
756
  return serializeAws_json1_1StepAdjustment(entry, context);
907
757
  });
908
758
  };
909
- var serializeAws_json1_1StepScalingPolicyConfiguration = function (input, context) {
910
- return __assign(__assign(__assign(__assign(__assign({}, (input.AdjustmentType != null && { AdjustmentType: input.AdjustmentType })), (input.Cooldown != null && { Cooldown: input.Cooldown })), (input.MetricAggregationType != null && { MetricAggregationType: input.MetricAggregationType })), (input.MinAdjustmentMagnitude != null && { MinAdjustmentMagnitude: input.MinAdjustmentMagnitude })), (input.StepAdjustments != null && {
911
- StepAdjustments: serializeAws_json1_1StepAdjustments(input.StepAdjustments, context),
912
- }));
759
+ const serializeAws_json1_1StepScalingPolicyConfiguration = (input, context) => {
760
+ return {
761
+ ...(input.AdjustmentType != null && { AdjustmentType: input.AdjustmentType }),
762
+ ...(input.Cooldown != null && { Cooldown: input.Cooldown }),
763
+ ...(input.MetricAggregationType != null && { MetricAggregationType: input.MetricAggregationType }),
764
+ ...(input.MinAdjustmentMagnitude != null && { MinAdjustmentMagnitude: input.MinAdjustmentMagnitude }),
765
+ ...(input.StepAdjustments != null && {
766
+ StepAdjustments: serializeAws_json1_1StepAdjustments(input.StepAdjustments, context),
767
+ }),
768
+ };
913
769
  };
914
- var serializeAws_json1_1SuspendedState = function (input, context) {
915
- return __assign(__assign(__assign({}, (input.DynamicScalingInSuspended != null && { DynamicScalingInSuspended: input.DynamicScalingInSuspended })), (input.DynamicScalingOutSuspended != null && { DynamicScalingOutSuspended: input.DynamicScalingOutSuspended })), (input.ScheduledScalingSuspended != null && { ScheduledScalingSuspended: input.ScheduledScalingSuspended }));
770
+ const serializeAws_json1_1SuspendedState = (input, context) => {
771
+ return {
772
+ ...(input.DynamicScalingInSuspended != null && { DynamicScalingInSuspended: input.DynamicScalingInSuspended }),
773
+ ...(input.DynamicScalingOutSuspended != null && { DynamicScalingOutSuspended: input.DynamicScalingOutSuspended }),
774
+ ...(input.ScheduledScalingSuspended != null && { ScheduledScalingSuspended: input.ScheduledScalingSuspended }),
775
+ };
916
776
  };
917
- var serializeAws_json1_1TargetTrackingScalingPolicyConfiguration = function (input, context) {
918
- return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.CustomizedMetricSpecification != null && {
919
- CustomizedMetricSpecification: serializeAws_json1_1CustomizedMetricSpecification(input.CustomizedMetricSpecification, context),
920
- })), (input.DisableScaleIn != null && { DisableScaleIn: input.DisableScaleIn })), (input.PredefinedMetricSpecification != null && {
921
- PredefinedMetricSpecification: serializeAws_json1_1PredefinedMetricSpecification(input.PredefinedMetricSpecification, context),
922
- })), (input.ScaleInCooldown != null && { ScaleInCooldown: input.ScaleInCooldown })), (input.ScaleOutCooldown != null && { ScaleOutCooldown: input.ScaleOutCooldown })), (input.TargetValue != null && { TargetValue: __serializeFloat(input.TargetValue) }));
777
+ const serializeAws_json1_1TargetTrackingScalingPolicyConfiguration = (input, context) => {
778
+ return {
779
+ ...(input.CustomizedMetricSpecification != null && {
780
+ CustomizedMetricSpecification: serializeAws_json1_1CustomizedMetricSpecification(input.CustomizedMetricSpecification, context),
781
+ }),
782
+ ...(input.DisableScaleIn != null && { DisableScaleIn: input.DisableScaleIn }),
783
+ ...(input.PredefinedMetricSpecification != null && {
784
+ PredefinedMetricSpecification: serializeAws_json1_1PredefinedMetricSpecification(input.PredefinedMetricSpecification, context),
785
+ }),
786
+ ...(input.ScaleInCooldown != null && { ScaleInCooldown: input.ScaleInCooldown }),
787
+ ...(input.ScaleOutCooldown != null && { ScaleOutCooldown: input.ScaleOutCooldown }),
788
+ ...(input.TargetValue != null && { TargetValue: __serializeFloat(input.TargetValue) }),
789
+ };
923
790
  };
924
- var deserializeAws_json1_1Alarm = function (output, context) {
791
+ const deserializeAws_json1_1Alarm = (output, context) => {
925
792
  return {
926
793
  AlarmARN: __expectString(output.AlarmARN),
927
794
  AlarmName: __expectString(output.AlarmName),
928
795
  };
929
796
  };
930
- var deserializeAws_json1_1Alarms = function (output, context) {
931
- var retVal = (output || [])
932
- .filter(function (e) { return e != null; })
933
- .map(function (entry) {
797
+ const deserializeAws_json1_1Alarms = (output, context) => {
798
+ const retVal = (output || [])
799
+ .filter((e) => e != null)
800
+ .map((entry) => {
934
801
  if (entry === null) {
935
802
  return null;
936
803
  }
@@ -938,12 +805,12 @@ var deserializeAws_json1_1Alarms = function (output, context) {
938
805
  });
939
806
  return retVal;
940
807
  };
941
- var deserializeAws_json1_1ConcurrentUpdateException = function (output, context) {
808
+ const deserializeAws_json1_1ConcurrentUpdateException = (output, context) => {
942
809
  return {
943
810
  Message: __expectString(output.Message),
944
811
  };
945
812
  };
946
- var deserializeAws_json1_1CustomizedMetricSpecification = function (output, context) {
813
+ const deserializeAws_json1_1CustomizedMetricSpecification = (output, context) => {
947
814
  return {
948
815
  Dimensions: output.Dimensions != null ? deserializeAws_json1_1MetricDimensions(output.Dimensions, context) : undefined,
949
816
  MetricName: __expectString(output.MetricName),
@@ -952,16 +819,16 @@ var deserializeAws_json1_1CustomizedMetricSpecification = function (output, cont
952
819
  Unit: __expectString(output.Unit),
953
820
  };
954
821
  };
955
- var deserializeAws_json1_1DeleteScalingPolicyResponse = function (output, context) {
822
+ const deserializeAws_json1_1DeleteScalingPolicyResponse = (output, context) => {
956
823
  return {};
957
824
  };
958
- var deserializeAws_json1_1DeleteScheduledActionResponse = function (output, context) {
825
+ const deserializeAws_json1_1DeleteScheduledActionResponse = (output, context) => {
959
826
  return {};
960
827
  };
961
- var deserializeAws_json1_1DeregisterScalableTargetResponse = function (output, context) {
828
+ const deserializeAws_json1_1DeregisterScalableTargetResponse = (output, context) => {
962
829
  return {};
963
830
  };
964
- var deserializeAws_json1_1DescribeScalableTargetsResponse = function (output, context) {
831
+ const deserializeAws_json1_1DescribeScalableTargetsResponse = (output, context) => {
965
832
  return {
966
833
  NextToken: __expectString(output.NextToken),
967
834
  ScalableTargets: output.ScalableTargets != null
@@ -969,7 +836,7 @@ var deserializeAws_json1_1DescribeScalableTargetsResponse = function (output, co
969
836
  : undefined,
970
837
  };
971
838
  };
972
- var deserializeAws_json1_1DescribeScalingActivitiesResponse = function (output, context) {
839
+ const deserializeAws_json1_1DescribeScalingActivitiesResponse = (output, context) => {
973
840
  return {
974
841
  NextToken: __expectString(output.NextToken),
975
842
  ScalingActivities: output.ScalingActivities != null
@@ -977,7 +844,7 @@ var deserializeAws_json1_1DescribeScalingActivitiesResponse = function (output,
977
844
  : undefined,
978
845
  };
979
846
  };
980
- var deserializeAws_json1_1DescribeScalingPoliciesResponse = function (output, context) {
847
+ const deserializeAws_json1_1DescribeScalingPoliciesResponse = (output, context) => {
981
848
  return {
982
849
  NextToken: __expectString(output.NextToken),
983
850
  ScalingPolicies: output.ScalingPolicies != null
@@ -985,7 +852,7 @@ var deserializeAws_json1_1DescribeScalingPoliciesResponse = function (output, co
985
852
  : undefined,
986
853
  };
987
854
  };
988
- var deserializeAws_json1_1DescribeScheduledActionsResponse = function (output, context) {
855
+ const deserializeAws_json1_1DescribeScheduledActionsResponse = (output, context) => {
989
856
  return {
990
857
  NextToken: __expectString(output.NextToken),
991
858
  ScheduledActions: output.ScheduledActions != null
@@ -993,36 +860,36 @@ var deserializeAws_json1_1DescribeScheduledActionsResponse = function (output, c
993
860
  : undefined,
994
861
  };
995
862
  };
996
- var deserializeAws_json1_1FailedResourceAccessException = function (output, context) {
863
+ const deserializeAws_json1_1FailedResourceAccessException = (output, context) => {
997
864
  return {
998
865
  Message: __expectString(output.Message),
999
866
  };
1000
867
  };
1001
- var deserializeAws_json1_1InternalServiceException = function (output, context) {
868
+ const deserializeAws_json1_1InternalServiceException = (output, context) => {
1002
869
  return {
1003
870
  Message: __expectString(output.Message),
1004
871
  };
1005
872
  };
1006
- var deserializeAws_json1_1InvalidNextTokenException = function (output, context) {
873
+ const deserializeAws_json1_1InvalidNextTokenException = (output, context) => {
1007
874
  return {
1008
875
  Message: __expectString(output.Message),
1009
876
  };
1010
877
  };
1011
- var deserializeAws_json1_1LimitExceededException = function (output, context) {
878
+ const deserializeAws_json1_1LimitExceededException = (output, context) => {
1012
879
  return {
1013
880
  Message: __expectString(output.Message),
1014
881
  };
1015
882
  };
1016
- var deserializeAws_json1_1MetricDimension = function (output, context) {
883
+ const deserializeAws_json1_1MetricDimension = (output, context) => {
1017
884
  return {
1018
885
  Name: __expectString(output.Name),
1019
886
  Value: __expectString(output.Value),
1020
887
  };
1021
888
  };
1022
- var deserializeAws_json1_1MetricDimensions = function (output, context) {
1023
- var retVal = (output || [])
1024
- .filter(function (e) { return e != null; })
1025
- .map(function (entry) {
889
+ const deserializeAws_json1_1MetricDimensions = (output, context) => {
890
+ const retVal = (output || [])
891
+ .filter((e) => e != null)
892
+ .map((entry) => {
1026
893
  if (entry === null) {
1027
894
  return null;
1028
895
  }
@@ -1030,30 +897,30 @@ var deserializeAws_json1_1MetricDimensions = function (output, context) {
1030
897
  });
1031
898
  return retVal;
1032
899
  };
1033
- var deserializeAws_json1_1ObjectNotFoundException = function (output, context) {
900
+ const deserializeAws_json1_1ObjectNotFoundException = (output, context) => {
1034
901
  return {
1035
902
  Message: __expectString(output.Message),
1036
903
  };
1037
904
  };
1038
- var deserializeAws_json1_1PredefinedMetricSpecification = function (output, context) {
905
+ const deserializeAws_json1_1PredefinedMetricSpecification = (output, context) => {
1039
906
  return {
1040
907
  PredefinedMetricType: __expectString(output.PredefinedMetricType),
1041
908
  ResourceLabel: __expectString(output.ResourceLabel),
1042
909
  };
1043
910
  };
1044
- var deserializeAws_json1_1PutScalingPolicyResponse = function (output, context) {
911
+ const deserializeAws_json1_1PutScalingPolicyResponse = (output, context) => {
1045
912
  return {
1046
913
  Alarms: output.Alarms != null ? deserializeAws_json1_1Alarms(output.Alarms, context) : undefined,
1047
914
  PolicyARN: __expectString(output.PolicyARN),
1048
915
  };
1049
916
  };
1050
- var deserializeAws_json1_1PutScheduledActionResponse = function (output, context) {
917
+ const deserializeAws_json1_1PutScheduledActionResponse = (output, context) => {
1051
918
  return {};
1052
919
  };
1053
- var deserializeAws_json1_1RegisterScalableTargetResponse = function (output, context) {
920
+ const deserializeAws_json1_1RegisterScalableTargetResponse = (output, context) => {
1054
921
  return {};
1055
922
  };
1056
- var deserializeAws_json1_1ScalableTarget = function (output, context) {
923
+ const deserializeAws_json1_1ScalableTarget = (output, context) => {
1057
924
  return {
1058
925
  CreationTime: output.CreationTime != null
1059
926
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationTime)))
@@ -1067,16 +934,16 @@ var deserializeAws_json1_1ScalableTarget = function (output, context) {
1067
934
  SuspendedState: output.SuspendedState != null ? deserializeAws_json1_1SuspendedState(output.SuspendedState, context) : undefined,
1068
935
  };
1069
936
  };
1070
- var deserializeAws_json1_1ScalableTargetAction = function (output, context) {
937
+ const deserializeAws_json1_1ScalableTargetAction = (output, context) => {
1071
938
  return {
1072
939
  MaxCapacity: __expectInt32(output.MaxCapacity),
1073
940
  MinCapacity: __expectInt32(output.MinCapacity),
1074
941
  };
1075
942
  };
1076
- var deserializeAws_json1_1ScalableTargets = function (output, context) {
1077
- var retVal = (output || [])
1078
- .filter(function (e) { return e != null; })
1079
- .map(function (entry) {
943
+ const deserializeAws_json1_1ScalableTargets = (output, context) => {
944
+ const retVal = (output || [])
945
+ .filter((e) => e != null)
946
+ .map((entry) => {
1080
947
  if (entry === null) {
1081
948
  return null;
1082
949
  }
@@ -1084,10 +951,10 @@ var deserializeAws_json1_1ScalableTargets = function (output, context) {
1084
951
  });
1085
952
  return retVal;
1086
953
  };
1087
- var deserializeAws_json1_1ScalingActivities = function (output, context) {
1088
- var retVal = (output || [])
1089
- .filter(function (e) { return e != null; })
1090
- .map(function (entry) {
954
+ const deserializeAws_json1_1ScalingActivities = (output, context) => {
955
+ const retVal = (output || [])
956
+ .filter((e) => e != null)
957
+ .map((entry) => {
1091
958
  if (entry === null) {
1092
959
  return null;
1093
960
  }
@@ -1095,7 +962,7 @@ var deserializeAws_json1_1ScalingActivities = function (output, context) {
1095
962
  });
1096
963
  return retVal;
1097
964
  };
1098
- var deserializeAws_json1_1ScalingActivity = function (output, context) {
965
+ const deserializeAws_json1_1ScalingActivity = (output, context) => {
1099
966
  return {
1100
967
  ActivityId: __expectString(output.ActivityId),
1101
968
  Cause: __expectString(output.Cause),
@@ -1110,10 +977,10 @@ var deserializeAws_json1_1ScalingActivity = function (output, context) {
1110
977
  StatusMessage: __expectString(output.StatusMessage),
1111
978
  };
1112
979
  };
1113
- var deserializeAws_json1_1ScalingPolicies = function (output, context) {
1114
- var retVal = (output || [])
1115
- .filter(function (e) { return e != null; })
1116
- .map(function (entry) {
980
+ const deserializeAws_json1_1ScalingPolicies = (output, context) => {
981
+ const retVal = (output || [])
982
+ .filter((e) => e != null)
983
+ .map((entry) => {
1117
984
  if (entry === null) {
1118
985
  return null;
1119
986
  }
@@ -1121,7 +988,7 @@ var deserializeAws_json1_1ScalingPolicies = function (output, context) {
1121
988
  });
1122
989
  return retVal;
1123
990
  };
1124
- var deserializeAws_json1_1ScalingPolicy = function (output, context) {
991
+ const deserializeAws_json1_1ScalingPolicy = (output, context) => {
1125
992
  return {
1126
993
  Alarms: output.Alarms != null ? deserializeAws_json1_1Alarms(output.Alarms, context) : undefined,
1127
994
  CreationTime: output.CreationTime != null
@@ -1141,7 +1008,7 @@ var deserializeAws_json1_1ScalingPolicy = function (output, context) {
1141
1008
  : undefined,
1142
1009
  };
1143
1010
  };
1144
- var deserializeAws_json1_1ScheduledAction = function (output, context) {
1011
+ const deserializeAws_json1_1ScheduledAction = (output, context) => {
1145
1012
  return {
1146
1013
  CreationTime: output.CreationTime != null
1147
1014
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationTime)))
@@ -1160,10 +1027,10 @@ var deserializeAws_json1_1ScheduledAction = function (output, context) {
1160
1027
  Timezone: __expectString(output.Timezone),
1161
1028
  };
1162
1029
  };
1163
- var deserializeAws_json1_1ScheduledActions = function (output, context) {
1164
- var retVal = (output || [])
1165
- .filter(function (e) { return e != null; })
1166
- .map(function (entry) {
1030
+ const deserializeAws_json1_1ScheduledActions = (output, context) => {
1031
+ const retVal = (output || [])
1032
+ .filter((e) => e != null)
1033
+ .map((entry) => {
1167
1034
  if (entry === null) {
1168
1035
  return null;
1169
1036
  }
@@ -1171,17 +1038,17 @@ var deserializeAws_json1_1ScheduledActions = function (output, context) {
1171
1038
  });
1172
1039
  return retVal;
1173
1040
  };
1174
- var deserializeAws_json1_1StepAdjustment = function (output, context) {
1041
+ const deserializeAws_json1_1StepAdjustment = (output, context) => {
1175
1042
  return {
1176
1043
  MetricIntervalLowerBound: __limitedParseDouble(output.MetricIntervalLowerBound),
1177
1044
  MetricIntervalUpperBound: __limitedParseDouble(output.MetricIntervalUpperBound),
1178
1045
  ScalingAdjustment: __expectInt32(output.ScalingAdjustment),
1179
1046
  };
1180
1047
  };
1181
- var deserializeAws_json1_1StepAdjustments = function (output, context) {
1182
- var retVal = (output || [])
1183
- .filter(function (e) { return e != null; })
1184
- .map(function (entry) {
1048
+ const deserializeAws_json1_1StepAdjustments = (output, context) => {
1049
+ const retVal = (output || [])
1050
+ .filter((e) => e != null)
1051
+ .map((entry) => {
1185
1052
  if (entry === null) {
1186
1053
  return null;
1187
1054
  }
@@ -1189,7 +1056,7 @@ var deserializeAws_json1_1StepAdjustments = function (output, context) {
1189
1056
  });
1190
1057
  return retVal;
1191
1058
  };
1192
- var deserializeAws_json1_1StepScalingPolicyConfiguration = function (output, context) {
1059
+ const deserializeAws_json1_1StepScalingPolicyConfiguration = (output, context) => {
1193
1060
  return {
1194
1061
  AdjustmentType: __expectString(output.AdjustmentType),
1195
1062
  Cooldown: __expectInt32(output.Cooldown),
@@ -1200,14 +1067,14 @@ var deserializeAws_json1_1StepScalingPolicyConfiguration = function (output, con
1200
1067
  : undefined,
1201
1068
  };
1202
1069
  };
1203
- var deserializeAws_json1_1SuspendedState = function (output, context) {
1070
+ const deserializeAws_json1_1SuspendedState = (output, context) => {
1204
1071
  return {
1205
1072
  DynamicScalingInSuspended: __expectBoolean(output.DynamicScalingInSuspended),
1206
1073
  DynamicScalingOutSuspended: __expectBoolean(output.DynamicScalingOutSuspended),
1207
1074
  ScheduledScalingSuspended: __expectBoolean(output.ScheduledScalingSuspended),
1208
1075
  };
1209
1076
  };
1210
- var deserializeAws_json1_1TargetTrackingScalingPolicyConfiguration = function (output, context) {
1077
+ const deserializeAws_json1_1TargetTrackingScalingPolicyConfiguration = (output, context) => {
1211
1078
  return {
1212
1079
  CustomizedMetricSpecification: output.CustomizedMetricSpecification != null
1213
1080
  ? deserializeAws_json1_1CustomizedMetricSpecification(output.CustomizedMetricSpecification, context)
@@ -1221,67 +1088,57 @@ var deserializeAws_json1_1TargetTrackingScalingPolicyConfiguration = function (o
1221
1088
  TargetValue: __limitedParseDouble(output.TargetValue),
1222
1089
  };
1223
1090
  };
1224
- var deserializeAws_json1_1ValidationException = function (output, context) {
1091
+ const deserializeAws_json1_1ValidationException = (output, context) => {
1225
1092
  return {
1226
1093
  Message: __expectString(output.Message),
1227
1094
  };
1228
1095
  };
1229
- var deserializeMetadata = function (output) {
1230
- var _a;
1231
- return ({
1232
- httpStatusCode: output.statusCode,
1233
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
1234
- extendedRequestId: output.headers["x-amz-id-2"],
1235
- cfId: output.headers["x-amz-cf-id"],
1236
- });
1237
- };
1238
- var collectBody = function (streamBody, context) {
1239
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1096
+ const deserializeMetadata = (output) => ({
1097
+ httpStatusCode: output.statusCode,
1098
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1099
+ extendedRequestId: output.headers["x-amz-id-2"],
1100
+ cfId: output.headers["x-amz-cf-id"],
1101
+ });
1102
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1240
1103
  if (streamBody instanceof Uint8Array) {
1241
1104
  return Promise.resolve(streamBody);
1242
1105
  }
1243
1106
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1244
1107
  };
1245
- var collectBodyString = function (streamBody, context) {
1246
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1247
- };
1248
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
1249
- var _a, hostname, _b, protocol, port, basePath, contents;
1250
- return __generator(this, function (_c) {
1251
- switch (_c.label) {
1252
- case 0: return [4, context.endpoint()];
1253
- case 1:
1254
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1255
- contents = {
1256
- protocol: protocol,
1257
- hostname: hostname,
1258
- port: port,
1259
- method: "POST",
1260
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1261
- headers: headers,
1262
- };
1263
- if (resolvedHostname !== undefined) {
1264
- contents.hostname = resolvedHostname;
1265
- }
1266
- if (body !== undefined) {
1267
- contents.body = body;
1268
- }
1269
- return [2, new __HttpRequest(contents)];
1270
- }
1271
- });
1272
- }); };
1273
- var parseBody = function (streamBody, context) {
1274
- return collectBodyString(streamBody, context).then(function (encoded) {
1275
- if (encoded.length) {
1276
- return JSON.parse(encoded);
1277
- }
1278
- return {};
1279
- });
1108
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1109
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1110
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1111
+ const contents = {
1112
+ protocol,
1113
+ hostname,
1114
+ port,
1115
+ method: "POST",
1116
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1117
+ headers,
1118
+ };
1119
+ if (resolvedHostname !== undefined) {
1120
+ contents.hostname = resolvedHostname;
1121
+ }
1122
+ if (body !== undefined) {
1123
+ contents.body = body;
1124
+ }
1125
+ return new __HttpRequest(contents);
1126
+ };
1127
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1128
+ if (encoded.length) {
1129
+ return JSON.parse(encoded);
1130
+ }
1131
+ return {};
1132
+ });
1133
+ const parseErrorBody = async (errorBody, context) => {
1134
+ const value = await parseBody(errorBody, context);
1135
+ value.message = value.message ?? value.Message;
1136
+ return value;
1280
1137
  };
1281
- var loadRestJsonErrorCode = function (output, data) {
1282
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1283
- var sanitizeErrorCode = function (rawValue) {
1284
- var cleanValue = rawValue;
1138
+ const loadRestJsonErrorCode = (output, data) => {
1139
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1140
+ const sanitizeErrorCode = (rawValue) => {
1141
+ let cleanValue = rawValue;
1285
1142
  if (typeof cleanValue === "number") {
1286
1143
  cleanValue = cleanValue.toString();
1287
1144
  }
@@ -1296,7 +1153,7 @@ var loadRestJsonErrorCode = function (output, data) {
1296
1153
  }
1297
1154
  return cleanValue;
1298
1155
  };
1299
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1156
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1300
1157
  if (headerKey !== undefined) {
1301
1158
  return sanitizeErrorCode(output.headers[headerKey]);
1302
1159
  }