@aws-sdk/client-cost-optimization-hub 3.901.0 → 3.907.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 +1107 -1237
  2. package/package.json +6 -6
package/dist-cjs/index.js CHANGED
@@ -1,1279 +1,1149 @@
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);
1
+ 'use strict';
20
2
 
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- AccessDeniedException: () => AccessDeniedException,
25
- ActionType: () => ActionType,
26
- AllocationStrategy: () => AllocationStrategy,
27
- CostOptimizationHub: () => CostOptimizationHub,
28
- CostOptimizationHubClient: () => CostOptimizationHubClient,
29
- CostOptimizationHubServiceException: () => CostOptimizationHubServiceException,
30
- Ec2AutoScalingGroupType: () => Ec2AutoScalingGroupType,
31
- EnrollmentStatus: () => EnrollmentStatus,
32
- GetPreferencesCommand: () => GetPreferencesCommand,
33
- GetRecommendationCommand: () => GetRecommendationCommand,
34
- ImplementationEffort: () => ImplementationEffort,
35
- InternalServerException: () => InternalServerException,
36
- ListEnrollmentStatusesCommand: () => ListEnrollmentStatusesCommand,
37
- ListRecommendationSummariesCommand: () => ListRecommendationSummariesCommand,
38
- ListRecommendationsCommand: () => ListRecommendationsCommand,
39
- MemberAccountDiscountVisibility: () => MemberAccountDiscountVisibility,
40
- Order: () => Order,
41
- PaymentOption: () => PaymentOption,
42
- ResourceDetails: () => ResourceDetails,
43
- ResourceNotFoundException: () => ResourceNotFoundException,
44
- ResourceType: () => ResourceType,
45
- SavingsEstimationMode: () => SavingsEstimationMode,
46
- Source: () => Source,
47
- SummaryMetrics: () => SummaryMetrics,
48
- Term: () => Term,
49
- ThrottlingException: () => ThrottlingException,
50
- UpdateEnrollmentStatusCommand: () => UpdateEnrollmentStatusCommand,
51
- UpdatePreferencesCommand: () => UpdatePreferencesCommand,
52
- ValidationException: () => ValidationException,
53
- ValidationExceptionReason: () => ValidationExceptionReason,
54
- __Client: () => import_smithy_client.Client,
55
- paginateListEnrollmentStatuses: () => paginateListEnrollmentStatuses,
56
- paginateListRecommendationSummaries: () => paginateListRecommendationSummaries,
57
- paginateListRecommendations: () => paginateListRecommendations
58
- });
59
- module.exports = __toCommonJS(index_exports);
60
-
61
- // src/CostOptimizationHubClient.ts
62
- var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
63
- var import_middleware_logger = require("@aws-sdk/middleware-logger");
64
- var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
65
- var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
66
- var import_config_resolver = require("@smithy/config-resolver");
67
- var import_core = require("@smithy/core");
68
- var import_middleware_content_length = require("@smithy/middleware-content-length");
69
- var import_middleware_endpoint = require("@smithy/middleware-endpoint");
70
- var import_middleware_retry = require("@smithy/middleware-retry");
71
-
72
- var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
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');
73
19
 
74
- // src/endpoint/EndpointParameters.ts
75
- var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
76
- return Object.assign(options, {
77
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
78
- useFipsEndpoint: options.useFipsEndpoint ?? false,
79
- defaultSigningName: "cost-optimization-hub"
80
- });
81
- }, "resolveClientEndpointParameters");
82
- var commonParams = {
83
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
84
- Endpoint: { type: "builtInParams", name: "endpoint" },
85
- Region: { type: "builtInParams", name: "region" },
86
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
20
+ const resolveClientEndpointParameters = (options) => {
21
+ return Object.assign(options, {
22
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
23
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
24
+ defaultSigningName: "cost-optimization-hub",
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" },
87
32
  };
88
33
 
89
- // src/CostOptimizationHubClient.ts
90
- 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
+ };
91
72
 
92
- // src/runtimeExtensions.ts
93
- var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
94
- var import_protocol_http = require("@smithy/protocol-http");
95
- 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
+ };
96
78
 
97
- // src/auth/httpAuthExtensionConfiguration.ts
98
- var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
99
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
100
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
101
- let _credentials = runtimeConfig.credentials;
102
- return {
103
- setHttpAuthScheme(httpAuthScheme) {
104
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
105
- if (index === -1) {
106
- _httpAuthSchemes.push(httpAuthScheme);
107
- } else {
108
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
109
- }
110
- },
111
- httpAuthSchemes() {
112
- return _httpAuthSchemes;
113
- },
114
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
115
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
116
- },
117
- httpAuthSchemeProvider() {
118
- return _httpAuthSchemeProvider;
119
- },
120
- setCredentials(credentials) {
121
- _credentials = credentials;
122
- },
123
- credentials() {
124
- return _credentials;
79
+ class CostOptimizationHubClient 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.defaultCostOptimizationHubHttpAuthSchemeParametersProvider,
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();
125
110
  }
126
- };
127
- }, "getHttpAuthExtensionConfiguration");
128
- var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
129
- return {
130
- httpAuthSchemes: config.httpAuthSchemes(),
131
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
132
- credentials: config.credentials()
133
- };
134
- }, "resolveHttpAuthRuntimeConfig");
111
+ }
135
112
 
136
- // src/runtimeExtensions.ts
137
- var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
138
- const extensionConfiguration = Object.assign(
139
- (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
140
- (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
141
- (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
142
- getHttpAuthExtensionConfiguration(runtimeConfig)
143
- );
144
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
145
- return Object.assign(
146
- runtimeConfig,
147
- (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
148
- (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
149
- (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
150
- resolveHttpAuthRuntimeConfig(extensionConfiguration)
151
- );
152
- }, "resolveRuntimeExtensions");
113
+ class CostOptimizationHubServiceException extends smithyClient.ServiceException {
114
+ constructor(options) {
115
+ super(options);
116
+ Object.setPrototypeOf(this, CostOptimizationHubServiceException.prototype);
117
+ }
118
+ }
153
119
 
154
- // src/CostOptimizationHubClient.ts
155
- var CostOptimizationHubClient = class extends import_smithy_client.Client {
156
- static {
157
- __name(this, "CostOptimizationHubClient");
158
- }
159
- /**
160
- * The resolved configuration of CostOptimizationHubClient class. This is resolved and normalized from the {@link CostOptimizationHubClientConfig | constructor configuration interface}.
161
- */
162
- config;
163
- constructor(...[configuration]) {
164
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
165
- super(_config_0);
166
- this.initConfig = _config_0;
167
- const _config_1 = resolveClientEndpointParameters(_config_0);
168
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
169
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
170
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
171
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
172
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
173
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
174
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
175
- this.config = _config_8;
176
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
177
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
178
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
179
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
180
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
181
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
182
- this.middlewareStack.use(
183
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
184
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultCostOptimizationHubHttpAuthSchemeParametersProvider,
185
- identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
186
- "aws.auth#sigv4": config.credentials
187
- }), "identityProviderConfigProvider")
188
- })
189
- );
190
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
191
- }
192
- /**
193
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
194
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
195
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
196
- */
197
- destroy() {
198
- super.destroy();
199
- }
120
+ class AccessDeniedException extends CostOptimizationHubServiceException {
121
+ name = "AccessDeniedException";
122
+ $fault = "client";
123
+ constructor(opts) {
124
+ super({
125
+ name: "AccessDeniedException",
126
+ $fault: "client",
127
+ ...opts,
128
+ });
129
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
130
+ }
131
+ }
132
+ const EnrollmentStatus = {
133
+ ACTIVE: "Active",
134
+ INACTIVE: "Inactive",
200
135
  };
201
-
202
- // src/CostOptimizationHub.ts
203
-
204
-
205
- // src/commands/GetPreferencesCommand.ts
206
-
207
- var import_middleware_serde = require("@smithy/middleware-serde");
208
-
209
-
210
- // src/protocols/Aws_json1_0.ts
211
- var import_core2 = require("@aws-sdk/core");
212
-
213
-
214
-
215
- // src/models/CostOptimizationHubServiceException.ts
216
-
217
- var CostOptimizationHubServiceException = class _CostOptimizationHubServiceException extends import_smithy_client.ServiceException {
218
- static {
219
- __name(this, "CostOptimizationHubServiceException");
220
- }
221
- /**
222
- * @internal
223
- */
224
- constructor(options) {
225
- super(options);
226
- Object.setPrototypeOf(this, _CostOptimizationHubServiceException.prototype);
227
- }
136
+ const ActionType = {
137
+ DELETE: "Delete",
138
+ MIGRATE_TO_GRAVITON: "MigrateToGraviton",
139
+ PURCHASE_RESERVED_INSTANCES: "PurchaseReservedInstances",
140
+ PURCHASE_SAVINGS_PLANS: "PurchaseSavingsPlans",
141
+ RIGHTSIZE: "Rightsize",
142
+ SCALE_IN: "ScaleIn",
143
+ STOP: "Stop",
144
+ UPGRADE: "Upgrade",
228
145
  };
229
-
230
- // src/models/models_0.ts
231
- var AccessDeniedException = class _AccessDeniedException extends CostOptimizationHubServiceException {
232
- static {
233
- __name(this, "AccessDeniedException");
234
- }
235
- name = "AccessDeniedException";
236
- $fault = "client";
237
- /**
238
- * @internal
239
- */
240
- constructor(opts) {
241
- super({
242
- name: "AccessDeniedException",
243
- $fault: "client",
244
- ...opts
245
- });
246
- Object.setPrototypeOf(this, _AccessDeniedException.prototype);
247
- }
248
- };
249
- var EnrollmentStatus = {
250
- ACTIVE: "Active",
251
- INACTIVE: "Inactive"
252
- };
253
- var ActionType = {
254
- DELETE: "Delete",
255
- MIGRATE_TO_GRAVITON: "MigrateToGraviton",
256
- PURCHASE_RESERVED_INSTANCES: "PurchaseReservedInstances",
257
- PURCHASE_SAVINGS_PLANS: "PurchaseSavingsPlans",
258
- RIGHTSIZE: "Rightsize",
259
- SCALE_IN: "ScaleIn",
260
- STOP: "Stop",
261
- UPGRADE: "Upgrade"
262
- };
263
- var AllocationStrategy = {
264
- LOWEST_PRICE: "LowestPrice",
265
- PRIORITIZED: "Prioritized"
266
- };
267
- var MemberAccountDiscountVisibility = {
268
- ALL: "All",
269
- NONE: "None"
270
- };
271
- var PaymentOption = {
272
- ALL_UPFRONT: "AllUpfront",
273
- NO_UPFRONT: "NoUpfront",
274
- PARTIAL_UPFRONT: "PartialUpfront"
275
- };
276
- var Term = {
277
- ONE_YEAR: "OneYear",
278
- THREE_YEARS: "ThreeYears"
279
- };
280
- var SavingsEstimationMode = {
281
- AFTER_DISCOUNTS: "AfterDiscounts",
282
- BEFORE_DISCOUNTS: "BeforeDiscounts"
283
- };
284
- var InternalServerException = class _InternalServerException extends CostOptimizationHubServiceException {
285
- static {
286
- __name(this, "InternalServerException");
287
- }
288
- name = "InternalServerException";
289
- $fault = "server";
290
- /**
291
- * @internal
292
- */
293
- constructor(opts) {
294
- super({
295
- name: "InternalServerException",
296
- $fault: "server",
297
- ...opts
298
- });
299
- Object.setPrototypeOf(this, _InternalServerException.prototype);
300
- }
301
- };
302
- var ThrottlingException = class _ThrottlingException extends CostOptimizationHubServiceException {
303
- static {
304
- __name(this, "ThrottlingException");
305
- }
306
- name = "ThrottlingException";
307
- $fault = "client";
308
- /**
309
- * @internal
310
- */
311
- constructor(opts) {
312
- super({
313
- name: "ThrottlingException",
314
- $fault: "client",
315
- ...opts
316
- });
317
- Object.setPrototypeOf(this, _ThrottlingException.prototype);
318
- }
319
- };
320
- var ValidationExceptionReason = {
321
- FIELD_VALIDATION_FAILED: "FieldValidationFailed",
322
- OTHER: "Other"
323
- };
324
- var ValidationException = class _ValidationException extends CostOptimizationHubServiceException {
325
- static {
326
- __name(this, "ValidationException");
327
- }
328
- name = "ValidationException";
329
- $fault = "client";
330
- /**
331
- * <p>The reason for the validation exception.</p>
332
- * @public
333
- */
334
- reason;
335
- /**
336
- * <p>The list of fields that are invalid.</p>
337
- * @public
338
- */
339
- fields;
340
- /**
341
- * @internal
342
- */
343
- constructor(opts) {
344
- super({
345
- name: "ValidationException",
346
- $fault: "client",
347
- ...opts
348
- });
349
- Object.setPrototypeOf(this, _ValidationException.prototype);
350
- this.reason = opts.reason;
351
- this.fields = opts.fields;
352
- }
353
- };
354
- var Ec2AutoScalingGroupType = {
355
- MIXED_INSTANCE_TYPES: "MixedInstanceTypes",
356
- SINGLE_INSTANCE_TYPE: "SingleInstanceType"
357
- };
358
- var ResourceDetails;
359
- ((ResourceDetails3) => {
360
- ResourceDetails3.visit = /* @__PURE__ */ __name((value, visitor) => {
361
- if (value.lambdaFunction !== void 0) return visitor.lambdaFunction(value.lambdaFunction);
362
- if (value.ecsService !== void 0) return visitor.ecsService(value.ecsService);
363
- if (value.ec2Instance !== void 0) return visitor.ec2Instance(value.ec2Instance);
364
- if (value.ebsVolume !== void 0) return visitor.ebsVolume(value.ebsVolume);
365
- if (value.ec2AutoScalingGroup !== void 0) return visitor.ec2AutoScalingGroup(value.ec2AutoScalingGroup);
366
- if (value.ec2ReservedInstances !== void 0) return visitor.ec2ReservedInstances(value.ec2ReservedInstances);
367
- if (value.rdsReservedInstances !== void 0) return visitor.rdsReservedInstances(value.rdsReservedInstances);
368
- if (value.elastiCacheReservedInstances !== void 0)
369
- return visitor.elastiCacheReservedInstances(value.elastiCacheReservedInstances);
370
- if (value.openSearchReservedInstances !== void 0)
371
- return visitor.openSearchReservedInstances(value.openSearchReservedInstances);
372
- if (value.redshiftReservedInstances !== void 0)
373
- return visitor.redshiftReservedInstances(value.redshiftReservedInstances);
374
- if (value.ec2InstanceSavingsPlans !== void 0)
375
- return visitor.ec2InstanceSavingsPlans(value.ec2InstanceSavingsPlans);
376
- if (value.computeSavingsPlans !== void 0) return visitor.computeSavingsPlans(value.computeSavingsPlans);
377
- if (value.sageMakerSavingsPlans !== void 0) return visitor.sageMakerSavingsPlans(value.sageMakerSavingsPlans);
378
- if (value.rdsDbInstance !== void 0) return visitor.rdsDbInstance(value.rdsDbInstance);
379
- if (value.rdsDbInstanceStorage !== void 0) return visitor.rdsDbInstanceStorage(value.rdsDbInstanceStorage);
380
- if (value.auroraDbClusterStorage !== void 0) return visitor.auroraDbClusterStorage(value.auroraDbClusterStorage);
381
- if (value.dynamoDbReservedCapacity !== void 0)
382
- return visitor.dynamoDbReservedCapacity(value.dynamoDbReservedCapacity);
383
- if (value.memoryDbReservedInstances !== void 0)
384
- return visitor.memoryDbReservedInstances(value.memoryDbReservedInstances);
385
- return visitor._(value.$unknown[0], value.$unknown[1]);
386
- }, "visit");
387
- })(ResourceDetails || (ResourceDetails = {}));
388
- var ResourceType = {
389
- AURORA_DB_CLUSTER_STORAGE: "AuroraDbClusterStorage",
390
- COMPUTE_SAVINGS_PLANS: "ComputeSavingsPlans",
391
- DYNAMO_DB_RESERVED_CAPACITY: "DynamoDbReservedCapacity",
392
- EBS_VOLUME: "EbsVolume",
393
- EC2_AUTO_SCALING_GROUP: "Ec2AutoScalingGroup",
394
- EC2_INSTANCE: "Ec2Instance",
395
- EC2_INSTANCE_SAVINGS_PLANS: "Ec2InstanceSavingsPlans",
396
- EC2_RESERVED_INSTANCES: "Ec2ReservedInstances",
397
- ECS_SERVICE: "EcsService",
398
- ELASTI_CACHE_RESERVED_INSTANCES: "ElastiCacheReservedInstances",
399
- LAMBDA_FUNCTION: "LambdaFunction",
400
- MEMORY_DB_RESERVED_INSTANCES: "MemoryDbReservedInstances",
401
- OPEN_SEARCH_RESERVED_INSTANCES: "OpenSearchReservedInstances",
402
- RDS_DB_INSTANCE: "RdsDbInstance",
403
- RDS_DB_INSTANCE_STORAGE: "RdsDbInstanceStorage",
404
- RDS_RESERVED_INSTANCES: "RdsReservedInstances",
405
- REDSHIFT_RESERVED_INSTANCES: "RedshiftReservedInstances",
406
- SAGE_MAKER_SAVINGS_PLANS: "SageMakerSavingsPlans"
407
- };
408
- var ImplementationEffort = {
409
- HIGH: "High",
410
- LOW: "Low",
411
- MEDIUM: "Medium",
412
- VERY_HIGH: "VeryHigh",
413
- VERY_LOW: "VeryLow"
414
- };
415
- var Source = {
416
- COMPUTE_OPTIMIZER: "ComputeOptimizer",
417
- COST_EXPLORER: "CostExplorer"
418
- };
419
- var ResourceNotFoundException = class _ResourceNotFoundException extends CostOptimizationHubServiceException {
420
- static {
421
- __name(this, "ResourceNotFoundException");
422
- }
423
- name = "ResourceNotFoundException";
424
- $fault = "client";
425
- /**
426
- * <p>The identifier of the resource that was not found.</p>
427
- * @public
428
- */
429
- resourceId;
430
- /**
431
- * @internal
432
- */
433
- constructor(opts) {
434
- super({
435
- name: "ResourceNotFoundException",
436
- $fault: "client",
437
- ...opts
438
- });
439
- Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
440
- this.resourceId = opts.resourceId;
441
- }
146
+ const AllocationStrategy = {
147
+ LOWEST_PRICE: "LowestPrice",
148
+ PRIORITIZED: "Prioritized",
442
149
  };
443
- var Order = {
444
- ASC: "Asc",
445
- DESC: "Desc"
150
+ const MemberAccountDiscountVisibility = {
151
+ ALL: "All",
152
+ NONE: "None",
446
153
  };
447
- var SummaryMetrics = {
448
- SAVINGS_PERCENTAGE: "SavingsPercentage"
154
+ const PaymentOption = {
155
+ ALL_UPFRONT: "AllUpfront",
156
+ NO_UPFRONT: "NoUpfront",
157
+ PARTIAL_UPFRONT: "PartialUpfront",
449
158
  };
450
-
451
- // src/protocols/Aws_json1_0.ts
452
- var se_GetPreferencesCommand = /* @__PURE__ */ __name(async (input, context) => {
453
- const headers = sharedHeaders("GetPreferences");
454
- let body;
455
- body = JSON.stringify((0, import_smithy_client._json)(input));
456
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
457
- }, "se_GetPreferencesCommand");
458
- var se_GetRecommendationCommand = /* @__PURE__ */ __name(async (input, context) => {
459
- const headers = sharedHeaders("GetRecommendation");
460
- let body;
461
- body = JSON.stringify((0, import_smithy_client._json)(input));
462
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
463
- }, "se_GetRecommendationCommand");
464
- var se_ListEnrollmentStatusesCommand = /* @__PURE__ */ __name(async (input, context) => {
465
- const headers = sharedHeaders("ListEnrollmentStatuses");
466
- let body;
467
- body = JSON.stringify((0, import_smithy_client._json)(input));
468
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
469
- }, "se_ListEnrollmentStatusesCommand");
470
- var se_ListRecommendationsCommand = /* @__PURE__ */ __name(async (input, context) => {
471
- const headers = sharedHeaders("ListRecommendations");
472
- let body;
473
- body = JSON.stringify((0, import_smithy_client._json)(input));
474
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
475
- }, "se_ListRecommendationsCommand");
476
- var se_ListRecommendationSummariesCommand = /* @__PURE__ */ __name(async (input, context) => {
477
- const headers = sharedHeaders("ListRecommendationSummaries");
478
- let body;
479
- body = JSON.stringify((0, import_smithy_client._json)(input));
480
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
481
- }, "se_ListRecommendationSummariesCommand");
482
- var se_UpdateEnrollmentStatusCommand = /* @__PURE__ */ __name(async (input, context) => {
483
- const headers = sharedHeaders("UpdateEnrollmentStatus");
484
- let body;
485
- body = JSON.stringify((0, import_smithy_client._json)(input));
486
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
487
- }, "se_UpdateEnrollmentStatusCommand");
488
- var se_UpdatePreferencesCommand = /* @__PURE__ */ __name(async (input, context) => {
489
- const headers = sharedHeaders("UpdatePreferences");
490
- let body;
491
- body = JSON.stringify((0, import_smithy_client._json)(input));
492
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
493
- }, "se_UpdatePreferencesCommand");
494
- var de_GetPreferencesCommand = /* @__PURE__ */ __name(async (output, context) => {
495
- if (output.statusCode >= 300) {
496
- return de_CommandError(output, context);
497
- }
498
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
499
- let contents = {};
500
- contents = (0, import_smithy_client._json)(data);
501
- const response = {
502
- $metadata: deserializeMetadata(output),
503
- ...contents
504
- };
505
- return response;
506
- }, "de_GetPreferencesCommand");
507
- var de_GetRecommendationCommand = /* @__PURE__ */ __name(async (output, context) => {
508
- if (output.statusCode >= 300) {
509
- return de_CommandError(output, context);
510
- }
511
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
512
- let contents = {};
513
- contents = de_GetRecommendationResponse(data, context);
514
- const response = {
515
- $metadata: deserializeMetadata(output),
516
- ...contents
517
- };
518
- return response;
519
- }, "de_GetRecommendationCommand");
520
- var de_ListEnrollmentStatusesCommand = /* @__PURE__ */ __name(async (output, context) => {
521
- if (output.statusCode >= 300) {
522
- return de_CommandError(output, context);
523
- }
524
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
525
- let contents = {};
526
- contents = de_ListEnrollmentStatusesResponse(data, context);
527
- const response = {
528
- $metadata: deserializeMetadata(output),
529
- ...contents
530
- };
531
- return response;
532
- }, "de_ListEnrollmentStatusesCommand");
533
- var de_ListRecommendationsCommand = /* @__PURE__ */ __name(async (output, context) => {
534
- if (output.statusCode >= 300) {
535
- return de_CommandError(output, context);
536
- }
537
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
538
- let contents = {};
539
- contents = de_ListRecommendationsResponse(data, context);
540
- const response = {
541
- $metadata: deserializeMetadata(output),
542
- ...contents
543
- };
544
- return response;
545
- }, "de_ListRecommendationsCommand");
546
- var de_ListRecommendationSummariesCommand = /* @__PURE__ */ __name(async (output, context) => {
547
- if (output.statusCode >= 300) {
548
- return de_CommandError(output, context);
549
- }
550
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
551
- let contents = {};
552
- contents = de_ListRecommendationSummariesResponse(data, context);
553
- const response = {
554
- $metadata: deserializeMetadata(output),
555
- ...contents
556
- };
557
- return response;
558
- }, "de_ListRecommendationSummariesCommand");
559
- var de_UpdateEnrollmentStatusCommand = /* @__PURE__ */ __name(async (output, context) => {
560
- if (output.statusCode >= 300) {
561
- return de_CommandError(output, context);
562
- }
563
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
564
- let contents = {};
565
- contents = (0, import_smithy_client._json)(data);
566
- const response = {
567
- $metadata: deserializeMetadata(output),
568
- ...contents
569
- };
570
- return response;
571
- }, "de_UpdateEnrollmentStatusCommand");
572
- var de_UpdatePreferencesCommand = /* @__PURE__ */ __name(async (output, context) => {
573
- if (output.statusCode >= 300) {
574
- return de_CommandError(output, context);
575
- }
576
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
577
- let contents = {};
578
- contents = (0, import_smithy_client._json)(data);
579
- const response = {
580
- $metadata: deserializeMetadata(output),
581
- ...contents
582
- };
583
- return response;
584
- }, "de_UpdatePreferencesCommand");
585
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
586
- const parsedOutput = {
587
- ...output,
588
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
589
- };
590
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
591
- switch (errorCode) {
592
- case "AccessDeniedException":
593
- case "com.amazonaws.costoptimizationhub#AccessDeniedException":
594
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
595
- case "InternalServerException":
596
- case "com.amazonaws.costoptimizationhub#InternalServerException":
597
- throw await de_InternalServerExceptionRes(parsedOutput, context);
598
- case "ThrottlingException":
599
- case "com.amazonaws.costoptimizationhub#ThrottlingException":
600
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
601
- case "ValidationException":
602
- case "com.amazonaws.costoptimizationhub#ValidationException":
603
- throw await de_ValidationExceptionRes(parsedOutput, context);
604
- case "ResourceNotFoundException":
605
- case "com.amazonaws.costoptimizationhub#ResourceNotFoundException":
606
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
607
- default:
608
- const parsedBody = parsedOutput.body;
609
- return throwDefaultError({
610
- output,
611
- parsedBody,
612
- errorCode
613
- });
614
- }
615
- }, "de_CommandError");
616
- var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
617
- const body = parsedOutput.body;
618
- const deserialized = (0, import_smithy_client._json)(body);
619
- const exception = new AccessDeniedException({
620
- $metadata: deserializeMetadata(parsedOutput),
621
- ...deserialized
622
- });
623
- return (0, import_smithy_client.decorateServiceException)(exception, body);
624
- }, "de_AccessDeniedExceptionRes");
625
- var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
626
- const body = parsedOutput.body;
627
- const deserialized = (0, import_smithy_client._json)(body);
628
- const exception = new InternalServerException({
629
- $metadata: deserializeMetadata(parsedOutput),
630
- ...deserialized
631
- });
632
- return (0, import_smithy_client.decorateServiceException)(exception, body);
633
- }, "de_InternalServerExceptionRes");
634
- var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
635
- const body = parsedOutput.body;
636
- const deserialized = (0, import_smithy_client._json)(body);
637
- const exception = new ResourceNotFoundException({
638
- $metadata: deserializeMetadata(parsedOutput),
639
- ...deserialized
640
- });
641
- return (0, import_smithy_client.decorateServiceException)(exception, body);
642
- }, "de_ResourceNotFoundExceptionRes");
643
- var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
644
- const body = parsedOutput.body;
645
- const deserialized = (0, import_smithy_client._json)(body);
646
- const exception = new ThrottlingException({
647
- $metadata: deserializeMetadata(parsedOutput),
648
- ...deserialized
649
- });
650
- return (0, import_smithy_client.decorateServiceException)(exception, body);
651
- }, "de_ThrottlingExceptionRes");
652
- var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
653
- const body = parsedOutput.body;
654
- const deserialized = (0, import_smithy_client._json)(body);
655
- const exception = new ValidationException({
656
- $metadata: deserializeMetadata(parsedOutput),
657
- ...deserialized
658
- });
659
- return (0, import_smithy_client.decorateServiceException)(exception, body);
660
- }, "de_ValidationExceptionRes");
661
- var de_AccountEnrollmentStatus = /* @__PURE__ */ __name((output, context) => {
662
- return (0, import_smithy_client.take)(output, {
663
- accountId: import_smithy_client.expectString,
664
- createdTimestamp: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), "createdTimestamp"),
665
- lastUpdatedTimestamp: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), "lastUpdatedTimestamp"),
666
- status: import_smithy_client.expectString
667
- });
668
- }, "de_AccountEnrollmentStatus");
669
- var de_AccountEnrollmentStatuses = /* @__PURE__ */ __name((output, context) => {
670
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
671
- return de_AccountEnrollmentStatus(entry, context);
672
- });
673
- return retVal;
674
- }, "de_AccountEnrollmentStatuses");
675
- var de_AuroraDbClusterStorage = /* @__PURE__ */ __name((output, context) => {
676
- return (0, import_smithy_client.take)(output, {
677
- configuration: import_smithy_client._json,
678
- costCalculation: /* @__PURE__ */ __name((_) => de_ResourceCostCalculation(_, context), "costCalculation")
679
- });
680
- }, "de_AuroraDbClusterStorage");
681
- var de_BlockStoragePerformanceConfiguration = /* @__PURE__ */ __name((output, context) => {
682
- return (0, import_smithy_client.take)(output, {
683
- iops: import_smithy_client.limitedParseDouble,
684
- throughput: import_smithy_client.limitedParseDouble
685
- });
686
- }, "de_BlockStoragePerformanceConfiguration");
687
- var de_ComputeConfiguration = /* @__PURE__ */ __name((output, context) => {
688
- return (0, import_smithy_client.take)(output, {
689
- architecture: import_smithy_client.expectString,
690
- memorySizeInMB: import_smithy_client.expectInt32,
691
- platform: import_smithy_client.expectString,
692
- vCpu: import_smithy_client.limitedParseDouble
693
- });
694
- }, "de_ComputeConfiguration");
695
- var de_ComputeSavingsPlans = /* @__PURE__ */ __name((output, context) => {
696
- return (0, import_smithy_client.take)(output, {
697
- configuration: import_smithy_client._json,
698
- costCalculation: /* @__PURE__ */ __name((_) => de_SavingsPlansCostCalculation(_, context), "costCalculation")
699
- });
700
- }, "de_ComputeSavingsPlans");
701
- var de_DynamoDbReservedCapacity = /* @__PURE__ */ __name((output, context) => {
702
- return (0, import_smithy_client.take)(output, {
703
- configuration: import_smithy_client._json,
704
- costCalculation: /* @__PURE__ */ __name((_) => de_ReservedInstancesCostCalculation(_, context), "costCalculation")
705
- });
706
- }, "de_DynamoDbReservedCapacity");
707
- var de_EbsVolume = /* @__PURE__ */ __name((output, context) => {
708
- return (0, import_smithy_client.take)(output, {
709
- configuration: /* @__PURE__ */ __name((_) => de_EbsVolumeConfiguration(_, context), "configuration"),
710
- costCalculation: /* @__PURE__ */ __name((_) => de_ResourceCostCalculation(_, context), "costCalculation")
711
- });
712
- }, "de_EbsVolume");
713
- var de_EbsVolumeConfiguration = /* @__PURE__ */ __name((output, context) => {
714
- return (0, import_smithy_client.take)(output, {
715
- attachmentState: import_smithy_client.expectString,
716
- performance: /* @__PURE__ */ __name((_) => de_BlockStoragePerformanceConfiguration(_, context), "performance"),
717
- storage: /* @__PURE__ */ __name((_) => de_StorageConfiguration(_, context), "storage")
718
- });
719
- }, "de_EbsVolumeConfiguration");
720
- var de_Ec2AutoScalingGroup = /* @__PURE__ */ __name((output, context) => {
721
- return (0, import_smithy_client.take)(output, {
722
- configuration: import_smithy_client._json,
723
- costCalculation: /* @__PURE__ */ __name((_) => de_ResourceCostCalculation(_, context), "costCalculation")
724
- });
725
- }, "de_Ec2AutoScalingGroup");
726
- var de_Ec2Instance = /* @__PURE__ */ __name((output, context) => {
727
- return (0, import_smithy_client.take)(output, {
728
- configuration: import_smithy_client._json,
729
- costCalculation: /* @__PURE__ */ __name((_) => de_ResourceCostCalculation(_, context), "costCalculation")
730
- });
731
- }, "de_Ec2Instance");
732
- var de_Ec2InstanceSavingsPlans = /* @__PURE__ */ __name((output, context) => {
733
- return (0, import_smithy_client.take)(output, {
734
- configuration: import_smithy_client._json,
735
- costCalculation: /* @__PURE__ */ __name((_) => de_SavingsPlansCostCalculation(_, context), "costCalculation")
736
- });
737
- }, "de_Ec2InstanceSavingsPlans");
738
- var de_Ec2ReservedInstances = /* @__PURE__ */ __name((output, context) => {
739
- return (0, import_smithy_client.take)(output, {
740
- configuration: import_smithy_client._json,
741
- costCalculation: /* @__PURE__ */ __name((_) => de_ReservedInstancesCostCalculation(_, context), "costCalculation")
742
- });
743
- }, "de_Ec2ReservedInstances");
744
- var de_EcsService = /* @__PURE__ */ __name((output, context) => {
745
- return (0, import_smithy_client.take)(output, {
746
- configuration: /* @__PURE__ */ __name((_) => de_EcsServiceConfiguration(_, context), "configuration"),
747
- costCalculation: /* @__PURE__ */ __name((_) => de_ResourceCostCalculation(_, context), "costCalculation")
748
- });
749
- }, "de_EcsService");
750
- var de_EcsServiceConfiguration = /* @__PURE__ */ __name((output, context) => {
751
- return (0, import_smithy_client.take)(output, {
752
- compute: /* @__PURE__ */ __name((_) => de_ComputeConfiguration(_, context), "compute")
753
- });
754
- }, "de_EcsServiceConfiguration");
755
- var de_ElastiCacheReservedInstances = /* @__PURE__ */ __name((output, context) => {
756
- return (0, import_smithy_client.take)(output, {
757
- configuration: import_smithy_client._json,
758
- costCalculation: /* @__PURE__ */ __name((_) => de_ReservedInstancesCostCalculation(_, context), "costCalculation")
759
- });
760
- }, "de_ElastiCacheReservedInstances");
761
- var de_EstimatedDiscounts = /* @__PURE__ */ __name((output, context) => {
762
- return (0, import_smithy_client.take)(output, {
763
- otherDiscount: import_smithy_client.limitedParseDouble,
764
- reservedInstancesDiscount: import_smithy_client.limitedParseDouble,
765
- savingsPlansDiscount: import_smithy_client.limitedParseDouble
766
- });
767
- }, "de_EstimatedDiscounts");
768
- var de_GetRecommendationResponse = /* @__PURE__ */ __name((output, context) => {
769
- return (0, import_smithy_client.take)(output, {
770
- accountId: import_smithy_client.expectString,
771
- actionType: import_smithy_client.expectString,
772
- costCalculationLookbackPeriodInDays: import_smithy_client.expectInt32,
773
- currencyCode: import_smithy_client.expectString,
774
- currentResourceDetails: /* @__PURE__ */ __name((_) => de_ResourceDetails((0, import_core2.awsExpectUnion)(_), context), "currentResourceDetails"),
775
- currentResourceType: import_smithy_client.expectString,
776
- estimatedMonthlyCost: import_smithy_client.limitedParseDouble,
777
- estimatedMonthlySavings: import_smithy_client.limitedParseDouble,
778
- estimatedSavingsOverCostCalculationLookbackPeriod: import_smithy_client.limitedParseDouble,
779
- estimatedSavingsPercentage: import_smithy_client.limitedParseDouble,
780
- implementationEffort: import_smithy_client.expectString,
781
- lastRefreshTimestamp: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), "lastRefreshTimestamp"),
782
- recommendationId: import_smithy_client.expectString,
783
- recommendationLookbackPeriodInDays: import_smithy_client.expectInt32,
784
- recommendedResourceDetails: /* @__PURE__ */ __name((_) => de_ResourceDetails((0, import_core2.awsExpectUnion)(_), context), "recommendedResourceDetails"),
785
- recommendedResourceType: import_smithy_client.expectString,
786
- region: import_smithy_client.expectString,
787
- resourceArn: import_smithy_client.expectString,
788
- resourceId: import_smithy_client.expectString,
789
- restartNeeded: import_smithy_client.expectBoolean,
790
- rollbackPossible: import_smithy_client.expectBoolean,
791
- source: import_smithy_client.expectString,
792
- tags: import_smithy_client._json
793
- });
794
- }, "de_GetRecommendationResponse");
795
- var de_LambdaFunction = /* @__PURE__ */ __name((output, context) => {
796
- return (0, import_smithy_client.take)(output, {
797
- configuration: /* @__PURE__ */ __name((_) => de_LambdaFunctionConfiguration(_, context), "configuration"),
798
- costCalculation: /* @__PURE__ */ __name((_) => de_ResourceCostCalculation(_, context), "costCalculation")
799
- });
800
- }, "de_LambdaFunction");
801
- var de_LambdaFunctionConfiguration = /* @__PURE__ */ __name((output, context) => {
802
- return (0, import_smithy_client.take)(output, {
803
- compute: /* @__PURE__ */ __name((_) => de_ComputeConfiguration(_, context), "compute")
804
- });
805
- }, "de_LambdaFunctionConfiguration");
806
- var de_ListEnrollmentStatusesResponse = /* @__PURE__ */ __name((output, context) => {
807
- return (0, import_smithy_client.take)(output, {
808
- includeMemberAccounts: import_smithy_client.expectBoolean,
809
- items: /* @__PURE__ */ __name((_) => de_AccountEnrollmentStatuses(_, context), "items"),
810
- nextToken: import_smithy_client.expectString
811
- });
812
- }, "de_ListEnrollmentStatusesResponse");
813
- var de_ListRecommendationsResponse = /* @__PURE__ */ __name((output, context) => {
814
- return (0, import_smithy_client.take)(output, {
815
- items: /* @__PURE__ */ __name((_) => de_RecommendationList(_, context), "items"),
816
- nextToken: import_smithy_client.expectString
817
- });
818
- }, "de_ListRecommendationsResponse");
819
- var de_ListRecommendationSummariesResponse = /* @__PURE__ */ __name((output, context) => {
820
- return (0, import_smithy_client.take)(output, {
821
- currencyCode: import_smithy_client.expectString,
822
- estimatedTotalDedupedSavings: import_smithy_client.limitedParseDouble,
823
- groupBy: import_smithy_client.expectString,
824
- items: /* @__PURE__ */ __name((_) => de_RecommendationSummariesList(_, context), "items"),
825
- metrics: import_smithy_client._json,
826
- nextToken: import_smithy_client.expectString
827
- });
828
- }, "de_ListRecommendationSummariesResponse");
829
- var de_MemoryDbReservedInstances = /* @__PURE__ */ __name((output, context) => {
830
- return (0, import_smithy_client.take)(output, {
831
- configuration: import_smithy_client._json,
832
- costCalculation: /* @__PURE__ */ __name((_) => de_ReservedInstancesCostCalculation(_, context), "costCalculation")
833
- });
834
- }, "de_MemoryDbReservedInstances");
835
- var de_OpenSearchReservedInstances = /* @__PURE__ */ __name((output, context) => {
836
- return (0, import_smithy_client.take)(output, {
837
- configuration: import_smithy_client._json,
838
- costCalculation: /* @__PURE__ */ __name((_) => de_ReservedInstancesCostCalculation(_, context), "costCalculation")
839
- });
840
- }, "de_OpenSearchReservedInstances");
841
- var de_RdsDbInstance = /* @__PURE__ */ __name((output, context) => {
842
- return (0, import_smithy_client.take)(output, {
843
- configuration: import_smithy_client._json,
844
- costCalculation: /* @__PURE__ */ __name((_) => de_ResourceCostCalculation(_, context), "costCalculation")
845
- });
846
- }, "de_RdsDbInstance");
847
- var de_RdsDbInstanceStorage = /* @__PURE__ */ __name((output, context) => {
848
- return (0, import_smithy_client.take)(output, {
849
- configuration: /* @__PURE__ */ __name((_) => de_RdsDbInstanceStorageConfiguration(_, context), "configuration"),
850
- costCalculation: /* @__PURE__ */ __name((_) => de_ResourceCostCalculation(_, context), "costCalculation")
851
- });
852
- }, "de_RdsDbInstanceStorage");
853
- var de_RdsDbInstanceStorageConfiguration = /* @__PURE__ */ __name((output, context) => {
854
- return (0, import_smithy_client.take)(output, {
855
- allocatedStorageInGb: import_smithy_client.limitedParseDouble,
856
- iops: import_smithy_client.limitedParseDouble,
857
- storageThroughput: import_smithy_client.limitedParseDouble,
858
- storageType: import_smithy_client.expectString
859
- });
860
- }, "de_RdsDbInstanceStorageConfiguration");
861
- var de_RdsReservedInstances = /* @__PURE__ */ __name((output, context) => {
862
- return (0, import_smithy_client.take)(output, {
863
- configuration: import_smithy_client._json,
864
- costCalculation: /* @__PURE__ */ __name((_) => de_ReservedInstancesCostCalculation(_, context), "costCalculation")
865
- });
866
- }, "de_RdsReservedInstances");
867
- var de_Recommendation = /* @__PURE__ */ __name((output, context) => {
868
- return (0, import_smithy_client.take)(output, {
869
- accountId: import_smithy_client.expectString,
870
- actionType: import_smithy_client.expectString,
871
- currencyCode: import_smithy_client.expectString,
872
- currentResourceSummary: import_smithy_client.expectString,
873
- currentResourceType: import_smithy_client.expectString,
874
- estimatedMonthlyCost: import_smithy_client.limitedParseDouble,
875
- estimatedMonthlySavings: import_smithy_client.limitedParseDouble,
876
- estimatedSavingsPercentage: import_smithy_client.limitedParseDouble,
877
- implementationEffort: import_smithy_client.expectString,
878
- lastRefreshTimestamp: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), "lastRefreshTimestamp"),
879
- recommendationId: import_smithy_client.expectString,
880
- recommendationLookbackPeriodInDays: import_smithy_client.expectInt32,
881
- recommendedResourceSummary: import_smithy_client.expectString,
882
- recommendedResourceType: import_smithy_client.expectString,
883
- region: import_smithy_client.expectString,
884
- resourceArn: import_smithy_client.expectString,
885
- resourceId: import_smithy_client.expectString,
886
- restartNeeded: import_smithy_client.expectBoolean,
887
- rollbackPossible: import_smithy_client.expectBoolean,
888
- source: import_smithy_client.expectString,
889
- tags: import_smithy_client._json
890
- });
891
- }, "de_Recommendation");
892
- var de_RecommendationList = /* @__PURE__ */ __name((output, context) => {
893
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
894
- return de_Recommendation(entry, context);
895
- });
896
- return retVal;
897
- }, "de_RecommendationList");
898
- var de_RecommendationSummariesList = /* @__PURE__ */ __name((output, context) => {
899
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
900
- return de_RecommendationSummary(entry, context);
901
- });
902
- return retVal;
903
- }, "de_RecommendationSummariesList");
904
- var de_RecommendationSummary = /* @__PURE__ */ __name((output, context) => {
905
- return (0, import_smithy_client.take)(output, {
906
- estimatedMonthlySavings: import_smithy_client.limitedParseDouble,
907
- group: import_smithy_client.expectString,
908
- recommendationCount: import_smithy_client.expectInt32
909
- });
910
- }, "de_RecommendationSummary");
911
- var de_RedshiftReservedInstances = /* @__PURE__ */ __name((output, context) => {
912
- return (0, import_smithy_client.take)(output, {
913
- configuration: import_smithy_client._json,
914
- costCalculation: /* @__PURE__ */ __name((_) => de_ReservedInstancesCostCalculation(_, context), "costCalculation")
915
- });
916
- }, "de_RedshiftReservedInstances");
917
- var de_ReservedInstancesCostCalculation = /* @__PURE__ */ __name((output, context) => {
918
- return (0, import_smithy_client.take)(output, {
919
- pricing: /* @__PURE__ */ __name((_) => de_ReservedInstancesPricing(_, context), "pricing")
920
- });
921
- }, "de_ReservedInstancesCostCalculation");
922
- var de_ReservedInstancesPricing = /* @__PURE__ */ __name((output, context) => {
923
- return (0, import_smithy_client.take)(output, {
924
- estimatedMonthlyAmortizedReservationCost: import_smithy_client.limitedParseDouble,
925
- estimatedOnDemandCost: import_smithy_client.limitedParseDouble,
926
- monthlyReservationEligibleCost: import_smithy_client.limitedParseDouble,
927
- savingsPercentage: import_smithy_client.limitedParseDouble
928
- });
929
- }, "de_ReservedInstancesPricing");
930
- var de_ResourceCostCalculation = /* @__PURE__ */ __name((output, context) => {
931
- return (0, import_smithy_client.take)(output, {
932
- pricing: /* @__PURE__ */ __name((_) => de_ResourcePricing(_, context), "pricing"),
933
- usages: /* @__PURE__ */ __name((_) => de_UsageList(_, context), "usages")
934
- });
935
- }, "de_ResourceCostCalculation");
936
- var de_ResourceDetails = /* @__PURE__ */ __name((output, context) => {
937
- if (output.auroraDbClusterStorage != null) {
938
- return {
939
- auroraDbClusterStorage: de_AuroraDbClusterStorage(output.auroraDbClusterStorage, context)
940
- };
941
- }
942
- if (output.computeSavingsPlans != null) {
943
- return {
944
- computeSavingsPlans: de_ComputeSavingsPlans(output.computeSavingsPlans, context)
945
- };
946
- }
947
- if (output.dynamoDbReservedCapacity != null) {
948
- return {
949
- dynamoDbReservedCapacity: de_DynamoDbReservedCapacity(output.dynamoDbReservedCapacity, context)
950
- };
951
- }
952
- if (output.ebsVolume != null) {
953
- return {
954
- ebsVolume: de_EbsVolume(output.ebsVolume, context)
955
- };
956
- }
957
- if (output.ec2AutoScalingGroup != null) {
958
- return {
959
- ec2AutoScalingGroup: de_Ec2AutoScalingGroup(output.ec2AutoScalingGroup, context)
960
- };
961
- }
962
- if (output.ec2Instance != null) {
963
- return {
964
- ec2Instance: de_Ec2Instance(output.ec2Instance, context)
965
- };
966
- }
967
- if (output.ec2InstanceSavingsPlans != null) {
968
- return {
969
- ec2InstanceSavingsPlans: de_Ec2InstanceSavingsPlans(output.ec2InstanceSavingsPlans, context)
970
- };
971
- }
972
- if (output.ec2ReservedInstances != null) {
973
- return {
974
- ec2ReservedInstances: de_Ec2ReservedInstances(output.ec2ReservedInstances, context)
975
- };
976
- }
977
- if (output.ecsService != null) {
978
- return {
979
- ecsService: de_EcsService(output.ecsService, context)
980
- };
981
- }
982
- if (output.elastiCacheReservedInstances != null) {
983
- return {
984
- elastiCacheReservedInstances: de_ElastiCacheReservedInstances(output.elastiCacheReservedInstances, context)
159
+ const Term = {
160
+ ONE_YEAR: "OneYear",
161
+ THREE_YEARS: "ThreeYears",
162
+ };
163
+ const SavingsEstimationMode = {
164
+ AFTER_DISCOUNTS: "AfterDiscounts",
165
+ BEFORE_DISCOUNTS: "BeforeDiscounts",
166
+ };
167
+ class InternalServerException extends CostOptimizationHubServiceException {
168
+ name = "InternalServerException";
169
+ $fault = "server";
170
+ constructor(opts) {
171
+ super({
172
+ name: "InternalServerException",
173
+ $fault: "server",
174
+ ...opts,
175
+ });
176
+ Object.setPrototypeOf(this, InternalServerException.prototype);
177
+ }
178
+ }
179
+ class ThrottlingException extends CostOptimizationHubServiceException {
180
+ name = "ThrottlingException";
181
+ $fault = "client";
182
+ constructor(opts) {
183
+ super({
184
+ name: "ThrottlingException",
185
+ $fault: "client",
186
+ ...opts,
187
+ });
188
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
189
+ }
190
+ }
191
+ const ValidationExceptionReason = {
192
+ FIELD_VALIDATION_FAILED: "FieldValidationFailed",
193
+ OTHER: "Other",
194
+ };
195
+ class ValidationException extends CostOptimizationHubServiceException {
196
+ name = "ValidationException";
197
+ $fault = "client";
198
+ reason;
199
+ fields;
200
+ constructor(opts) {
201
+ super({
202
+ name: "ValidationException",
203
+ $fault: "client",
204
+ ...opts,
205
+ });
206
+ Object.setPrototypeOf(this, ValidationException.prototype);
207
+ this.reason = opts.reason;
208
+ this.fields = opts.fields;
209
+ }
210
+ }
211
+ const Ec2AutoScalingGroupType = {
212
+ MIXED_INSTANCE_TYPES: "MixedInstanceTypes",
213
+ SINGLE_INSTANCE_TYPE: "SingleInstanceType",
214
+ };
215
+ exports.ResourceDetails = void 0;
216
+ (function (ResourceDetails) {
217
+ ResourceDetails.visit = (value, visitor) => {
218
+ if (value.lambdaFunction !== undefined)
219
+ return visitor.lambdaFunction(value.lambdaFunction);
220
+ if (value.ecsService !== undefined)
221
+ return visitor.ecsService(value.ecsService);
222
+ if (value.ec2Instance !== undefined)
223
+ return visitor.ec2Instance(value.ec2Instance);
224
+ if (value.ebsVolume !== undefined)
225
+ return visitor.ebsVolume(value.ebsVolume);
226
+ if (value.ec2AutoScalingGroup !== undefined)
227
+ return visitor.ec2AutoScalingGroup(value.ec2AutoScalingGroup);
228
+ if (value.ec2ReservedInstances !== undefined)
229
+ return visitor.ec2ReservedInstances(value.ec2ReservedInstances);
230
+ if (value.rdsReservedInstances !== undefined)
231
+ return visitor.rdsReservedInstances(value.rdsReservedInstances);
232
+ if (value.elastiCacheReservedInstances !== undefined)
233
+ return visitor.elastiCacheReservedInstances(value.elastiCacheReservedInstances);
234
+ if (value.openSearchReservedInstances !== undefined)
235
+ return visitor.openSearchReservedInstances(value.openSearchReservedInstances);
236
+ if (value.redshiftReservedInstances !== undefined)
237
+ return visitor.redshiftReservedInstances(value.redshiftReservedInstances);
238
+ if (value.ec2InstanceSavingsPlans !== undefined)
239
+ return visitor.ec2InstanceSavingsPlans(value.ec2InstanceSavingsPlans);
240
+ if (value.computeSavingsPlans !== undefined)
241
+ return visitor.computeSavingsPlans(value.computeSavingsPlans);
242
+ if (value.sageMakerSavingsPlans !== undefined)
243
+ return visitor.sageMakerSavingsPlans(value.sageMakerSavingsPlans);
244
+ if (value.rdsDbInstance !== undefined)
245
+ return visitor.rdsDbInstance(value.rdsDbInstance);
246
+ if (value.rdsDbInstanceStorage !== undefined)
247
+ return visitor.rdsDbInstanceStorage(value.rdsDbInstanceStorage);
248
+ if (value.auroraDbClusterStorage !== undefined)
249
+ return visitor.auroraDbClusterStorage(value.auroraDbClusterStorage);
250
+ if (value.dynamoDbReservedCapacity !== undefined)
251
+ return visitor.dynamoDbReservedCapacity(value.dynamoDbReservedCapacity);
252
+ if (value.memoryDbReservedInstances !== undefined)
253
+ return visitor.memoryDbReservedInstances(value.memoryDbReservedInstances);
254
+ return visitor._(value.$unknown[0], value.$unknown[1]);
985
255
  };
986
- }
987
- if (output.lambdaFunction != null) {
988
- return {
989
- lambdaFunction: de_LambdaFunction(output.lambdaFunction, context)
256
+ })(exports.ResourceDetails || (exports.ResourceDetails = {}));
257
+ const ResourceType = {
258
+ AURORA_DB_CLUSTER_STORAGE: "AuroraDbClusterStorage",
259
+ COMPUTE_SAVINGS_PLANS: "ComputeSavingsPlans",
260
+ DYNAMO_DB_RESERVED_CAPACITY: "DynamoDbReservedCapacity",
261
+ EBS_VOLUME: "EbsVolume",
262
+ EC2_AUTO_SCALING_GROUP: "Ec2AutoScalingGroup",
263
+ EC2_INSTANCE: "Ec2Instance",
264
+ EC2_INSTANCE_SAVINGS_PLANS: "Ec2InstanceSavingsPlans",
265
+ EC2_RESERVED_INSTANCES: "Ec2ReservedInstances",
266
+ ECS_SERVICE: "EcsService",
267
+ ELASTI_CACHE_RESERVED_INSTANCES: "ElastiCacheReservedInstances",
268
+ LAMBDA_FUNCTION: "LambdaFunction",
269
+ MEMORY_DB_RESERVED_INSTANCES: "MemoryDbReservedInstances",
270
+ OPEN_SEARCH_RESERVED_INSTANCES: "OpenSearchReservedInstances",
271
+ RDS_DB_INSTANCE: "RdsDbInstance",
272
+ RDS_DB_INSTANCE_STORAGE: "RdsDbInstanceStorage",
273
+ RDS_RESERVED_INSTANCES: "RdsReservedInstances",
274
+ REDSHIFT_RESERVED_INSTANCES: "RedshiftReservedInstances",
275
+ SAGE_MAKER_SAVINGS_PLANS: "SageMakerSavingsPlans",
276
+ };
277
+ const ImplementationEffort = {
278
+ HIGH: "High",
279
+ LOW: "Low",
280
+ MEDIUM: "Medium",
281
+ VERY_HIGH: "VeryHigh",
282
+ VERY_LOW: "VeryLow",
283
+ };
284
+ const Source = {
285
+ COMPUTE_OPTIMIZER: "ComputeOptimizer",
286
+ COST_EXPLORER: "CostExplorer",
287
+ };
288
+ class ResourceNotFoundException extends CostOptimizationHubServiceException {
289
+ name = "ResourceNotFoundException";
290
+ $fault = "client";
291
+ resourceId;
292
+ constructor(opts) {
293
+ super({
294
+ name: "ResourceNotFoundException",
295
+ $fault: "client",
296
+ ...opts,
297
+ });
298
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
299
+ this.resourceId = opts.resourceId;
300
+ }
301
+ }
302
+ const Order = {
303
+ ASC: "Asc",
304
+ DESC: "Desc",
305
+ };
306
+ const SummaryMetrics = {
307
+ SAVINGS_PERCENTAGE: "SavingsPercentage",
308
+ };
309
+
310
+ const se_GetPreferencesCommand = async (input, context) => {
311
+ const headers = sharedHeaders("GetPreferences");
312
+ let body;
313
+ body = JSON.stringify(smithyClient._json(input));
314
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
315
+ };
316
+ const se_GetRecommendationCommand = async (input, context) => {
317
+ const headers = sharedHeaders("GetRecommendation");
318
+ let body;
319
+ body = JSON.stringify(smithyClient._json(input));
320
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
321
+ };
322
+ const se_ListEnrollmentStatusesCommand = async (input, context) => {
323
+ const headers = sharedHeaders("ListEnrollmentStatuses");
324
+ let body;
325
+ body = JSON.stringify(smithyClient._json(input));
326
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
327
+ };
328
+ const se_ListRecommendationsCommand = async (input, context) => {
329
+ const headers = sharedHeaders("ListRecommendations");
330
+ let body;
331
+ body = JSON.stringify(smithyClient._json(input));
332
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
333
+ };
334
+ const se_ListRecommendationSummariesCommand = async (input, context) => {
335
+ const headers = sharedHeaders("ListRecommendationSummaries");
336
+ let body;
337
+ body = JSON.stringify(smithyClient._json(input));
338
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
339
+ };
340
+ const se_UpdateEnrollmentStatusCommand = async (input, context) => {
341
+ const headers = sharedHeaders("UpdateEnrollmentStatus");
342
+ let body;
343
+ body = JSON.stringify(smithyClient._json(input));
344
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
345
+ };
346
+ const se_UpdatePreferencesCommand = async (input, context) => {
347
+ const headers = sharedHeaders("UpdatePreferences");
348
+ let body;
349
+ body = JSON.stringify(smithyClient._json(input));
350
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
351
+ };
352
+ const de_GetPreferencesCommand = async (output, context) => {
353
+ if (output.statusCode >= 300) {
354
+ return de_CommandError(output, context);
355
+ }
356
+ const data = await core$1.parseJsonBody(output.body, context);
357
+ let contents = {};
358
+ contents = smithyClient._json(data);
359
+ const response = {
360
+ $metadata: deserializeMetadata(output),
361
+ ...contents,
990
362
  };
991
- }
992
- if (output.memoryDbReservedInstances != null) {
993
- return {
994
- memoryDbReservedInstances: de_MemoryDbReservedInstances(output.memoryDbReservedInstances, context)
363
+ return response;
364
+ };
365
+ const de_GetRecommendationCommand = async (output, context) => {
366
+ if (output.statusCode >= 300) {
367
+ return de_CommandError(output, context);
368
+ }
369
+ const data = await core$1.parseJsonBody(output.body, context);
370
+ let contents = {};
371
+ contents = de_GetRecommendationResponse(data);
372
+ const response = {
373
+ $metadata: deserializeMetadata(output),
374
+ ...contents,
995
375
  };
996
- }
997
- if (output.openSearchReservedInstances != null) {
998
- return {
999
- openSearchReservedInstances: de_OpenSearchReservedInstances(output.openSearchReservedInstances, context)
376
+ return response;
377
+ };
378
+ const de_ListEnrollmentStatusesCommand = async (output, context) => {
379
+ if (output.statusCode >= 300) {
380
+ return de_CommandError(output, context);
381
+ }
382
+ const data = await core$1.parseJsonBody(output.body, context);
383
+ let contents = {};
384
+ contents = de_ListEnrollmentStatusesResponse(data);
385
+ const response = {
386
+ $metadata: deserializeMetadata(output),
387
+ ...contents,
1000
388
  };
1001
- }
1002
- if (output.rdsDbInstance != null) {
1003
- return {
1004
- rdsDbInstance: de_RdsDbInstance(output.rdsDbInstance, context)
389
+ return response;
390
+ };
391
+ const de_ListRecommendationsCommand = async (output, context) => {
392
+ if (output.statusCode >= 300) {
393
+ return de_CommandError(output, context);
394
+ }
395
+ const data = await core$1.parseJsonBody(output.body, context);
396
+ let contents = {};
397
+ contents = de_ListRecommendationsResponse(data);
398
+ const response = {
399
+ $metadata: deserializeMetadata(output),
400
+ ...contents,
1005
401
  };
1006
- }
1007
- if (output.rdsDbInstanceStorage != null) {
1008
- return {
1009
- rdsDbInstanceStorage: de_RdsDbInstanceStorage(output.rdsDbInstanceStorage, context)
402
+ return response;
403
+ };
404
+ const de_ListRecommendationSummariesCommand = async (output, context) => {
405
+ if (output.statusCode >= 300) {
406
+ return de_CommandError(output, context);
407
+ }
408
+ const data = await core$1.parseJsonBody(output.body, context);
409
+ let contents = {};
410
+ contents = de_ListRecommendationSummariesResponse(data);
411
+ const response = {
412
+ $metadata: deserializeMetadata(output),
413
+ ...contents,
1010
414
  };
1011
- }
1012
- if (output.rdsReservedInstances != null) {
1013
- return {
1014
- rdsReservedInstances: de_RdsReservedInstances(output.rdsReservedInstances, context)
415
+ return response;
416
+ };
417
+ const de_UpdateEnrollmentStatusCommand = async (output, context) => {
418
+ if (output.statusCode >= 300) {
419
+ return de_CommandError(output, context);
420
+ }
421
+ const data = await core$1.parseJsonBody(output.body, context);
422
+ let contents = {};
423
+ contents = smithyClient._json(data);
424
+ const response = {
425
+ $metadata: deserializeMetadata(output),
426
+ ...contents,
1015
427
  };
1016
- }
1017
- if (output.redshiftReservedInstances != null) {
1018
- return {
1019
- redshiftReservedInstances: de_RedshiftReservedInstances(output.redshiftReservedInstances, context)
428
+ return response;
429
+ };
430
+ const de_UpdatePreferencesCommand = async (output, context) => {
431
+ if (output.statusCode >= 300) {
432
+ return de_CommandError(output, context);
433
+ }
434
+ const data = await core$1.parseJsonBody(output.body, context);
435
+ let contents = {};
436
+ contents = smithyClient._json(data);
437
+ const response = {
438
+ $metadata: deserializeMetadata(output),
439
+ ...contents,
1020
440
  };
1021
- }
1022
- if (output.sageMakerSavingsPlans != null) {
1023
- return {
1024
- sageMakerSavingsPlans: de_SageMakerSavingsPlans(output.sageMakerSavingsPlans, context)
441
+ return response;
442
+ };
443
+ const de_CommandError = async (output, context) => {
444
+ const parsedOutput = {
445
+ ...output,
446
+ body: await core$1.parseJsonErrorBody(output.body, context),
1025
447
  };
1026
- }
1027
- return { $unknown: Object.entries(output)[0] };
1028
- }, "de_ResourceDetails");
1029
- var de_ResourcePricing = /* @__PURE__ */ __name((output, context) => {
1030
- return (0, import_smithy_client.take)(output, {
1031
- estimatedCostAfterDiscounts: import_smithy_client.limitedParseDouble,
1032
- estimatedCostBeforeDiscounts: import_smithy_client.limitedParseDouble,
1033
- estimatedDiscounts: /* @__PURE__ */ __name((_) => de_EstimatedDiscounts(_, context), "estimatedDiscounts"),
1034
- estimatedNetUnusedAmortizedCommitments: import_smithy_client.limitedParseDouble
1035
- });
1036
- }, "de_ResourcePricing");
1037
- var de_SageMakerSavingsPlans = /* @__PURE__ */ __name((output, context) => {
1038
- return (0, import_smithy_client.take)(output, {
1039
- configuration: import_smithy_client._json,
1040
- costCalculation: /* @__PURE__ */ __name((_) => de_SavingsPlansCostCalculation(_, context), "costCalculation")
1041
- });
1042
- }, "de_SageMakerSavingsPlans");
1043
- var de_SavingsPlansCostCalculation = /* @__PURE__ */ __name((output, context) => {
1044
- return (0, import_smithy_client.take)(output, {
1045
- pricing: /* @__PURE__ */ __name((_) => de_SavingsPlansPricing(_, context), "pricing")
1046
- });
1047
- }, "de_SavingsPlansCostCalculation");
1048
- var de_SavingsPlansPricing = /* @__PURE__ */ __name((output, context) => {
1049
- return (0, import_smithy_client.take)(output, {
1050
- estimatedMonthlyCommitment: import_smithy_client.limitedParseDouble,
1051
- estimatedOnDemandCost: import_smithy_client.limitedParseDouble,
1052
- monthlySavingsPlansEligibleCost: import_smithy_client.limitedParseDouble,
1053
- savingsPercentage: import_smithy_client.limitedParseDouble
1054
- });
1055
- }, "de_SavingsPlansPricing");
1056
- var de_StorageConfiguration = /* @__PURE__ */ __name((output, context) => {
1057
- return (0, import_smithy_client.take)(output, {
1058
- sizeInGb: import_smithy_client.limitedParseDouble,
1059
- type: import_smithy_client.expectString
1060
- });
1061
- }, "de_StorageConfiguration");
1062
- var de_Usage = /* @__PURE__ */ __name((output, context) => {
1063
- return (0, import_smithy_client.take)(output, {
1064
- operation: import_smithy_client.expectString,
1065
- productCode: import_smithy_client.expectString,
1066
- unit: import_smithy_client.expectString,
1067
- usageAmount: import_smithy_client.limitedParseDouble,
1068
- usageType: import_smithy_client.expectString
1069
- });
1070
- }, "de_Usage");
1071
- var de_UsageList = /* @__PURE__ */ __name((output, context) => {
1072
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
1073
- return de_Usage(entry, context);
1074
- });
1075
- return retVal;
1076
- }, "de_UsageList");
1077
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1078
- httpStatusCode: output.statusCode,
1079
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1080
- extendedRequestId: output.headers["x-amz-id-2"],
1081
- cfId: output.headers["x-amz-cf-id"]
1082
- }), "deserializeMetadata");
1083
- var throwDefaultError = (0, import_smithy_client.withBaseException)(CostOptimizationHubServiceException);
1084
- var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
1085
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1086
- const contents = {
1087
- protocol,
1088
- hostname,
1089
- port,
1090
- method: "POST",
1091
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1092
- headers
1093
- };
1094
- if (resolvedHostname !== void 0) {
1095
- contents.hostname = resolvedHostname;
1096
- }
1097
- if (body !== void 0) {
1098
- contents.body = body;
1099
- }
1100
- return new import_protocol_http.HttpRequest(contents);
1101
- }, "buildHttpRpcRequest");
1102
- function sharedHeaders(operation) {
1103
- return {
1104
- "content-type": "application/x-amz-json-1.0",
1105
- "x-amz-target": `CostOptimizationHubService.${operation}`
1106
- };
1107
- }
1108
- __name(sharedHeaders, "sharedHeaders");
1109
-
1110
- // src/commands/GetPreferencesCommand.ts
1111
- var GetPreferencesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
1112
- return [
1113
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1114
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1115
- ];
1116
- }).s("CostOptimizationHubService", "GetPreferences", {}).n("CostOptimizationHubClient", "GetPreferencesCommand").f(void 0, void 0).ser(se_GetPreferencesCommand).de(de_GetPreferencesCommand).build() {
1117
- static {
1118
- __name(this, "GetPreferencesCommand");
1119
- }
448
+ const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
449
+ switch (errorCode) {
450
+ case "AccessDeniedException":
451
+ case "com.amazonaws.costoptimizationhub#AccessDeniedException":
452
+ throw await de_AccessDeniedExceptionRes(parsedOutput);
453
+ case "InternalServerException":
454
+ case "com.amazonaws.costoptimizationhub#InternalServerException":
455
+ throw await de_InternalServerExceptionRes(parsedOutput);
456
+ case "ThrottlingException":
457
+ case "com.amazonaws.costoptimizationhub#ThrottlingException":
458
+ throw await de_ThrottlingExceptionRes(parsedOutput);
459
+ case "ValidationException":
460
+ case "com.amazonaws.costoptimizationhub#ValidationException":
461
+ throw await de_ValidationExceptionRes(parsedOutput);
462
+ case "ResourceNotFoundException":
463
+ case "com.amazonaws.costoptimizationhub#ResourceNotFoundException":
464
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput);
465
+ default:
466
+ const parsedBody = parsedOutput.body;
467
+ return throwDefaultError({
468
+ output,
469
+ parsedBody,
470
+ errorCode,
471
+ });
472
+ }
1120
473
  };
1121
-
1122
- // src/commands/GetRecommendationCommand.ts
1123
-
1124
-
1125
-
1126
- var GetRecommendationCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
1127
- return [
1128
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1129
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1130
- ];
1131
- }).s("CostOptimizationHubService", "GetRecommendation", {}).n("CostOptimizationHubClient", "GetRecommendationCommand").f(void 0, void 0).ser(se_GetRecommendationCommand).de(de_GetRecommendationCommand).build() {
1132
- static {
1133
- __name(this, "GetRecommendationCommand");
1134
- }
474
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
475
+ const body = parsedOutput.body;
476
+ const deserialized = smithyClient._json(body);
477
+ const exception = new AccessDeniedException({
478
+ $metadata: deserializeMetadata(parsedOutput),
479
+ ...deserialized,
480
+ });
481
+ return smithyClient.decorateServiceException(exception, body);
1135
482
  };
1136
-
1137
- // src/commands/ListEnrollmentStatusesCommand.ts
1138
-
1139
-
1140
-
1141
- var ListEnrollmentStatusesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
1142
- return [
1143
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1144
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1145
- ];
1146
- }).s("CostOptimizationHubService", "ListEnrollmentStatuses", {}).n("CostOptimizationHubClient", "ListEnrollmentStatusesCommand").f(void 0, void 0).ser(se_ListEnrollmentStatusesCommand).de(de_ListEnrollmentStatusesCommand).build() {
1147
- static {
1148
- __name(this, "ListEnrollmentStatusesCommand");
1149
- }
483
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
484
+ const body = parsedOutput.body;
485
+ const deserialized = smithyClient._json(body);
486
+ const exception = new InternalServerException({
487
+ $metadata: deserializeMetadata(parsedOutput),
488
+ ...deserialized,
489
+ });
490
+ return smithyClient.decorateServiceException(exception, body);
1150
491
  };
1151
-
1152
- // src/commands/ListRecommendationsCommand.ts
1153
-
1154
-
1155
-
1156
- var ListRecommendationsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
1157
- return [
1158
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1159
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1160
- ];
1161
- }).s("CostOptimizationHubService", "ListRecommendations", {}).n("CostOptimizationHubClient", "ListRecommendationsCommand").f(void 0, void 0).ser(se_ListRecommendationsCommand).de(de_ListRecommendationsCommand).build() {
1162
- static {
1163
- __name(this, "ListRecommendationsCommand");
1164
- }
492
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
493
+ const body = parsedOutput.body;
494
+ const deserialized = smithyClient._json(body);
495
+ const exception = new ResourceNotFoundException({
496
+ $metadata: deserializeMetadata(parsedOutput),
497
+ ...deserialized,
498
+ });
499
+ return smithyClient.decorateServiceException(exception, body);
1165
500
  };
1166
-
1167
- // src/commands/ListRecommendationSummariesCommand.ts
1168
-
1169
-
1170
-
1171
- var ListRecommendationSummariesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
1172
- return [
1173
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1174
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1175
- ];
1176
- }).s("CostOptimizationHubService", "ListRecommendationSummaries", {}).n("CostOptimizationHubClient", "ListRecommendationSummariesCommand").f(void 0, void 0).ser(se_ListRecommendationSummariesCommand).de(de_ListRecommendationSummariesCommand).build() {
1177
- static {
1178
- __name(this, "ListRecommendationSummariesCommand");
1179
- }
501
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
502
+ const body = parsedOutput.body;
503
+ const deserialized = smithyClient._json(body);
504
+ const exception = new ThrottlingException({
505
+ $metadata: deserializeMetadata(parsedOutput),
506
+ ...deserialized,
507
+ });
508
+ return smithyClient.decorateServiceException(exception, body);
1180
509
  };
1181
-
1182
- // src/commands/UpdateEnrollmentStatusCommand.ts
1183
-
1184
-
1185
-
1186
- var UpdateEnrollmentStatusCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
1187
- return [
1188
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1189
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1190
- ];
1191
- }).s("CostOptimizationHubService", "UpdateEnrollmentStatus", {}).n("CostOptimizationHubClient", "UpdateEnrollmentStatusCommand").f(void 0, void 0).ser(se_UpdateEnrollmentStatusCommand).de(de_UpdateEnrollmentStatusCommand).build() {
1192
- static {
1193
- __name(this, "UpdateEnrollmentStatusCommand");
1194
- }
510
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
511
+ const body = parsedOutput.body;
512
+ const deserialized = smithyClient._json(body);
513
+ const exception = new ValidationException({
514
+ $metadata: deserializeMetadata(parsedOutput),
515
+ ...deserialized,
516
+ });
517
+ return smithyClient.decorateServiceException(exception, body);
518
+ };
519
+ const de_AccountEnrollmentStatus = (output, context) => {
520
+ return smithyClient.take(output, {
521
+ accountId: smithyClient.expectString,
522
+ createdTimestamp: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
523
+ lastUpdatedTimestamp: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
524
+ status: smithyClient.expectString,
525
+ });
526
+ };
527
+ const de_AccountEnrollmentStatuses = (output, context) => {
528
+ const retVal = (output || [])
529
+ .filter((e) => e != null)
530
+ .map((entry) => {
531
+ return de_AccountEnrollmentStatus(entry);
532
+ });
533
+ return retVal;
534
+ };
535
+ const de_AuroraDbClusterStorage = (output, context) => {
536
+ return smithyClient.take(output, {
537
+ configuration: smithyClient._json,
538
+ costCalculation: (_) => de_ResourceCostCalculation(_),
539
+ });
540
+ };
541
+ const de_BlockStoragePerformanceConfiguration = (output, context) => {
542
+ return smithyClient.take(output, {
543
+ iops: smithyClient.limitedParseDouble,
544
+ throughput: smithyClient.limitedParseDouble,
545
+ });
546
+ };
547
+ const de_ComputeConfiguration = (output, context) => {
548
+ return smithyClient.take(output, {
549
+ architecture: smithyClient.expectString,
550
+ memorySizeInMB: smithyClient.expectInt32,
551
+ platform: smithyClient.expectString,
552
+ vCpu: smithyClient.limitedParseDouble,
553
+ });
554
+ };
555
+ const de_ComputeSavingsPlans = (output, context) => {
556
+ return smithyClient.take(output, {
557
+ configuration: smithyClient._json,
558
+ costCalculation: (_) => de_SavingsPlansCostCalculation(_),
559
+ });
560
+ };
561
+ const de_DynamoDbReservedCapacity = (output, context) => {
562
+ return smithyClient.take(output, {
563
+ configuration: smithyClient._json,
564
+ costCalculation: (_) => de_ReservedInstancesCostCalculation(_),
565
+ });
566
+ };
567
+ const de_EbsVolume = (output, context) => {
568
+ return smithyClient.take(output, {
569
+ configuration: (_) => de_EbsVolumeConfiguration(_),
570
+ costCalculation: (_) => de_ResourceCostCalculation(_),
571
+ });
572
+ };
573
+ const de_EbsVolumeConfiguration = (output, context) => {
574
+ return smithyClient.take(output, {
575
+ attachmentState: smithyClient.expectString,
576
+ performance: (_) => de_BlockStoragePerformanceConfiguration(_),
577
+ storage: (_) => de_StorageConfiguration(_),
578
+ });
579
+ };
580
+ const de_Ec2AutoScalingGroup = (output, context) => {
581
+ return smithyClient.take(output, {
582
+ configuration: smithyClient._json,
583
+ costCalculation: (_) => de_ResourceCostCalculation(_),
584
+ });
585
+ };
586
+ const de_Ec2Instance = (output, context) => {
587
+ return smithyClient.take(output, {
588
+ configuration: smithyClient._json,
589
+ costCalculation: (_) => de_ResourceCostCalculation(_),
590
+ });
591
+ };
592
+ const de_Ec2InstanceSavingsPlans = (output, context) => {
593
+ return smithyClient.take(output, {
594
+ configuration: smithyClient._json,
595
+ costCalculation: (_) => de_SavingsPlansCostCalculation(_),
596
+ });
597
+ };
598
+ const de_Ec2ReservedInstances = (output, context) => {
599
+ return smithyClient.take(output, {
600
+ configuration: smithyClient._json,
601
+ costCalculation: (_) => de_ReservedInstancesCostCalculation(_),
602
+ });
603
+ };
604
+ const de_EcsService = (output, context) => {
605
+ return smithyClient.take(output, {
606
+ configuration: (_) => de_EcsServiceConfiguration(_),
607
+ costCalculation: (_) => de_ResourceCostCalculation(_),
608
+ });
609
+ };
610
+ const de_EcsServiceConfiguration = (output, context) => {
611
+ return smithyClient.take(output, {
612
+ compute: (_) => de_ComputeConfiguration(_),
613
+ });
614
+ };
615
+ const de_ElastiCacheReservedInstances = (output, context) => {
616
+ return smithyClient.take(output, {
617
+ configuration: smithyClient._json,
618
+ costCalculation: (_) => de_ReservedInstancesCostCalculation(_),
619
+ });
620
+ };
621
+ const de_EstimatedDiscounts = (output, context) => {
622
+ return smithyClient.take(output, {
623
+ otherDiscount: smithyClient.limitedParseDouble,
624
+ reservedInstancesDiscount: smithyClient.limitedParseDouble,
625
+ savingsPlansDiscount: smithyClient.limitedParseDouble,
626
+ });
627
+ };
628
+ const de_GetRecommendationResponse = (output, context) => {
629
+ return smithyClient.take(output, {
630
+ accountId: smithyClient.expectString,
631
+ actionType: smithyClient.expectString,
632
+ costCalculationLookbackPeriodInDays: smithyClient.expectInt32,
633
+ currencyCode: smithyClient.expectString,
634
+ currentResourceDetails: (_) => de_ResourceDetails(core$1.awsExpectUnion(_)),
635
+ currentResourceType: smithyClient.expectString,
636
+ estimatedMonthlyCost: smithyClient.limitedParseDouble,
637
+ estimatedMonthlySavings: smithyClient.limitedParseDouble,
638
+ estimatedSavingsOverCostCalculationLookbackPeriod: smithyClient.limitedParseDouble,
639
+ estimatedSavingsPercentage: smithyClient.limitedParseDouble,
640
+ implementationEffort: smithyClient.expectString,
641
+ lastRefreshTimestamp: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
642
+ recommendationId: smithyClient.expectString,
643
+ recommendationLookbackPeriodInDays: smithyClient.expectInt32,
644
+ recommendedResourceDetails: (_) => de_ResourceDetails(core$1.awsExpectUnion(_)),
645
+ recommendedResourceType: smithyClient.expectString,
646
+ region: smithyClient.expectString,
647
+ resourceArn: smithyClient.expectString,
648
+ resourceId: smithyClient.expectString,
649
+ restartNeeded: smithyClient.expectBoolean,
650
+ rollbackPossible: smithyClient.expectBoolean,
651
+ source: smithyClient.expectString,
652
+ tags: smithyClient._json,
653
+ });
654
+ };
655
+ const de_LambdaFunction = (output, context) => {
656
+ return smithyClient.take(output, {
657
+ configuration: (_) => de_LambdaFunctionConfiguration(_),
658
+ costCalculation: (_) => de_ResourceCostCalculation(_),
659
+ });
660
+ };
661
+ const de_LambdaFunctionConfiguration = (output, context) => {
662
+ return smithyClient.take(output, {
663
+ compute: (_) => de_ComputeConfiguration(_),
664
+ });
665
+ };
666
+ const de_ListEnrollmentStatusesResponse = (output, context) => {
667
+ return smithyClient.take(output, {
668
+ includeMemberAccounts: smithyClient.expectBoolean,
669
+ items: (_) => de_AccountEnrollmentStatuses(_),
670
+ nextToken: smithyClient.expectString,
671
+ });
672
+ };
673
+ const de_ListRecommendationsResponse = (output, context) => {
674
+ return smithyClient.take(output, {
675
+ items: (_) => de_RecommendationList(_),
676
+ nextToken: smithyClient.expectString,
677
+ });
678
+ };
679
+ const de_ListRecommendationSummariesResponse = (output, context) => {
680
+ return smithyClient.take(output, {
681
+ currencyCode: smithyClient.expectString,
682
+ estimatedTotalDedupedSavings: smithyClient.limitedParseDouble,
683
+ groupBy: smithyClient.expectString,
684
+ items: (_) => de_RecommendationSummariesList(_),
685
+ metrics: smithyClient._json,
686
+ nextToken: smithyClient.expectString,
687
+ });
688
+ };
689
+ const de_MemoryDbReservedInstances = (output, context) => {
690
+ return smithyClient.take(output, {
691
+ configuration: smithyClient._json,
692
+ costCalculation: (_) => de_ReservedInstancesCostCalculation(_),
693
+ });
694
+ };
695
+ const de_OpenSearchReservedInstances = (output, context) => {
696
+ return smithyClient.take(output, {
697
+ configuration: smithyClient._json,
698
+ costCalculation: (_) => de_ReservedInstancesCostCalculation(_),
699
+ });
700
+ };
701
+ const de_RdsDbInstance = (output, context) => {
702
+ return smithyClient.take(output, {
703
+ configuration: smithyClient._json,
704
+ costCalculation: (_) => de_ResourceCostCalculation(_),
705
+ });
706
+ };
707
+ const de_RdsDbInstanceStorage = (output, context) => {
708
+ return smithyClient.take(output, {
709
+ configuration: (_) => de_RdsDbInstanceStorageConfiguration(_),
710
+ costCalculation: (_) => de_ResourceCostCalculation(_),
711
+ });
712
+ };
713
+ const de_RdsDbInstanceStorageConfiguration = (output, context) => {
714
+ return smithyClient.take(output, {
715
+ allocatedStorageInGb: smithyClient.limitedParseDouble,
716
+ iops: smithyClient.limitedParseDouble,
717
+ storageThroughput: smithyClient.limitedParseDouble,
718
+ storageType: smithyClient.expectString,
719
+ });
720
+ };
721
+ const de_RdsReservedInstances = (output, context) => {
722
+ return smithyClient.take(output, {
723
+ configuration: smithyClient._json,
724
+ costCalculation: (_) => de_ReservedInstancesCostCalculation(_),
725
+ });
726
+ };
727
+ const de_Recommendation = (output, context) => {
728
+ return smithyClient.take(output, {
729
+ accountId: smithyClient.expectString,
730
+ actionType: smithyClient.expectString,
731
+ currencyCode: smithyClient.expectString,
732
+ currentResourceSummary: smithyClient.expectString,
733
+ currentResourceType: smithyClient.expectString,
734
+ estimatedMonthlyCost: smithyClient.limitedParseDouble,
735
+ estimatedMonthlySavings: smithyClient.limitedParseDouble,
736
+ estimatedSavingsPercentage: smithyClient.limitedParseDouble,
737
+ implementationEffort: smithyClient.expectString,
738
+ lastRefreshTimestamp: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
739
+ recommendationId: smithyClient.expectString,
740
+ recommendationLookbackPeriodInDays: smithyClient.expectInt32,
741
+ recommendedResourceSummary: smithyClient.expectString,
742
+ recommendedResourceType: smithyClient.expectString,
743
+ region: smithyClient.expectString,
744
+ resourceArn: smithyClient.expectString,
745
+ resourceId: smithyClient.expectString,
746
+ restartNeeded: smithyClient.expectBoolean,
747
+ rollbackPossible: smithyClient.expectBoolean,
748
+ source: smithyClient.expectString,
749
+ tags: smithyClient._json,
750
+ });
751
+ };
752
+ const de_RecommendationList = (output, context) => {
753
+ const retVal = (output || [])
754
+ .filter((e) => e != null)
755
+ .map((entry) => {
756
+ return de_Recommendation(entry);
757
+ });
758
+ return retVal;
759
+ };
760
+ const de_RecommendationSummariesList = (output, context) => {
761
+ const retVal = (output || [])
762
+ .filter((e) => e != null)
763
+ .map((entry) => {
764
+ return de_RecommendationSummary(entry);
765
+ });
766
+ return retVal;
767
+ };
768
+ const de_RecommendationSummary = (output, context) => {
769
+ return smithyClient.take(output, {
770
+ estimatedMonthlySavings: smithyClient.limitedParseDouble,
771
+ group: smithyClient.expectString,
772
+ recommendationCount: smithyClient.expectInt32,
773
+ });
774
+ };
775
+ const de_RedshiftReservedInstances = (output, context) => {
776
+ return smithyClient.take(output, {
777
+ configuration: smithyClient._json,
778
+ costCalculation: (_) => de_ReservedInstancesCostCalculation(_),
779
+ });
780
+ };
781
+ const de_ReservedInstancesCostCalculation = (output, context) => {
782
+ return smithyClient.take(output, {
783
+ pricing: (_) => de_ReservedInstancesPricing(_),
784
+ });
785
+ };
786
+ const de_ReservedInstancesPricing = (output, context) => {
787
+ return smithyClient.take(output, {
788
+ estimatedMonthlyAmortizedReservationCost: smithyClient.limitedParseDouble,
789
+ estimatedOnDemandCost: smithyClient.limitedParseDouble,
790
+ monthlyReservationEligibleCost: smithyClient.limitedParseDouble,
791
+ savingsPercentage: smithyClient.limitedParseDouble,
792
+ });
793
+ };
794
+ const de_ResourceCostCalculation = (output, context) => {
795
+ return smithyClient.take(output, {
796
+ pricing: (_) => de_ResourcePricing(_),
797
+ usages: (_) => de_UsageList(_),
798
+ });
799
+ };
800
+ const de_ResourceDetails = (output, context) => {
801
+ if (output.auroraDbClusterStorage != null) {
802
+ return {
803
+ auroraDbClusterStorage: de_AuroraDbClusterStorage(output.auroraDbClusterStorage),
804
+ };
805
+ }
806
+ if (output.computeSavingsPlans != null) {
807
+ return {
808
+ computeSavingsPlans: de_ComputeSavingsPlans(output.computeSavingsPlans),
809
+ };
810
+ }
811
+ if (output.dynamoDbReservedCapacity != null) {
812
+ return {
813
+ dynamoDbReservedCapacity: de_DynamoDbReservedCapacity(output.dynamoDbReservedCapacity),
814
+ };
815
+ }
816
+ if (output.ebsVolume != null) {
817
+ return {
818
+ ebsVolume: de_EbsVolume(output.ebsVolume),
819
+ };
820
+ }
821
+ if (output.ec2AutoScalingGroup != null) {
822
+ return {
823
+ ec2AutoScalingGroup: de_Ec2AutoScalingGroup(output.ec2AutoScalingGroup),
824
+ };
825
+ }
826
+ if (output.ec2Instance != null) {
827
+ return {
828
+ ec2Instance: de_Ec2Instance(output.ec2Instance),
829
+ };
830
+ }
831
+ if (output.ec2InstanceSavingsPlans != null) {
832
+ return {
833
+ ec2InstanceSavingsPlans: de_Ec2InstanceSavingsPlans(output.ec2InstanceSavingsPlans),
834
+ };
835
+ }
836
+ if (output.ec2ReservedInstances != null) {
837
+ return {
838
+ ec2ReservedInstances: de_Ec2ReservedInstances(output.ec2ReservedInstances),
839
+ };
840
+ }
841
+ if (output.ecsService != null) {
842
+ return {
843
+ ecsService: de_EcsService(output.ecsService),
844
+ };
845
+ }
846
+ if (output.elastiCacheReservedInstances != null) {
847
+ return {
848
+ elastiCacheReservedInstances: de_ElastiCacheReservedInstances(output.elastiCacheReservedInstances),
849
+ };
850
+ }
851
+ if (output.lambdaFunction != null) {
852
+ return {
853
+ lambdaFunction: de_LambdaFunction(output.lambdaFunction),
854
+ };
855
+ }
856
+ if (output.memoryDbReservedInstances != null) {
857
+ return {
858
+ memoryDbReservedInstances: de_MemoryDbReservedInstances(output.memoryDbReservedInstances),
859
+ };
860
+ }
861
+ if (output.openSearchReservedInstances != null) {
862
+ return {
863
+ openSearchReservedInstances: de_OpenSearchReservedInstances(output.openSearchReservedInstances),
864
+ };
865
+ }
866
+ if (output.rdsDbInstance != null) {
867
+ return {
868
+ rdsDbInstance: de_RdsDbInstance(output.rdsDbInstance),
869
+ };
870
+ }
871
+ if (output.rdsDbInstanceStorage != null) {
872
+ return {
873
+ rdsDbInstanceStorage: de_RdsDbInstanceStorage(output.rdsDbInstanceStorage),
874
+ };
875
+ }
876
+ if (output.rdsReservedInstances != null) {
877
+ return {
878
+ rdsReservedInstances: de_RdsReservedInstances(output.rdsReservedInstances),
879
+ };
880
+ }
881
+ if (output.redshiftReservedInstances != null) {
882
+ return {
883
+ redshiftReservedInstances: de_RedshiftReservedInstances(output.redshiftReservedInstances),
884
+ };
885
+ }
886
+ if (output.sageMakerSavingsPlans != null) {
887
+ return {
888
+ sageMakerSavingsPlans: de_SageMakerSavingsPlans(output.sageMakerSavingsPlans),
889
+ };
890
+ }
891
+ return { $unknown: Object.entries(output)[0] };
892
+ };
893
+ const de_ResourcePricing = (output, context) => {
894
+ return smithyClient.take(output, {
895
+ estimatedCostAfterDiscounts: smithyClient.limitedParseDouble,
896
+ estimatedCostBeforeDiscounts: smithyClient.limitedParseDouble,
897
+ estimatedDiscounts: (_) => de_EstimatedDiscounts(_),
898
+ estimatedNetUnusedAmortizedCommitments: smithyClient.limitedParseDouble,
899
+ });
1195
900
  };
901
+ const de_SageMakerSavingsPlans = (output, context) => {
902
+ return smithyClient.take(output, {
903
+ configuration: smithyClient._json,
904
+ costCalculation: (_) => de_SavingsPlansCostCalculation(_),
905
+ });
906
+ };
907
+ const de_SavingsPlansCostCalculation = (output, context) => {
908
+ return smithyClient.take(output, {
909
+ pricing: (_) => de_SavingsPlansPricing(_),
910
+ });
911
+ };
912
+ const de_SavingsPlansPricing = (output, context) => {
913
+ return smithyClient.take(output, {
914
+ estimatedMonthlyCommitment: smithyClient.limitedParseDouble,
915
+ estimatedOnDemandCost: smithyClient.limitedParseDouble,
916
+ monthlySavingsPlansEligibleCost: smithyClient.limitedParseDouble,
917
+ savingsPercentage: smithyClient.limitedParseDouble,
918
+ });
919
+ };
920
+ const de_StorageConfiguration = (output, context) => {
921
+ return smithyClient.take(output, {
922
+ sizeInGb: smithyClient.limitedParseDouble,
923
+ type: smithyClient.expectString,
924
+ });
925
+ };
926
+ const de_Usage = (output, context) => {
927
+ return smithyClient.take(output, {
928
+ operation: smithyClient.expectString,
929
+ productCode: smithyClient.expectString,
930
+ unit: smithyClient.expectString,
931
+ usageAmount: smithyClient.limitedParseDouble,
932
+ usageType: smithyClient.expectString,
933
+ });
934
+ };
935
+ const de_UsageList = (output, context) => {
936
+ const retVal = (output || [])
937
+ .filter((e) => e != null)
938
+ .map((entry) => {
939
+ return de_Usage(entry);
940
+ });
941
+ return retVal;
942
+ };
943
+ const deserializeMetadata = (output) => ({
944
+ httpStatusCode: output.statusCode,
945
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
946
+ extendedRequestId: output.headers["x-amz-id-2"],
947
+ cfId: output.headers["x-amz-cf-id"],
948
+ });
949
+ const throwDefaultError = smithyClient.withBaseException(CostOptimizationHubServiceException);
950
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
951
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
952
+ const contents = {
953
+ protocol,
954
+ hostname,
955
+ port,
956
+ method: "POST",
957
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
958
+ headers,
959
+ };
960
+ if (body !== undefined) {
961
+ contents.body = body;
962
+ }
963
+ return new protocolHttp.HttpRequest(contents);
964
+ };
965
+ function sharedHeaders(operation) {
966
+ return {
967
+ "content-type": "application/x-amz-json-1.0",
968
+ "x-amz-target": `CostOptimizationHubService.${operation}`,
969
+ };
970
+ }
1196
971
 
1197
- // src/commands/UpdatePreferencesCommand.ts
972
+ class GetPreferencesCommand extends smithyClient.Command
973
+ .classBuilder()
974
+ .ep(commonParams)
975
+ .m(function (Command, cs, config, o) {
976
+ return [
977
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
978
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
979
+ ];
980
+ })
981
+ .s("CostOptimizationHubService", "GetPreferences", {})
982
+ .n("CostOptimizationHubClient", "GetPreferencesCommand")
983
+ .f(void 0, void 0)
984
+ .ser(se_GetPreferencesCommand)
985
+ .de(de_GetPreferencesCommand)
986
+ .build() {
987
+ }
1198
988
 
989
+ class GetRecommendationCommand extends smithyClient.Command
990
+ .classBuilder()
991
+ .ep(commonParams)
992
+ .m(function (Command, cs, config, o) {
993
+ return [
994
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
995
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
996
+ ];
997
+ })
998
+ .s("CostOptimizationHubService", "GetRecommendation", {})
999
+ .n("CostOptimizationHubClient", "GetRecommendationCommand")
1000
+ .f(void 0, void 0)
1001
+ .ser(se_GetRecommendationCommand)
1002
+ .de(de_GetRecommendationCommand)
1003
+ .build() {
1004
+ }
1199
1005
 
1006
+ class ListEnrollmentStatusesCommand extends smithyClient.Command
1007
+ .classBuilder()
1008
+ .ep(commonParams)
1009
+ .m(function (Command, cs, config, o) {
1010
+ return [
1011
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1012
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1013
+ ];
1014
+ })
1015
+ .s("CostOptimizationHubService", "ListEnrollmentStatuses", {})
1016
+ .n("CostOptimizationHubClient", "ListEnrollmentStatusesCommand")
1017
+ .f(void 0, void 0)
1018
+ .ser(se_ListEnrollmentStatusesCommand)
1019
+ .de(de_ListEnrollmentStatusesCommand)
1020
+ .build() {
1021
+ }
1200
1022
 
1201
- var UpdatePreferencesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
1202
- return [
1203
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1204
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1205
- ];
1206
- }).s("CostOptimizationHubService", "UpdatePreferences", {}).n("CostOptimizationHubClient", "UpdatePreferencesCommand").f(void 0, void 0).ser(se_UpdatePreferencesCommand).de(de_UpdatePreferencesCommand).build() {
1207
- static {
1208
- __name(this, "UpdatePreferencesCommand");
1209
- }
1210
- };
1023
+ class ListRecommendationsCommand extends smithyClient.Command
1024
+ .classBuilder()
1025
+ .ep(commonParams)
1026
+ .m(function (Command, cs, config, o) {
1027
+ return [
1028
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1029
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1030
+ ];
1031
+ })
1032
+ .s("CostOptimizationHubService", "ListRecommendations", {})
1033
+ .n("CostOptimizationHubClient", "ListRecommendationsCommand")
1034
+ .f(void 0, void 0)
1035
+ .ser(se_ListRecommendationsCommand)
1036
+ .de(de_ListRecommendationsCommand)
1037
+ .build() {
1038
+ }
1211
1039
 
1212
- // src/CostOptimizationHub.ts
1213
- var commands = {
1214
- GetPreferencesCommand,
1215
- GetRecommendationCommand,
1216
- ListEnrollmentStatusesCommand,
1217
- ListRecommendationsCommand,
1218
- ListRecommendationSummariesCommand,
1219
- UpdateEnrollmentStatusCommand,
1220
- UpdatePreferencesCommand
1221
- };
1222
- var CostOptimizationHub = class extends CostOptimizationHubClient {
1223
- static {
1224
- __name(this, "CostOptimizationHub");
1225
- }
1226
- };
1227
- (0, import_smithy_client.createAggregatedClient)(commands, CostOptimizationHub);
1040
+ class ListRecommendationSummariesCommand extends smithyClient.Command
1041
+ .classBuilder()
1042
+ .ep(commonParams)
1043
+ .m(function (Command, cs, config, o) {
1044
+ return [
1045
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1046
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1047
+ ];
1048
+ })
1049
+ .s("CostOptimizationHubService", "ListRecommendationSummaries", {})
1050
+ .n("CostOptimizationHubClient", "ListRecommendationSummariesCommand")
1051
+ .f(void 0, void 0)
1052
+ .ser(se_ListRecommendationSummariesCommand)
1053
+ .de(de_ListRecommendationSummariesCommand)
1054
+ .build() {
1055
+ }
1228
1056
 
1229
- // src/pagination/ListEnrollmentStatusesPaginator.ts
1057
+ class UpdateEnrollmentStatusCommand extends smithyClient.Command
1058
+ .classBuilder()
1059
+ .ep(commonParams)
1060
+ .m(function (Command, cs, config, o) {
1061
+ return [
1062
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1063
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1064
+ ];
1065
+ })
1066
+ .s("CostOptimizationHubService", "UpdateEnrollmentStatus", {})
1067
+ .n("CostOptimizationHubClient", "UpdateEnrollmentStatusCommand")
1068
+ .f(void 0, void 0)
1069
+ .ser(se_UpdateEnrollmentStatusCommand)
1070
+ .de(de_UpdateEnrollmentStatusCommand)
1071
+ .build() {
1072
+ }
1230
1073
 
1231
- var paginateListEnrollmentStatuses = (0, import_core.createPaginator)(CostOptimizationHubClient, ListEnrollmentStatusesCommand, "nextToken", "nextToken", "maxResults");
1074
+ class UpdatePreferencesCommand extends smithyClient.Command
1075
+ .classBuilder()
1076
+ .ep(commonParams)
1077
+ .m(function (Command, cs, config, o) {
1078
+ return [
1079
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1080
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1081
+ ];
1082
+ })
1083
+ .s("CostOptimizationHubService", "UpdatePreferences", {})
1084
+ .n("CostOptimizationHubClient", "UpdatePreferencesCommand")
1085
+ .f(void 0, void 0)
1086
+ .ser(se_UpdatePreferencesCommand)
1087
+ .de(de_UpdatePreferencesCommand)
1088
+ .build() {
1089
+ }
1232
1090
 
1233
- // src/pagination/ListRecommendationSummariesPaginator.ts
1091
+ const commands = {
1092
+ GetPreferencesCommand,
1093
+ GetRecommendationCommand,
1094
+ ListEnrollmentStatusesCommand,
1095
+ ListRecommendationsCommand,
1096
+ ListRecommendationSummariesCommand,
1097
+ UpdateEnrollmentStatusCommand,
1098
+ UpdatePreferencesCommand,
1099
+ };
1100
+ class CostOptimizationHub extends CostOptimizationHubClient {
1101
+ }
1102
+ smithyClient.createAggregatedClient(commands, CostOptimizationHub);
1234
1103
 
1235
- var paginateListRecommendationSummaries = (0, import_core.createPaginator)(CostOptimizationHubClient, ListRecommendationSummariesCommand, "nextToken", "nextToken", "maxResults");
1104
+ const paginateListEnrollmentStatuses = core.createPaginator(CostOptimizationHubClient, ListEnrollmentStatusesCommand, "nextToken", "nextToken", "maxResults");
1236
1105
 
1237
- // src/pagination/ListRecommendationsPaginator.ts
1106
+ const paginateListRecommendationSummaries = core.createPaginator(CostOptimizationHubClient, ListRecommendationSummariesCommand, "nextToken", "nextToken", "maxResults");
1238
1107
 
1239
- var paginateListRecommendations = (0, import_core.createPaginator)(CostOptimizationHubClient, ListRecommendationsCommand, "nextToken", "nextToken", "maxResults");
1240
- // Annotate the CommonJS export names for ESM import in node:
1108
+ const paginateListRecommendations = core.createPaginator(CostOptimizationHubClient, ListRecommendationsCommand, "nextToken", "nextToken", "maxResults");
1241
1109
 
1242
- 0 && (module.exports = {
1243
- CostOptimizationHubServiceException,
1244
- __Client,
1245
- CostOptimizationHubClient,
1246
- CostOptimizationHub,
1247
- $Command,
1248
- GetPreferencesCommand,
1249
- GetRecommendationCommand,
1250
- ListEnrollmentStatusesCommand,
1251
- ListRecommendationSummariesCommand,
1252
- ListRecommendationsCommand,
1253
- UpdateEnrollmentStatusCommand,
1254
- UpdatePreferencesCommand,
1255
- paginateListEnrollmentStatuses,
1256
- paginateListRecommendationSummaries,
1257
- paginateListRecommendations,
1258
- AccessDeniedException,
1259
- EnrollmentStatus,
1260
- ActionType,
1261
- AllocationStrategy,
1262
- MemberAccountDiscountVisibility,
1263
- PaymentOption,
1264
- Term,
1265
- SavingsEstimationMode,
1266
- InternalServerException,
1267
- ThrottlingException,
1268
- ValidationExceptionReason,
1269
- ValidationException,
1270
- Ec2AutoScalingGroupType,
1271
- ResourceDetails,
1272
- ResourceType,
1273
- ImplementationEffort,
1274
- Source,
1275
- ResourceNotFoundException,
1276
- Order,
1277
- SummaryMetrics
1110
+ Object.defineProperty(exports, "$Command", {
1111
+ enumerable: true,
1112
+ get: function () { return smithyClient.Command; }
1278
1113
  });
1279
-
1114
+ Object.defineProperty(exports, "__Client", {
1115
+ enumerable: true,
1116
+ get: function () { return smithyClient.Client; }
1117
+ });
1118
+ exports.AccessDeniedException = AccessDeniedException;
1119
+ exports.ActionType = ActionType;
1120
+ exports.AllocationStrategy = AllocationStrategy;
1121
+ exports.CostOptimizationHub = CostOptimizationHub;
1122
+ exports.CostOptimizationHubClient = CostOptimizationHubClient;
1123
+ exports.CostOptimizationHubServiceException = CostOptimizationHubServiceException;
1124
+ exports.Ec2AutoScalingGroupType = Ec2AutoScalingGroupType;
1125
+ exports.EnrollmentStatus = EnrollmentStatus;
1126
+ exports.GetPreferencesCommand = GetPreferencesCommand;
1127
+ exports.GetRecommendationCommand = GetRecommendationCommand;
1128
+ exports.ImplementationEffort = ImplementationEffort;
1129
+ exports.InternalServerException = InternalServerException;
1130
+ exports.ListEnrollmentStatusesCommand = ListEnrollmentStatusesCommand;
1131
+ exports.ListRecommendationSummariesCommand = ListRecommendationSummariesCommand;
1132
+ exports.ListRecommendationsCommand = ListRecommendationsCommand;
1133
+ exports.MemberAccountDiscountVisibility = MemberAccountDiscountVisibility;
1134
+ exports.Order = Order;
1135
+ exports.PaymentOption = PaymentOption;
1136
+ exports.ResourceNotFoundException = ResourceNotFoundException;
1137
+ exports.ResourceType = ResourceType;
1138
+ exports.SavingsEstimationMode = SavingsEstimationMode;
1139
+ exports.Source = Source;
1140
+ exports.SummaryMetrics = SummaryMetrics;
1141
+ exports.Term = Term;
1142
+ exports.ThrottlingException = ThrottlingException;
1143
+ exports.UpdateEnrollmentStatusCommand = UpdateEnrollmentStatusCommand;
1144
+ exports.UpdatePreferencesCommand = UpdatePreferencesCommand;
1145
+ exports.ValidationException = ValidationException;
1146
+ exports.ValidationExceptionReason = ValidationExceptionReason;
1147
+ exports.paginateListEnrollmentStatuses = paginateListEnrollmentStatuses;
1148
+ exports.paginateListRecommendationSummaries = paginateListRecommendationSummaries;
1149
+ exports.paginateListRecommendations = paginateListRecommendations;