@aws-sdk/client-auto-scaling-plans 3.490.0 → 3.496.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,622 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateScalingPlanCommand = exports.de_GetScalingPlanResourceForecastDataCommand = exports.de_DescribeScalingPlansCommand = exports.de_DescribeScalingPlanResourcesCommand = exports.de_DeleteScalingPlanCommand = exports.de_CreateScalingPlanCommand = exports.se_UpdateScalingPlanCommand = exports.se_GetScalingPlanResourceForecastDataCommand = exports.se_DescribeScalingPlansCommand = exports.se_DescribeScalingPlanResourcesCommand = exports.se_DeleteScalingPlanCommand = exports.se_CreateScalingPlanCommand = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const AutoScalingPlansServiceException_1 = require("../models/AutoScalingPlansServiceException");
7
- const models_0_1 = require("../models/models_0");
8
- const se_CreateScalingPlanCommand = async (input, context) => {
9
- const headers = sharedHeaders("CreateScalingPlan");
10
- let body;
11
- body = JSON.stringify(se_CreateScalingPlanRequest(input, context));
12
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
- };
14
- exports.se_CreateScalingPlanCommand = se_CreateScalingPlanCommand;
15
- const se_DeleteScalingPlanCommand = async (input, context) => {
16
- const headers = sharedHeaders("DeleteScalingPlan");
17
- let body;
18
- body = JSON.stringify((0, smithy_client_1._json)(input));
19
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
- };
21
- exports.se_DeleteScalingPlanCommand = se_DeleteScalingPlanCommand;
22
- const se_DescribeScalingPlanResourcesCommand = async (input, context) => {
23
- const headers = sharedHeaders("DescribeScalingPlanResources");
24
- let body;
25
- body = JSON.stringify((0, smithy_client_1._json)(input));
26
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
- };
28
- exports.se_DescribeScalingPlanResourcesCommand = se_DescribeScalingPlanResourcesCommand;
29
- const se_DescribeScalingPlansCommand = async (input, context) => {
30
- const headers = sharedHeaders("DescribeScalingPlans");
31
- let body;
32
- body = JSON.stringify((0, smithy_client_1._json)(input));
33
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
- };
35
- exports.se_DescribeScalingPlansCommand = se_DescribeScalingPlansCommand;
36
- const se_GetScalingPlanResourceForecastDataCommand = async (input, context) => {
37
- const headers = sharedHeaders("GetScalingPlanResourceForecastData");
38
- let body;
39
- body = JSON.stringify(se_GetScalingPlanResourceForecastDataRequest(input, context));
40
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
- };
42
- exports.se_GetScalingPlanResourceForecastDataCommand = se_GetScalingPlanResourceForecastDataCommand;
43
- const se_UpdateScalingPlanCommand = async (input, context) => {
44
- const headers = sharedHeaders("UpdateScalingPlan");
45
- let body;
46
- body = JSON.stringify(se_UpdateScalingPlanRequest(input, context));
47
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
48
- };
49
- exports.se_UpdateScalingPlanCommand = se_UpdateScalingPlanCommand;
50
- const de_CreateScalingPlanCommand = async (output, context) => {
51
- if (output.statusCode >= 300) {
52
- return de_CreateScalingPlanCommandError(output, context);
53
- }
54
- const data = await parseBody(output.body, context);
55
- let contents = {};
56
- contents = (0, smithy_client_1._json)(data);
57
- const response = {
58
- $metadata: deserializeMetadata(output),
59
- ...contents,
60
- };
61
- return response;
62
- };
63
- exports.de_CreateScalingPlanCommand = de_CreateScalingPlanCommand;
64
- const de_CreateScalingPlanCommandError = async (output, context) => {
65
- const parsedOutput = {
66
- ...output,
67
- body: await parseErrorBody(output.body, context),
68
- };
69
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
70
- switch (errorCode) {
71
- case "ConcurrentUpdateException":
72
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
73
- throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context);
74
- case "InternalServiceException":
75
- case "com.amazonaws.autoscalingplans#InternalServiceException":
76
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
77
- case "LimitExceededException":
78
- case "com.amazonaws.autoscalingplans#LimitExceededException":
79
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
80
- case "ValidationException":
81
- case "com.amazonaws.autoscalingplans#ValidationException":
82
- throw await de_ValidationExceptionRes(parsedOutput, context);
83
- default:
84
- const parsedBody = parsedOutput.body;
85
- return throwDefaultError({
86
- output,
87
- parsedBody,
88
- errorCode,
89
- });
90
- }
91
- };
92
- const de_DeleteScalingPlanCommand = async (output, context) => {
93
- if (output.statusCode >= 300) {
94
- return de_DeleteScalingPlanCommandError(output, context);
95
- }
96
- const data = await parseBody(output.body, context);
97
- let contents = {};
98
- contents = (0, smithy_client_1._json)(data);
99
- const response = {
100
- $metadata: deserializeMetadata(output),
101
- ...contents,
102
- };
103
- return response;
104
- };
105
- exports.de_DeleteScalingPlanCommand = de_DeleteScalingPlanCommand;
106
- const de_DeleteScalingPlanCommandError = async (output, context) => {
107
- const parsedOutput = {
108
- ...output,
109
- body: await parseErrorBody(output.body, context),
110
- };
111
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
112
- switch (errorCode) {
113
- case "ConcurrentUpdateException":
114
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
115
- throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context);
116
- case "InternalServiceException":
117
- case "com.amazonaws.autoscalingplans#InternalServiceException":
118
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
119
- case "ObjectNotFoundException":
120
- case "com.amazonaws.autoscalingplans#ObjectNotFoundException":
121
- throw await de_ObjectNotFoundExceptionRes(parsedOutput, context);
122
- case "ValidationException":
123
- case "com.amazonaws.autoscalingplans#ValidationException":
124
- throw await de_ValidationExceptionRes(parsedOutput, context);
125
- default:
126
- const parsedBody = parsedOutput.body;
127
- return throwDefaultError({
128
- output,
129
- parsedBody,
130
- errorCode,
131
- });
132
- }
133
- };
134
- const de_DescribeScalingPlanResourcesCommand = async (output, context) => {
135
- if (output.statusCode >= 300) {
136
- return de_DescribeScalingPlanResourcesCommandError(output, context);
137
- }
138
- const data = await parseBody(output.body, context);
139
- let contents = {};
140
- contents = de_DescribeScalingPlanResourcesResponse(data, context);
141
- const response = {
142
- $metadata: deserializeMetadata(output),
143
- ...contents,
144
- };
145
- return response;
146
- };
147
- exports.de_DescribeScalingPlanResourcesCommand = de_DescribeScalingPlanResourcesCommand;
148
- const de_DescribeScalingPlanResourcesCommandError = async (output, context) => {
149
- const parsedOutput = {
150
- ...output,
151
- body: await parseErrorBody(output.body, context),
152
- };
153
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
154
- switch (errorCode) {
155
- case "ConcurrentUpdateException":
156
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
157
- throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context);
158
- case "InternalServiceException":
159
- case "com.amazonaws.autoscalingplans#InternalServiceException":
160
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
161
- case "InvalidNextTokenException":
162
- case "com.amazonaws.autoscalingplans#InvalidNextTokenException":
163
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
164
- case "ValidationException":
165
- case "com.amazonaws.autoscalingplans#ValidationException":
166
- throw await de_ValidationExceptionRes(parsedOutput, context);
167
- default:
168
- const parsedBody = parsedOutput.body;
169
- return throwDefaultError({
170
- output,
171
- parsedBody,
172
- errorCode,
173
- });
174
- }
175
- };
176
- const de_DescribeScalingPlansCommand = async (output, context) => {
177
- if (output.statusCode >= 300) {
178
- return de_DescribeScalingPlansCommandError(output, context);
179
- }
180
- const data = await parseBody(output.body, context);
181
- let contents = {};
182
- contents = de_DescribeScalingPlansResponse(data, context);
183
- const response = {
184
- $metadata: deserializeMetadata(output),
185
- ...contents,
186
- };
187
- return response;
188
- };
189
- exports.de_DescribeScalingPlansCommand = de_DescribeScalingPlansCommand;
190
- const de_DescribeScalingPlansCommandError = async (output, context) => {
191
- const parsedOutput = {
192
- ...output,
193
- body: await parseErrorBody(output.body, context),
194
- };
195
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
196
- switch (errorCode) {
197
- case "ConcurrentUpdateException":
198
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
199
- throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context);
200
- case "InternalServiceException":
201
- case "com.amazonaws.autoscalingplans#InternalServiceException":
202
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
203
- case "InvalidNextTokenException":
204
- case "com.amazonaws.autoscalingplans#InvalidNextTokenException":
205
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
206
- case "ValidationException":
207
- case "com.amazonaws.autoscalingplans#ValidationException":
208
- throw await de_ValidationExceptionRes(parsedOutput, context);
209
- default:
210
- const parsedBody = parsedOutput.body;
211
- return throwDefaultError({
212
- output,
213
- parsedBody,
214
- errorCode,
215
- });
216
- }
217
- };
218
- const de_GetScalingPlanResourceForecastDataCommand = async (output, context) => {
219
- if (output.statusCode >= 300) {
220
- return de_GetScalingPlanResourceForecastDataCommandError(output, context);
221
- }
222
- const data = await parseBody(output.body, context);
223
- let contents = {};
224
- contents = de_GetScalingPlanResourceForecastDataResponse(data, context);
225
- const response = {
226
- $metadata: deserializeMetadata(output),
227
- ...contents,
228
- };
229
- return response;
230
- };
231
- exports.de_GetScalingPlanResourceForecastDataCommand = de_GetScalingPlanResourceForecastDataCommand;
232
- const de_GetScalingPlanResourceForecastDataCommandError = async (output, context) => {
233
- const parsedOutput = {
234
- ...output,
235
- body: await parseErrorBody(output.body, context),
236
- };
237
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
238
- switch (errorCode) {
239
- case "InternalServiceException":
240
- case "com.amazonaws.autoscalingplans#InternalServiceException":
241
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
242
- case "ValidationException":
243
- case "com.amazonaws.autoscalingplans#ValidationException":
244
- throw await de_ValidationExceptionRes(parsedOutput, context);
245
- default:
246
- const parsedBody = parsedOutput.body;
247
- return throwDefaultError({
248
- output,
249
- parsedBody,
250
- errorCode,
251
- });
252
- }
253
- };
254
- const de_UpdateScalingPlanCommand = async (output, context) => {
255
- if (output.statusCode >= 300) {
256
- return de_UpdateScalingPlanCommandError(output, context);
257
- }
258
- const data = await parseBody(output.body, context);
259
- let contents = {};
260
- contents = (0, smithy_client_1._json)(data);
261
- const response = {
262
- $metadata: deserializeMetadata(output),
263
- ...contents,
264
- };
265
- return response;
266
- };
267
- exports.de_UpdateScalingPlanCommand = de_UpdateScalingPlanCommand;
268
- const de_UpdateScalingPlanCommandError = async (output, context) => {
269
- const parsedOutput = {
270
- ...output,
271
- body: await parseErrorBody(output.body, context),
272
- };
273
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
274
- switch (errorCode) {
275
- case "ConcurrentUpdateException":
276
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
277
- throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context);
278
- case "InternalServiceException":
279
- case "com.amazonaws.autoscalingplans#InternalServiceException":
280
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
281
- case "ObjectNotFoundException":
282
- case "com.amazonaws.autoscalingplans#ObjectNotFoundException":
283
- throw await de_ObjectNotFoundExceptionRes(parsedOutput, context);
284
- case "ValidationException":
285
- case "com.amazonaws.autoscalingplans#ValidationException":
286
- throw await de_ValidationExceptionRes(parsedOutput, context);
287
- default:
288
- const parsedBody = parsedOutput.body;
289
- return throwDefaultError({
290
- output,
291
- parsedBody,
292
- errorCode,
293
- });
294
- }
295
- };
296
- const de_ConcurrentUpdateExceptionRes = async (parsedOutput, context) => {
297
- const body = parsedOutput.body;
298
- const deserialized = (0, smithy_client_1._json)(body);
299
- const exception = new models_0_1.ConcurrentUpdateException({
300
- $metadata: deserializeMetadata(parsedOutput),
301
- ...deserialized,
302
- });
303
- return (0, smithy_client_1.decorateServiceException)(exception, body);
304
- };
305
- const de_InternalServiceExceptionRes = async (parsedOutput, context) => {
306
- const body = parsedOutput.body;
307
- const deserialized = (0, smithy_client_1._json)(body);
308
- const exception = new models_0_1.InternalServiceException({
309
- $metadata: deserializeMetadata(parsedOutput),
310
- ...deserialized,
311
- });
312
- return (0, smithy_client_1.decorateServiceException)(exception, body);
313
- };
314
- const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
315
- const body = parsedOutput.body;
316
- const deserialized = (0, smithy_client_1._json)(body);
317
- const exception = new models_0_1.InvalidNextTokenException({
318
- $metadata: deserializeMetadata(parsedOutput),
319
- ...deserialized,
320
- });
321
- return (0, smithy_client_1.decorateServiceException)(exception, body);
322
- };
323
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
324
- const body = parsedOutput.body;
325
- const deserialized = (0, smithy_client_1._json)(body);
326
- const exception = new models_0_1.LimitExceededException({
327
- $metadata: deserializeMetadata(parsedOutput),
328
- ...deserialized,
329
- });
330
- return (0, smithy_client_1.decorateServiceException)(exception, body);
331
- };
332
- const de_ObjectNotFoundExceptionRes = async (parsedOutput, context) => {
333
- const body = parsedOutput.body;
334
- const deserialized = (0, smithy_client_1._json)(body);
335
- const exception = new models_0_1.ObjectNotFoundException({
336
- $metadata: deserializeMetadata(parsedOutput),
337
- ...deserialized,
338
- });
339
- return (0, smithy_client_1.decorateServiceException)(exception, body);
340
- };
341
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
342
- const body = parsedOutput.body;
343
- const deserialized = (0, smithy_client_1._json)(body);
344
- const exception = new models_0_1.ValidationException({
345
- $metadata: deserializeMetadata(parsedOutput),
346
- ...deserialized,
347
- });
348
- return (0, smithy_client_1.decorateServiceException)(exception, body);
349
- };
350
- const se_CreateScalingPlanRequest = (input, context) => {
351
- return (0, smithy_client_1.take)(input, {
352
- ApplicationSource: smithy_client_1._json,
353
- ScalingInstructions: (_) => se_ScalingInstructions(_, context),
354
- ScalingPlanName: [],
355
- });
356
- };
357
- const se_GetScalingPlanResourceForecastDataRequest = (input, context) => {
358
- return (0, smithy_client_1.take)(input, {
359
- EndTime: (_) => Math.round(_.getTime() / 1000),
360
- ForecastDataType: [],
361
- ResourceId: [],
362
- ScalableDimension: [],
363
- ScalingPlanName: [],
364
- ScalingPlanVersion: [],
365
- ServiceNamespace: [],
366
- StartTime: (_) => Math.round(_.getTime() / 1000),
367
- });
368
- };
369
- const se_ScalingInstruction = (input, context) => {
370
- return (0, smithy_client_1.take)(input, {
371
- CustomizedLoadMetricSpecification: smithy_client_1._json,
372
- DisableDynamicScaling: [],
373
- MaxCapacity: [],
374
- MinCapacity: [],
375
- PredefinedLoadMetricSpecification: smithy_client_1._json,
376
- PredictiveScalingMaxCapacityBehavior: [],
377
- PredictiveScalingMaxCapacityBuffer: [],
378
- PredictiveScalingMode: [],
379
- ResourceId: [],
380
- ScalableDimension: [],
381
- ScalingPolicyUpdateBehavior: [],
382
- ScheduledActionBufferTime: [],
383
- ServiceNamespace: [],
384
- TargetTrackingConfigurations: (_) => se_TargetTrackingConfigurations(_, context),
385
- });
386
- };
387
- const se_ScalingInstructions = (input, context) => {
388
- return input
389
- .filter((e) => e != null)
390
- .map((entry) => {
391
- return se_ScalingInstruction(entry, context);
392
- });
393
- };
394
- const se_TargetTrackingConfiguration = (input, context) => {
395
- return (0, smithy_client_1.take)(input, {
396
- CustomizedScalingMetricSpecification: smithy_client_1._json,
397
- DisableScaleIn: [],
398
- EstimatedInstanceWarmup: [],
399
- PredefinedScalingMetricSpecification: smithy_client_1._json,
400
- ScaleInCooldown: [],
401
- ScaleOutCooldown: [],
402
- TargetValue: smithy_client_1.serializeFloat,
403
- });
404
- };
405
- const se_TargetTrackingConfigurations = (input, context) => {
406
- return input
407
- .filter((e) => e != null)
408
- .map((entry) => {
409
- return se_TargetTrackingConfiguration(entry, context);
410
- });
411
- };
412
- const se_UpdateScalingPlanRequest = (input, context) => {
413
- return (0, smithy_client_1.take)(input, {
414
- ApplicationSource: smithy_client_1._json,
415
- ScalingInstructions: (_) => se_ScalingInstructions(_, context),
416
- ScalingPlanName: [],
417
- ScalingPlanVersion: [],
418
- });
419
- };
420
- const de_Datapoint = (output, context) => {
421
- return (0, smithy_client_1.take)(output, {
422
- Timestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
423
- Value: smithy_client_1.limitedParseDouble,
424
- });
425
- };
426
- const de_Datapoints = (output, context) => {
427
- const retVal = (output || [])
428
- .filter((e) => e != null)
429
- .map((entry) => {
430
- return de_Datapoint(entry, context);
431
- });
432
- return retVal;
433
- };
434
- const de_DescribeScalingPlanResourcesResponse = (output, context) => {
435
- return (0, smithy_client_1.take)(output, {
436
- NextToken: smithy_client_1.expectString,
437
- ScalingPlanResources: (_) => de_ScalingPlanResources(_, context),
438
- });
439
- };
440
- const de_DescribeScalingPlansResponse = (output, context) => {
441
- return (0, smithy_client_1.take)(output, {
442
- NextToken: smithy_client_1.expectString,
443
- ScalingPlans: (_) => de_ScalingPlans(_, context),
444
- });
445
- };
446
- const de_GetScalingPlanResourceForecastDataResponse = (output, context) => {
447
- return (0, smithy_client_1.take)(output, {
448
- Datapoints: (_) => de_Datapoints(_, context),
449
- });
450
- };
451
- const de_ScalingInstruction = (output, context) => {
452
- return (0, smithy_client_1.take)(output, {
453
- CustomizedLoadMetricSpecification: smithy_client_1._json,
454
- DisableDynamicScaling: smithy_client_1.expectBoolean,
455
- MaxCapacity: smithy_client_1.expectInt32,
456
- MinCapacity: smithy_client_1.expectInt32,
457
- PredefinedLoadMetricSpecification: smithy_client_1._json,
458
- PredictiveScalingMaxCapacityBehavior: smithy_client_1.expectString,
459
- PredictiveScalingMaxCapacityBuffer: smithy_client_1.expectInt32,
460
- PredictiveScalingMode: smithy_client_1.expectString,
461
- ResourceId: smithy_client_1.expectString,
462
- ScalableDimension: smithy_client_1.expectString,
463
- ScalingPolicyUpdateBehavior: smithy_client_1.expectString,
464
- ScheduledActionBufferTime: smithy_client_1.expectInt32,
465
- ServiceNamespace: smithy_client_1.expectString,
466
- TargetTrackingConfigurations: (_) => de_TargetTrackingConfigurations(_, context),
467
- });
468
- };
469
- const de_ScalingInstructions = (output, context) => {
470
- const retVal = (output || [])
471
- .filter((e) => e != null)
472
- .map((entry) => {
473
- return de_ScalingInstruction(entry, context);
474
- });
475
- return retVal;
476
- };
477
- const de_ScalingPlan = (output, context) => {
478
- return (0, smithy_client_1.take)(output, {
479
- ApplicationSource: smithy_client_1._json,
480
- CreationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
481
- ScalingInstructions: (_) => de_ScalingInstructions(_, context),
482
- ScalingPlanName: smithy_client_1.expectString,
483
- ScalingPlanVersion: smithy_client_1.expectLong,
484
- StatusCode: smithy_client_1.expectString,
485
- StatusMessage: smithy_client_1.expectString,
486
- StatusStartTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
487
- });
488
- };
489
- const de_ScalingPlanResource = (output, context) => {
490
- return (0, smithy_client_1.take)(output, {
491
- ResourceId: smithy_client_1.expectString,
492
- ScalableDimension: smithy_client_1.expectString,
493
- ScalingPlanName: smithy_client_1.expectString,
494
- ScalingPlanVersion: smithy_client_1.expectLong,
495
- ScalingPolicies: (_) => de_ScalingPolicies(_, context),
496
- ScalingStatusCode: smithy_client_1.expectString,
497
- ScalingStatusMessage: smithy_client_1.expectString,
498
- ServiceNamespace: smithy_client_1.expectString,
499
- });
500
- };
501
- const de_ScalingPlanResources = (output, context) => {
502
- const retVal = (output || [])
503
- .filter((e) => e != null)
504
- .map((entry) => {
505
- return de_ScalingPlanResource(entry, context);
506
- });
507
- return retVal;
508
- };
509
- const de_ScalingPlans = (output, context) => {
510
- const retVal = (output || [])
511
- .filter((e) => e != null)
512
- .map((entry) => {
513
- return de_ScalingPlan(entry, context);
514
- });
515
- return retVal;
516
- };
517
- const de_ScalingPolicies = (output, context) => {
518
- const retVal = (output || [])
519
- .filter((e) => e != null)
520
- .map((entry) => {
521
- return de_ScalingPolicy(entry, context);
522
- });
523
- return retVal;
524
- };
525
- const de_ScalingPolicy = (output, context) => {
526
- return (0, smithy_client_1.take)(output, {
527
- PolicyName: smithy_client_1.expectString,
528
- PolicyType: smithy_client_1.expectString,
529
- TargetTrackingConfiguration: (_) => de_TargetTrackingConfiguration(_, context),
530
- });
531
- };
532
- const de_TargetTrackingConfiguration = (output, context) => {
533
- return (0, smithy_client_1.take)(output, {
534
- CustomizedScalingMetricSpecification: smithy_client_1._json,
535
- DisableScaleIn: smithy_client_1.expectBoolean,
536
- EstimatedInstanceWarmup: smithy_client_1.expectInt32,
537
- PredefinedScalingMetricSpecification: smithy_client_1._json,
538
- ScaleInCooldown: smithy_client_1.expectInt32,
539
- ScaleOutCooldown: smithy_client_1.expectInt32,
540
- TargetValue: smithy_client_1.limitedParseDouble,
541
- });
542
- };
543
- const de_TargetTrackingConfigurations = (output, context) => {
544
- const retVal = (output || [])
545
- .filter((e) => e != null)
546
- .map((entry) => {
547
- return de_TargetTrackingConfiguration(entry, context);
548
- });
549
- return retVal;
550
- };
551
- const deserializeMetadata = (output) => ({
552
- httpStatusCode: output.statusCode,
553
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
554
- extendedRequestId: output.headers["x-amz-id-2"],
555
- cfId: output.headers["x-amz-cf-id"],
556
- });
557
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
558
- const throwDefaultError = (0, smithy_client_1.withBaseException)(AutoScalingPlansServiceException_1.AutoScalingPlansServiceException);
559
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
560
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
561
- const contents = {
562
- protocol,
563
- hostname,
564
- port,
565
- method: "POST",
566
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
567
- headers,
568
- };
569
- if (resolvedHostname !== undefined) {
570
- contents.hostname = resolvedHostname;
571
- }
572
- if (body !== undefined) {
573
- contents.body = body;
574
- }
575
- return new protocol_http_1.HttpRequest(contents);
576
- };
577
- function sharedHeaders(operation) {
578
- return {
579
- "content-type": "application/x-amz-json-1.1",
580
- "x-amz-target": `AnyScaleScalingPlannerFrontendService.${operation}`,
581
- };
582
- }
583
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
584
- if (encoded.length) {
585
- return JSON.parse(encoded);
586
- }
587
- return {};
588
- });
589
- const parseErrorBody = async (errorBody, context) => {
590
- const value = await parseBody(errorBody, context);
591
- value.message = value.message ?? value.Message;
592
- return value;
593
- };
594
- const loadRestJsonErrorCode = (output, data) => {
595
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
596
- const sanitizeErrorCode = (rawValue) => {
597
- let cleanValue = rawValue;
598
- if (typeof cleanValue === "number") {
599
- cleanValue = cleanValue.toString();
600
- }
601
- if (cleanValue.indexOf(",") >= 0) {
602
- cleanValue = cleanValue.split(",")[0];
603
- }
604
- if (cleanValue.indexOf(":") >= 0) {
605
- cleanValue = cleanValue.split(":")[0];
606
- }
607
- if (cleanValue.indexOf("#") >= 0) {
608
- cleanValue = cleanValue.split("#")[1];
609
- }
610
- return cleanValue;
611
- };
612
- const headerKey = findKey(output.headers, "x-amzn-errortype");
613
- if (headerKey !== undefined) {
614
- return sanitizeErrorCode(output.headers[headerKey]);
615
- }
616
- if (data.code !== undefined) {
617
- return sanitizeErrorCode(data.code);
618
- }
619
- if (data["__type"] !== undefined) {
620
- return sanitizeErrorCode(data["__type"]);
621
- }
622
- };
1
+ module.exports = require("../index.js");
@@ -1,22 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveRuntimeExtensions = void 0;
4
- const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const asPartial = (t) => t;
8
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
9
- const extensionConfiguration = {
10
- ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
11
- ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
12
- ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
13
- };
14
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
15
- return {
16
- ...runtimeConfig,
17
- ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
18
- ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
19
- ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
20
- };
21
- };
22
- exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
1
+ module.exports = require("./index.js");