@aws-sdk/client-auto-scaling-plans 3.183.0 → 3.185.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,584 +1,639 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  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";
3
4
  import { AutoScalingPlansServiceException as __BaseException } from "../models/AutoScalingPlansServiceException";
4
5
  import { ConcurrentUpdateException, InternalServiceException, InvalidNextTokenException, LimitExceededException, ObjectNotFoundException, ValidationException, } from "../models/models_0";
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);
197
- };
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
- };
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) }));
364
498
  };
365
- const serializeAws_json1_1ApplicationSources = (input, context) => {
499
+ var serializeAws_json1_1ApplicationSources = function (input, context) {
366
500
  return input
367
- .filter((e) => e != null)
368
- .map((entry) => {
501
+ .filter(function (e) { return e != null; })
502
+ .map(function (entry) {
369
503
  return serializeAws_json1_1ApplicationSource(entry, context);
370
504
  });
371
505
  };
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
- };
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 }));
382
512
  };
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
- };
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 }));
391
515
  };
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
- };
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 }));
400
518
  };
401
- const serializeAws_json1_1DeleteScalingPlanRequest = (input, context) => {
402
- return {
403
- ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
404
- ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
405
- };
519
+ var serializeAws_json1_1DeleteScalingPlanRequest = function (input, context) {
520
+ return __assign(__assign({}, (input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName })), (input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }));
406
521
  };
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
- };
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 }));
414
524
  };
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
- };
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 }));
427
531
  };
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
- };
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) }));
439
534
  };
440
- const serializeAws_json1_1MetricDimension = (input, context) => {
441
- return {
442
- ...(input.Name != null && { Name: input.Name }),
443
- ...(input.Value != null && { Value: input.Value }),
444
- };
535
+ var serializeAws_json1_1MetricDimension = function (input, context) {
536
+ return __assign(__assign({}, (input.Name != null && { Name: input.Name })), (input.Value != null && { Value: input.Value }));
445
537
  };
446
- const serializeAws_json1_1MetricDimensions = (input, context) => {
538
+ var serializeAws_json1_1MetricDimensions = function (input, context) {
447
539
  return input
448
- .filter((e) => e != null)
449
- .map((entry) => {
540
+ .filter(function (e) { return e != null; })
541
+ .map(function (entry) {
450
542
  return serializeAws_json1_1MetricDimension(entry, context);
451
543
  });
452
544
  };
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) => {
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) {
498
569
  return input
499
- .filter((e) => e != null)
500
- .map((entry) => {
570
+ .filter(function (e) { return e != null; })
571
+ .map(function (entry) {
501
572
  return serializeAws_json1_1ScalingInstruction(entry, context);
502
573
  });
503
574
  };
504
- const serializeAws_json1_1ScalingPlanNames = (input, context) => {
575
+ var serializeAws_json1_1ScalingPlanNames = function (input, context) {
505
576
  return input
506
- .filter((e) => e != null)
507
- .map((entry) => {
577
+ .filter(function (e) { return e != null; })
578
+ .map(function (entry) {
508
579
  return entry;
509
580
  });
510
581
  };
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
- };
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) }));
516
584
  };
517
- const serializeAws_json1_1TagFilters = (input, context) => {
585
+ var serializeAws_json1_1TagFilters = function (input, context) {
518
586
  return input
519
- .filter((e) => e != null)
520
- .map((entry) => {
587
+ .filter(function (e) { return e != null; })
588
+ .map(function (entry) {
521
589
  return serializeAws_json1_1TagFilter(entry, context);
522
590
  });
523
591
  };
524
- const serializeAws_json1_1TagValues = (input, context) => {
592
+ var serializeAws_json1_1TagValues = function (input, context) {
525
593
  return input
526
- .filter((e) => e != null)
527
- .map((entry) => {
594
+ .filter(function (e) { return e != null; })
595
+ .map(function (entry) {
528
596
  return entry;
529
597
  });
530
598
  };
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
- };
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) }));
545
605
  };
546
- const serializeAws_json1_1TargetTrackingConfigurations = (input, context) => {
606
+ var serializeAws_json1_1TargetTrackingConfigurations = function (input, context) {
547
607
  return input
548
- .filter((e) => e != null)
549
- .map((entry) => {
608
+ .filter(function (e) { return e != null; })
609
+ .map(function (entry) {
550
610
  return serializeAws_json1_1TargetTrackingConfiguration(entry, context);
551
611
  });
552
612
  };
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
- };
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 }));
564
619
  };
565
- const deserializeAws_json1_1ApplicationSource = (output, context) => {
620
+ var deserializeAws_json1_1ApplicationSource = function (output, context) {
566
621
  return {
567
622
  CloudFormationStackARN: __expectString(output.CloudFormationStackARN),
568
623
  TagFilters: output.TagFilters != null ? deserializeAws_json1_1TagFilters(output.TagFilters, context) : undefined,
569
624
  };
570
625
  };
571
- const deserializeAws_json1_1ConcurrentUpdateException = (output, context) => {
626
+ var deserializeAws_json1_1ConcurrentUpdateException = function (output, context) {
572
627
  return {
573
628
  Message: __expectString(output.Message),
574
629
  };
575
630
  };
576
- const deserializeAws_json1_1CreateScalingPlanResponse = (output, context) => {
631
+ var deserializeAws_json1_1CreateScalingPlanResponse = function (output, context) {
577
632
  return {
578
633
  ScalingPlanVersion: __expectLong(output.ScalingPlanVersion),
579
634
  };
580
635
  };
581
- const deserializeAws_json1_1CustomizedLoadMetricSpecification = (output, context) => {
636
+ var deserializeAws_json1_1CustomizedLoadMetricSpecification = function (output, context) {
582
637
  return {
583
638
  Dimensions: output.Dimensions != null ? deserializeAws_json1_1MetricDimensions(output.Dimensions, context) : undefined,
584
639
  MetricName: __expectString(output.MetricName),
@@ -587,7 +642,7 @@ const deserializeAws_json1_1CustomizedLoadMetricSpecification = (output, context
587
642
  Unit: __expectString(output.Unit),
588
643
  };
589
644
  };
590
- const deserializeAws_json1_1CustomizedScalingMetricSpecification = (output, context) => {
645
+ var deserializeAws_json1_1CustomizedScalingMetricSpecification = function (output, context) {
591
646
  return {
592
647
  Dimensions: output.Dimensions != null ? deserializeAws_json1_1MetricDimensions(output.Dimensions, context) : undefined,
593
648
  MetricName: __expectString(output.MetricName),
@@ -596,16 +651,16 @@ const deserializeAws_json1_1CustomizedScalingMetricSpecification = (output, cont
596
651
  Unit: __expectString(output.Unit),
597
652
  };
598
653
  };
599
- const deserializeAws_json1_1Datapoint = (output, context) => {
654
+ var deserializeAws_json1_1Datapoint = function (output, context) {
600
655
  return {
601
656
  Timestamp: output.Timestamp != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.Timestamp))) : undefined,
602
657
  Value: __limitedParseDouble(output.Value),
603
658
  };
604
659
  };
605
- const deserializeAws_json1_1Datapoints = (output, context) => {
606
- const retVal = (output || [])
607
- .filter((e) => e != null)
608
- .map((entry) => {
660
+ var deserializeAws_json1_1Datapoints = function (output, context) {
661
+ var retVal = (output || [])
662
+ .filter(function (e) { return e != null; })
663
+ .map(function (entry) {
609
664
  if (entry === null) {
610
665
  return null;
611
666
  }
@@ -613,10 +668,10 @@ const deserializeAws_json1_1Datapoints = (output, context) => {
613
668
  });
614
669
  return retVal;
615
670
  };
616
- const deserializeAws_json1_1DeleteScalingPlanResponse = (output, context) => {
671
+ var deserializeAws_json1_1DeleteScalingPlanResponse = function (output, context) {
617
672
  return {};
618
673
  };
619
- const deserializeAws_json1_1DescribeScalingPlanResourcesResponse = (output, context) => {
674
+ var deserializeAws_json1_1DescribeScalingPlanResourcesResponse = function (output, context) {
620
675
  return {
621
676
  NextToken: __expectString(output.NextToken),
622
677
  ScalingPlanResources: output.ScalingPlanResources != null
@@ -624,42 +679,42 @@ const deserializeAws_json1_1DescribeScalingPlanResourcesResponse = (output, cont
624
679
  : undefined,
625
680
  };
626
681
  };
627
- const deserializeAws_json1_1DescribeScalingPlansResponse = (output, context) => {
682
+ var deserializeAws_json1_1DescribeScalingPlansResponse = function (output, context) {
628
683
  return {
629
684
  NextToken: __expectString(output.NextToken),
630
685
  ScalingPlans: output.ScalingPlans != null ? deserializeAws_json1_1ScalingPlans(output.ScalingPlans, context) : undefined,
631
686
  };
632
687
  };
633
- const deserializeAws_json1_1GetScalingPlanResourceForecastDataResponse = (output, context) => {
688
+ var deserializeAws_json1_1GetScalingPlanResourceForecastDataResponse = function (output, context) {
634
689
  return {
635
690
  Datapoints: output.Datapoints != null ? deserializeAws_json1_1Datapoints(output.Datapoints, context) : undefined,
636
691
  };
637
692
  };
638
- const deserializeAws_json1_1InternalServiceException = (output, context) => {
693
+ var deserializeAws_json1_1InternalServiceException = function (output, context) {
639
694
  return {
640
695
  Message: __expectString(output.Message),
641
696
  };
642
697
  };
643
- const deserializeAws_json1_1InvalidNextTokenException = (output, context) => {
698
+ var deserializeAws_json1_1InvalidNextTokenException = function (output, context) {
644
699
  return {
645
700
  Message: __expectString(output.Message),
646
701
  };
647
702
  };
648
- const deserializeAws_json1_1LimitExceededException = (output, context) => {
703
+ var deserializeAws_json1_1LimitExceededException = function (output, context) {
649
704
  return {
650
705
  Message: __expectString(output.Message),
651
706
  };
652
707
  };
653
- const deserializeAws_json1_1MetricDimension = (output, context) => {
708
+ var deserializeAws_json1_1MetricDimension = function (output, context) {
654
709
  return {
655
710
  Name: __expectString(output.Name),
656
711
  Value: __expectString(output.Value),
657
712
  };
658
713
  };
659
- const deserializeAws_json1_1MetricDimensions = (output, context) => {
660
- const retVal = (output || [])
661
- .filter((e) => e != null)
662
- .map((entry) => {
714
+ var deserializeAws_json1_1MetricDimensions = function (output, context) {
715
+ var retVal = (output || [])
716
+ .filter(function (e) { return e != null; })
717
+ .map(function (entry) {
663
718
  if (entry === null) {
664
719
  return null;
665
720
  }
@@ -667,24 +722,24 @@ const deserializeAws_json1_1MetricDimensions = (output, context) => {
667
722
  });
668
723
  return retVal;
669
724
  };
670
- const deserializeAws_json1_1ObjectNotFoundException = (output, context) => {
725
+ var deserializeAws_json1_1ObjectNotFoundException = function (output, context) {
671
726
  return {
672
727
  Message: __expectString(output.Message),
673
728
  };
674
729
  };
675
- const deserializeAws_json1_1PredefinedLoadMetricSpecification = (output, context) => {
730
+ var deserializeAws_json1_1PredefinedLoadMetricSpecification = function (output, context) {
676
731
  return {
677
732
  PredefinedLoadMetricType: __expectString(output.PredefinedLoadMetricType),
678
733
  ResourceLabel: __expectString(output.ResourceLabel),
679
734
  };
680
735
  };
681
- const deserializeAws_json1_1PredefinedScalingMetricSpecification = (output, context) => {
736
+ var deserializeAws_json1_1PredefinedScalingMetricSpecification = function (output, context) {
682
737
  return {
683
738
  PredefinedScalingMetricType: __expectString(output.PredefinedScalingMetricType),
684
739
  ResourceLabel: __expectString(output.ResourceLabel),
685
740
  };
686
741
  };
687
- const deserializeAws_json1_1ScalingInstruction = (output, context) => {
742
+ var deserializeAws_json1_1ScalingInstruction = function (output, context) {
688
743
  return {
689
744
  CustomizedLoadMetricSpecification: output.CustomizedLoadMetricSpecification != null
690
745
  ? deserializeAws_json1_1CustomizedLoadMetricSpecification(output.CustomizedLoadMetricSpecification, context)
@@ -708,10 +763,10 @@ const deserializeAws_json1_1ScalingInstruction = (output, context) => {
708
763
  : undefined,
709
764
  };
710
765
  };
711
- const deserializeAws_json1_1ScalingInstructions = (output, context) => {
712
- const retVal = (output || [])
713
- .filter((e) => e != null)
714
- .map((entry) => {
766
+ var deserializeAws_json1_1ScalingInstructions = function (output, context) {
767
+ var retVal = (output || [])
768
+ .filter(function (e) { return e != null; })
769
+ .map(function (entry) {
715
770
  if (entry === null) {
716
771
  return null;
717
772
  }
@@ -719,7 +774,7 @@ const deserializeAws_json1_1ScalingInstructions = (output, context) => {
719
774
  });
720
775
  return retVal;
721
776
  };
722
- const deserializeAws_json1_1ScalingPlan = (output, context) => {
777
+ var deserializeAws_json1_1ScalingPlan = function (output, context) {
723
778
  return {
724
779
  ApplicationSource: output.ApplicationSource != null
725
780
  ? deserializeAws_json1_1ApplicationSource(output.ApplicationSource, context)
@@ -739,7 +794,7 @@ const deserializeAws_json1_1ScalingPlan = (output, context) => {
739
794
  : undefined,
740
795
  };
741
796
  };
742
- const deserializeAws_json1_1ScalingPlanResource = (output, context) => {
797
+ var deserializeAws_json1_1ScalingPlanResource = function (output, context) {
743
798
  return {
744
799
  ResourceId: __expectString(output.ResourceId),
745
800
  ScalableDimension: __expectString(output.ScalableDimension),
@@ -753,10 +808,10 @@ const deserializeAws_json1_1ScalingPlanResource = (output, context) => {
753
808
  ServiceNamespace: __expectString(output.ServiceNamespace),
754
809
  };
755
810
  };
756
- const deserializeAws_json1_1ScalingPlanResources = (output, context) => {
757
- const retVal = (output || [])
758
- .filter((e) => e != null)
759
- .map((entry) => {
811
+ var deserializeAws_json1_1ScalingPlanResources = function (output, context) {
812
+ var retVal = (output || [])
813
+ .filter(function (e) { return e != null; })
814
+ .map(function (entry) {
760
815
  if (entry === null) {
761
816
  return null;
762
817
  }
@@ -764,10 +819,10 @@ const deserializeAws_json1_1ScalingPlanResources = (output, context) => {
764
819
  });
765
820
  return retVal;
766
821
  };
767
- const deserializeAws_json1_1ScalingPlans = (output, context) => {
768
- const retVal = (output || [])
769
- .filter((e) => e != null)
770
- .map((entry) => {
822
+ var deserializeAws_json1_1ScalingPlans = function (output, context) {
823
+ var retVal = (output || [])
824
+ .filter(function (e) { return e != null; })
825
+ .map(function (entry) {
771
826
  if (entry === null) {
772
827
  return null;
773
828
  }
@@ -775,10 +830,10 @@ const deserializeAws_json1_1ScalingPlans = (output, context) => {
775
830
  });
776
831
  return retVal;
777
832
  };
778
- const deserializeAws_json1_1ScalingPolicies = (output, context) => {
779
- const retVal = (output || [])
780
- .filter((e) => e != null)
781
- .map((entry) => {
833
+ var deserializeAws_json1_1ScalingPolicies = function (output, context) {
834
+ var retVal = (output || [])
835
+ .filter(function (e) { return e != null; })
836
+ .map(function (entry) {
782
837
  if (entry === null) {
783
838
  return null;
784
839
  }
@@ -786,7 +841,7 @@ const deserializeAws_json1_1ScalingPolicies = (output, context) => {
786
841
  });
787
842
  return retVal;
788
843
  };
789
- const deserializeAws_json1_1ScalingPolicy = (output, context) => {
844
+ var deserializeAws_json1_1ScalingPolicy = function (output, context) {
790
845
  return {
791
846
  PolicyName: __expectString(output.PolicyName),
792
847
  PolicyType: __expectString(output.PolicyType),
@@ -795,16 +850,16 @@ const deserializeAws_json1_1ScalingPolicy = (output, context) => {
795
850
  : undefined,
796
851
  };
797
852
  };
798
- const deserializeAws_json1_1TagFilter = (output, context) => {
853
+ var deserializeAws_json1_1TagFilter = function (output, context) {
799
854
  return {
800
855
  Key: __expectString(output.Key),
801
856
  Values: output.Values != null ? deserializeAws_json1_1TagValues(output.Values, context) : undefined,
802
857
  };
803
858
  };
804
- const deserializeAws_json1_1TagFilters = (output, context) => {
805
- const retVal = (output || [])
806
- .filter((e) => e != null)
807
- .map((entry) => {
859
+ var deserializeAws_json1_1TagFilters = function (output, context) {
860
+ var retVal = (output || [])
861
+ .filter(function (e) { return e != null; })
862
+ .map(function (entry) {
808
863
  if (entry === null) {
809
864
  return null;
810
865
  }
@@ -812,10 +867,10 @@ const deserializeAws_json1_1TagFilters = (output, context) => {
812
867
  });
813
868
  return retVal;
814
869
  };
815
- const deserializeAws_json1_1TagValues = (output, context) => {
816
- const retVal = (output || [])
817
- .filter((e) => e != null)
818
- .map((entry) => {
870
+ var deserializeAws_json1_1TagValues = function (output, context) {
871
+ var retVal = (output || [])
872
+ .filter(function (e) { return e != null; })
873
+ .map(function (entry) {
819
874
  if (entry === null) {
820
875
  return null;
821
876
  }
@@ -823,7 +878,7 @@ const deserializeAws_json1_1TagValues = (output, context) => {
823
878
  });
824
879
  return retVal;
825
880
  };
826
- const deserializeAws_json1_1TargetTrackingConfiguration = (output, context) => {
881
+ var deserializeAws_json1_1TargetTrackingConfiguration = function (output, context) {
827
882
  return {
828
883
  CustomizedScalingMetricSpecification: output.CustomizedScalingMetricSpecification != null
829
884
  ? deserializeAws_json1_1CustomizedScalingMetricSpecification(output.CustomizedScalingMetricSpecification, context)
@@ -838,10 +893,10 @@ const deserializeAws_json1_1TargetTrackingConfiguration = (output, context) => {
838
893
  TargetValue: __limitedParseDouble(output.TargetValue),
839
894
  };
840
895
  };
841
- const deserializeAws_json1_1TargetTrackingConfigurations = (output, context) => {
842
- const retVal = (output || [])
843
- .filter((e) => e != null)
844
- .map((entry) => {
896
+ var deserializeAws_json1_1TargetTrackingConfigurations = function (output, context) {
897
+ var retVal = (output || [])
898
+ .filter(function (e) { return e != null; })
899
+ .map(function (entry) {
845
900
  if (entry === null) {
846
901
  return null;
847
902
  }
@@ -849,60 +904,83 @@ const deserializeAws_json1_1TargetTrackingConfigurations = (output, context) =>
849
904
  });
850
905
  return retVal;
851
906
  };
852
- const deserializeAws_json1_1UpdateScalingPlanResponse = (output, context) => {
907
+ var deserializeAws_json1_1UpdateScalingPlanResponse = function (output, context) {
853
908
  return {};
854
909
  };
855
- const deserializeAws_json1_1ValidationException = (output, context) => {
910
+ var deserializeAws_json1_1ValidationException = function (output, context) {
856
911
  return {
857
912
  Message: __expectString(output.Message),
858
913
  };
859
914
  };
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) => {
915
+ var deserializeMetadata = function (output) {
916
+ var _a, _b;
917
+ return ({
918
+ httpStatusCode: output.statusCode,
919
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-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(); }
867
926
  if (streamBody instanceof Uint8Array) {
868
927
  return Promise.resolve(streamBody);
869
928
  }
870
929
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
871
930
  };
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);
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
+ });
890
966
  };
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;
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;
906
984
  if (typeof cleanValue === "number") {
907
985
  cleanValue = cleanValue.toString();
908
986
  }
@@ -917,7 +995,7 @@ const loadRestJsonErrorCode = (output, data) => {
917
995
  }
918
996
  return cleanValue;
919
997
  };
920
- const headerKey = findKey(output.headers, "x-amzn-errortype");
998
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
921
999
  if (headerKey !== undefined) {
922
1000
  return sanitizeErrorCode(output.headers[headerKey]);
923
1001
  }