@aws-sdk/client-auto-scaling-plans 3.901.0 → 3.906.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist-cjs/index.js +836 -953
  2. package/package.json +5 -5
package/dist-cjs/index.js CHANGED
@@ -1,984 +1,867 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- AutoScalingPlans: () => AutoScalingPlans,
25
- AutoScalingPlansClient: () => AutoScalingPlansClient,
26
- AutoScalingPlansServiceException: () => AutoScalingPlansServiceException,
27
- ConcurrentUpdateException: () => ConcurrentUpdateException,
28
- CreateScalingPlanCommand: () => CreateScalingPlanCommand,
29
- DeleteScalingPlanCommand: () => DeleteScalingPlanCommand,
30
- DescribeScalingPlanResourcesCommand: () => DescribeScalingPlanResourcesCommand,
31
- DescribeScalingPlansCommand: () => DescribeScalingPlansCommand,
32
- ForecastDataType: () => ForecastDataType,
33
- GetScalingPlanResourceForecastDataCommand: () => GetScalingPlanResourceForecastDataCommand,
34
- InternalServiceException: () => InternalServiceException,
35
- InvalidNextTokenException: () => InvalidNextTokenException,
36
- LimitExceededException: () => LimitExceededException,
37
- LoadMetricType: () => LoadMetricType,
38
- MetricStatistic: () => MetricStatistic,
39
- ObjectNotFoundException: () => ObjectNotFoundException,
40
- PolicyType: () => PolicyType,
41
- PredictiveScalingMaxCapacityBehavior: () => PredictiveScalingMaxCapacityBehavior,
42
- PredictiveScalingMode: () => PredictiveScalingMode,
43
- ScalableDimension: () => ScalableDimension,
44
- ScalingMetricType: () => ScalingMetricType,
45
- ScalingPlanStatusCode: () => ScalingPlanStatusCode,
46
- ScalingPolicyUpdateBehavior: () => ScalingPolicyUpdateBehavior,
47
- ScalingStatusCode: () => ScalingStatusCode,
48
- ServiceNamespace: () => ServiceNamespace,
49
- UpdateScalingPlanCommand: () => UpdateScalingPlanCommand,
50
- ValidationException: () => ValidationException,
51
- __Client: () => import_smithy_client.Client
52
- });
53
- module.exports = __toCommonJS(index_exports);
54
-
55
- // src/AutoScalingPlansClient.ts
56
- var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
57
- var import_middleware_logger = require("@aws-sdk/middleware-logger");
58
- var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
59
- var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
60
- var import_config_resolver = require("@smithy/config-resolver");
61
- var import_core = require("@smithy/core");
62
- var import_middleware_content_length = require("@smithy/middleware-content-length");
63
- var import_middleware_endpoint = require("@smithy/middleware-endpoint");
64
- var import_middleware_retry = require("@smithy/middleware-retry");
65
-
66
- var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
67
-
68
- // src/endpoint/EndpointParameters.ts
69
- var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
70
- return Object.assign(options, {
71
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
72
- useFipsEndpoint: options.useFipsEndpoint ?? false,
73
- defaultSigningName: "autoscaling-plans"
74
- });
75
- }, "resolveClientEndpointParameters");
76
- var commonParams = {
77
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
78
- Endpoint: { type: "builtInParams", name: "endpoint" },
79
- Region: { type: "builtInParams", name: "region" },
80
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
1
+ 'use strict';
2
+
3
+ var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
4
+ var middlewareLogger = require('@aws-sdk/middleware-logger');
5
+ var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
6
+ var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
7
+ var configResolver = require('@smithy/config-resolver');
8
+ var core = require('@smithy/core');
9
+ var middlewareContentLength = require('@smithy/middleware-content-length');
10
+ var middlewareEndpoint = require('@smithy/middleware-endpoint');
11
+ var middlewareRetry = require('@smithy/middleware-retry');
12
+ var smithyClient = require('@smithy/smithy-client');
13
+ var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
14
+ var runtimeConfig = require('./runtimeConfig');
15
+ var regionConfigResolver = require('@aws-sdk/region-config-resolver');
16
+ var protocolHttp = require('@smithy/protocol-http');
17
+ var middlewareSerde = require('@smithy/middleware-serde');
18
+ var core$1 = require('@aws-sdk/core');
19
+
20
+ const resolveClientEndpointParameters = (options) => {
21
+ return Object.assign(options, {
22
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
23
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
24
+ defaultSigningName: "autoscaling-plans",
25
+ });
26
+ };
27
+ const commonParams = {
28
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
29
+ Endpoint: { type: "builtInParams", name: "endpoint" },
30
+ Region: { type: "builtInParams", name: "region" },
31
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
81
32
  };
82
33
 
83
- // src/AutoScalingPlansClient.ts
84
- var import_runtimeConfig = require("././runtimeConfig");
34
+ const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
35
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
36
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
37
+ let _credentials = runtimeConfig.credentials;
38
+ return {
39
+ setHttpAuthScheme(httpAuthScheme) {
40
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
41
+ if (index === -1) {
42
+ _httpAuthSchemes.push(httpAuthScheme);
43
+ }
44
+ else {
45
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
46
+ }
47
+ },
48
+ httpAuthSchemes() {
49
+ return _httpAuthSchemes;
50
+ },
51
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
52
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
53
+ },
54
+ httpAuthSchemeProvider() {
55
+ return _httpAuthSchemeProvider;
56
+ },
57
+ setCredentials(credentials) {
58
+ _credentials = credentials;
59
+ },
60
+ credentials() {
61
+ return _credentials;
62
+ },
63
+ };
64
+ };
65
+ const resolveHttpAuthRuntimeConfig = (config) => {
66
+ return {
67
+ httpAuthSchemes: config.httpAuthSchemes(),
68
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
69
+ credentials: config.credentials(),
70
+ };
71
+ };
85
72
 
86
- // src/runtimeExtensions.ts
87
- var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
88
- var import_protocol_http = require("@smithy/protocol-http");
89
- var import_smithy_client = require("@smithy/smithy-client");
73
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
74
+ const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
75
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
76
+ return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
77
+ };
90
78
 
91
- // src/auth/httpAuthExtensionConfiguration.ts
92
- var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
93
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
94
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
95
- let _credentials = runtimeConfig.credentials;
96
- return {
97
- setHttpAuthScheme(httpAuthScheme) {
98
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
99
- if (index === -1) {
100
- _httpAuthSchemes.push(httpAuthScheme);
101
- } else {
102
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
103
- }
104
- },
105
- httpAuthSchemes() {
106
- return _httpAuthSchemes;
107
- },
108
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
109
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
110
- },
111
- httpAuthSchemeProvider() {
112
- return _httpAuthSchemeProvider;
113
- },
114
- setCredentials(credentials) {
115
- _credentials = credentials;
116
- },
117
- credentials() {
118
- return _credentials;
79
+ class AutoScalingPlansClient extends smithyClient.Client {
80
+ config;
81
+ constructor(...[configuration]) {
82
+ const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
83
+ super(_config_0);
84
+ this.initConfig = _config_0;
85
+ const _config_1 = resolveClientEndpointParameters(_config_0);
86
+ const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
87
+ const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
88
+ const _config_4 = configResolver.resolveRegionConfig(_config_3);
89
+ const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
90
+ const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
91
+ const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
92
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
93
+ this.config = _config_8;
94
+ this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
95
+ this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
96
+ this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
97
+ this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
98
+ this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
99
+ this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
100
+ this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
101
+ httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultAutoScalingPlansHttpAuthSchemeParametersProvider,
102
+ identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
103
+ "aws.auth#sigv4": config.credentials,
104
+ }),
105
+ }));
106
+ this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
107
+ }
108
+ destroy() {
109
+ super.destroy();
119
110
  }
120
- };
121
- }, "getHttpAuthExtensionConfiguration");
122
- var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
123
- return {
124
- httpAuthSchemes: config.httpAuthSchemes(),
125
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
126
- credentials: config.credentials()
127
- };
128
- }, "resolveHttpAuthRuntimeConfig");
111
+ }
129
112
 
130
- // src/runtimeExtensions.ts
131
- var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
132
- const extensionConfiguration = Object.assign(
133
- (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
134
- (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
135
- (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
136
- getHttpAuthExtensionConfiguration(runtimeConfig)
137
- );
138
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
139
- return Object.assign(
140
- runtimeConfig,
141
- (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
142
- (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
143
- (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
144
- resolveHttpAuthRuntimeConfig(extensionConfiguration)
145
- );
146
- }, "resolveRuntimeExtensions");
113
+ class AutoScalingPlansServiceException extends smithyClient.ServiceException {
114
+ constructor(options) {
115
+ super(options);
116
+ Object.setPrototypeOf(this, AutoScalingPlansServiceException.prototype);
117
+ }
118
+ }
147
119
 
148
- // src/AutoScalingPlansClient.ts
149
- var AutoScalingPlansClient = class extends import_smithy_client.Client {
150
- static {
151
- __name(this, "AutoScalingPlansClient");
152
- }
153
- /**
154
- * The resolved configuration of AutoScalingPlansClient class. This is resolved and normalized from the {@link AutoScalingPlansClientConfig | constructor configuration interface}.
155
- */
156
- config;
157
- constructor(...[configuration]) {
158
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
159
- super(_config_0);
160
- this.initConfig = _config_0;
161
- const _config_1 = resolveClientEndpointParameters(_config_0);
162
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
163
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
164
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
165
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
166
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
167
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
168
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
169
- this.config = _config_8;
170
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
171
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
172
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
173
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
174
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
175
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
176
- this.middlewareStack.use(
177
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
178
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultAutoScalingPlansHttpAuthSchemeParametersProvider,
179
- identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
180
- "aws.auth#sigv4": config.credentials
181
- }), "identityProviderConfigProvider")
182
- })
183
- );
184
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
185
- }
186
- /**
187
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
188
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
189
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
190
- */
191
- destroy() {
192
- super.destroy();
193
- }
120
+ class ConcurrentUpdateException extends AutoScalingPlansServiceException {
121
+ name = "ConcurrentUpdateException";
122
+ $fault = "server";
123
+ Message;
124
+ constructor(opts) {
125
+ super({
126
+ name: "ConcurrentUpdateException",
127
+ $fault: "server",
128
+ ...opts,
129
+ });
130
+ Object.setPrototypeOf(this, ConcurrentUpdateException.prototype);
131
+ this.Message = opts.Message;
132
+ }
133
+ }
134
+ const MetricStatistic = {
135
+ Average: "Average",
136
+ Maximum: "Maximum",
137
+ Minimum: "Minimum",
138
+ SampleCount: "SampleCount",
139
+ Sum: "Sum",
194
140
  };
195
-
196
- // src/AutoScalingPlans.ts
197
-
198
-
199
- // src/commands/CreateScalingPlanCommand.ts
200
-
201
- var import_middleware_serde = require("@smithy/middleware-serde");
202
-
203
-
204
- // src/protocols/Aws_json1_1.ts
205
- var import_core2 = require("@aws-sdk/core");
206
-
207
-
208
-
209
- // src/models/AutoScalingPlansServiceException.ts
210
-
211
- var AutoScalingPlansServiceException = class _AutoScalingPlansServiceException extends import_smithy_client.ServiceException {
212
- static {
213
- __name(this, "AutoScalingPlansServiceException");
214
- }
215
- /**
216
- * @internal
217
- */
218
- constructor(options) {
219
- super(options);
220
- Object.setPrototypeOf(this, _AutoScalingPlansServiceException.prototype);
221
- }
141
+ const LoadMetricType = {
142
+ ALBTargetGroupRequestCount: "ALBTargetGroupRequestCount",
143
+ ASGTotalCPUUtilization: "ASGTotalCPUUtilization",
144
+ ASGTotalNetworkIn: "ASGTotalNetworkIn",
145
+ ASGTotalNetworkOut: "ASGTotalNetworkOut",
146
+ };
147
+ const PredictiveScalingMaxCapacityBehavior = {
148
+ SetForecastCapacityToMaxCapacity: "SetForecastCapacityToMaxCapacity",
149
+ SetMaxCapacityAboveForecastCapacity: "SetMaxCapacityAboveForecastCapacity",
150
+ SetMaxCapacityToForecastCapacity: "SetMaxCapacityToForecastCapacity",
151
+ };
152
+ const PredictiveScalingMode = {
153
+ ForecastAndScale: "ForecastAndScale",
154
+ ForecastOnly: "ForecastOnly",
155
+ };
156
+ const ScalableDimension = {
157
+ AutoScalingGroupDesiredCapacity: "autoscaling:autoScalingGroup:DesiredCapacity",
158
+ DynamoDBIndexReadCapacityUnits: "dynamodb:index:ReadCapacityUnits",
159
+ DynamoDBIndexWriteCapacityUnits: "dynamodb:index:WriteCapacityUnits",
160
+ DynamoDBTableReadCapacityUnits: "dynamodb:table:ReadCapacityUnits",
161
+ DynamoDBTableWriteCapacityUnits: "dynamodb:table:WriteCapacityUnits",
162
+ EC2SpotFleetRequestTargetCapacity: "ec2:spot-fleet-request:TargetCapacity",
163
+ ECSServiceDesiredCount: "ecs:service:DesiredCount",
164
+ RDSClusterReadReplicaCount: "rds:cluster:ReadReplicaCount",
165
+ };
166
+ const ScalingPolicyUpdateBehavior = {
167
+ KeepExternalPolicies: "KeepExternalPolicies",
168
+ ReplaceExternalPolicies: "ReplaceExternalPolicies",
169
+ };
170
+ const ServiceNamespace = {
171
+ AUTOSCALING: "autoscaling",
172
+ DYNAMODB: "dynamodb",
173
+ EC2: "ec2",
174
+ ECS: "ecs",
175
+ RDS: "rds",
176
+ };
177
+ const ScalingMetricType = {
178
+ ALBRequestCountPerTarget: "ALBRequestCountPerTarget",
179
+ ASGAverageCPUUtilization: "ASGAverageCPUUtilization",
180
+ ASGAverageNetworkIn: "ASGAverageNetworkIn",
181
+ ASGAverageNetworkOut: "ASGAverageNetworkOut",
182
+ DynamoDBReadCapacityUtilization: "DynamoDBReadCapacityUtilization",
183
+ DynamoDBWriteCapacityUtilization: "DynamoDBWriteCapacityUtilization",
184
+ EC2SpotFleetRequestAverageCPUUtilization: "EC2SpotFleetRequestAverageCPUUtilization",
185
+ EC2SpotFleetRequestAverageNetworkIn: "EC2SpotFleetRequestAverageNetworkIn",
186
+ EC2SpotFleetRequestAverageNetworkOut: "EC2SpotFleetRequestAverageNetworkOut",
187
+ ECSServiceAverageCPUUtilization: "ECSServiceAverageCPUUtilization",
188
+ ECSServiceAverageMemoryUtilization: "ECSServiceAverageMemoryUtilization",
189
+ RDSReaderAverageCPUUtilization: "RDSReaderAverageCPUUtilization",
190
+ RDSReaderAverageDatabaseConnections: "RDSReaderAverageDatabaseConnections",
191
+ };
192
+ class InternalServiceException extends AutoScalingPlansServiceException {
193
+ name = "InternalServiceException";
194
+ $fault = "server";
195
+ Message;
196
+ constructor(opts) {
197
+ super({
198
+ name: "InternalServiceException",
199
+ $fault: "server",
200
+ ...opts,
201
+ });
202
+ Object.setPrototypeOf(this, InternalServiceException.prototype);
203
+ this.Message = opts.Message;
204
+ }
205
+ }
206
+ class LimitExceededException extends AutoScalingPlansServiceException {
207
+ name = "LimitExceededException";
208
+ $fault = "client";
209
+ Message;
210
+ constructor(opts) {
211
+ super({
212
+ name: "LimitExceededException",
213
+ $fault: "client",
214
+ ...opts,
215
+ });
216
+ Object.setPrototypeOf(this, LimitExceededException.prototype);
217
+ this.Message = opts.Message;
218
+ }
219
+ }
220
+ class ValidationException extends AutoScalingPlansServiceException {
221
+ name = "ValidationException";
222
+ $fault = "client";
223
+ Message;
224
+ constructor(opts) {
225
+ super({
226
+ name: "ValidationException",
227
+ $fault: "client",
228
+ ...opts,
229
+ });
230
+ Object.setPrototypeOf(this, ValidationException.prototype);
231
+ this.Message = opts.Message;
232
+ }
233
+ }
234
+ class ObjectNotFoundException extends AutoScalingPlansServiceException {
235
+ name = "ObjectNotFoundException";
236
+ $fault = "client";
237
+ Message;
238
+ constructor(opts) {
239
+ super({
240
+ name: "ObjectNotFoundException",
241
+ $fault: "client",
242
+ ...opts,
243
+ });
244
+ Object.setPrototypeOf(this, ObjectNotFoundException.prototype);
245
+ this.Message = opts.Message;
246
+ }
247
+ }
248
+ const PolicyType = {
249
+ TargetTrackingScaling: "TargetTrackingScaling",
250
+ };
251
+ const ScalingStatusCode = {
252
+ Active: "Active",
253
+ Inactive: "Inactive",
254
+ PartiallyActive: "PartiallyActive",
255
+ };
256
+ class InvalidNextTokenException extends AutoScalingPlansServiceException {
257
+ name = "InvalidNextTokenException";
258
+ $fault = "client";
259
+ Message;
260
+ constructor(opts) {
261
+ super({
262
+ name: "InvalidNextTokenException",
263
+ $fault: "client",
264
+ ...opts,
265
+ });
266
+ Object.setPrototypeOf(this, InvalidNextTokenException.prototype);
267
+ this.Message = opts.Message;
268
+ }
269
+ }
270
+ const ScalingPlanStatusCode = {
271
+ Active: "Active",
272
+ ActiveWithProblems: "ActiveWithProblems",
273
+ CreationFailed: "CreationFailed",
274
+ CreationInProgress: "CreationInProgress",
275
+ DeletionFailed: "DeletionFailed",
276
+ DeletionInProgress: "DeletionInProgress",
277
+ UpdateFailed: "UpdateFailed",
278
+ UpdateInProgress: "UpdateInProgress",
279
+ };
280
+ const ForecastDataType = {
281
+ CapacityForecast: "CapacityForecast",
282
+ LoadForecast: "LoadForecast",
283
+ ScheduledActionMaxCapacity: "ScheduledActionMaxCapacity",
284
+ ScheduledActionMinCapacity: "ScheduledActionMinCapacity",
222
285
  };
223
286
 
224
- // src/models/models_0.ts
225
- var ConcurrentUpdateException = class _ConcurrentUpdateException extends AutoScalingPlansServiceException {
226
- static {
227
- __name(this, "ConcurrentUpdateException");
228
- }
229
- name = "ConcurrentUpdateException";
230
- $fault = "server";
231
- Message;
232
- /**
233
- * @internal
234
- */
235
- constructor(opts) {
236
- super({
237
- name: "ConcurrentUpdateException",
238
- $fault: "server",
239
- ...opts
287
+ const se_CreateScalingPlanCommand = async (input, context) => {
288
+ const headers = sharedHeaders("CreateScalingPlan");
289
+ let body;
290
+ body = JSON.stringify(se_CreateScalingPlanRequest(input));
291
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
292
+ };
293
+ const se_DeleteScalingPlanCommand = async (input, context) => {
294
+ const headers = sharedHeaders("DeleteScalingPlan");
295
+ let body;
296
+ body = JSON.stringify(smithyClient._json(input));
297
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
298
+ };
299
+ const se_DescribeScalingPlanResourcesCommand = async (input, context) => {
300
+ const headers = sharedHeaders("DescribeScalingPlanResources");
301
+ let body;
302
+ body = JSON.stringify(smithyClient._json(input));
303
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
304
+ };
305
+ const se_DescribeScalingPlansCommand = async (input, context) => {
306
+ const headers = sharedHeaders("DescribeScalingPlans");
307
+ let body;
308
+ body = JSON.stringify(smithyClient._json(input));
309
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
310
+ };
311
+ const se_GetScalingPlanResourceForecastDataCommand = async (input, context) => {
312
+ const headers = sharedHeaders("GetScalingPlanResourceForecastData");
313
+ let body;
314
+ body = JSON.stringify(se_GetScalingPlanResourceForecastDataRequest(input));
315
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
316
+ };
317
+ const se_UpdateScalingPlanCommand = async (input, context) => {
318
+ const headers = sharedHeaders("UpdateScalingPlan");
319
+ let body;
320
+ body = JSON.stringify(se_UpdateScalingPlanRequest(input));
321
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
322
+ };
323
+ const de_CreateScalingPlanCommand = async (output, context) => {
324
+ if (output.statusCode >= 300) {
325
+ return de_CommandError(output, context);
326
+ }
327
+ const data = await core$1.parseJsonBody(output.body, context);
328
+ let contents = {};
329
+ contents = smithyClient._json(data);
330
+ const response = {
331
+ $metadata: deserializeMetadata(output),
332
+ ...contents,
333
+ };
334
+ return response;
335
+ };
336
+ const de_DeleteScalingPlanCommand = async (output, context) => {
337
+ if (output.statusCode >= 300) {
338
+ return de_CommandError(output, context);
339
+ }
340
+ const data = await core$1.parseJsonBody(output.body, context);
341
+ let contents = {};
342
+ contents = smithyClient._json(data);
343
+ const response = {
344
+ $metadata: deserializeMetadata(output),
345
+ ...contents,
346
+ };
347
+ return response;
348
+ };
349
+ const de_DescribeScalingPlanResourcesCommand = async (output, context) => {
350
+ if (output.statusCode >= 300) {
351
+ return de_CommandError(output, context);
352
+ }
353
+ const data = await core$1.parseJsonBody(output.body, context);
354
+ let contents = {};
355
+ contents = de_DescribeScalingPlanResourcesResponse(data);
356
+ const response = {
357
+ $metadata: deserializeMetadata(output),
358
+ ...contents,
359
+ };
360
+ return response;
361
+ };
362
+ const de_DescribeScalingPlansCommand = async (output, context) => {
363
+ if (output.statusCode >= 300) {
364
+ return de_CommandError(output, context);
365
+ }
366
+ const data = await core$1.parseJsonBody(output.body, context);
367
+ let contents = {};
368
+ contents = de_DescribeScalingPlansResponse(data);
369
+ const response = {
370
+ $metadata: deserializeMetadata(output),
371
+ ...contents,
372
+ };
373
+ return response;
374
+ };
375
+ const de_GetScalingPlanResourceForecastDataCommand = async (output, context) => {
376
+ if (output.statusCode >= 300) {
377
+ return de_CommandError(output, context);
378
+ }
379
+ const data = await core$1.parseJsonBody(output.body, context);
380
+ let contents = {};
381
+ contents = de_GetScalingPlanResourceForecastDataResponse(data);
382
+ const response = {
383
+ $metadata: deserializeMetadata(output),
384
+ ...contents,
385
+ };
386
+ return response;
387
+ };
388
+ const de_UpdateScalingPlanCommand = async (output, context) => {
389
+ if (output.statusCode >= 300) {
390
+ return de_CommandError(output, context);
391
+ }
392
+ const data = await core$1.parseJsonBody(output.body, context);
393
+ let contents = {};
394
+ contents = smithyClient._json(data);
395
+ const response = {
396
+ $metadata: deserializeMetadata(output),
397
+ ...contents,
398
+ };
399
+ return response;
400
+ };
401
+ const de_CommandError = async (output, context) => {
402
+ const parsedOutput = {
403
+ ...output,
404
+ body: await core$1.parseJsonErrorBody(output.body, context),
405
+ };
406
+ const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
407
+ switch (errorCode) {
408
+ case "ConcurrentUpdateException":
409
+ case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
410
+ throw await de_ConcurrentUpdateExceptionRes(parsedOutput);
411
+ case "InternalServiceException":
412
+ case "com.amazonaws.autoscalingplans#InternalServiceException":
413
+ throw await de_InternalServiceExceptionRes(parsedOutput);
414
+ case "LimitExceededException":
415
+ case "com.amazonaws.autoscalingplans#LimitExceededException":
416
+ throw await de_LimitExceededExceptionRes(parsedOutput);
417
+ case "ValidationException":
418
+ case "com.amazonaws.autoscalingplans#ValidationException":
419
+ throw await de_ValidationExceptionRes(parsedOutput);
420
+ case "ObjectNotFoundException":
421
+ case "com.amazonaws.autoscalingplans#ObjectNotFoundException":
422
+ throw await de_ObjectNotFoundExceptionRes(parsedOutput);
423
+ case "InvalidNextTokenException":
424
+ case "com.amazonaws.autoscalingplans#InvalidNextTokenException":
425
+ throw await de_InvalidNextTokenExceptionRes(parsedOutput);
426
+ default:
427
+ const parsedBody = parsedOutput.body;
428
+ return throwDefaultError({
429
+ output,
430
+ parsedBody,
431
+ errorCode,
432
+ });
433
+ }
434
+ };
435
+ const de_ConcurrentUpdateExceptionRes = async (parsedOutput, context) => {
436
+ const body = parsedOutput.body;
437
+ const deserialized = smithyClient._json(body);
438
+ const exception = new ConcurrentUpdateException({
439
+ $metadata: deserializeMetadata(parsedOutput),
440
+ ...deserialized,
240
441
  });
241
- Object.setPrototypeOf(this, _ConcurrentUpdateException.prototype);
242
- this.Message = opts.Message;
243
- }
244
- };
245
- var MetricStatistic = {
246
- Average: "Average",
247
- Maximum: "Maximum",
248
- Minimum: "Minimum",
249
- SampleCount: "SampleCount",
250
- Sum: "Sum"
251
- };
252
- var LoadMetricType = {
253
- ALBTargetGroupRequestCount: "ALBTargetGroupRequestCount",
254
- ASGTotalCPUUtilization: "ASGTotalCPUUtilization",
255
- ASGTotalNetworkIn: "ASGTotalNetworkIn",
256
- ASGTotalNetworkOut: "ASGTotalNetworkOut"
257
- };
258
- var PredictiveScalingMaxCapacityBehavior = {
259
- SetForecastCapacityToMaxCapacity: "SetForecastCapacityToMaxCapacity",
260
- SetMaxCapacityAboveForecastCapacity: "SetMaxCapacityAboveForecastCapacity",
261
- SetMaxCapacityToForecastCapacity: "SetMaxCapacityToForecastCapacity"
262
- };
263
- var PredictiveScalingMode = {
264
- ForecastAndScale: "ForecastAndScale",
265
- ForecastOnly: "ForecastOnly"
266
- };
267
- var ScalableDimension = {
268
- AutoScalingGroupDesiredCapacity: "autoscaling:autoScalingGroup:DesiredCapacity",
269
- DynamoDBIndexReadCapacityUnits: "dynamodb:index:ReadCapacityUnits",
270
- DynamoDBIndexWriteCapacityUnits: "dynamodb:index:WriteCapacityUnits",
271
- DynamoDBTableReadCapacityUnits: "dynamodb:table:ReadCapacityUnits",
272
- DynamoDBTableWriteCapacityUnits: "dynamodb:table:WriteCapacityUnits",
273
- EC2SpotFleetRequestTargetCapacity: "ec2:spot-fleet-request:TargetCapacity",
274
- ECSServiceDesiredCount: "ecs:service:DesiredCount",
275
- RDSClusterReadReplicaCount: "rds:cluster:ReadReplicaCount"
276
- };
277
- var ScalingPolicyUpdateBehavior = {
278
- KeepExternalPolicies: "KeepExternalPolicies",
279
- ReplaceExternalPolicies: "ReplaceExternalPolicies"
280
- };
281
- var ServiceNamespace = {
282
- AUTOSCALING: "autoscaling",
283
- DYNAMODB: "dynamodb",
284
- EC2: "ec2",
285
- ECS: "ecs",
286
- RDS: "rds"
287
- };
288
- var ScalingMetricType = {
289
- ALBRequestCountPerTarget: "ALBRequestCountPerTarget",
290
- ASGAverageCPUUtilization: "ASGAverageCPUUtilization",
291
- ASGAverageNetworkIn: "ASGAverageNetworkIn",
292
- ASGAverageNetworkOut: "ASGAverageNetworkOut",
293
- DynamoDBReadCapacityUtilization: "DynamoDBReadCapacityUtilization",
294
- DynamoDBWriteCapacityUtilization: "DynamoDBWriteCapacityUtilization",
295
- EC2SpotFleetRequestAverageCPUUtilization: "EC2SpotFleetRequestAverageCPUUtilization",
296
- EC2SpotFleetRequestAverageNetworkIn: "EC2SpotFleetRequestAverageNetworkIn",
297
- EC2SpotFleetRequestAverageNetworkOut: "EC2SpotFleetRequestAverageNetworkOut",
298
- ECSServiceAverageCPUUtilization: "ECSServiceAverageCPUUtilization",
299
- ECSServiceAverageMemoryUtilization: "ECSServiceAverageMemoryUtilization",
300
- RDSReaderAverageCPUUtilization: "RDSReaderAverageCPUUtilization",
301
- RDSReaderAverageDatabaseConnections: "RDSReaderAverageDatabaseConnections"
302
- };
303
- var InternalServiceException = class _InternalServiceException extends AutoScalingPlansServiceException {
304
- static {
305
- __name(this, "InternalServiceException");
306
- }
307
- name = "InternalServiceException";
308
- $fault = "server";
309
- Message;
310
- /**
311
- * @internal
312
- */
313
- constructor(opts) {
314
- super({
315
- name: "InternalServiceException",
316
- $fault: "server",
317
- ...opts
442
+ return smithyClient.decorateServiceException(exception, body);
443
+ };
444
+ const de_InternalServiceExceptionRes = async (parsedOutput, context) => {
445
+ const body = parsedOutput.body;
446
+ const deserialized = smithyClient._json(body);
447
+ const exception = new InternalServiceException({
448
+ $metadata: deserializeMetadata(parsedOutput),
449
+ ...deserialized,
318
450
  });
319
- Object.setPrototypeOf(this, _InternalServiceException.prototype);
320
- this.Message = opts.Message;
321
- }
322
- };
323
- var LimitExceededException = class _LimitExceededException extends AutoScalingPlansServiceException {
324
- static {
325
- __name(this, "LimitExceededException");
326
- }
327
- name = "LimitExceededException";
328
- $fault = "client";
329
- Message;
330
- /**
331
- * @internal
332
- */
333
- constructor(opts) {
334
- super({
335
- name: "LimitExceededException",
336
- $fault: "client",
337
- ...opts
451
+ return smithyClient.decorateServiceException(exception, body);
452
+ };
453
+ const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
454
+ const body = parsedOutput.body;
455
+ const deserialized = smithyClient._json(body);
456
+ const exception = new InvalidNextTokenException({
457
+ $metadata: deserializeMetadata(parsedOutput),
458
+ ...deserialized,
338
459
  });
339
- Object.setPrototypeOf(this, _LimitExceededException.prototype);
340
- this.Message = opts.Message;
341
- }
342
- };
343
- var ValidationException = class _ValidationException extends AutoScalingPlansServiceException {
344
- static {
345
- __name(this, "ValidationException");
346
- }
347
- name = "ValidationException";
348
- $fault = "client";
349
- Message;
350
- /**
351
- * @internal
352
- */
353
- constructor(opts) {
354
- super({
355
- name: "ValidationException",
356
- $fault: "client",
357
- ...opts
460
+ return smithyClient.decorateServiceException(exception, body);
461
+ };
462
+ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
463
+ const body = parsedOutput.body;
464
+ const deserialized = smithyClient._json(body);
465
+ const exception = new LimitExceededException({
466
+ $metadata: deserializeMetadata(parsedOutput),
467
+ ...deserialized,
358
468
  });
359
- Object.setPrototypeOf(this, _ValidationException.prototype);
360
- this.Message = opts.Message;
361
- }
362
- };
363
- var ObjectNotFoundException = class _ObjectNotFoundException extends AutoScalingPlansServiceException {
364
- static {
365
- __name(this, "ObjectNotFoundException");
366
- }
367
- name = "ObjectNotFoundException";
368
- $fault = "client";
369
- Message;
370
- /**
371
- * @internal
372
- */
373
- constructor(opts) {
374
- super({
375
- name: "ObjectNotFoundException",
376
- $fault: "client",
377
- ...opts
469
+ return smithyClient.decorateServiceException(exception, body);
470
+ };
471
+ const de_ObjectNotFoundExceptionRes = async (parsedOutput, context) => {
472
+ const body = parsedOutput.body;
473
+ const deserialized = smithyClient._json(body);
474
+ const exception = new ObjectNotFoundException({
475
+ $metadata: deserializeMetadata(parsedOutput),
476
+ ...deserialized,
378
477
  });
379
- Object.setPrototypeOf(this, _ObjectNotFoundException.prototype);
380
- this.Message = opts.Message;
381
- }
382
- };
383
- var PolicyType = {
384
- TargetTrackingScaling: "TargetTrackingScaling"
385
- };
386
- var ScalingStatusCode = {
387
- Active: "Active",
388
- Inactive: "Inactive",
389
- PartiallyActive: "PartiallyActive"
390
- };
391
- var InvalidNextTokenException = class _InvalidNextTokenException extends AutoScalingPlansServiceException {
392
- static {
393
- __name(this, "InvalidNextTokenException");
394
- }
395
- name = "InvalidNextTokenException";
396
- $fault = "client";
397
- Message;
398
- /**
399
- * @internal
400
- */
401
- constructor(opts) {
402
- super({
403
- name: "InvalidNextTokenException",
404
- $fault: "client",
405
- ...opts
478
+ return smithyClient.decorateServiceException(exception, body);
479
+ };
480
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
481
+ const body = parsedOutput.body;
482
+ const deserialized = smithyClient._json(body);
483
+ const exception = new ValidationException({
484
+ $metadata: deserializeMetadata(parsedOutput),
485
+ ...deserialized,
406
486
  });
407
- Object.setPrototypeOf(this, _InvalidNextTokenException.prototype);
408
- this.Message = opts.Message;
409
- }
410
- };
411
- var ScalingPlanStatusCode = {
412
- Active: "Active",
413
- ActiveWithProblems: "ActiveWithProblems",
414
- CreationFailed: "CreationFailed",
415
- CreationInProgress: "CreationInProgress",
416
- DeletionFailed: "DeletionFailed",
417
- DeletionInProgress: "DeletionInProgress",
418
- UpdateFailed: "UpdateFailed",
419
- UpdateInProgress: "UpdateInProgress"
420
- };
421
- var ForecastDataType = {
422
- CapacityForecast: "CapacityForecast",
423
- LoadForecast: "LoadForecast",
424
- ScheduledActionMaxCapacity: "ScheduledActionMaxCapacity",
425
- ScheduledActionMinCapacity: "ScheduledActionMinCapacity"
487
+ return smithyClient.decorateServiceException(exception, body);
426
488
  };
427
-
428
- // src/protocols/Aws_json1_1.ts
429
- var se_CreateScalingPlanCommand = /* @__PURE__ */ __name(async (input, context) => {
430
- const headers = sharedHeaders("CreateScalingPlan");
431
- let body;
432
- body = JSON.stringify(se_CreateScalingPlanRequest(input, context));
433
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
434
- }, "se_CreateScalingPlanCommand");
435
- var se_DeleteScalingPlanCommand = /* @__PURE__ */ __name(async (input, context) => {
436
- const headers = sharedHeaders("DeleteScalingPlan");
437
- let body;
438
- body = JSON.stringify((0, import_smithy_client._json)(input));
439
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
440
- }, "se_DeleteScalingPlanCommand");
441
- var se_DescribeScalingPlanResourcesCommand = /* @__PURE__ */ __name(async (input, context) => {
442
- const headers = sharedHeaders("DescribeScalingPlanResources");
443
- let body;
444
- body = JSON.stringify((0, import_smithy_client._json)(input));
445
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
446
- }, "se_DescribeScalingPlanResourcesCommand");
447
- var se_DescribeScalingPlansCommand = /* @__PURE__ */ __name(async (input, context) => {
448
- const headers = sharedHeaders("DescribeScalingPlans");
449
- let body;
450
- body = JSON.stringify((0, import_smithy_client._json)(input));
451
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
452
- }, "se_DescribeScalingPlansCommand");
453
- var se_GetScalingPlanResourceForecastDataCommand = /* @__PURE__ */ __name(async (input, context) => {
454
- const headers = sharedHeaders("GetScalingPlanResourceForecastData");
455
- let body;
456
- body = JSON.stringify(se_GetScalingPlanResourceForecastDataRequest(input, context));
457
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
458
- }, "se_GetScalingPlanResourceForecastDataCommand");
459
- var se_UpdateScalingPlanCommand = /* @__PURE__ */ __name(async (input, context) => {
460
- const headers = sharedHeaders("UpdateScalingPlan");
461
- let body;
462
- body = JSON.stringify(se_UpdateScalingPlanRequest(input, context));
463
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
464
- }, "se_UpdateScalingPlanCommand");
465
- var de_CreateScalingPlanCommand = /* @__PURE__ */ __name(async (output, context) => {
466
- if (output.statusCode >= 300) {
467
- return de_CommandError(output, context);
468
- }
469
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
470
- let contents = {};
471
- contents = (0, import_smithy_client._json)(data);
472
- const response = {
473
- $metadata: deserializeMetadata(output),
474
- ...contents
475
- };
476
- return response;
477
- }, "de_CreateScalingPlanCommand");
478
- var de_DeleteScalingPlanCommand = /* @__PURE__ */ __name(async (output, context) => {
479
- if (output.statusCode >= 300) {
480
- return de_CommandError(output, context);
481
- }
482
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
483
- let contents = {};
484
- contents = (0, import_smithy_client._json)(data);
485
- const response = {
486
- $metadata: deserializeMetadata(output),
487
- ...contents
488
- };
489
- return response;
490
- }, "de_DeleteScalingPlanCommand");
491
- var de_DescribeScalingPlanResourcesCommand = /* @__PURE__ */ __name(async (output, context) => {
492
- if (output.statusCode >= 300) {
493
- return de_CommandError(output, context);
494
- }
495
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
496
- let contents = {};
497
- contents = de_DescribeScalingPlanResourcesResponse(data, context);
498
- const response = {
499
- $metadata: deserializeMetadata(output),
500
- ...contents
501
- };
502
- return response;
503
- }, "de_DescribeScalingPlanResourcesCommand");
504
- var de_DescribeScalingPlansCommand = /* @__PURE__ */ __name(async (output, context) => {
505
- if (output.statusCode >= 300) {
506
- return de_CommandError(output, context);
507
- }
508
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
509
- let contents = {};
510
- contents = de_DescribeScalingPlansResponse(data, context);
511
- const response = {
512
- $metadata: deserializeMetadata(output),
513
- ...contents
514
- };
515
- return response;
516
- }, "de_DescribeScalingPlansCommand");
517
- var de_GetScalingPlanResourceForecastDataCommand = /* @__PURE__ */ __name(async (output, context) => {
518
- if (output.statusCode >= 300) {
519
- return de_CommandError(output, context);
520
- }
521
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
522
- let contents = {};
523
- contents = de_GetScalingPlanResourceForecastDataResponse(data, context);
524
- const response = {
525
- $metadata: deserializeMetadata(output),
526
- ...contents
527
- };
528
- return response;
529
- }, "de_GetScalingPlanResourceForecastDataCommand");
530
- var de_UpdateScalingPlanCommand = /* @__PURE__ */ __name(async (output, context) => {
531
- if (output.statusCode >= 300) {
532
- return de_CommandError(output, context);
533
- }
534
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
535
- let contents = {};
536
- contents = (0, import_smithy_client._json)(data);
537
- const response = {
538
- $metadata: deserializeMetadata(output),
539
- ...contents
540
- };
541
- return response;
542
- }, "de_UpdateScalingPlanCommand");
543
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
544
- const parsedOutput = {
545
- ...output,
546
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
547
- };
548
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
549
- switch (errorCode) {
550
- case "ConcurrentUpdateException":
551
- case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
552
- throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context);
553
- case "InternalServiceException":
554
- case "com.amazonaws.autoscalingplans#InternalServiceException":
555
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
556
- case "LimitExceededException":
557
- case "com.amazonaws.autoscalingplans#LimitExceededException":
558
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
559
- case "ValidationException":
560
- case "com.amazonaws.autoscalingplans#ValidationException":
561
- throw await de_ValidationExceptionRes(parsedOutput, context);
562
- case "ObjectNotFoundException":
563
- case "com.amazonaws.autoscalingplans#ObjectNotFoundException":
564
- throw await de_ObjectNotFoundExceptionRes(parsedOutput, context);
565
- case "InvalidNextTokenException":
566
- case "com.amazonaws.autoscalingplans#InvalidNextTokenException":
567
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
568
- default:
569
- const parsedBody = parsedOutput.body;
570
- return throwDefaultError({
571
- output,
572
- parsedBody,
573
- errorCode
574
- });
575
- }
576
- }, "de_CommandError");
577
- var de_ConcurrentUpdateExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
578
- const body = parsedOutput.body;
579
- const deserialized = (0, import_smithy_client._json)(body);
580
- const exception = new ConcurrentUpdateException({
581
- $metadata: deserializeMetadata(parsedOutput),
582
- ...deserialized
583
- });
584
- return (0, import_smithy_client.decorateServiceException)(exception, body);
585
- }, "de_ConcurrentUpdateExceptionRes");
586
- var de_InternalServiceExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
587
- const body = parsedOutput.body;
588
- const deserialized = (0, import_smithy_client._json)(body);
589
- const exception = new InternalServiceException({
590
- $metadata: deserializeMetadata(parsedOutput),
591
- ...deserialized
592
- });
593
- return (0, import_smithy_client.decorateServiceException)(exception, body);
594
- }, "de_InternalServiceExceptionRes");
595
- var de_InvalidNextTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
596
- const body = parsedOutput.body;
597
- const deserialized = (0, import_smithy_client._json)(body);
598
- const exception = new InvalidNextTokenException({
599
- $metadata: deserializeMetadata(parsedOutput),
600
- ...deserialized
601
- });
602
- return (0, import_smithy_client.decorateServiceException)(exception, body);
603
- }, "de_InvalidNextTokenExceptionRes");
604
- var de_LimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
605
- const body = parsedOutput.body;
606
- const deserialized = (0, import_smithy_client._json)(body);
607
- const exception = new LimitExceededException({
608
- $metadata: deserializeMetadata(parsedOutput),
609
- ...deserialized
610
- });
611
- return (0, import_smithy_client.decorateServiceException)(exception, body);
612
- }, "de_LimitExceededExceptionRes");
613
- var de_ObjectNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
614
- const body = parsedOutput.body;
615
- const deserialized = (0, import_smithy_client._json)(body);
616
- const exception = new ObjectNotFoundException({
617
- $metadata: deserializeMetadata(parsedOutput),
618
- ...deserialized
619
- });
620
- return (0, import_smithy_client.decorateServiceException)(exception, body);
621
- }, "de_ObjectNotFoundExceptionRes");
622
- var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
623
- const body = parsedOutput.body;
624
- const deserialized = (0, import_smithy_client._json)(body);
625
- const exception = new ValidationException({
626
- $metadata: deserializeMetadata(parsedOutput),
627
- ...deserialized
628
- });
629
- return (0, import_smithy_client.decorateServiceException)(exception, body);
630
- }, "de_ValidationExceptionRes");
631
- var se_CreateScalingPlanRequest = /* @__PURE__ */ __name((input, context) => {
632
- return (0, import_smithy_client.take)(input, {
633
- ApplicationSource: import_smithy_client._json,
634
- ScalingInstructions: /* @__PURE__ */ __name((_) => se_ScalingInstructions(_, context), "ScalingInstructions"),
635
- ScalingPlanName: []
636
- });
637
- }, "se_CreateScalingPlanRequest");
638
- var se_GetScalingPlanResourceForecastDataRequest = /* @__PURE__ */ __name((input, context) => {
639
- return (0, import_smithy_client.take)(input, {
640
- EndTime: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "EndTime"),
641
- ForecastDataType: [],
642
- ResourceId: [],
643
- ScalableDimension: [],
644
- ScalingPlanName: [],
645
- ScalingPlanVersion: [],
646
- ServiceNamespace: [],
647
- StartTime: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "StartTime")
648
- });
649
- }, "se_GetScalingPlanResourceForecastDataRequest");
650
- var se_ScalingInstruction = /* @__PURE__ */ __name((input, context) => {
651
- return (0, import_smithy_client.take)(input, {
652
- CustomizedLoadMetricSpecification: import_smithy_client._json,
653
- DisableDynamicScaling: [],
654
- MaxCapacity: [],
655
- MinCapacity: [],
656
- PredefinedLoadMetricSpecification: import_smithy_client._json,
657
- PredictiveScalingMaxCapacityBehavior: [],
658
- PredictiveScalingMaxCapacityBuffer: [],
659
- PredictiveScalingMode: [],
660
- ResourceId: [],
661
- ScalableDimension: [],
662
- ScalingPolicyUpdateBehavior: [],
663
- ScheduledActionBufferTime: [],
664
- ServiceNamespace: [],
665
- TargetTrackingConfigurations: /* @__PURE__ */ __name((_) => se_TargetTrackingConfigurations(_, context), "TargetTrackingConfigurations")
666
- });
667
- }, "se_ScalingInstruction");
668
- var se_ScalingInstructions = /* @__PURE__ */ __name((input, context) => {
669
- return input.filter((e) => e != null).map((entry) => {
670
- return se_ScalingInstruction(entry, context);
671
- });
672
- }, "se_ScalingInstructions");
673
- var se_TargetTrackingConfiguration = /* @__PURE__ */ __name((input, context) => {
674
- return (0, import_smithy_client.take)(input, {
675
- CustomizedScalingMetricSpecification: import_smithy_client._json,
676
- DisableScaleIn: [],
677
- EstimatedInstanceWarmup: [],
678
- PredefinedScalingMetricSpecification: import_smithy_client._json,
679
- ScaleInCooldown: [],
680
- ScaleOutCooldown: [],
681
- TargetValue: import_smithy_client.serializeFloat
682
- });
683
- }, "se_TargetTrackingConfiguration");
684
- var se_TargetTrackingConfigurations = /* @__PURE__ */ __name((input, context) => {
685
- return input.filter((e) => e != null).map((entry) => {
686
- return se_TargetTrackingConfiguration(entry, context);
687
- });
688
- }, "se_TargetTrackingConfigurations");
689
- var se_UpdateScalingPlanRequest = /* @__PURE__ */ __name((input, context) => {
690
- return (0, import_smithy_client.take)(input, {
691
- ApplicationSource: import_smithy_client._json,
692
- ScalingInstructions: /* @__PURE__ */ __name((_) => se_ScalingInstructions(_, context), "ScalingInstructions"),
693
- ScalingPlanName: [],
694
- ScalingPlanVersion: []
695
- });
696
- }, "se_UpdateScalingPlanRequest");
697
- var de_Datapoint = /* @__PURE__ */ __name((output, context) => {
698
- return (0, import_smithy_client.take)(output, {
699
- Timestamp: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), "Timestamp"),
700
- Value: import_smithy_client.limitedParseDouble
701
- });
702
- }, "de_Datapoint");
703
- var de_Datapoints = /* @__PURE__ */ __name((output, context) => {
704
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
705
- return de_Datapoint(entry, context);
706
- });
707
- return retVal;
708
- }, "de_Datapoints");
709
- var de_DescribeScalingPlanResourcesResponse = /* @__PURE__ */ __name((output, context) => {
710
- return (0, import_smithy_client.take)(output, {
711
- NextToken: import_smithy_client.expectString,
712
- ScalingPlanResources: /* @__PURE__ */ __name((_) => de_ScalingPlanResources(_, context), "ScalingPlanResources")
713
- });
714
- }, "de_DescribeScalingPlanResourcesResponse");
715
- var de_DescribeScalingPlansResponse = /* @__PURE__ */ __name((output, context) => {
716
- return (0, import_smithy_client.take)(output, {
717
- NextToken: import_smithy_client.expectString,
718
- ScalingPlans: /* @__PURE__ */ __name((_) => de_ScalingPlans(_, context), "ScalingPlans")
719
- });
720
- }, "de_DescribeScalingPlansResponse");
721
- var de_GetScalingPlanResourceForecastDataResponse = /* @__PURE__ */ __name((output, context) => {
722
- return (0, import_smithy_client.take)(output, {
723
- Datapoints: /* @__PURE__ */ __name((_) => de_Datapoints(_, context), "Datapoints")
724
- });
725
- }, "de_GetScalingPlanResourceForecastDataResponse");
726
- var de_ScalingInstruction = /* @__PURE__ */ __name((output, context) => {
727
- return (0, import_smithy_client.take)(output, {
728
- CustomizedLoadMetricSpecification: import_smithy_client._json,
729
- DisableDynamicScaling: import_smithy_client.expectBoolean,
730
- MaxCapacity: import_smithy_client.expectInt32,
731
- MinCapacity: import_smithy_client.expectInt32,
732
- PredefinedLoadMetricSpecification: import_smithy_client._json,
733
- PredictiveScalingMaxCapacityBehavior: import_smithy_client.expectString,
734
- PredictiveScalingMaxCapacityBuffer: import_smithy_client.expectInt32,
735
- PredictiveScalingMode: import_smithy_client.expectString,
736
- ResourceId: import_smithy_client.expectString,
737
- ScalableDimension: import_smithy_client.expectString,
738
- ScalingPolicyUpdateBehavior: import_smithy_client.expectString,
739
- ScheduledActionBufferTime: import_smithy_client.expectInt32,
740
- ServiceNamespace: import_smithy_client.expectString,
741
- TargetTrackingConfigurations: /* @__PURE__ */ __name((_) => de_TargetTrackingConfigurations(_, context), "TargetTrackingConfigurations")
742
- });
743
- }, "de_ScalingInstruction");
744
- var de_ScalingInstructions = /* @__PURE__ */ __name((output, context) => {
745
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
746
- return de_ScalingInstruction(entry, context);
747
- });
748
- return retVal;
749
- }, "de_ScalingInstructions");
750
- var de_ScalingPlan = /* @__PURE__ */ __name((output, context) => {
751
- return (0, import_smithy_client.take)(output, {
752
- ApplicationSource: import_smithy_client._json,
753
- CreationTime: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), "CreationTime"),
754
- ScalingInstructions: /* @__PURE__ */ __name((_) => de_ScalingInstructions(_, context), "ScalingInstructions"),
755
- ScalingPlanName: import_smithy_client.expectString,
756
- ScalingPlanVersion: import_smithy_client.expectLong,
757
- StatusCode: import_smithy_client.expectString,
758
- StatusMessage: import_smithy_client.expectString,
759
- StatusStartTime: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), "StatusStartTime")
760
- });
761
- }, "de_ScalingPlan");
762
- var de_ScalingPlanResource = /* @__PURE__ */ __name((output, context) => {
763
- return (0, import_smithy_client.take)(output, {
764
- ResourceId: import_smithy_client.expectString,
765
- ScalableDimension: import_smithy_client.expectString,
766
- ScalingPlanName: import_smithy_client.expectString,
767
- ScalingPlanVersion: import_smithy_client.expectLong,
768
- ScalingPolicies: /* @__PURE__ */ __name((_) => de_ScalingPolicies(_, context), "ScalingPolicies"),
769
- ScalingStatusCode: import_smithy_client.expectString,
770
- ScalingStatusMessage: import_smithy_client.expectString,
771
- ServiceNamespace: import_smithy_client.expectString
772
- });
773
- }, "de_ScalingPlanResource");
774
- var de_ScalingPlanResources = /* @__PURE__ */ __name((output, context) => {
775
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
776
- return de_ScalingPlanResource(entry, context);
777
- });
778
- return retVal;
779
- }, "de_ScalingPlanResources");
780
- var de_ScalingPlans = /* @__PURE__ */ __name((output, context) => {
781
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
782
- return de_ScalingPlan(entry, context);
783
- });
784
- return retVal;
785
- }, "de_ScalingPlans");
786
- var de_ScalingPolicies = /* @__PURE__ */ __name((output, context) => {
787
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
788
- return de_ScalingPolicy(entry, context);
789
- });
790
- return retVal;
791
- }, "de_ScalingPolicies");
792
- var de_ScalingPolicy = /* @__PURE__ */ __name((output, context) => {
793
- return (0, import_smithy_client.take)(output, {
794
- PolicyName: import_smithy_client.expectString,
795
- PolicyType: import_smithy_client.expectString,
796
- TargetTrackingConfiguration: /* @__PURE__ */ __name((_) => de_TargetTrackingConfiguration(_, context), "TargetTrackingConfiguration")
797
- });
798
- }, "de_ScalingPolicy");
799
- var de_TargetTrackingConfiguration = /* @__PURE__ */ __name((output, context) => {
800
- return (0, import_smithy_client.take)(output, {
801
- CustomizedScalingMetricSpecification: import_smithy_client._json,
802
- DisableScaleIn: import_smithy_client.expectBoolean,
803
- EstimatedInstanceWarmup: import_smithy_client.expectInt32,
804
- PredefinedScalingMetricSpecification: import_smithy_client._json,
805
- ScaleInCooldown: import_smithy_client.expectInt32,
806
- ScaleOutCooldown: import_smithy_client.expectInt32,
807
- TargetValue: import_smithy_client.limitedParseDouble
808
- });
809
- }, "de_TargetTrackingConfiguration");
810
- var de_TargetTrackingConfigurations = /* @__PURE__ */ __name((output, context) => {
811
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
812
- return de_TargetTrackingConfiguration(entry, context);
813
- });
814
- return retVal;
815
- }, "de_TargetTrackingConfigurations");
816
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
817
- httpStatusCode: output.statusCode,
818
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
819
- extendedRequestId: output.headers["x-amz-id-2"],
820
- cfId: output.headers["x-amz-cf-id"]
821
- }), "deserializeMetadata");
822
- var throwDefaultError = (0, import_smithy_client.withBaseException)(AutoScalingPlansServiceException);
823
- var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
824
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
825
- const contents = {
826
- protocol,
827
- hostname,
828
- port,
829
- method: "POST",
830
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
831
- headers
832
- };
833
- if (resolvedHostname !== void 0) {
834
- contents.hostname = resolvedHostname;
835
- }
836
- if (body !== void 0) {
837
- contents.body = body;
838
- }
839
- return new import_protocol_http.HttpRequest(contents);
840
- }, "buildHttpRpcRequest");
841
- function sharedHeaders(operation) {
842
- return {
843
- "content-type": "application/x-amz-json-1.1",
844
- "x-amz-target": `AnyScaleScalingPlannerFrontendService.${operation}`
845
- };
846
- }
847
- __name(sharedHeaders, "sharedHeaders");
848
-
849
- // src/commands/CreateScalingPlanCommand.ts
850
- var CreateScalingPlanCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
851
- return [
852
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
853
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
854
- ];
855
- }).s("AnyScaleScalingPlannerFrontendService", "CreateScalingPlan", {}).n("AutoScalingPlansClient", "CreateScalingPlanCommand").f(void 0, void 0).ser(se_CreateScalingPlanCommand).de(de_CreateScalingPlanCommand).build() {
856
- static {
857
- __name(this, "CreateScalingPlanCommand");
858
- }
489
+ const se_CreateScalingPlanRequest = (input, context) => {
490
+ return smithyClient.take(input, {
491
+ ApplicationSource: smithyClient._json,
492
+ ScalingInstructions: (_) => se_ScalingInstructions(_),
493
+ ScalingPlanName: [],
494
+ });
859
495
  };
860
-
861
- // src/commands/DeleteScalingPlanCommand.ts
862
-
863
-
864
-
865
- var DeleteScalingPlanCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
866
- return [
867
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
868
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
869
- ];
870
- }).s("AnyScaleScalingPlannerFrontendService", "DeleteScalingPlan", {}).n("AutoScalingPlansClient", "DeleteScalingPlanCommand").f(void 0, void 0).ser(se_DeleteScalingPlanCommand).de(de_DeleteScalingPlanCommand).build() {
871
- static {
872
- __name(this, "DeleteScalingPlanCommand");
873
- }
496
+ const se_GetScalingPlanResourceForecastDataRequest = (input, context) => {
497
+ return smithyClient.take(input, {
498
+ EndTime: (_) => _.getTime() / 1_000,
499
+ ForecastDataType: [],
500
+ ResourceId: [],
501
+ ScalableDimension: [],
502
+ ScalingPlanName: [],
503
+ ScalingPlanVersion: [],
504
+ ServiceNamespace: [],
505
+ StartTime: (_) => _.getTime() / 1_000,
506
+ });
874
507
  };
875
-
876
- // src/commands/DescribeScalingPlanResourcesCommand.ts
877
-
878
-
879
-
880
- var DescribeScalingPlanResourcesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
881
- return [
882
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
883
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
884
- ];
885
- }).s("AnyScaleScalingPlannerFrontendService", "DescribeScalingPlanResources", {}).n("AutoScalingPlansClient", "DescribeScalingPlanResourcesCommand").f(void 0, void 0).ser(se_DescribeScalingPlanResourcesCommand).de(de_DescribeScalingPlanResourcesCommand).build() {
886
- static {
887
- __name(this, "DescribeScalingPlanResourcesCommand");
888
- }
508
+ const se_ScalingInstruction = (input, context) => {
509
+ return smithyClient.take(input, {
510
+ CustomizedLoadMetricSpecification: smithyClient._json,
511
+ DisableDynamicScaling: [],
512
+ MaxCapacity: [],
513
+ MinCapacity: [],
514
+ PredefinedLoadMetricSpecification: smithyClient._json,
515
+ PredictiveScalingMaxCapacityBehavior: [],
516
+ PredictiveScalingMaxCapacityBuffer: [],
517
+ PredictiveScalingMode: [],
518
+ ResourceId: [],
519
+ ScalableDimension: [],
520
+ ScalingPolicyUpdateBehavior: [],
521
+ ScheduledActionBufferTime: [],
522
+ ServiceNamespace: [],
523
+ TargetTrackingConfigurations: (_) => se_TargetTrackingConfigurations(_),
524
+ });
889
525
  };
890
-
891
- // src/commands/DescribeScalingPlansCommand.ts
892
-
893
-
894
-
895
- var DescribeScalingPlansCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
896
- return [
897
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
898
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
899
- ];
900
- }).s("AnyScaleScalingPlannerFrontendService", "DescribeScalingPlans", {}).n("AutoScalingPlansClient", "DescribeScalingPlansCommand").f(void 0, void 0).ser(se_DescribeScalingPlansCommand).de(de_DescribeScalingPlansCommand).build() {
901
- static {
902
- __name(this, "DescribeScalingPlansCommand");
903
- }
526
+ const se_ScalingInstructions = (input, context) => {
527
+ return input
528
+ .filter((e) => e != null)
529
+ .map((entry) => {
530
+ return se_ScalingInstruction(entry);
531
+ });
904
532
  };
533
+ const se_TargetTrackingConfiguration = (input, context) => {
534
+ return smithyClient.take(input, {
535
+ CustomizedScalingMetricSpecification: smithyClient._json,
536
+ DisableScaleIn: [],
537
+ EstimatedInstanceWarmup: [],
538
+ PredefinedScalingMetricSpecification: smithyClient._json,
539
+ ScaleInCooldown: [],
540
+ ScaleOutCooldown: [],
541
+ TargetValue: smithyClient.serializeFloat,
542
+ });
543
+ };
544
+ const se_TargetTrackingConfigurations = (input, context) => {
545
+ return input
546
+ .filter((e) => e != null)
547
+ .map((entry) => {
548
+ return se_TargetTrackingConfiguration(entry);
549
+ });
550
+ };
551
+ const se_UpdateScalingPlanRequest = (input, context) => {
552
+ return smithyClient.take(input, {
553
+ ApplicationSource: smithyClient._json,
554
+ ScalingInstructions: (_) => se_ScalingInstructions(_),
555
+ ScalingPlanName: [],
556
+ ScalingPlanVersion: [],
557
+ });
558
+ };
559
+ const de_Datapoint = (output, context) => {
560
+ return smithyClient.take(output, {
561
+ Timestamp: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
562
+ Value: smithyClient.limitedParseDouble,
563
+ });
564
+ };
565
+ const de_Datapoints = (output, context) => {
566
+ const retVal = (output || [])
567
+ .filter((e) => e != null)
568
+ .map((entry) => {
569
+ return de_Datapoint(entry);
570
+ });
571
+ return retVal;
572
+ };
573
+ const de_DescribeScalingPlanResourcesResponse = (output, context) => {
574
+ return smithyClient.take(output, {
575
+ NextToken: smithyClient.expectString,
576
+ ScalingPlanResources: (_) => de_ScalingPlanResources(_),
577
+ });
578
+ };
579
+ const de_DescribeScalingPlansResponse = (output, context) => {
580
+ return smithyClient.take(output, {
581
+ NextToken: smithyClient.expectString,
582
+ ScalingPlans: (_) => de_ScalingPlans(_),
583
+ });
584
+ };
585
+ const de_GetScalingPlanResourceForecastDataResponse = (output, context) => {
586
+ return smithyClient.take(output, {
587
+ Datapoints: (_) => de_Datapoints(_),
588
+ });
589
+ };
590
+ const de_ScalingInstruction = (output, context) => {
591
+ return smithyClient.take(output, {
592
+ CustomizedLoadMetricSpecification: smithyClient._json,
593
+ DisableDynamicScaling: smithyClient.expectBoolean,
594
+ MaxCapacity: smithyClient.expectInt32,
595
+ MinCapacity: smithyClient.expectInt32,
596
+ PredefinedLoadMetricSpecification: smithyClient._json,
597
+ PredictiveScalingMaxCapacityBehavior: smithyClient.expectString,
598
+ PredictiveScalingMaxCapacityBuffer: smithyClient.expectInt32,
599
+ PredictiveScalingMode: smithyClient.expectString,
600
+ ResourceId: smithyClient.expectString,
601
+ ScalableDimension: smithyClient.expectString,
602
+ ScalingPolicyUpdateBehavior: smithyClient.expectString,
603
+ ScheduledActionBufferTime: smithyClient.expectInt32,
604
+ ServiceNamespace: smithyClient.expectString,
605
+ TargetTrackingConfigurations: (_) => de_TargetTrackingConfigurations(_),
606
+ });
607
+ };
608
+ const de_ScalingInstructions = (output, context) => {
609
+ const retVal = (output || [])
610
+ .filter((e) => e != null)
611
+ .map((entry) => {
612
+ return de_ScalingInstruction(entry);
613
+ });
614
+ return retVal;
615
+ };
616
+ const de_ScalingPlan = (output, context) => {
617
+ return smithyClient.take(output, {
618
+ ApplicationSource: smithyClient._json,
619
+ CreationTime: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
620
+ ScalingInstructions: (_) => de_ScalingInstructions(_),
621
+ ScalingPlanName: smithyClient.expectString,
622
+ ScalingPlanVersion: smithyClient.expectLong,
623
+ StatusCode: smithyClient.expectString,
624
+ StatusMessage: smithyClient.expectString,
625
+ StatusStartTime: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
626
+ });
627
+ };
628
+ const de_ScalingPlanResource = (output, context) => {
629
+ return smithyClient.take(output, {
630
+ ResourceId: smithyClient.expectString,
631
+ ScalableDimension: smithyClient.expectString,
632
+ ScalingPlanName: smithyClient.expectString,
633
+ ScalingPlanVersion: smithyClient.expectLong,
634
+ ScalingPolicies: (_) => de_ScalingPolicies(_),
635
+ ScalingStatusCode: smithyClient.expectString,
636
+ ScalingStatusMessage: smithyClient.expectString,
637
+ ServiceNamespace: smithyClient.expectString,
638
+ });
639
+ };
640
+ const de_ScalingPlanResources = (output, context) => {
641
+ const retVal = (output || [])
642
+ .filter((e) => e != null)
643
+ .map((entry) => {
644
+ return de_ScalingPlanResource(entry);
645
+ });
646
+ return retVal;
647
+ };
648
+ const de_ScalingPlans = (output, context) => {
649
+ const retVal = (output || [])
650
+ .filter((e) => e != null)
651
+ .map((entry) => {
652
+ return de_ScalingPlan(entry);
653
+ });
654
+ return retVal;
655
+ };
656
+ const de_ScalingPolicies = (output, context) => {
657
+ const retVal = (output || [])
658
+ .filter((e) => e != null)
659
+ .map((entry) => {
660
+ return de_ScalingPolicy(entry);
661
+ });
662
+ return retVal;
663
+ };
664
+ const de_ScalingPolicy = (output, context) => {
665
+ return smithyClient.take(output, {
666
+ PolicyName: smithyClient.expectString,
667
+ PolicyType: smithyClient.expectString,
668
+ TargetTrackingConfiguration: (_) => de_TargetTrackingConfiguration(_),
669
+ });
670
+ };
671
+ const de_TargetTrackingConfiguration = (output, context) => {
672
+ return smithyClient.take(output, {
673
+ CustomizedScalingMetricSpecification: smithyClient._json,
674
+ DisableScaleIn: smithyClient.expectBoolean,
675
+ EstimatedInstanceWarmup: smithyClient.expectInt32,
676
+ PredefinedScalingMetricSpecification: smithyClient._json,
677
+ ScaleInCooldown: smithyClient.expectInt32,
678
+ ScaleOutCooldown: smithyClient.expectInt32,
679
+ TargetValue: smithyClient.limitedParseDouble,
680
+ });
681
+ };
682
+ const de_TargetTrackingConfigurations = (output, context) => {
683
+ const retVal = (output || [])
684
+ .filter((e) => e != null)
685
+ .map((entry) => {
686
+ return de_TargetTrackingConfiguration(entry);
687
+ });
688
+ return retVal;
689
+ };
690
+ const deserializeMetadata = (output) => ({
691
+ httpStatusCode: output.statusCode,
692
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
693
+ extendedRequestId: output.headers["x-amz-id-2"],
694
+ cfId: output.headers["x-amz-cf-id"],
695
+ });
696
+ const throwDefaultError = smithyClient.withBaseException(AutoScalingPlansServiceException);
697
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
698
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
699
+ const contents = {
700
+ protocol,
701
+ hostname,
702
+ port,
703
+ method: "POST",
704
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
705
+ headers,
706
+ };
707
+ if (body !== undefined) {
708
+ contents.body = body;
709
+ }
710
+ return new protocolHttp.HttpRequest(contents);
711
+ };
712
+ function sharedHeaders(operation) {
713
+ return {
714
+ "content-type": "application/x-amz-json-1.1",
715
+ "x-amz-target": `AnyScaleScalingPlannerFrontendService.${operation}`,
716
+ };
717
+ }
905
718
 
906
- // src/commands/GetScalingPlanResourceForecastDataCommand.ts
907
-
719
+ class CreateScalingPlanCommand extends smithyClient.Command
720
+ .classBuilder()
721
+ .ep(commonParams)
722
+ .m(function (Command, cs, config, o) {
723
+ return [
724
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
725
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
726
+ ];
727
+ })
728
+ .s("AnyScaleScalingPlannerFrontendService", "CreateScalingPlan", {})
729
+ .n("AutoScalingPlansClient", "CreateScalingPlanCommand")
730
+ .f(void 0, void 0)
731
+ .ser(se_CreateScalingPlanCommand)
732
+ .de(de_CreateScalingPlanCommand)
733
+ .build() {
734
+ }
908
735
 
736
+ class DeleteScalingPlanCommand extends smithyClient.Command
737
+ .classBuilder()
738
+ .ep(commonParams)
739
+ .m(function (Command, cs, config, o) {
740
+ return [
741
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
742
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
743
+ ];
744
+ })
745
+ .s("AnyScaleScalingPlannerFrontendService", "DeleteScalingPlan", {})
746
+ .n("AutoScalingPlansClient", "DeleteScalingPlanCommand")
747
+ .f(void 0, void 0)
748
+ .ser(se_DeleteScalingPlanCommand)
749
+ .de(de_DeleteScalingPlanCommand)
750
+ .build() {
751
+ }
909
752
 
910
- var GetScalingPlanResourceForecastDataCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
911
- return [
912
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
913
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
914
- ];
915
- }).s("AnyScaleScalingPlannerFrontendService", "GetScalingPlanResourceForecastData", {}).n("AutoScalingPlansClient", "GetScalingPlanResourceForecastDataCommand").f(void 0, void 0).ser(se_GetScalingPlanResourceForecastDataCommand).de(de_GetScalingPlanResourceForecastDataCommand).build() {
916
- static {
917
- __name(this, "GetScalingPlanResourceForecastDataCommand");
918
- }
919
- };
753
+ class DescribeScalingPlanResourcesCommand extends smithyClient.Command
754
+ .classBuilder()
755
+ .ep(commonParams)
756
+ .m(function (Command, cs, config, o) {
757
+ return [
758
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
759
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
760
+ ];
761
+ })
762
+ .s("AnyScaleScalingPlannerFrontendService", "DescribeScalingPlanResources", {})
763
+ .n("AutoScalingPlansClient", "DescribeScalingPlanResourcesCommand")
764
+ .f(void 0, void 0)
765
+ .ser(se_DescribeScalingPlanResourcesCommand)
766
+ .de(de_DescribeScalingPlanResourcesCommand)
767
+ .build() {
768
+ }
920
769
 
921
- // src/commands/UpdateScalingPlanCommand.ts
770
+ class DescribeScalingPlansCommand extends smithyClient.Command
771
+ .classBuilder()
772
+ .ep(commonParams)
773
+ .m(function (Command, cs, config, o) {
774
+ return [
775
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
776
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
777
+ ];
778
+ })
779
+ .s("AnyScaleScalingPlannerFrontendService", "DescribeScalingPlans", {})
780
+ .n("AutoScalingPlansClient", "DescribeScalingPlansCommand")
781
+ .f(void 0, void 0)
782
+ .ser(se_DescribeScalingPlansCommand)
783
+ .de(de_DescribeScalingPlansCommand)
784
+ .build() {
785
+ }
922
786
 
787
+ class GetScalingPlanResourceForecastDataCommand extends smithyClient.Command
788
+ .classBuilder()
789
+ .ep(commonParams)
790
+ .m(function (Command, cs, config, o) {
791
+ return [
792
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
793
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
794
+ ];
795
+ })
796
+ .s("AnyScaleScalingPlannerFrontendService", "GetScalingPlanResourceForecastData", {})
797
+ .n("AutoScalingPlansClient", "GetScalingPlanResourceForecastDataCommand")
798
+ .f(void 0, void 0)
799
+ .ser(se_GetScalingPlanResourceForecastDataCommand)
800
+ .de(de_GetScalingPlanResourceForecastDataCommand)
801
+ .build() {
802
+ }
923
803
 
804
+ class UpdateScalingPlanCommand extends smithyClient.Command
805
+ .classBuilder()
806
+ .ep(commonParams)
807
+ .m(function (Command, cs, config, o) {
808
+ return [
809
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
810
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
811
+ ];
812
+ })
813
+ .s("AnyScaleScalingPlannerFrontendService", "UpdateScalingPlan", {})
814
+ .n("AutoScalingPlansClient", "UpdateScalingPlanCommand")
815
+ .f(void 0, void 0)
816
+ .ser(se_UpdateScalingPlanCommand)
817
+ .de(de_UpdateScalingPlanCommand)
818
+ .build() {
819
+ }
924
820
 
925
- var UpdateScalingPlanCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
926
- return [
927
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
928
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
929
- ];
930
- }).s("AnyScaleScalingPlannerFrontendService", "UpdateScalingPlan", {}).n("AutoScalingPlansClient", "UpdateScalingPlanCommand").f(void 0, void 0).ser(se_UpdateScalingPlanCommand).de(de_UpdateScalingPlanCommand).build() {
931
- static {
932
- __name(this, "UpdateScalingPlanCommand");
933
- }
821
+ const commands = {
822
+ CreateScalingPlanCommand,
823
+ DeleteScalingPlanCommand,
824
+ DescribeScalingPlanResourcesCommand,
825
+ DescribeScalingPlansCommand,
826
+ GetScalingPlanResourceForecastDataCommand,
827
+ UpdateScalingPlanCommand,
934
828
  };
829
+ class AutoScalingPlans extends AutoScalingPlansClient {
830
+ }
831
+ smithyClient.createAggregatedClient(commands, AutoScalingPlans);
935
832
 
936
- // src/AutoScalingPlans.ts
937
- var commands = {
938
- CreateScalingPlanCommand,
939
- DeleteScalingPlanCommand,
940
- DescribeScalingPlanResourcesCommand,
941
- DescribeScalingPlansCommand,
942
- GetScalingPlanResourceForecastDataCommand,
943
- UpdateScalingPlanCommand
944
- };
945
- var AutoScalingPlans = class extends AutoScalingPlansClient {
946
- static {
947
- __name(this, "AutoScalingPlans");
948
- }
949
- };
950
- (0, import_smithy_client.createAggregatedClient)(commands, AutoScalingPlans);
951
- // Annotate the CommonJS export names for ESM import in node:
952
-
953
- 0 && (module.exports = {
954
- AutoScalingPlansServiceException,
955
- __Client,
956
- AutoScalingPlansClient,
957
- AutoScalingPlans,
958
- $Command,
959
- CreateScalingPlanCommand,
960
- DeleteScalingPlanCommand,
961
- DescribeScalingPlanResourcesCommand,
962
- DescribeScalingPlansCommand,
963
- GetScalingPlanResourceForecastDataCommand,
964
- UpdateScalingPlanCommand,
965
- ConcurrentUpdateException,
966
- MetricStatistic,
967
- LoadMetricType,
968
- PredictiveScalingMaxCapacityBehavior,
969
- PredictiveScalingMode,
970
- ScalableDimension,
971
- ScalingPolicyUpdateBehavior,
972
- ServiceNamespace,
973
- ScalingMetricType,
974
- InternalServiceException,
975
- LimitExceededException,
976
- ValidationException,
977
- ObjectNotFoundException,
978
- PolicyType,
979
- ScalingStatusCode,
980
- InvalidNextTokenException,
981
- ScalingPlanStatusCode,
982
- ForecastDataType
833
+ Object.defineProperty(exports, "$Command", {
834
+ enumerable: true,
835
+ get: function () { return smithyClient.Command; }
983
836
  });
984
-
837
+ Object.defineProperty(exports, "__Client", {
838
+ enumerable: true,
839
+ get: function () { return smithyClient.Client; }
840
+ });
841
+ exports.AutoScalingPlans = AutoScalingPlans;
842
+ exports.AutoScalingPlansClient = AutoScalingPlansClient;
843
+ exports.AutoScalingPlansServiceException = AutoScalingPlansServiceException;
844
+ exports.ConcurrentUpdateException = ConcurrentUpdateException;
845
+ exports.CreateScalingPlanCommand = CreateScalingPlanCommand;
846
+ exports.DeleteScalingPlanCommand = DeleteScalingPlanCommand;
847
+ exports.DescribeScalingPlanResourcesCommand = DescribeScalingPlanResourcesCommand;
848
+ exports.DescribeScalingPlansCommand = DescribeScalingPlansCommand;
849
+ exports.ForecastDataType = ForecastDataType;
850
+ exports.GetScalingPlanResourceForecastDataCommand = GetScalingPlanResourceForecastDataCommand;
851
+ exports.InternalServiceException = InternalServiceException;
852
+ exports.InvalidNextTokenException = InvalidNextTokenException;
853
+ exports.LimitExceededException = LimitExceededException;
854
+ exports.LoadMetricType = LoadMetricType;
855
+ exports.MetricStatistic = MetricStatistic;
856
+ exports.ObjectNotFoundException = ObjectNotFoundException;
857
+ exports.PolicyType = PolicyType;
858
+ exports.PredictiveScalingMaxCapacityBehavior = PredictiveScalingMaxCapacityBehavior;
859
+ exports.PredictiveScalingMode = PredictiveScalingMode;
860
+ exports.ScalableDimension = ScalableDimension;
861
+ exports.ScalingMetricType = ScalingMetricType;
862
+ exports.ScalingPlanStatusCode = ScalingPlanStatusCode;
863
+ exports.ScalingPolicyUpdateBehavior = ScalingPolicyUpdateBehavior;
864
+ exports.ScalingStatusCode = ScalingStatusCode;
865
+ exports.ServiceNamespace = ServiceNamespace;
866
+ exports.UpdateScalingPlanCommand = UpdateScalingPlanCommand;
867
+ exports.ValidationException = ValidationException;