@aws-sdk/client-auto-scaling-plans 3.181.0 → 3.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,639 +1,584 @@
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, expectLong as __expectLong, 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 { AutoScalingPlansServiceException as __BaseException } from "../models/AutoScalingPlansServiceException";
5
4
  import { ConcurrentUpdateException, InternalServiceException, InvalidNextTokenException, LimitExceededException, ObjectNotFoundException, ValidationException, } from "../models/models_0";
6
- export var serializeAws_json1_1CreateScalingPlanCommand = 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": "AnyScaleScalingPlannerFrontendService.CreateScalingPlan",
12
- };
13
- body = JSON.stringify(serializeAws_json1_1CreateScalingPlanRequest(input, context));
14
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
- });
16
- }); };
17
- export var serializeAws_json1_1DeleteScalingPlanCommand = 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": "AnyScaleScalingPlannerFrontendService.DeleteScalingPlan",
23
- };
24
- body = JSON.stringify(serializeAws_json1_1DeleteScalingPlanRequest(input, context));
25
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
- });
27
- }); };
28
- export var serializeAws_json1_1DescribeScalingPlanResourcesCommand = 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": "AnyScaleScalingPlannerFrontendService.DescribeScalingPlanResources",
34
- };
35
- body = JSON.stringify(serializeAws_json1_1DescribeScalingPlanResourcesRequest(input, context));
36
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
- });
38
- }); };
39
- export var serializeAws_json1_1DescribeScalingPlansCommand = 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": "AnyScaleScalingPlannerFrontendService.DescribeScalingPlans",
45
- };
46
- body = JSON.stringify(serializeAws_json1_1DescribeScalingPlansRequest(input, context));
47
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
48
- });
49
- }); };
50
- export var serializeAws_json1_1GetScalingPlanResourceForecastDataCommand = 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": "AnyScaleScalingPlannerFrontendService.GetScalingPlanResourceForecastData",
56
- };
57
- body = JSON.stringify(serializeAws_json1_1GetScalingPlanResourceForecastDataRequest(input, context));
58
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
59
- });
60
- }); };
61
- export var serializeAws_json1_1UpdateScalingPlanCommand = 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": "AnyScaleScalingPlannerFrontendService.UpdateScalingPlan",
67
- };
68
- body = JSON.stringify(serializeAws_json1_1UpdateScalingPlanRequest(input, context));
69
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
70
- });
71
- }); };
72
- export var deserializeAws_json1_1CreateScalingPlanCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
73
- var data, contents, response;
74
- return __generator(this, function (_a) {
75
- switch (_a.label) {
76
- case 0:
77
- if (output.statusCode >= 300) {
78
- return [2, deserializeAws_json1_1CreateScalingPlanCommandError(output, context)];
79
- }
80
- return [4, parseBody(output.body, context)];
81
- case 1:
82
- data = _a.sent();
83
- contents = {};
84
- contents = deserializeAws_json1_1CreateScalingPlanResponse(data, context);
85
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
86
- return [2, Promise.resolve(response)];
87
- }
88
- });
89
- }); };
90
- var deserializeAws_json1_1CreateScalingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
91
- var parsedOutput, _a, errorCode, _b, parsedBody;
92
- var _c;
93
- return __generator(this, function (_d) {
94
- switch (_d.label) {
95
- case 0:
96
- _a = [__assign({}, output)];
97
- _c = {};
98
- return [4, parseErrorBody(output.body, context)];
99
- case 1:
100
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
101
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
102
- _b = errorCode;
103
- switch (_b) {
104
- case "ConcurrentUpdateException": return [3, 2];
105
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": return [3, 2];
106
- case "InternalServiceException": return [3, 4];
107
- case "com.amazonaws.autoscalingplans#InternalServiceException": return [3, 4];
108
- case "LimitExceededException": return [3, 6];
109
- case "com.amazonaws.autoscalingplans#LimitExceededException": return [3, 6];
110
- case "ValidationException": return [3, 8];
111
- case "com.amazonaws.autoscalingplans#ValidationException": return [3, 8];
112
- }
113
- return [3, 10];
114
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
115
- case 3: throw _d.sent();
116
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
117
- case 5: throw _d.sent();
118
- case 6: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
119
- case 7: throw _d.sent();
120
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
121
- case 9: throw _d.sent();
122
- case 10:
123
- parsedBody = parsedOutput.body;
124
- throwDefaultError({
125
- output: output,
126
- parsedBody: parsedBody,
127
- exceptionCtor: __BaseException,
128
- errorCode: errorCode,
129
- });
130
- _d.label = 11;
131
- case 11: return [2];
132
- }
133
- });
134
- }); };
135
- export var deserializeAws_json1_1DeleteScalingPlanCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
136
- var data, contents, response;
137
- return __generator(this, function (_a) {
138
- switch (_a.label) {
139
- case 0:
140
- if (output.statusCode >= 300) {
141
- return [2, deserializeAws_json1_1DeleteScalingPlanCommandError(output, context)];
142
- }
143
- return [4, parseBody(output.body, context)];
144
- case 1:
145
- data = _a.sent();
146
- contents = {};
147
- contents = deserializeAws_json1_1DeleteScalingPlanResponse(data, context);
148
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
149
- return [2, Promise.resolve(response)];
150
- }
151
- });
152
- }); };
153
- var deserializeAws_json1_1DeleteScalingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
154
- var parsedOutput, _a, errorCode, _b, parsedBody;
155
- var _c;
156
- return __generator(this, function (_d) {
157
- switch (_d.label) {
158
- case 0:
159
- _a = [__assign({}, output)];
160
- _c = {};
161
- return [4, parseErrorBody(output.body, context)];
162
- case 1:
163
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
164
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
165
- _b = errorCode;
166
- switch (_b) {
167
- case "ConcurrentUpdateException": return [3, 2];
168
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": return [3, 2];
169
- case "InternalServiceException": return [3, 4];
170
- case "com.amazonaws.autoscalingplans#InternalServiceException": return [3, 4];
171
- case "ObjectNotFoundException": return [3, 6];
172
- case "com.amazonaws.autoscalingplans#ObjectNotFoundException": return [3, 6];
173
- case "ValidationException": return [3, 8];
174
- case "com.amazonaws.autoscalingplans#ValidationException": return [3, 8];
175
- }
176
- return [3, 10];
177
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
178
- case 3: throw _d.sent();
179
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
180
- case 5: throw _d.sent();
181
- case 6: return [4, deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)];
182
- case 7: throw _d.sent();
183
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
184
- case 9: throw _d.sent();
185
- case 10:
186
- parsedBody = parsedOutput.body;
187
- throwDefaultError({
188
- output: output,
189
- parsedBody: parsedBody,
190
- exceptionCtor: __BaseException,
191
- errorCode: errorCode,
192
- });
193
- _d.label = 11;
194
- case 11: return [2];
195
- }
196
- });
197
- }); };
198
- export var deserializeAws_json1_1DescribeScalingPlanResourcesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
199
- var data, contents, response;
200
- return __generator(this, function (_a) {
201
- switch (_a.label) {
202
- case 0:
203
- if (output.statusCode >= 300) {
204
- return [2, deserializeAws_json1_1DescribeScalingPlanResourcesCommandError(output, context)];
205
- }
206
- return [4, parseBody(output.body, context)];
207
- case 1:
208
- data = _a.sent();
209
- contents = {};
210
- contents = deserializeAws_json1_1DescribeScalingPlanResourcesResponse(data, context);
211
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
212
- return [2, Promise.resolve(response)];
213
- }
214
- });
215
- }); };
216
- var deserializeAws_json1_1DescribeScalingPlanResourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
217
- var parsedOutput, _a, errorCode, _b, parsedBody;
218
- var _c;
219
- return __generator(this, function (_d) {
220
- switch (_d.label) {
221
- case 0:
222
- _a = [__assign({}, output)];
223
- _c = {};
224
- return [4, parseErrorBody(output.body, context)];
225
- case 1:
226
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
227
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
228
- _b = errorCode;
229
- switch (_b) {
230
- case "ConcurrentUpdateException": return [3, 2];
231
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": return [3, 2];
232
- case "InternalServiceException": return [3, 4];
233
- case "com.amazonaws.autoscalingplans#InternalServiceException": return [3, 4];
234
- case "InvalidNextTokenException": return [3, 6];
235
- case "com.amazonaws.autoscalingplans#InvalidNextTokenException": return [3, 6];
236
- case "ValidationException": return [3, 8];
237
- case "com.amazonaws.autoscalingplans#ValidationException": return [3, 8];
238
- }
239
- return [3, 10];
240
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
241
- case 3: throw _d.sent();
242
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
243
- case 5: throw _d.sent();
244
- case 6: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
245
- case 7: throw _d.sent();
246
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
247
- case 9: throw _d.sent();
248
- case 10:
249
- parsedBody = parsedOutput.body;
250
- throwDefaultError({
251
- output: output,
252
- parsedBody: parsedBody,
253
- exceptionCtor: __BaseException,
254
- errorCode: errorCode,
255
- });
256
- _d.label = 11;
257
- case 11: return [2];
258
- }
259
- });
260
- }); };
261
- export var deserializeAws_json1_1DescribeScalingPlansCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
262
- var data, contents, response;
263
- return __generator(this, function (_a) {
264
- switch (_a.label) {
265
- case 0:
266
- if (output.statusCode >= 300) {
267
- return [2, deserializeAws_json1_1DescribeScalingPlansCommandError(output, context)];
268
- }
269
- return [4, parseBody(output.body, context)];
270
- case 1:
271
- data = _a.sent();
272
- contents = {};
273
- contents = deserializeAws_json1_1DescribeScalingPlansResponse(data, context);
274
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
275
- return [2, Promise.resolve(response)];
276
- }
277
- });
278
- }); };
279
- var deserializeAws_json1_1DescribeScalingPlansCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
280
- var parsedOutput, _a, errorCode, _b, parsedBody;
281
- var _c;
282
- return __generator(this, function (_d) {
283
- switch (_d.label) {
284
- case 0:
285
- _a = [__assign({}, output)];
286
- _c = {};
287
- return [4, parseErrorBody(output.body, context)];
288
- case 1:
289
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
290
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
291
- _b = errorCode;
292
- switch (_b) {
293
- case "ConcurrentUpdateException": return [3, 2];
294
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": return [3, 2];
295
- case "InternalServiceException": return [3, 4];
296
- case "com.amazonaws.autoscalingplans#InternalServiceException": return [3, 4];
297
- case "InvalidNextTokenException": return [3, 6];
298
- case "com.amazonaws.autoscalingplans#InvalidNextTokenException": return [3, 6];
299
- case "ValidationException": return [3, 8];
300
- case "com.amazonaws.autoscalingplans#ValidationException": return [3, 8];
301
- }
302
- return [3, 10];
303
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
304
- case 3: throw _d.sent();
305
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
306
- case 5: throw _d.sent();
307
- case 6: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
308
- case 7: throw _d.sent();
309
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
310
- case 9: throw _d.sent();
311
- case 10:
312
- parsedBody = parsedOutput.body;
313
- throwDefaultError({
314
- output: output,
315
- parsedBody: parsedBody,
316
- exceptionCtor: __BaseException,
317
- errorCode: errorCode,
318
- });
319
- _d.label = 11;
320
- case 11: return [2];
321
- }
322
- });
323
- }); };
324
- export var deserializeAws_json1_1GetScalingPlanResourceForecastDataCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
325
- var data, contents, response;
326
- return __generator(this, function (_a) {
327
- switch (_a.label) {
328
- case 0:
329
- if (output.statusCode >= 300) {
330
- return [2, deserializeAws_json1_1GetScalingPlanResourceForecastDataCommandError(output, context)];
331
- }
332
- return [4, parseBody(output.body, context)];
333
- case 1:
334
- data = _a.sent();
335
- contents = {};
336
- contents = deserializeAws_json1_1GetScalingPlanResourceForecastDataResponse(data, context);
337
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
338
- return [2, Promise.resolve(response)];
339
- }
340
- });
341
- }); };
342
- var deserializeAws_json1_1GetScalingPlanResourceForecastDataCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
343
- var parsedOutput, _a, errorCode, _b, parsedBody;
344
- var _c;
345
- return __generator(this, function (_d) {
346
- switch (_d.label) {
347
- case 0:
348
- _a = [__assign({}, output)];
349
- _c = {};
350
- return [4, parseErrorBody(output.body, context)];
351
- case 1:
352
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
353
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
354
- _b = errorCode;
355
- switch (_b) {
356
- case "InternalServiceException": return [3, 2];
357
- case "com.amazonaws.autoscalingplans#InternalServiceException": return [3, 2];
358
- case "ValidationException": return [3, 4];
359
- case "com.amazonaws.autoscalingplans#ValidationException": return [3, 4];
360
- }
361
- return [3, 6];
362
- case 2: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
363
- case 3: throw _d.sent();
364
- case 4: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
365
- case 5: throw _d.sent();
366
- case 6:
367
- parsedBody = parsedOutput.body;
368
- throwDefaultError({
369
- output: output,
370
- parsedBody: parsedBody,
371
- exceptionCtor: __BaseException,
372
- errorCode: errorCode,
373
- });
374
- _d.label = 7;
375
- case 7: return [2];
376
- }
377
- });
378
- }); };
379
- export var deserializeAws_json1_1UpdateScalingPlanCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
380
- var data, contents, response;
381
- return __generator(this, function (_a) {
382
- switch (_a.label) {
383
- case 0:
384
- if (output.statusCode >= 300) {
385
- return [2, deserializeAws_json1_1UpdateScalingPlanCommandError(output, context)];
386
- }
387
- return [4, parseBody(output.body, context)];
388
- case 1:
389
- data = _a.sent();
390
- contents = {};
391
- contents = deserializeAws_json1_1UpdateScalingPlanResponse(data, context);
392
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
393
- return [2, Promise.resolve(response)];
394
- }
395
- });
396
- }); };
397
- var deserializeAws_json1_1UpdateScalingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
398
- var parsedOutput, _a, errorCode, _b, parsedBody;
399
- var _c;
400
- return __generator(this, function (_d) {
401
- switch (_d.label) {
402
- case 0:
403
- _a = [__assign({}, output)];
404
- _c = {};
405
- return [4, parseErrorBody(output.body, context)];
406
- case 1:
407
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
408
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
409
- _b = errorCode;
410
- switch (_b) {
411
- case "ConcurrentUpdateException": return [3, 2];
412
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": return [3, 2];
413
- case "InternalServiceException": return [3, 4];
414
- case "com.amazonaws.autoscalingplans#InternalServiceException": return [3, 4];
415
- case "ObjectNotFoundException": return [3, 6];
416
- case "com.amazonaws.autoscalingplans#ObjectNotFoundException": return [3, 6];
417
- case "ValidationException": return [3, 8];
418
- case "com.amazonaws.autoscalingplans#ValidationException": return [3, 8];
419
- }
420
- return [3, 10];
421
- case 2: return [4, deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)];
422
- case 3: throw _d.sent();
423
- case 4: return [4, deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)];
424
- case 5: throw _d.sent();
425
- case 6: return [4, deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)];
426
- case 7: throw _d.sent();
427
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
428
- case 9: throw _d.sent();
429
- case 10:
430
- parsedBody = parsedOutput.body;
431
- throwDefaultError({
432
- output: output,
433
- parsedBody: parsedBody,
434
- exceptionCtor: __BaseException,
435
- errorCode: errorCode,
436
- });
437
- _d.label = 11;
438
- case 11: return [2];
439
- }
440
- });
441
- }); };
442
- var deserializeAws_json1_1ConcurrentUpdateExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
443
- var body, deserialized, exception;
444
- return __generator(this, function (_a) {
445
- body = parsedOutput.body;
446
- deserialized = deserializeAws_json1_1ConcurrentUpdateException(body, context);
447
- exception = new ConcurrentUpdateException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
448
- return [2, __decorateServiceException(exception, body)];
449
- });
450
- }); };
451
- var deserializeAws_json1_1InternalServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
452
- var body, deserialized, exception;
453
- return __generator(this, function (_a) {
454
- body = parsedOutput.body;
455
- deserialized = deserializeAws_json1_1InternalServiceException(body, context);
456
- exception = new InternalServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
457
- return [2, __decorateServiceException(exception, body)];
458
- });
459
- }); };
460
- var deserializeAws_json1_1InvalidNextTokenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
461
- var body, deserialized, exception;
462
- return __generator(this, function (_a) {
463
- body = parsedOutput.body;
464
- deserialized = deserializeAws_json1_1InvalidNextTokenException(body, context);
465
- exception = new InvalidNextTokenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
466
- return [2, __decorateServiceException(exception, body)];
467
- });
468
- }); };
469
- var deserializeAws_json1_1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
470
- var body, deserialized, exception;
471
- return __generator(this, function (_a) {
472
- body = parsedOutput.body;
473
- deserialized = deserializeAws_json1_1LimitExceededException(body, context);
474
- exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
475
- return [2, __decorateServiceException(exception, body)];
476
- });
477
- }); };
478
- var deserializeAws_json1_1ObjectNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
479
- var body, deserialized, exception;
480
- return __generator(this, function (_a) {
481
- body = parsedOutput.body;
482
- deserialized = deserializeAws_json1_1ObjectNotFoundException(body, context);
483
- exception = new ObjectNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
484
- return [2, __decorateServiceException(exception, body)];
485
- });
486
- }); };
487
- var deserializeAws_json1_1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
488
- var body, deserialized, exception;
489
- return __generator(this, function (_a) {
490
- body = parsedOutput.body;
491
- deserialized = deserializeAws_json1_1ValidationException(body, context);
492
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
493
- return [2, __decorateServiceException(exception, body)];
494
- });
495
- }); };
496
- var serializeAws_json1_1ApplicationSource = function (input, context) {
497
- return __assign(__assign({}, (input.CloudFormationStackARN != null && { CloudFormationStackARN: input.CloudFormationStackARN })), (input.TagFilters != null && { TagFilters: serializeAws_json1_1TagFilters(input.TagFilters, context) }));
5
+ export const serializeAws_json1_1CreateScalingPlanCommand = async (input, context) => {
6
+ const headers = {
7
+ "content-type": "application/x-amz-json-1.1",
8
+ "x-amz-target": "AnyScaleScalingPlannerFrontendService.CreateScalingPlan",
9
+ };
10
+ let body;
11
+ body = JSON.stringify(serializeAws_json1_1CreateScalingPlanRequest(input, context));
12
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
+ };
14
+ export const serializeAws_json1_1DeleteScalingPlanCommand = async (input, context) => {
15
+ const headers = {
16
+ "content-type": "application/x-amz-json-1.1",
17
+ "x-amz-target": "AnyScaleScalingPlannerFrontendService.DeleteScalingPlan",
18
+ };
19
+ let body;
20
+ body = JSON.stringify(serializeAws_json1_1DeleteScalingPlanRequest(input, context));
21
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
+ };
23
+ export const serializeAws_json1_1DescribeScalingPlanResourcesCommand = async (input, context) => {
24
+ const headers = {
25
+ "content-type": "application/x-amz-json-1.1",
26
+ "x-amz-target": "AnyScaleScalingPlannerFrontendService.DescribeScalingPlanResources",
27
+ };
28
+ let body;
29
+ body = JSON.stringify(serializeAws_json1_1DescribeScalingPlanResourcesRequest(input, context));
30
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
+ };
32
+ export const serializeAws_json1_1DescribeScalingPlansCommand = async (input, context) => {
33
+ const headers = {
34
+ "content-type": "application/x-amz-json-1.1",
35
+ "x-amz-target": "AnyScaleScalingPlannerFrontendService.DescribeScalingPlans",
36
+ };
37
+ let body;
38
+ body = JSON.stringify(serializeAws_json1_1DescribeScalingPlansRequest(input, context));
39
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
+ };
41
+ export const serializeAws_json1_1GetScalingPlanResourceForecastDataCommand = async (input, context) => {
42
+ const headers = {
43
+ "content-type": "application/x-amz-json-1.1",
44
+ "x-amz-target": "AnyScaleScalingPlannerFrontendService.GetScalingPlanResourceForecastData",
45
+ };
46
+ let body;
47
+ body = JSON.stringify(serializeAws_json1_1GetScalingPlanResourceForecastDataRequest(input, context));
48
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
+ };
50
+ export const serializeAws_json1_1UpdateScalingPlanCommand = async (input, context) => {
51
+ const headers = {
52
+ "content-type": "application/x-amz-json-1.1",
53
+ "x-amz-target": "AnyScaleScalingPlannerFrontendService.UpdateScalingPlan",
54
+ };
55
+ let body;
56
+ body = JSON.stringify(serializeAws_json1_1UpdateScalingPlanRequest(input, context));
57
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
+ };
59
+ export const deserializeAws_json1_1CreateScalingPlanCommand = async (output, context) => {
60
+ if (output.statusCode >= 300) {
61
+ return deserializeAws_json1_1CreateScalingPlanCommandError(output, context);
62
+ }
63
+ const data = await parseBody(output.body, context);
64
+ let contents = {};
65
+ contents = deserializeAws_json1_1CreateScalingPlanResponse(data, context);
66
+ const response = {
67
+ $metadata: deserializeMetadata(output),
68
+ ...contents,
69
+ };
70
+ return Promise.resolve(response);
71
+ };
72
+ const deserializeAws_json1_1CreateScalingPlanCommandError = async (output, context) => {
73
+ const parsedOutput = {
74
+ ...output,
75
+ body: await parseErrorBody(output.body, context),
76
+ };
77
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
78
+ switch (errorCode) {
79
+ case "ConcurrentUpdateException":
80
+ case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
81
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
82
+ case "InternalServiceException":
83
+ case "com.amazonaws.autoscalingplans#InternalServiceException":
84
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
85
+ case "LimitExceededException":
86
+ case "com.amazonaws.autoscalingplans#LimitExceededException":
87
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
88
+ case "ValidationException":
89
+ case "com.amazonaws.autoscalingplans#ValidationException":
90
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
91
+ default:
92
+ const parsedBody = parsedOutput.body;
93
+ throwDefaultError({
94
+ output,
95
+ parsedBody,
96
+ exceptionCtor: __BaseException,
97
+ errorCode,
98
+ });
99
+ }
100
+ };
101
+ export const deserializeAws_json1_1DeleteScalingPlanCommand = async (output, context) => {
102
+ if (output.statusCode >= 300) {
103
+ return deserializeAws_json1_1DeleteScalingPlanCommandError(output, context);
104
+ }
105
+ const data = await parseBody(output.body, context);
106
+ let contents = {};
107
+ contents = deserializeAws_json1_1DeleteScalingPlanResponse(data, context);
108
+ const response = {
109
+ $metadata: deserializeMetadata(output),
110
+ ...contents,
111
+ };
112
+ return Promise.resolve(response);
113
+ };
114
+ const deserializeAws_json1_1DeleteScalingPlanCommandError = async (output, context) => {
115
+ const parsedOutput = {
116
+ ...output,
117
+ body: await parseErrorBody(output.body, context),
118
+ };
119
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
120
+ switch (errorCode) {
121
+ case "ConcurrentUpdateException":
122
+ case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
123
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
124
+ case "InternalServiceException":
125
+ case "com.amazonaws.autoscalingplans#InternalServiceException":
126
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
127
+ case "ObjectNotFoundException":
128
+ case "com.amazonaws.autoscalingplans#ObjectNotFoundException":
129
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
130
+ case "ValidationException":
131
+ case "com.amazonaws.autoscalingplans#ValidationException":
132
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
133
+ default:
134
+ const parsedBody = parsedOutput.body;
135
+ throwDefaultError({
136
+ output,
137
+ parsedBody,
138
+ exceptionCtor: __BaseException,
139
+ errorCode,
140
+ });
141
+ }
142
+ };
143
+ export const deserializeAws_json1_1DescribeScalingPlanResourcesCommand = async (output, context) => {
144
+ if (output.statusCode >= 300) {
145
+ return deserializeAws_json1_1DescribeScalingPlanResourcesCommandError(output, context);
146
+ }
147
+ const data = await parseBody(output.body, context);
148
+ let contents = {};
149
+ contents = deserializeAws_json1_1DescribeScalingPlanResourcesResponse(data, context);
150
+ const response = {
151
+ $metadata: deserializeMetadata(output),
152
+ ...contents,
153
+ };
154
+ return Promise.resolve(response);
155
+ };
156
+ const deserializeAws_json1_1DescribeScalingPlanResourcesCommandError = async (output, context) => {
157
+ const parsedOutput = {
158
+ ...output,
159
+ body: await parseErrorBody(output.body, context),
160
+ };
161
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
162
+ switch (errorCode) {
163
+ case "ConcurrentUpdateException":
164
+ case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
165
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
166
+ case "InternalServiceException":
167
+ case "com.amazonaws.autoscalingplans#InternalServiceException":
168
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
169
+ case "InvalidNextTokenException":
170
+ case "com.amazonaws.autoscalingplans#InvalidNextTokenException":
171
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
172
+ case "ValidationException":
173
+ case "com.amazonaws.autoscalingplans#ValidationException":
174
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
175
+ default:
176
+ const parsedBody = parsedOutput.body;
177
+ throwDefaultError({
178
+ output,
179
+ parsedBody,
180
+ exceptionCtor: __BaseException,
181
+ errorCode,
182
+ });
183
+ }
184
+ };
185
+ export const deserializeAws_json1_1DescribeScalingPlansCommand = async (output, context) => {
186
+ if (output.statusCode >= 300) {
187
+ return deserializeAws_json1_1DescribeScalingPlansCommandError(output, context);
188
+ }
189
+ const data = await parseBody(output.body, context);
190
+ let contents = {};
191
+ contents = deserializeAws_json1_1DescribeScalingPlansResponse(data, context);
192
+ const response = {
193
+ $metadata: deserializeMetadata(output),
194
+ ...contents,
195
+ };
196
+ return Promise.resolve(response);
498
197
  };
499
- var serializeAws_json1_1ApplicationSources = function (input, context) {
198
+ const deserializeAws_json1_1DescribeScalingPlansCommandError = async (output, context) => {
199
+ const parsedOutput = {
200
+ ...output,
201
+ body: await parseErrorBody(output.body, context),
202
+ };
203
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
204
+ switch (errorCode) {
205
+ case "ConcurrentUpdateException":
206
+ case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
207
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
208
+ case "InternalServiceException":
209
+ case "com.amazonaws.autoscalingplans#InternalServiceException":
210
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
211
+ case "InvalidNextTokenException":
212
+ case "com.amazonaws.autoscalingplans#InvalidNextTokenException":
213
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
214
+ case "ValidationException":
215
+ case "com.amazonaws.autoscalingplans#ValidationException":
216
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
217
+ default:
218
+ const parsedBody = parsedOutput.body;
219
+ throwDefaultError({
220
+ output,
221
+ parsedBody,
222
+ exceptionCtor: __BaseException,
223
+ errorCode,
224
+ });
225
+ }
226
+ };
227
+ export const deserializeAws_json1_1GetScalingPlanResourceForecastDataCommand = async (output, context) => {
228
+ if (output.statusCode >= 300) {
229
+ return deserializeAws_json1_1GetScalingPlanResourceForecastDataCommandError(output, context);
230
+ }
231
+ const data = await parseBody(output.body, context);
232
+ let contents = {};
233
+ contents = deserializeAws_json1_1GetScalingPlanResourceForecastDataResponse(data, context);
234
+ const response = {
235
+ $metadata: deserializeMetadata(output),
236
+ ...contents,
237
+ };
238
+ return Promise.resolve(response);
239
+ };
240
+ const deserializeAws_json1_1GetScalingPlanResourceForecastDataCommandError = async (output, context) => {
241
+ const parsedOutput = {
242
+ ...output,
243
+ body: await parseErrorBody(output.body, context),
244
+ };
245
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
246
+ switch (errorCode) {
247
+ case "InternalServiceException":
248
+ case "com.amazonaws.autoscalingplans#InternalServiceException":
249
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
250
+ case "ValidationException":
251
+ case "com.amazonaws.autoscalingplans#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_1UpdateScalingPlanCommand = async (output, context) => {
264
+ if (output.statusCode >= 300) {
265
+ return deserializeAws_json1_1UpdateScalingPlanCommandError(output, context);
266
+ }
267
+ const data = await parseBody(output.body, context);
268
+ let contents = {};
269
+ contents = deserializeAws_json1_1UpdateScalingPlanResponse(data, context);
270
+ const response = {
271
+ $metadata: deserializeMetadata(output),
272
+ ...contents,
273
+ };
274
+ return Promise.resolve(response);
275
+ };
276
+ const deserializeAws_json1_1UpdateScalingPlanCommandError = 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.autoscalingplans#ConcurrentUpdateException":
285
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
286
+ case "InternalServiceException":
287
+ case "com.amazonaws.autoscalingplans#InternalServiceException":
288
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
289
+ case "ObjectNotFoundException":
290
+ case "com.amazonaws.autoscalingplans#ObjectNotFoundException":
291
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
292
+ case "ValidationException":
293
+ case "com.amazonaws.autoscalingplans#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
+ const deserializeAws_json1_1ConcurrentUpdateExceptionResponse = async (parsedOutput, context) => {
306
+ const body = parsedOutput.body;
307
+ const deserialized = deserializeAws_json1_1ConcurrentUpdateException(body, context);
308
+ const exception = new ConcurrentUpdateException({
309
+ $metadata: deserializeMetadata(parsedOutput),
310
+ ...deserialized,
311
+ });
312
+ return __decorateServiceException(exception, body);
313
+ };
314
+ const deserializeAws_json1_1InternalServiceExceptionResponse = async (parsedOutput, context) => {
315
+ const body = parsedOutput.body;
316
+ const deserialized = deserializeAws_json1_1InternalServiceException(body, context);
317
+ const exception = new InternalServiceException({
318
+ $metadata: deserializeMetadata(parsedOutput),
319
+ ...deserialized,
320
+ });
321
+ return __decorateServiceException(exception, body);
322
+ };
323
+ const deserializeAws_json1_1InvalidNextTokenExceptionResponse = async (parsedOutput, context) => {
324
+ const body = parsedOutput.body;
325
+ const deserialized = deserializeAws_json1_1InvalidNextTokenException(body, context);
326
+ const exception = new InvalidNextTokenException({
327
+ $metadata: deserializeMetadata(parsedOutput),
328
+ ...deserialized,
329
+ });
330
+ return __decorateServiceException(exception, body);
331
+ };
332
+ const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
333
+ const body = parsedOutput.body;
334
+ const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
335
+ const exception = new LimitExceededException({
336
+ $metadata: deserializeMetadata(parsedOutput),
337
+ ...deserialized,
338
+ });
339
+ return __decorateServiceException(exception, body);
340
+ };
341
+ const deserializeAws_json1_1ObjectNotFoundExceptionResponse = async (parsedOutput, context) => {
342
+ const body = parsedOutput.body;
343
+ const deserialized = deserializeAws_json1_1ObjectNotFoundException(body, context);
344
+ const exception = new ObjectNotFoundException({
345
+ $metadata: deserializeMetadata(parsedOutput),
346
+ ...deserialized,
347
+ });
348
+ return __decorateServiceException(exception, body);
349
+ };
350
+ const deserializeAws_json1_1ValidationExceptionResponse = async (parsedOutput, context) => {
351
+ const body = parsedOutput.body;
352
+ const deserialized = deserializeAws_json1_1ValidationException(body, context);
353
+ const exception = new ValidationException({
354
+ $metadata: deserializeMetadata(parsedOutput),
355
+ ...deserialized,
356
+ });
357
+ return __decorateServiceException(exception, body);
358
+ };
359
+ const serializeAws_json1_1ApplicationSource = (input, context) => {
360
+ return {
361
+ ...(input.CloudFormationStackARN != null && { CloudFormationStackARN: input.CloudFormationStackARN }),
362
+ ...(input.TagFilters != null && { TagFilters: serializeAws_json1_1TagFilters(input.TagFilters, context) }),
363
+ };
364
+ };
365
+ const serializeAws_json1_1ApplicationSources = (input, context) => {
500
366
  return input
501
- .filter(function (e) { return e != null; })
502
- .map(function (entry) {
367
+ .filter((e) => e != null)
368
+ .map((entry) => {
503
369
  return serializeAws_json1_1ApplicationSource(entry, context);
504
370
  });
505
371
  };
506
- var serializeAws_json1_1CreateScalingPlanRequest = function (input, context) {
507
- return __assign(__assign(__assign({}, (input.ApplicationSource != null && {
508
- ApplicationSource: serializeAws_json1_1ApplicationSource(input.ApplicationSource, context),
509
- })), (input.ScalingInstructions != null && {
510
- ScalingInstructions: serializeAws_json1_1ScalingInstructions(input.ScalingInstructions, context),
511
- })), (input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }));
372
+ const serializeAws_json1_1CreateScalingPlanRequest = (input, context) => {
373
+ return {
374
+ ...(input.ApplicationSource != null && {
375
+ ApplicationSource: serializeAws_json1_1ApplicationSource(input.ApplicationSource, context),
376
+ }),
377
+ ...(input.ScalingInstructions != null && {
378
+ ScalingInstructions: serializeAws_json1_1ScalingInstructions(input.ScalingInstructions, context),
379
+ }),
380
+ ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
381
+ };
512
382
  };
513
- var serializeAws_json1_1CustomizedLoadMetricSpecification = function (input, context) {
514
- 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 }));
383
+ const serializeAws_json1_1CustomizedLoadMetricSpecification = (input, context) => {
384
+ return {
385
+ ...(input.Dimensions != null && { Dimensions: serializeAws_json1_1MetricDimensions(input.Dimensions, context) }),
386
+ ...(input.MetricName != null && { MetricName: input.MetricName }),
387
+ ...(input.Namespace != null && { Namespace: input.Namespace }),
388
+ ...(input.Statistic != null && { Statistic: input.Statistic }),
389
+ ...(input.Unit != null && { Unit: input.Unit }),
390
+ };
515
391
  };
516
- var serializeAws_json1_1CustomizedScalingMetricSpecification = function (input, context) {
517
- 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 }));
392
+ const serializeAws_json1_1CustomizedScalingMetricSpecification = (input, context) => {
393
+ return {
394
+ ...(input.Dimensions != null && { Dimensions: serializeAws_json1_1MetricDimensions(input.Dimensions, context) }),
395
+ ...(input.MetricName != null && { MetricName: input.MetricName }),
396
+ ...(input.Namespace != null && { Namespace: input.Namespace }),
397
+ ...(input.Statistic != null && { Statistic: input.Statistic }),
398
+ ...(input.Unit != null && { Unit: input.Unit }),
399
+ };
518
400
  };
519
- var serializeAws_json1_1DeleteScalingPlanRequest = function (input, context) {
520
- return __assign(__assign({}, (input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName })), (input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }));
401
+ const serializeAws_json1_1DeleteScalingPlanRequest = (input, context) => {
402
+ return {
403
+ ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
404
+ ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
405
+ };
521
406
  };
522
- var serializeAws_json1_1DescribeScalingPlanResourcesRequest = function (input, context) {
523
- return __assign(__assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName })), (input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }));
407
+ const serializeAws_json1_1DescribeScalingPlanResourcesRequest = (input, context) => {
408
+ return {
409
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
410
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
411
+ ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
412
+ ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
413
+ };
524
414
  };
525
- var serializeAws_json1_1DescribeScalingPlansRequest = function (input, context) {
526
- return __assign(__assign(__assign(__assign(__assign({}, (input.ApplicationSources != null && {
527
- ApplicationSources: serializeAws_json1_1ApplicationSources(input.ApplicationSources, context),
528
- })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ScalingPlanNames != null && {
529
- ScalingPlanNames: serializeAws_json1_1ScalingPlanNames(input.ScalingPlanNames, context),
530
- })), (input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }));
415
+ const serializeAws_json1_1DescribeScalingPlansRequest = (input, context) => {
416
+ return {
417
+ ...(input.ApplicationSources != null && {
418
+ ApplicationSources: serializeAws_json1_1ApplicationSources(input.ApplicationSources, context),
419
+ }),
420
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
421
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
422
+ ...(input.ScalingPlanNames != null && {
423
+ ScalingPlanNames: serializeAws_json1_1ScalingPlanNames(input.ScalingPlanNames, context),
424
+ }),
425
+ ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
426
+ };
531
427
  };
532
- var serializeAws_json1_1GetScalingPlanResourceForecastDataRequest = function (input, context) {
533
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.EndTime != null && { EndTime: Math.round(input.EndTime.getTime() / 1000) })), (input.ForecastDataType != null && { ForecastDataType: input.ForecastDataType })), (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName })), (input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace })), (input.StartTime != null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }));
428
+ const serializeAws_json1_1GetScalingPlanResourceForecastDataRequest = (input, context) => {
429
+ return {
430
+ ...(input.EndTime != null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }),
431
+ ...(input.ForecastDataType != null && { ForecastDataType: input.ForecastDataType }),
432
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
433
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
434
+ ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
435
+ ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
436
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
437
+ ...(input.StartTime != null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }),
438
+ };
534
439
  };
535
- var serializeAws_json1_1MetricDimension = function (input, context) {
536
- return __assign(__assign({}, (input.Name != null && { Name: input.Name })), (input.Value != null && { Value: input.Value }));
440
+ const serializeAws_json1_1MetricDimension = (input, context) => {
441
+ return {
442
+ ...(input.Name != null && { Name: input.Name }),
443
+ ...(input.Value != null && { Value: input.Value }),
444
+ };
537
445
  };
538
- var serializeAws_json1_1MetricDimensions = function (input, context) {
446
+ const serializeAws_json1_1MetricDimensions = (input, context) => {
539
447
  return input
540
- .filter(function (e) { return e != null; })
541
- .map(function (entry) {
448
+ .filter((e) => e != null)
449
+ .map((entry) => {
542
450
  return serializeAws_json1_1MetricDimension(entry, context);
543
451
  });
544
452
  };
545
- var serializeAws_json1_1PredefinedLoadMetricSpecification = function (input, context) {
546
- return __assign(__assign({}, (input.PredefinedLoadMetricType != null && { PredefinedLoadMetricType: input.PredefinedLoadMetricType })), (input.ResourceLabel != null && { ResourceLabel: input.ResourceLabel }));
547
- };
548
- var serializeAws_json1_1PredefinedScalingMetricSpecification = function (input, context) {
549
- return __assign(__assign({}, (input.PredefinedScalingMetricType != null && {
550
- PredefinedScalingMetricType: input.PredefinedScalingMetricType,
551
- })), (input.ResourceLabel != null && { ResourceLabel: input.ResourceLabel }));
552
- };
553
- var serializeAws_json1_1ScalingInstruction = function (input, context) {
554
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.CustomizedLoadMetricSpecification != null && {
555
- CustomizedLoadMetricSpecification: serializeAws_json1_1CustomizedLoadMetricSpecification(input.CustomizedLoadMetricSpecification, context),
556
- })), (input.DisableDynamicScaling != null && { DisableDynamicScaling: input.DisableDynamicScaling })), (input.MaxCapacity != null && { MaxCapacity: input.MaxCapacity })), (input.MinCapacity != null && { MinCapacity: input.MinCapacity })), (input.PredefinedLoadMetricSpecification != null && {
557
- PredefinedLoadMetricSpecification: serializeAws_json1_1PredefinedLoadMetricSpecification(input.PredefinedLoadMetricSpecification, context),
558
- })), (input.PredictiveScalingMaxCapacityBehavior != null && {
559
- PredictiveScalingMaxCapacityBehavior: input.PredictiveScalingMaxCapacityBehavior,
560
- })), (input.PredictiveScalingMaxCapacityBuffer != null && {
561
- PredictiveScalingMaxCapacityBuffer: input.PredictiveScalingMaxCapacityBuffer,
562
- })), (input.PredictiveScalingMode != null && { PredictiveScalingMode: input.PredictiveScalingMode })), (input.ResourceId != null && { ResourceId: input.ResourceId })), (input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension })), (input.ScalingPolicyUpdateBehavior != null && {
563
- ScalingPolicyUpdateBehavior: input.ScalingPolicyUpdateBehavior,
564
- })), (input.ScheduledActionBufferTime != null && { ScheduledActionBufferTime: input.ScheduledActionBufferTime })), (input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace })), (input.TargetTrackingConfigurations != null && {
565
- TargetTrackingConfigurations: serializeAws_json1_1TargetTrackingConfigurations(input.TargetTrackingConfigurations, context),
566
- }));
567
- };
568
- var serializeAws_json1_1ScalingInstructions = function (input, context) {
453
+ const serializeAws_json1_1PredefinedLoadMetricSpecification = (input, context) => {
454
+ return {
455
+ ...(input.PredefinedLoadMetricType != null && { PredefinedLoadMetricType: input.PredefinedLoadMetricType }),
456
+ ...(input.ResourceLabel != null && { ResourceLabel: input.ResourceLabel }),
457
+ };
458
+ };
459
+ const serializeAws_json1_1PredefinedScalingMetricSpecification = (input, context) => {
460
+ return {
461
+ ...(input.PredefinedScalingMetricType != null && {
462
+ PredefinedScalingMetricType: input.PredefinedScalingMetricType,
463
+ }),
464
+ ...(input.ResourceLabel != null && { ResourceLabel: input.ResourceLabel }),
465
+ };
466
+ };
467
+ const serializeAws_json1_1ScalingInstruction = (input, context) => {
468
+ return {
469
+ ...(input.CustomizedLoadMetricSpecification != null && {
470
+ CustomizedLoadMetricSpecification: serializeAws_json1_1CustomizedLoadMetricSpecification(input.CustomizedLoadMetricSpecification, context),
471
+ }),
472
+ ...(input.DisableDynamicScaling != null && { DisableDynamicScaling: input.DisableDynamicScaling }),
473
+ ...(input.MaxCapacity != null && { MaxCapacity: input.MaxCapacity }),
474
+ ...(input.MinCapacity != null && { MinCapacity: input.MinCapacity }),
475
+ ...(input.PredefinedLoadMetricSpecification != null && {
476
+ PredefinedLoadMetricSpecification: serializeAws_json1_1PredefinedLoadMetricSpecification(input.PredefinedLoadMetricSpecification, context),
477
+ }),
478
+ ...(input.PredictiveScalingMaxCapacityBehavior != null && {
479
+ PredictiveScalingMaxCapacityBehavior: input.PredictiveScalingMaxCapacityBehavior,
480
+ }),
481
+ ...(input.PredictiveScalingMaxCapacityBuffer != null && {
482
+ PredictiveScalingMaxCapacityBuffer: input.PredictiveScalingMaxCapacityBuffer,
483
+ }),
484
+ ...(input.PredictiveScalingMode != null && { PredictiveScalingMode: input.PredictiveScalingMode }),
485
+ ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
486
+ ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
487
+ ...(input.ScalingPolicyUpdateBehavior != null && {
488
+ ScalingPolicyUpdateBehavior: input.ScalingPolicyUpdateBehavior,
489
+ }),
490
+ ...(input.ScheduledActionBufferTime != null && { ScheduledActionBufferTime: input.ScheduledActionBufferTime }),
491
+ ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
492
+ ...(input.TargetTrackingConfigurations != null && {
493
+ TargetTrackingConfigurations: serializeAws_json1_1TargetTrackingConfigurations(input.TargetTrackingConfigurations, context),
494
+ }),
495
+ };
496
+ };
497
+ const serializeAws_json1_1ScalingInstructions = (input, context) => {
569
498
  return input
570
- .filter(function (e) { return e != null; })
571
- .map(function (entry) {
499
+ .filter((e) => e != null)
500
+ .map((entry) => {
572
501
  return serializeAws_json1_1ScalingInstruction(entry, context);
573
502
  });
574
503
  };
575
- var serializeAws_json1_1ScalingPlanNames = function (input, context) {
504
+ const serializeAws_json1_1ScalingPlanNames = (input, context) => {
576
505
  return input
577
- .filter(function (e) { return e != null; })
578
- .map(function (entry) {
506
+ .filter((e) => e != null)
507
+ .map((entry) => {
579
508
  return entry;
580
509
  });
581
510
  };
582
- var serializeAws_json1_1TagFilter = function (input, context) {
583
- return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Values != null && { Values: serializeAws_json1_1TagValues(input.Values, context) }));
511
+ const serializeAws_json1_1TagFilter = (input, context) => {
512
+ return {
513
+ ...(input.Key != null && { Key: input.Key }),
514
+ ...(input.Values != null && { Values: serializeAws_json1_1TagValues(input.Values, context) }),
515
+ };
584
516
  };
585
- var serializeAws_json1_1TagFilters = function (input, context) {
517
+ const serializeAws_json1_1TagFilters = (input, context) => {
586
518
  return input
587
- .filter(function (e) { return e != null; })
588
- .map(function (entry) {
519
+ .filter((e) => e != null)
520
+ .map((entry) => {
589
521
  return serializeAws_json1_1TagFilter(entry, context);
590
522
  });
591
523
  };
592
- var serializeAws_json1_1TagValues = function (input, context) {
524
+ const serializeAws_json1_1TagValues = (input, context) => {
593
525
  return input
594
- .filter(function (e) { return e != null; })
595
- .map(function (entry) {
526
+ .filter((e) => e != null)
527
+ .map((entry) => {
596
528
  return entry;
597
529
  });
598
530
  };
599
- var serializeAws_json1_1TargetTrackingConfiguration = function (input, context) {
600
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.CustomizedScalingMetricSpecification != null && {
601
- CustomizedScalingMetricSpecification: serializeAws_json1_1CustomizedScalingMetricSpecification(input.CustomizedScalingMetricSpecification, context),
602
- })), (input.DisableScaleIn != null && { DisableScaleIn: input.DisableScaleIn })), (input.EstimatedInstanceWarmup != null && { EstimatedInstanceWarmup: input.EstimatedInstanceWarmup })), (input.PredefinedScalingMetricSpecification != null && {
603
- PredefinedScalingMetricSpecification: serializeAws_json1_1PredefinedScalingMetricSpecification(input.PredefinedScalingMetricSpecification, context),
604
- })), (input.ScaleInCooldown != null && { ScaleInCooldown: input.ScaleInCooldown })), (input.ScaleOutCooldown != null && { ScaleOutCooldown: input.ScaleOutCooldown })), (input.TargetValue != null && { TargetValue: __serializeFloat(input.TargetValue) }));
531
+ const serializeAws_json1_1TargetTrackingConfiguration = (input, context) => {
532
+ return {
533
+ ...(input.CustomizedScalingMetricSpecification != null && {
534
+ CustomizedScalingMetricSpecification: serializeAws_json1_1CustomizedScalingMetricSpecification(input.CustomizedScalingMetricSpecification, context),
535
+ }),
536
+ ...(input.DisableScaleIn != null && { DisableScaleIn: input.DisableScaleIn }),
537
+ ...(input.EstimatedInstanceWarmup != null && { EstimatedInstanceWarmup: input.EstimatedInstanceWarmup }),
538
+ ...(input.PredefinedScalingMetricSpecification != null && {
539
+ PredefinedScalingMetricSpecification: serializeAws_json1_1PredefinedScalingMetricSpecification(input.PredefinedScalingMetricSpecification, context),
540
+ }),
541
+ ...(input.ScaleInCooldown != null && { ScaleInCooldown: input.ScaleInCooldown }),
542
+ ...(input.ScaleOutCooldown != null && { ScaleOutCooldown: input.ScaleOutCooldown }),
543
+ ...(input.TargetValue != null && { TargetValue: __serializeFloat(input.TargetValue) }),
544
+ };
605
545
  };
606
- var serializeAws_json1_1TargetTrackingConfigurations = function (input, context) {
546
+ const serializeAws_json1_1TargetTrackingConfigurations = (input, context) => {
607
547
  return input
608
- .filter(function (e) { return e != null; })
609
- .map(function (entry) {
548
+ .filter((e) => e != null)
549
+ .map((entry) => {
610
550
  return serializeAws_json1_1TargetTrackingConfiguration(entry, context);
611
551
  });
612
552
  };
613
- var serializeAws_json1_1UpdateScalingPlanRequest = function (input, context) {
614
- return __assign(__assign(__assign(__assign({}, (input.ApplicationSource != null && {
615
- ApplicationSource: serializeAws_json1_1ApplicationSource(input.ApplicationSource, context),
616
- })), (input.ScalingInstructions != null && {
617
- ScalingInstructions: serializeAws_json1_1ScalingInstructions(input.ScalingInstructions, context),
618
- })), (input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName })), (input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }));
553
+ const serializeAws_json1_1UpdateScalingPlanRequest = (input, context) => {
554
+ return {
555
+ ...(input.ApplicationSource != null && {
556
+ ApplicationSource: serializeAws_json1_1ApplicationSource(input.ApplicationSource, context),
557
+ }),
558
+ ...(input.ScalingInstructions != null && {
559
+ ScalingInstructions: serializeAws_json1_1ScalingInstructions(input.ScalingInstructions, context),
560
+ }),
561
+ ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
562
+ ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
563
+ };
619
564
  };
620
- var deserializeAws_json1_1ApplicationSource = function (output, context) {
565
+ const deserializeAws_json1_1ApplicationSource = (output, context) => {
621
566
  return {
622
567
  CloudFormationStackARN: __expectString(output.CloudFormationStackARN),
623
568
  TagFilters: output.TagFilters != null ? deserializeAws_json1_1TagFilters(output.TagFilters, context) : undefined,
624
569
  };
625
570
  };
626
- var deserializeAws_json1_1ConcurrentUpdateException = function (output, context) {
571
+ const deserializeAws_json1_1ConcurrentUpdateException = (output, context) => {
627
572
  return {
628
573
  Message: __expectString(output.Message),
629
574
  };
630
575
  };
631
- var deserializeAws_json1_1CreateScalingPlanResponse = function (output, context) {
576
+ const deserializeAws_json1_1CreateScalingPlanResponse = (output, context) => {
632
577
  return {
633
578
  ScalingPlanVersion: __expectLong(output.ScalingPlanVersion),
634
579
  };
635
580
  };
636
- var deserializeAws_json1_1CustomizedLoadMetricSpecification = function (output, context) {
581
+ const deserializeAws_json1_1CustomizedLoadMetricSpecification = (output, context) => {
637
582
  return {
638
583
  Dimensions: output.Dimensions != null ? deserializeAws_json1_1MetricDimensions(output.Dimensions, context) : undefined,
639
584
  MetricName: __expectString(output.MetricName),
@@ -642,7 +587,7 @@ var deserializeAws_json1_1CustomizedLoadMetricSpecification = function (output,
642
587
  Unit: __expectString(output.Unit),
643
588
  };
644
589
  };
645
- var deserializeAws_json1_1CustomizedScalingMetricSpecification = function (output, context) {
590
+ const deserializeAws_json1_1CustomizedScalingMetricSpecification = (output, context) => {
646
591
  return {
647
592
  Dimensions: output.Dimensions != null ? deserializeAws_json1_1MetricDimensions(output.Dimensions, context) : undefined,
648
593
  MetricName: __expectString(output.MetricName),
@@ -651,16 +596,16 @@ var deserializeAws_json1_1CustomizedScalingMetricSpecification = function (outpu
651
596
  Unit: __expectString(output.Unit),
652
597
  };
653
598
  };
654
- var deserializeAws_json1_1Datapoint = function (output, context) {
599
+ const deserializeAws_json1_1Datapoint = (output, context) => {
655
600
  return {
656
601
  Timestamp: output.Timestamp != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.Timestamp))) : undefined,
657
602
  Value: __limitedParseDouble(output.Value),
658
603
  };
659
604
  };
660
- var deserializeAws_json1_1Datapoints = function (output, context) {
661
- var retVal = (output || [])
662
- .filter(function (e) { return e != null; })
663
- .map(function (entry) {
605
+ const deserializeAws_json1_1Datapoints = (output, context) => {
606
+ const retVal = (output || [])
607
+ .filter((e) => e != null)
608
+ .map((entry) => {
664
609
  if (entry === null) {
665
610
  return null;
666
611
  }
@@ -668,10 +613,10 @@ var deserializeAws_json1_1Datapoints = function (output, context) {
668
613
  });
669
614
  return retVal;
670
615
  };
671
- var deserializeAws_json1_1DeleteScalingPlanResponse = function (output, context) {
616
+ const deserializeAws_json1_1DeleteScalingPlanResponse = (output, context) => {
672
617
  return {};
673
618
  };
674
- var deserializeAws_json1_1DescribeScalingPlanResourcesResponse = function (output, context) {
619
+ const deserializeAws_json1_1DescribeScalingPlanResourcesResponse = (output, context) => {
675
620
  return {
676
621
  NextToken: __expectString(output.NextToken),
677
622
  ScalingPlanResources: output.ScalingPlanResources != null
@@ -679,42 +624,42 @@ var deserializeAws_json1_1DescribeScalingPlanResourcesResponse = function (outpu
679
624
  : undefined,
680
625
  };
681
626
  };
682
- var deserializeAws_json1_1DescribeScalingPlansResponse = function (output, context) {
627
+ const deserializeAws_json1_1DescribeScalingPlansResponse = (output, context) => {
683
628
  return {
684
629
  NextToken: __expectString(output.NextToken),
685
630
  ScalingPlans: output.ScalingPlans != null ? deserializeAws_json1_1ScalingPlans(output.ScalingPlans, context) : undefined,
686
631
  };
687
632
  };
688
- var deserializeAws_json1_1GetScalingPlanResourceForecastDataResponse = function (output, context) {
633
+ const deserializeAws_json1_1GetScalingPlanResourceForecastDataResponse = (output, context) => {
689
634
  return {
690
635
  Datapoints: output.Datapoints != null ? deserializeAws_json1_1Datapoints(output.Datapoints, context) : undefined,
691
636
  };
692
637
  };
693
- var deserializeAws_json1_1InternalServiceException = function (output, context) {
638
+ const deserializeAws_json1_1InternalServiceException = (output, context) => {
694
639
  return {
695
640
  Message: __expectString(output.Message),
696
641
  };
697
642
  };
698
- var deserializeAws_json1_1InvalidNextTokenException = function (output, context) {
643
+ const deserializeAws_json1_1InvalidNextTokenException = (output, context) => {
699
644
  return {
700
645
  Message: __expectString(output.Message),
701
646
  };
702
647
  };
703
- var deserializeAws_json1_1LimitExceededException = function (output, context) {
648
+ const deserializeAws_json1_1LimitExceededException = (output, context) => {
704
649
  return {
705
650
  Message: __expectString(output.Message),
706
651
  };
707
652
  };
708
- var deserializeAws_json1_1MetricDimension = function (output, context) {
653
+ const deserializeAws_json1_1MetricDimension = (output, context) => {
709
654
  return {
710
655
  Name: __expectString(output.Name),
711
656
  Value: __expectString(output.Value),
712
657
  };
713
658
  };
714
- var deserializeAws_json1_1MetricDimensions = function (output, context) {
715
- var retVal = (output || [])
716
- .filter(function (e) { return e != null; })
717
- .map(function (entry) {
659
+ const deserializeAws_json1_1MetricDimensions = (output, context) => {
660
+ const retVal = (output || [])
661
+ .filter((e) => e != null)
662
+ .map((entry) => {
718
663
  if (entry === null) {
719
664
  return null;
720
665
  }
@@ -722,24 +667,24 @@ var deserializeAws_json1_1MetricDimensions = function (output, context) {
722
667
  });
723
668
  return retVal;
724
669
  };
725
- var deserializeAws_json1_1ObjectNotFoundException = function (output, context) {
670
+ const deserializeAws_json1_1ObjectNotFoundException = (output, context) => {
726
671
  return {
727
672
  Message: __expectString(output.Message),
728
673
  };
729
674
  };
730
- var deserializeAws_json1_1PredefinedLoadMetricSpecification = function (output, context) {
675
+ const deserializeAws_json1_1PredefinedLoadMetricSpecification = (output, context) => {
731
676
  return {
732
677
  PredefinedLoadMetricType: __expectString(output.PredefinedLoadMetricType),
733
678
  ResourceLabel: __expectString(output.ResourceLabel),
734
679
  };
735
680
  };
736
- var deserializeAws_json1_1PredefinedScalingMetricSpecification = function (output, context) {
681
+ const deserializeAws_json1_1PredefinedScalingMetricSpecification = (output, context) => {
737
682
  return {
738
683
  PredefinedScalingMetricType: __expectString(output.PredefinedScalingMetricType),
739
684
  ResourceLabel: __expectString(output.ResourceLabel),
740
685
  };
741
686
  };
742
- var deserializeAws_json1_1ScalingInstruction = function (output, context) {
687
+ const deserializeAws_json1_1ScalingInstruction = (output, context) => {
743
688
  return {
744
689
  CustomizedLoadMetricSpecification: output.CustomizedLoadMetricSpecification != null
745
690
  ? deserializeAws_json1_1CustomizedLoadMetricSpecification(output.CustomizedLoadMetricSpecification, context)
@@ -763,10 +708,10 @@ var deserializeAws_json1_1ScalingInstruction = function (output, context) {
763
708
  : undefined,
764
709
  };
765
710
  };
766
- var deserializeAws_json1_1ScalingInstructions = function (output, context) {
767
- var retVal = (output || [])
768
- .filter(function (e) { return e != null; })
769
- .map(function (entry) {
711
+ const deserializeAws_json1_1ScalingInstructions = (output, context) => {
712
+ const retVal = (output || [])
713
+ .filter((e) => e != null)
714
+ .map((entry) => {
770
715
  if (entry === null) {
771
716
  return null;
772
717
  }
@@ -774,7 +719,7 @@ var deserializeAws_json1_1ScalingInstructions = function (output, context) {
774
719
  });
775
720
  return retVal;
776
721
  };
777
- var deserializeAws_json1_1ScalingPlan = function (output, context) {
722
+ const deserializeAws_json1_1ScalingPlan = (output, context) => {
778
723
  return {
779
724
  ApplicationSource: output.ApplicationSource != null
780
725
  ? deserializeAws_json1_1ApplicationSource(output.ApplicationSource, context)
@@ -794,7 +739,7 @@ var deserializeAws_json1_1ScalingPlan = function (output, context) {
794
739
  : undefined,
795
740
  };
796
741
  };
797
- var deserializeAws_json1_1ScalingPlanResource = function (output, context) {
742
+ const deserializeAws_json1_1ScalingPlanResource = (output, context) => {
798
743
  return {
799
744
  ResourceId: __expectString(output.ResourceId),
800
745
  ScalableDimension: __expectString(output.ScalableDimension),
@@ -808,10 +753,10 @@ var deserializeAws_json1_1ScalingPlanResource = function (output, context) {
808
753
  ServiceNamespace: __expectString(output.ServiceNamespace),
809
754
  };
810
755
  };
811
- var deserializeAws_json1_1ScalingPlanResources = function (output, context) {
812
- var retVal = (output || [])
813
- .filter(function (e) { return e != null; })
814
- .map(function (entry) {
756
+ const deserializeAws_json1_1ScalingPlanResources = (output, context) => {
757
+ const retVal = (output || [])
758
+ .filter((e) => e != null)
759
+ .map((entry) => {
815
760
  if (entry === null) {
816
761
  return null;
817
762
  }
@@ -819,10 +764,10 @@ var deserializeAws_json1_1ScalingPlanResources = function (output, context) {
819
764
  });
820
765
  return retVal;
821
766
  };
822
- var deserializeAws_json1_1ScalingPlans = function (output, context) {
823
- var retVal = (output || [])
824
- .filter(function (e) { return e != null; })
825
- .map(function (entry) {
767
+ const deserializeAws_json1_1ScalingPlans = (output, context) => {
768
+ const retVal = (output || [])
769
+ .filter((e) => e != null)
770
+ .map((entry) => {
826
771
  if (entry === null) {
827
772
  return null;
828
773
  }
@@ -830,10 +775,10 @@ var deserializeAws_json1_1ScalingPlans = function (output, context) {
830
775
  });
831
776
  return retVal;
832
777
  };
833
- var deserializeAws_json1_1ScalingPolicies = function (output, context) {
834
- var retVal = (output || [])
835
- .filter(function (e) { return e != null; })
836
- .map(function (entry) {
778
+ const deserializeAws_json1_1ScalingPolicies = (output, context) => {
779
+ const retVal = (output || [])
780
+ .filter((e) => e != null)
781
+ .map((entry) => {
837
782
  if (entry === null) {
838
783
  return null;
839
784
  }
@@ -841,7 +786,7 @@ var deserializeAws_json1_1ScalingPolicies = function (output, context) {
841
786
  });
842
787
  return retVal;
843
788
  };
844
- var deserializeAws_json1_1ScalingPolicy = function (output, context) {
789
+ const deserializeAws_json1_1ScalingPolicy = (output, context) => {
845
790
  return {
846
791
  PolicyName: __expectString(output.PolicyName),
847
792
  PolicyType: __expectString(output.PolicyType),
@@ -850,16 +795,16 @@ var deserializeAws_json1_1ScalingPolicy = function (output, context) {
850
795
  : undefined,
851
796
  };
852
797
  };
853
- var deserializeAws_json1_1TagFilter = function (output, context) {
798
+ const deserializeAws_json1_1TagFilter = (output, context) => {
854
799
  return {
855
800
  Key: __expectString(output.Key),
856
801
  Values: output.Values != null ? deserializeAws_json1_1TagValues(output.Values, context) : undefined,
857
802
  };
858
803
  };
859
- var deserializeAws_json1_1TagFilters = function (output, context) {
860
- var retVal = (output || [])
861
- .filter(function (e) { return e != null; })
862
- .map(function (entry) {
804
+ const deserializeAws_json1_1TagFilters = (output, context) => {
805
+ const retVal = (output || [])
806
+ .filter((e) => e != null)
807
+ .map((entry) => {
863
808
  if (entry === null) {
864
809
  return null;
865
810
  }
@@ -867,10 +812,10 @@ var deserializeAws_json1_1TagFilters = function (output, context) {
867
812
  });
868
813
  return retVal;
869
814
  };
870
- var deserializeAws_json1_1TagValues = function (output, context) {
871
- var retVal = (output || [])
872
- .filter(function (e) { return e != null; })
873
- .map(function (entry) {
815
+ const deserializeAws_json1_1TagValues = (output, context) => {
816
+ const retVal = (output || [])
817
+ .filter((e) => e != null)
818
+ .map((entry) => {
874
819
  if (entry === null) {
875
820
  return null;
876
821
  }
@@ -878,7 +823,7 @@ var deserializeAws_json1_1TagValues = function (output, context) {
878
823
  });
879
824
  return retVal;
880
825
  };
881
- var deserializeAws_json1_1TargetTrackingConfiguration = function (output, context) {
826
+ const deserializeAws_json1_1TargetTrackingConfiguration = (output, context) => {
882
827
  return {
883
828
  CustomizedScalingMetricSpecification: output.CustomizedScalingMetricSpecification != null
884
829
  ? deserializeAws_json1_1CustomizedScalingMetricSpecification(output.CustomizedScalingMetricSpecification, context)
@@ -893,10 +838,10 @@ var deserializeAws_json1_1TargetTrackingConfiguration = function (output, contex
893
838
  TargetValue: __limitedParseDouble(output.TargetValue),
894
839
  };
895
840
  };
896
- var deserializeAws_json1_1TargetTrackingConfigurations = function (output, context) {
897
- var retVal = (output || [])
898
- .filter(function (e) { return e != null; })
899
- .map(function (entry) {
841
+ const deserializeAws_json1_1TargetTrackingConfigurations = (output, context) => {
842
+ const retVal = (output || [])
843
+ .filter((e) => e != null)
844
+ .map((entry) => {
900
845
  if (entry === null) {
901
846
  return null;
902
847
  }
@@ -904,83 +849,60 @@ var deserializeAws_json1_1TargetTrackingConfigurations = function (output, conte
904
849
  });
905
850
  return retVal;
906
851
  };
907
- var deserializeAws_json1_1UpdateScalingPlanResponse = function (output, context) {
852
+ const deserializeAws_json1_1UpdateScalingPlanResponse = (output, context) => {
908
853
  return {};
909
854
  };
910
- var deserializeAws_json1_1ValidationException = function (output, context) {
855
+ const deserializeAws_json1_1ValidationException = (output, context) => {
911
856
  return {
912
857
  Message: __expectString(output.Message),
913
858
  };
914
859
  };
915
- var deserializeMetadata = function (output) {
916
- var _a;
917
- return ({
918
- httpStatusCode: output.statusCode,
919
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
920
- extendedRequestId: output.headers["x-amz-id-2"],
921
- cfId: output.headers["x-amz-cf-id"],
922
- });
923
- };
924
- var collectBody = function (streamBody, context) {
925
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
860
+ const deserializeMetadata = (output) => ({
861
+ httpStatusCode: output.statusCode,
862
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
863
+ extendedRequestId: output.headers["x-amz-id-2"],
864
+ cfId: output.headers["x-amz-cf-id"],
865
+ });
866
+ const collectBody = (streamBody = new Uint8Array(), context) => {
926
867
  if (streamBody instanceof Uint8Array) {
927
868
  return Promise.resolve(streamBody);
928
869
  }
929
870
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
930
871
  };
931
- var collectBodyString = function (streamBody, context) {
932
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
933
- };
934
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
935
- var _a, hostname, _b, protocol, port, basePath, contents;
936
- return __generator(this, function (_c) {
937
- switch (_c.label) {
938
- case 0: return [4, context.endpoint()];
939
- case 1:
940
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
941
- contents = {
942
- protocol: protocol,
943
- hostname: hostname,
944
- port: port,
945
- method: "POST",
946
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
947
- headers: headers,
948
- };
949
- if (resolvedHostname !== undefined) {
950
- contents.hostname = resolvedHostname;
951
- }
952
- if (body !== undefined) {
953
- contents.body = body;
954
- }
955
- return [2, new __HttpRequest(contents)];
956
- }
957
- });
958
- }); };
959
- var parseBody = function (streamBody, context) {
960
- return collectBodyString(streamBody, context).then(function (encoded) {
961
- if (encoded.length) {
962
- return JSON.parse(encoded);
963
- }
964
- return {};
965
- });
872
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
873
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
874
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
875
+ const contents = {
876
+ protocol,
877
+ hostname,
878
+ port,
879
+ method: "POST",
880
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
881
+ headers,
882
+ };
883
+ if (resolvedHostname !== undefined) {
884
+ contents.hostname = resolvedHostname;
885
+ }
886
+ if (body !== undefined) {
887
+ contents.body = body;
888
+ }
889
+ return new __HttpRequest(contents);
966
890
  };
967
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
968
- var value;
969
- var _a;
970
- return __generator(this, function (_b) {
971
- switch (_b.label) {
972
- case 0: return [4, parseBody(errorBody, context)];
973
- case 1:
974
- value = _b.sent();
975
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
976
- return [2, value];
977
- }
978
- });
979
- }); };
980
- var loadRestJsonErrorCode = function (output, data) {
981
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
982
- var sanitizeErrorCode = function (rawValue) {
983
- var cleanValue = rawValue;
891
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
892
+ if (encoded.length) {
893
+ return JSON.parse(encoded);
894
+ }
895
+ return {};
896
+ });
897
+ const parseErrorBody = async (errorBody, context) => {
898
+ const value = await parseBody(errorBody, context);
899
+ value.message = value.message ?? value.Message;
900
+ return value;
901
+ };
902
+ const loadRestJsonErrorCode = (output, data) => {
903
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
904
+ const sanitizeErrorCode = (rawValue) => {
905
+ let cleanValue = rawValue;
984
906
  if (typeof cleanValue === "number") {
985
907
  cleanValue = cleanValue.toString();
986
908
  }
@@ -995,7 +917,7 @@ var loadRestJsonErrorCode = function (output, data) {
995
917
  }
996
918
  return cleanValue;
997
919
  };
998
- var headerKey = findKey(output.headers, "x-amzn-errortype");
920
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
999
921
  if (headerKey !== undefined) {
1000
922
  return sanitizeErrorCode(output.headers[headerKey]);
1001
923
  }