@aws-sdk/client-freetier 3.899.0 → 3.906.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist-cjs/index.js +644 -767
  2. package/package.json +37 -37
package/dist-cjs/index.js CHANGED
@@ -1,797 +1,674 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- AccessDeniedException: () => AccessDeniedException,
25
- AccountPlanStatus: () => AccountPlanStatus,
26
- AccountPlanType: () => AccountPlanType,
27
- ActivityReward: () => ActivityReward,
28
- ActivityStatus: () => ActivityStatus,
29
- CurrencyCode: () => CurrencyCode,
30
- Dimension: () => Dimension,
31
- FreeTier: () => FreeTier,
32
- FreeTierClient: () => FreeTierClient,
33
- FreeTierServiceException: () => FreeTierServiceException,
34
- GetAccountActivityCommand: () => GetAccountActivityCommand,
35
- GetAccountPlanStateCommand: () => GetAccountPlanStateCommand,
36
- GetFreeTierUsageCommand: () => GetFreeTierUsageCommand,
37
- InternalServerException: () => InternalServerException,
38
- LanguageCode: () => LanguageCode,
39
- ListAccountActivitiesCommand: () => ListAccountActivitiesCommand,
40
- MatchOption: () => MatchOption,
41
- ResourceNotFoundException: () => ResourceNotFoundException,
42
- ThrottlingException: () => ThrottlingException,
43
- UpgradeAccountPlanCommand: () => UpgradeAccountPlanCommand,
44
- ValidationException: () => ValidationException,
45
- __Client: () => import_smithy_client.Client,
46
- paginateGetFreeTierUsage: () => paginateGetFreeTierUsage,
47
- paginateListAccountActivities: () => paginateListAccountActivities
48
- });
49
- module.exports = __toCommonJS(index_exports);
50
-
51
- // src/FreeTierClient.ts
52
- var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
53
- var import_middleware_logger = require("@aws-sdk/middleware-logger");
54
- var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
55
- var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
56
- var import_config_resolver = require("@smithy/config-resolver");
57
- var import_core = require("@smithy/core");
58
- var import_middleware_content_length = require("@smithy/middleware-content-length");
59
- var import_middleware_endpoint = require("@smithy/middleware-endpoint");
60
- var import_middleware_retry = require("@smithy/middleware-retry");
61
-
62
- var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
63
-
64
- // src/endpoint/EndpointParameters.ts
65
- var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
66
- return Object.assign(options, {
67
- useFipsEndpoint: options.useFipsEndpoint ?? false,
68
- defaultSigningName: "freetier"
69
- });
70
- }, "resolveClientEndpointParameters");
71
- var commonParams = {
72
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
73
- Endpoint: { type: "builtInParams", name: "endpoint" },
74
- Region: { type: "builtInParams", name: "region" }
1
+ 'use strict';
2
+
3
+ var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
4
+ var middlewareLogger = require('@aws-sdk/middleware-logger');
5
+ var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
6
+ var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
7
+ var configResolver = require('@smithy/config-resolver');
8
+ var core = require('@smithy/core');
9
+ var middlewareContentLength = require('@smithy/middleware-content-length');
10
+ var middlewareEndpoint = require('@smithy/middleware-endpoint');
11
+ var middlewareRetry = require('@smithy/middleware-retry');
12
+ var smithyClient = require('@smithy/smithy-client');
13
+ var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
14
+ var runtimeConfig = require('./runtimeConfig');
15
+ var regionConfigResolver = require('@aws-sdk/region-config-resolver');
16
+ var protocolHttp = require('@smithy/protocol-http');
17
+ var middlewareSerde = require('@smithy/middleware-serde');
18
+ var core$1 = require('@aws-sdk/core');
19
+
20
+ const resolveClientEndpointParameters = (options) => {
21
+ return Object.assign(options, {
22
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
23
+ defaultSigningName: "freetier",
24
+ });
25
+ };
26
+ const commonParams = {
27
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
28
+ Endpoint: { type: "builtInParams", name: "endpoint" },
29
+ Region: { type: "builtInParams", name: "region" },
75
30
  };
76
31
 
77
- // src/FreeTierClient.ts
78
- var import_runtimeConfig = require("././runtimeConfig");
32
+ const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
33
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
34
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
35
+ let _credentials = runtimeConfig.credentials;
36
+ return {
37
+ setHttpAuthScheme(httpAuthScheme) {
38
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
39
+ if (index === -1) {
40
+ _httpAuthSchemes.push(httpAuthScheme);
41
+ }
42
+ else {
43
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
44
+ }
45
+ },
46
+ httpAuthSchemes() {
47
+ return _httpAuthSchemes;
48
+ },
49
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
50
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
51
+ },
52
+ httpAuthSchemeProvider() {
53
+ return _httpAuthSchemeProvider;
54
+ },
55
+ setCredentials(credentials) {
56
+ _credentials = credentials;
57
+ },
58
+ credentials() {
59
+ return _credentials;
60
+ },
61
+ };
62
+ };
63
+ const resolveHttpAuthRuntimeConfig = (config) => {
64
+ return {
65
+ httpAuthSchemes: config.httpAuthSchemes(),
66
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
67
+ credentials: config.credentials(),
68
+ };
69
+ };
79
70
 
80
- // src/runtimeExtensions.ts
81
- var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
82
- var import_protocol_http = require("@smithy/protocol-http");
83
- var import_smithy_client = require("@smithy/smithy-client");
71
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
72
+ const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
73
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
74
+ return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
75
+ };
84
76
 
85
- // src/auth/httpAuthExtensionConfiguration.ts
86
- var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
87
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
88
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
89
- let _credentials = runtimeConfig.credentials;
90
- return {
91
- setHttpAuthScheme(httpAuthScheme) {
92
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
93
- if (index === -1) {
94
- _httpAuthSchemes.push(httpAuthScheme);
95
- } else {
96
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
97
- }
98
- },
99
- httpAuthSchemes() {
100
- return _httpAuthSchemes;
101
- },
102
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
103
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
104
- },
105
- httpAuthSchemeProvider() {
106
- return _httpAuthSchemeProvider;
107
- },
108
- setCredentials(credentials) {
109
- _credentials = credentials;
110
- },
111
- credentials() {
112
- return _credentials;
77
+ class FreeTierClient extends smithyClient.Client {
78
+ config;
79
+ constructor(...[configuration]) {
80
+ const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
81
+ super(_config_0);
82
+ this.initConfig = _config_0;
83
+ const _config_1 = resolveClientEndpointParameters(_config_0);
84
+ const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
85
+ const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
86
+ const _config_4 = configResolver.resolveRegionConfig(_config_3);
87
+ const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
88
+ const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
89
+ const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
90
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
91
+ this.config = _config_8;
92
+ this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
93
+ this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
94
+ this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
95
+ this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
96
+ this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
97
+ this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
98
+ this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
99
+ httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultFreeTierHttpAuthSchemeParametersProvider,
100
+ identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
101
+ "aws.auth#sigv4": config.credentials,
102
+ }),
103
+ }));
104
+ this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
105
+ }
106
+ destroy() {
107
+ super.destroy();
113
108
  }
114
- };
115
- }, "getHttpAuthExtensionConfiguration");
116
- var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
117
- return {
118
- httpAuthSchemes: config.httpAuthSchemes(),
119
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
120
- credentials: config.credentials()
121
- };
122
- }, "resolveHttpAuthRuntimeConfig");
109
+ }
123
110
 
124
- // src/runtimeExtensions.ts
125
- var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
126
- const extensionConfiguration = Object.assign(
127
- (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
128
- (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
129
- (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
130
- getHttpAuthExtensionConfiguration(runtimeConfig)
131
- );
132
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
133
- return Object.assign(
134
- runtimeConfig,
135
- (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
136
- (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
137
- (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
138
- resolveHttpAuthRuntimeConfig(extensionConfiguration)
139
- );
140
- }, "resolveRuntimeExtensions");
111
+ class FreeTierServiceException extends smithyClient.ServiceException {
112
+ constructor(options) {
113
+ super(options);
114
+ Object.setPrototypeOf(this, FreeTierServiceException.prototype);
115
+ }
116
+ }
141
117
 
142
- // src/FreeTierClient.ts
143
- var FreeTierClient = class extends import_smithy_client.Client {
144
- static {
145
- __name(this, "FreeTierClient");
146
- }
147
- /**
148
- * The resolved configuration of FreeTierClient class. This is resolved and normalized from the {@link FreeTierClientConfig | constructor configuration interface}.
149
- */
150
- config;
151
- constructor(...[configuration]) {
152
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
153
- super(_config_0);
154
- this.initConfig = _config_0;
155
- const _config_1 = resolveClientEndpointParameters(_config_0);
156
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
157
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
158
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
159
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
160
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
161
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
162
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
163
- this.config = _config_8;
164
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
165
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
166
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
167
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
168
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
169
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
170
- this.middlewareStack.use(
171
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
172
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultFreeTierHttpAuthSchemeParametersProvider,
173
- identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
174
- "aws.auth#sigv4": config.credentials
175
- }), "identityProviderConfigProvider")
176
- })
177
- );
178
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
179
- }
180
- /**
181
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
182
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
183
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
184
- */
185
- destroy() {
186
- super.destroy();
187
- }
118
+ class AccessDeniedException extends FreeTierServiceException {
119
+ name = "AccessDeniedException";
120
+ $fault = "client";
121
+ constructor(opts) {
122
+ super({
123
+ name: "AccessDeniedException",
124
+ $fault: "client",
125
+ ...opts,
126
+ });
127
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
128
+ }
129
+ }
130
+ const AccountPlanStatus = {
131
+ ACTIVE: "ACTIVE",
132
+ EXPIRED: "EXPIRED",
133
+ NOT_STARTED: "NOT_STARTED",
188
134
  };
189
-
190
- // src/FreeTier.ts
191
-
192
-
193
- // src/commands/GetAccountActivityCommand.ts
194
-
195
- var import_middleware_serde = require("@smithy/middleware-serde");
196
-
197
-
198
- // src/protocols/Aws_json1_0.ts
199
- var import_core2 = require("@aws-sdk/core");
200
-
201
-
202
-
203
- // src/models/FreeTierServiceException.ts
204
-
205
- var FreeTierServiceException = class _FreeTierServiceException extends import_smithy_client.ServiceException {
206
- static {
207
- __name(this, "FreeTierServiceException");
208
- }
209
- /**
210
- * @internal
211
- */
212
- constructor(options) {
213
- super(options);
214
- Object.setPrototypeOf(this, _FreeTierServiceException.prototype);
215
- }
135
+ const AccountPlanType = {
136
+ FREE: "FREE",
137
+ PAID: "PAID",
138
+ };
139
+ const CurrencyCode = {
140
+ USD: "USD",
141
+ };
142
+ exports.ActivityReward = void 0;
143
+ (function (ActivityReward) {
144
+ ActivityReward.visit = (value, visitor) => {
145
+ if (value.credit !== undefined)
146
+ return visitor.credit(value.credit);
147
+ return visitor._(value.$unknown[0], value.$unknown[1]);
148
+ };
149
+ })(exports.ActivityReward || (exports.ActivityReward = {}));
150
+ const ActivityStatus = {
151
+ COMPLETED: "COMPLETED",
152
+ EXPIRING: "EXPIRING",
153
+ IN_PROGRESS: "IN_PROGRESS",
154
+ NOT_STARTED: "NOT_STARTED",
155
+ };
156
+ const LanguageCode = {
157
+ DE_DE: "de-DE",
158
+ EN_GB: "en-GB",
159
+ EN_US: "en-US",
160
+ ES_ES: "es-ES",
161
+ FR_FR: "fr-FR",
162
+ ID_ID: "id-ID",
163
+ IT_IT: "it-IT",
164
+ JA_JP: "ja-JP",
165
+ KO_KR: "ko-KR",
166
+ PT_PT: "pt-PT",
167
+ TR_TR: "tr-TR",
168
+ ZH_CN: "zh-CN",
169
+ ZH_TW: "zh-TW",
170
+ };
171
+ class InternalServerException extends FreeTierServiceException {
172
+ name = "InternalServerException";
173
+ $fault = "server";
174
+ constructor(opts) {
175
+ super({
176
+ name: "InternalServerException",
177
+ $fault: "server",
178
+ ...opts,
179
+ });
180
+ Object.setPrototypeOf(this, InternalServerException.prototype);
181
+ }
182
+ }
183
+ class ResourceNotFoundException extends FreeTierServiceException {
184
+ name = "ResourceNotFoundException";
185
+ $fault = "client";
186
+ constructor(opts) {
187
+ super({
188
+ name: "ResourceNotFoundException",
189
+ $fault: "client",
190
+ ...opts,
191
+ });
192
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
193
+ }
194
+ }
195
+ class ThrottlingException extends FreeTierServiceException {
196
+ name = "ThrottlingException";
197
+ $fault = "client";
198
+ constructor(opts) {
199
+ super({
200
+ name: "ThrottlingException",
201
+ $fault: "client",
202
+ ...opts,
203
+ });
204
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
205
+ }
206
+ }
207
+ class ValidationException extends FreeTierServiceException {
208
+ name = "ValidationException";
209
+ $fault = "client";
210
+ constructor(opts) {
211
+ super({
212
+ name: "ValidationException",
213
+ $fault: "client",
214
+ ...opts,
215
+ });
216
+ Object.setPrototypeOf(this, ValidationException.prototype);
217
+ }
218
+ }
219
+ const Dimension = {
220
+ DESCRIPTION: "DESCRIPTION",
221
+ FREE_TIER_TYPE: "FREE_TIER_TYPE",
222
+ OPERATION: "OPERATION",
223
+ REGION: "REGION",
224
+ SERVICE: "SERVICE",
225
+ USAGE_PERCENTAGE: "USAGE_PERCENTAGE",
226
+ USAGE_TYPE: "USAGE_TYPE",
227
+ };
228
+ const MatchOption = {
229
+ CONTAINS: "CONTAINS",
230
+ ENDS_WITH: "ENDS_WITH",
231
+ EQUALS: "EQUALS",
232
+ GREATER_THAN_OR_EQUAL: "GREATER_THAN_OR_EQUAL",
233
+ STARTS_WITH: "STARTS_WITH",
216
234
  };
217
235
 
218
- // src/models/models_0.ts
219
- var AccessDeniedException = class _AccessDeniedException extends FreeTierServiceException {
220
- static {
221
- __name(this, "AccessDeniedException");
222
- }
223
- name = "AccessDeniedException";
224
- $fault = "client";
225
- /**
226
- * @internal
227
- */
228
- constructor(opts) {
229
- super({
230
- name: "AccessDeniedException",
231
- $fault: "client",
232
- ...opts
236
+ const se_GetAccountActivityCommand = async (input, context) => {
237
+ const headers = sharedHeaders("GetAccountActivity");
238
+ let body;
239
+ body = JSON.stringify(smithyClient._json(input));
240
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
241
+ };
242
+ const se_GetAccountPlanStateCommand = async (input, context) => {
243
+ const headers = sharedHeaders("GetAccountPlanState");
244
+ let body;
245
+ body = JSON.stringify(smithyClient._json(input));
246
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
247
+ };
248
+ const se_GetFreeTierUsageCommand = async (input, context) => {
249
+ const headers = sharedHeaders("GetFreeTierUsage");
250
+ let body;
251
+ body = JSON.stringify(se_GetFreeTierUsageRequest(input));
252
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
253
+ };
254
+ const se_ListAccountActivitiesCommand = async (input, context) => {
255
+ const headers = sharedHeaders("ListAccountActivities");
256
+ let body;
257
+ body = JSON.stringify(smithyClient._json(input));
258
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
259
+ };
260
+ const se_UpgradeAccountPlanCommand = async (input, context) => {
261
+ const headers = sharedHeaders("UpgradeAccountPlan");
262
+ let body;
263
+ body = JSON.stringify(smithyClient._json(input));
264
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
265
+ };
266
+ const de_GetAccountActivityCommand = async (output, context) => {
267
+ if (output.statusCode >= 300) {
268
+ return de_CommandError(output, context);
269
+ }
270
+ const data = await core$1.parseJsonBody(output.body, context);
271
+ let contents = {};
272
+ contents = de_GetAccountActivityResponse(data);
273
+ const response = {
274
+ $metadata: deserializeMetadata(output),
275
+ ...contents,
276
+ };
277
+ return response;
278
+ };
279
+ const de_GetAccountPlanStateCommand = async (output, context) => {
280
+ if (output.statusCode >= 300) {
281
+ return de_CommandError(output, context);
282
+ }
283
+ const data = await core$1.parseJsonBody(output.body, context);
284
+ let contents = {};
285
+ contents = de_GetAccountPlanStateResponse(data);
286
+ const response = {
287
+ $metadata: deserializeMetadata(output),
288
+ ...contents,
289
+ };
290
+ return response;
291
+ };
292
+ const de_GetFreeTierUsageCommand = async (output, context) => {
293
+ if (output.statusCode >= 300) {
294
+ return de_CommandError(output, context);
295
+ }
296
+ const data = await core$1.parseJsonBody(output.body, context);
297
+ let contents = {};
298
+ contents = de_GetFreeTierUsageResponse(data);
299
+ const response = {
300
+ $metadata: deserializeMetadata(output),
301
+ ...contents,
302
+ };
303
+ return response;
304
+ };
305
+ const de_ListAccountActivitiesCommand = async (output, context) => {
306
+ if (output.statusCode >= 300) {
307
+ return de_CommandError(output, context);
308
+ }
309
+ const data = await core$1.parseJsonBody(output.body, context);
310
+ let contents = {};
311
+ contents = de_ListAccountActivitiesResponse(data);
312
+ const response = {
313
+ $metadata: deserializeMetadata(output),
314
+ ...contents,
315
+ };
316
+ return response;
317
+ };
318
+ const de_UpgradeAccountPlanCommand = async (output, context) => {
319
+ if (output.statusCode >= 300) {
320
+ return de_CommandError(output, context);
321
+ }
322
+ const data = await core$1.parseJsonBody(output.body, context);
323
+ let contents = {};
324
+ contents = smithyClient._json(data);
325
+ const response = {
326
+ $metadata: deserializeMetadata(output),
327
+ ...contents,
328
+ };
329
+ return response;
330
+ };
331
+ const de_CommandError = async (output, context) => {
332
+ const parsedOutput = {
333
+ ...output,
334
+ body: await core$1.parseJsonErrorBody(output.body, context),
335
+ };
336
+ const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
337
+ switch (errorCode) {
338
+ case "InternalServerException":
339
+ case "com.amazonaws.freetier#InternalServerException":
340
+ throw await de_InternalServerExceptionRes(parsedOutput);
341
+ case "ResourceNotFoundException":
342
+ case "com.amazonaws.freetier#ResourceNotFoundException":
343
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput);
344
+ case "ThrottlingException":
345
+ case "com.amazonaws.freetier#ThrottlingException":
346
+ throw await de_ThrottlingExceptionRes(parsedOutput);
347
+ case "ValidationException":
348
+ case "com.amazonaws.freetier#ValidationException":
349
+ throw await de_ValidationExceptionRes(parsedOutput);
350
+ case "AccessDeniedException":
351
+ case "com.amazonaws.freetier#AccessDeniedException":
352
+ throw await de_AccessDeniedExceptionRes(parsedOutput);
353
+ default:
354
+ const parsedBody = parsedOutput.body;
355
+ return throwDefaultError({
356
+ output,
357
+ parsedBody,
358
+ errorCode,
359
+ });
360
+ }
361
+ };
362
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
363
+ const body = parsedOutput.body;
364
+ const deserialized = smithyClient._json(body);
365
+ const exception = new AccessDeniedException({
366
+ $metadata: deserializeMetadata(parsedOutput),
367
+ ...deserialized,
233
368
  });
234
- Object.setPrototypeOf(this, _AccessDeniedException.prototype);
235
- }
236
- };
237
- var AccountPlanStatus = {
238
- ACTIVE: "ACTIVE",
239
- EXPIRED: "EXPIRED",
240
- NOT_STARTED: "NOT_STARTED"
241
- };
242
- var AccountPlanType = {
243
- FREE: "FREE",
244
- PAID: "PAID"
245
- };
246
- var CurrencyCode = {
247
- USD: "USD"
248
- };
249
- var ActivityReward;
250
- ((ActivityReward3) => {
251
- ActivityReward3.visit = /* @__PURE__ */ __name((value, visitor) => {
252
- if (value.credit !== void 0) return visitor.credit(value.credit);
253
- return visitor._(value.$unknown[0], value.$unknown[1]);
254
- }, "visit");
255
- })(ActivityReward || (ActivityReward = {}));
256
- var ActivityStatus = {
257
- COMPLETED: "COMPLETED",
258
- EXPIRING: "EXPIRING",
259
- IN_PROGRESS: "IN_PROGRESS",
260
- NOT_STARTED: "NOT_STARTED"
261
- };
262
- var LanguageCode = {
263
- DE_DE: "de-DE",
264
- EN_GB: "en-GB",
265
- EN_US: "en-US",
266
- ES_ES: "es-ES",
267
- FR_FR: "fr-FR",
268
- ID_ID: "id-ID",
269
- IT_IT: "it-IT",
270
- JA_JP: "ja-JP",
271
- KO_KR: "ko-KR",
272
- PT_PT: "pt-PT",
273
- TR_TR: "tr-TR",
274
- ZH_CN: "zh-CN",
275
- ZH_TW: "zh-TW"
276
- };
277
- var InternalServerException = class _InternalServerException extends FreeTierServiceException {
278
- static {
279
- __name(this, "InternalServerException");
280
- }
281
- name = "InternalServerException";
282
- $fault = "server";
283
- /**
284
- * @internal
285
- */
286
- constructor(opts) {
287
- super({
288
- name: "InternalServerException",
289
- $fault: "server",
290
- ...opts
369
+ return smithyClient.decorateServiceException(exception, body);
370
+ };
371
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
372
+ const body = parsedOutput.body;
373
+ const deserialized = smithyClient._json(body);
374
+ const exception = new InternalServerException({
375
+ $metadata: deserializeMetadata(parsedOutput),
376
+ ...deserialized,
291
377
  });
292
- Object.setPrototypeOf(this, _InternalServerException.prototype);
293
- }
294
- };
295
- var ResourceNotFoundException = class _ResourceNotFoundException extends FreeTierServiceException {
296
- static {
297
- __name(this, "ResourceNotFoundException");
298
- }
299
- name = "ResourceNotFoundException";
300
- $fault = "client";
301
- /**
302
- * @internal
303
- */
304
- constructor(opts) {
305
- super({
306
- name: "ResourceNotFoundException",
307
- $fault: "client",
308
- ...opts
378
+ return smithyClient.decorateServiceException(exception, body);
379
+ };
380
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
381
+ const body = parsedOutput.body;
382
+ const deserialized = smithyClient._json(body);
383
+ const exception = new ResourceNotFoundException({
384
+ $metadata: deserializeMetadata(parsedOutput),
385
+ ...deserialized,
309
386
  });
310
- Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
311
- }
312
- };
313
- var ThrottlingException = class _ThrottlingException extends FreeTierServiceException {
314
- static {
315
- __name(this, "ThrottlingException");
316
- }
317
- name = "ThrottlingException";
318
- $fault = "client";
319
- /**
320
- * @internal
321
- */
322
- constructor(opts) {
323
- super({
324
- name: "ThrottlingException",
325
- $fault: "client",
326
- ...opts
387
+ return smithyClient.decorateServiceException(exception, body);
388
+ };
389
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
390
+ const body = parsedOutput.body;
391
+ const deserialized = smithyClient._json(body);
392
+ const exception = new ThrottlingException({
393
+ $metadata: deserializeMetadata(parsedOutput),
394
+ ...deserialized,
327
395
  });
328
- Object.setPrototypeOf(this, _ThrottlingException.prototype);
329
- }
330
- };
331
- var ValidationException = class _ValidationException extends FreeTierServiceException {
332
- static {
333
- __name(this, "ValidationException");
334
- }
335
- name = "ValidationException";
336
- $fault = "client";
337
- /**
338
- * @internal
339
- */
340
- constructor(opts) {
341
- super({
342
- name: "ValidationException",
343
- $fault: "client",
344
- ...opts
396
+ return smithyClient.decorateServiceException(exception, body);
397
+ };
398
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
399
+ const body = parsedOutput.body;
400
+ const deserialized = smithyClient._json(body);
401
+ const exception = new ValidationException({
402
+ $metadata: deserializeMetadata(parsedOutput),
403
+ ...deserialized,
345
404
  });
346
- Object.setPrototypeOf(this, _ValidationException.prototype);
347
- }
348
- };
349
- var Dimension = {
350
- DESCRIPTION: "DESCRIPTION",
351
- FREE_TIER_TYPE: "FREE_TIER_TYPE",
352
- OPERATION: "OPERATION",
353
- REGION: "REGION",
354
- SERVICE: "SERVICE",
355
- USAGE_PERCENTAGE: "USAGE_PERCENTAGE",
356
- USAGE_TYPE: "USAGE_TYPE"
357
- };
358
- var MatchOption = {
359
- CONTAINS: "CONTAINS",
360
- ENDS_WITH: "ENDS_WITH",
361
- EQUALS: "EQUALS",
362
- GREATER_THAN_OR_EQUAL: "GREATER_THAN_OR_EQUAL",
363
- STARTS_WITH: "STARTS_WITH"
405
+ return smithyClient.decorateServiceException(exception, body);
364
406
  };
365
-
366
- // src/protocols/Aws_json1_0.ts
367
- var se_GetAccountActivityCommand = /* @__PURE__ */ __name(async (input, context) => {
368
- const headers = sharedHeaders("GetAccountActivity");
369
- let body;
370
- body = JSON.stringify((0, import_smithy_client._json)(input));
371
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
372
- }, "se_GetAccountActivityCommand");
373
- var se_GetAccountPlanStateCommand = /* @__PURE__ */ __name(async (input, context) => {
374
- const headers = sharedHeaders("GetAccountPlanState");
375
- let body;
376
- body = JSON.stringify((0, import_smithy_client._json)(input));
377
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
378
- }, "se_GetAccountPlanStateCommand");
379
- var se_GetFreeTierUsageCommand = /* @__PURE__ */ __name(async (input, context) => {
380
- const headers = sharedHeaders("GetFreeTierUsage");
381
- let body;
382
- body = JSON.stringify(se_GetFreeTierUsageRequest(input, context));
383
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
384
- }, "se_GetFreeTierUsageCommand");
385
- var se_ListAccountActivitiesCommand = /* @__PURE__ */ __name(async (input, context) => {
386
- const headers = sharedHeaders("ListAccountActivities");
387
- let body;
388
- body = JSON.stringify((0, import_smithy_client._json)(input));
389
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
390
- }, "se_ListAccountActivitiesCommand");
391
- var se_UpgradeAccountPlanCommand = /* @__PURE__ */ __name(async (input, context) => {
392
- const headers = sharedHeaders("UpgradeAccountPlan");
393
- let body;
394
- body = JSON.stringify((0, import_smithy_client._json)(input));
395
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
396
- }, "se_UpgradeAccountPlanCommand");
397
- var de_GetAccountActivityCommand = /* @__PURE__ */ __name(async (output, context) => {
398
- if (output.statusCode >= 300) {
399
- return de_CommandError(output, context);
400
- }
401
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
402
- let contents = {};
403
- contents = de_GetAccountActivityResponse(data, context);
404
- const response = {
405
- $metadata: deserializeMetadata(output),
406
- ...contents
407
- };
408
- return response;
409
- }, "de_GetAccountActivityCommand");
410
- var de_GetAccountPlanStateCommand = /* @__PURE__ */ __name(async (output, context) => {
411
- if (output.statusCode >= 300) {
412
- return de_CommandError(output, context);
413
- }
414
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
415
- let contents = {};
416
- contents = de_GetAccountPlanStateResponse(data, context);
417
- const response = {
418
- $metadata: deserializeMetadata(output),
419
- ...contents
420
- };
421
- return response;
422
- }, "de_GetAccountPlanStateCommand");
423
- var de_GetFreeTierUsageCommand = /* @__PURE__ */ __name(async (output, context) => {
424
- if (output.statusCode >= 300) {
425
- return de_CommandError(output, context);
426
- }
427
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
428
- let contents = {};
429
- contents = de_GetFreeTierUsageResponse(data, context);
430
- const response = {
431
- $metadata: deserializeMetadata(output),
432
- ...contents
433
- };
434
- return response;
435
- }, "de_GetFreeTierUsageCommand");
436
- var de_ListAccountActivitiesCommand = /* @__PURE__ */ __name(async (output, context) => {
437
- if (output.statusCode >= 300) {
438
- return de_CommandError(output, context);
439
- }
440
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
441
- let contents = {};
442
- contents = de_ListAccountActivitiesResponse(data, context);
443
- const response = {
444
- $metadata: deserializeMetadata(output),
445
- ...contents
446
- };
447
- return response;
448
- }, "de_ListAccountActivitiesCommand");
449
- var de_UpgradeAccountPlanCommand = /* @__PURE__ */ __name(async (output, context) => {
450
- if (output.statusCode >= 300) {
451
- return de_CommandError(output, context);
452
- }
453
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
454
- let contents = {};
455
- contents = (0, import_smithy_client._json)(data);
456
- const response = {
457
- $metadata: deserializeMetadata(output),
458
- ...contents
459
- };
460
- return response;
461
- }, "de_UpgradeAccountPlanCommand");
462
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
463
- const parsedOutput = {
464
- ...output,
465
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
466
- };
467
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
468
- switch (errorCode) {
469
- case "InternalServerException":
470
- case "com.amazonaws.freetier#InternalServerException":
471
- throw await de_InternalServerExceptionRes(parsedOutput, context);
472
- case "ResourceNotFoundException":
473
- case "com.amazonaws.freetier#ResourceNotFoundException":
474
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
475
- case "ThrottlingException":
476
- case "com.amazonaws.freetier#ThrottlingException":
477
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
478
- case "ValidationException":
479
- case "com.amazonaws.freetier#ValidationException":
480
- throw await de_ValidationExceptionRes(parsedOutput, context);
481
- case "AccessDeniedException":
482
- case "com.amazonaws.freetier#AccessDeniedException":
483
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
484
- default:
485
- const parsedBody = parsedOutput.body;
486
- return throwDefaultError({
487
- output,
488
- parsedBody,
489
- errorCode
490
- });
491
- }
492
- }, "de_CommandError");
493
- var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
494
- const body = parsedOutput.body;
495
- const deserialized = (0, import_smithy_client._json)(body);
496
- const exception = new AccessDeniedException({
497
- $metadata: deserializeMetadata(parsedOutput),
498
- ...deserialized
499
- });
500
- return (0, import_smithy_client.decorateServiceException)(exception, body);
501
- }, "de_AccessDeniedExceptionRes");
502
- var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
503
- const body = parsedOutput.body;
504
- const deserialized = (0, import_smithy_client._json)(body);
505
- const exception = new InternalServerException({
506
- $metadata: deserializeMetadata(parsedOutput),
507
- ...deserialized
508
- });
509
- return (0, import_smithy_client.decorateServiceException)(exception, body);
510
- }, "de_InternalServerExceptionRes");
511
- var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
512
- const body = parsedOutput.body;
513
- const deserialized = (0, import_smithy_client._json)(body);
514
- const exception = new ResourceNotFoundException({
515
- $metadata: deserializeMetadata(parsedOutput),
516
- ...deserialized
517
- });
518
- return (0, import_smithy_client.decorateServiceException)(exception, body);
519
- }, "de_ResourceNotFoundExceptionRes");
520
- var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
521
- const body = parsedOutput.body;
522
- const deserialized = (0, import_smithy_client._json)(body);
523
- const exception = new ThrottlingException({
524
- $metadata: deserializeMetadata(parsedOutput),
525
- ...deserialized
526
- });
527
- return (0, import_smithy_client.decorateServiceException)(exception, body);
528
- }, "de_ThrottlingExceptionRes");
529
- var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
530
- const body = parsedOutput.body;
531
- const deserialized = (0, import_smithy_client._json)(body);
532
- const exception = new ValidationException({
533
- $metadata: deserializeMetadata(parsedOutput),
534
- ...deserialized
535
- });
536
- return (0, import_smithy_client.decorateServiceException)(exception, body);
537
- }, "de_ValidationExceptionRes");
538
- var se_Expression = /* @__PURE__ */ __name((input, context) => {
539
- return (0, import_smithy_client.take)(input, {
540
- And: /* @__PURE__ */ __name((_) => se_Expressions(_, context), "And"),
541
- Dimensions: import_smithy_client._json,
542
- Not: /* @__PURE__ */ __name((_) => se_Expression(_, context), "Not"),
543
- Or: /* @__PURE__ */ __name((_) => se_Expressions(_, context), "Or")
544
- });
545
- }, "se_Expression");
546
- var se_Expressions = /* @__PURE__ */ __name((input, context) => {
547
- return input.filter((e) => e != null).map((entry) => {
548
- return se_Expression(entry, context);
549
- });
550
- }, "se_Expressions");
551
- var se_GetFreeTierUsageRequest = /* @__PURE__ */ __name((input, context) => {
552
- return (0, import_smithy_client.take)(input, {
553
- filter: /* @__PURE__ */ __name((_) => se_Expression(_, context), "filter"),
554
- maxResults: [],
555
- nextToken: []
556
- });
557
- }, "se_GetFreeTierUsageRequest");
558
- var de_Activities = /* @__PURE__ */ __name((output, context) => {
559
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
560
- return de_ActivitySummary(entry, context);
561
- });
562
- return retVal;
563
- }, "de_Activities");
564
- var de_ActivityReward = /* @__PURE__ */ __name((output, context) => {
565
- if (output.credit != null) {
566
- return {
567
- credit: de_MonetaryAmount(output.credit, context)
568
- };
569
- }
570
- return { $unknown: Object.entries(output)[0] };
571
- }, "de_ActivityReward");
572
- var de_ActivitySummary = /* @__PURE__ */ __name((output, context) => {
573
- return (0, import_smithy_client.take)(output, {
574
- activityId: import_smithy_client.expectString,
575
- reward: /* @__PURE__ */ __name((_) => de_ActivityReward((0, import_core2.awsExpectUnion)(_), context), "reward"),
576
- status: import_smithy_client.expectString,
577
- title: import_smithy_client.expectString
578
- });
579
- }, "de_ActivitySummary");
580
- var de_FreeTierUsage = /* @__PURE__ */ __name((output, context) => {
581
- return (0, import_smithy_client.take)(output, {
582
- actualUsageAmount: import_smithy_client.limitedParseDouble,
583
- description: import_smithy_client.expectString,
584
- forecastedUsageAmount: import_smithy_client.limitedParseDouble,
585
- freeTierType: import_smithy_client.expectString,
586
- limit: import_smithy_client.limitedParseDouble,
587
- operation: import_smithy_client.expectString,
588
- region: import_smithy_client.expectString,
589
- service: import_smithy_client.expectString,
590
- unit: import_smithy_client.expectString,
591
- usageType: import_smithy_client.expectString
592
- });
593
- }, "de_FreeTierUsage");
594
- var de_FreeTierUsages = /* @__PURE__ */ __name((output, context) => {
595
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
596
- return de_FreeTierUsage(entry, context);
597
- });
598
- return retVal;
599
- }, "de_FreeTierUsages");
600
- var de_GetAccountActivityResponse = /* @__PURE__ */ __name((output, context) => {
601
- return (0, import_smithy_client.take)(output, {
602
- activityId: import_smithy_client.expectString,
603
- completedAt: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)), "completedAt"),
604
- description: import_smithy_client.expectString,
605
- estimatedTimeToCompleteInMinutes: import_smithy_client.expectInt32,
606
- expiresAt: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)), "expiresAt"),
607
- instructionsUrl: import_smithy_client.expectString,
608
- reward: /* @__PURE__ */ __name((_) => de_ActivityReward((0, import_core2.awsExpectUnion)(_), context), "reward"),
609
- startedAt: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)), "startedAt"),
610
- status: import_smithy_client.expectString,
611
- title: import_smithy_client.expectString
612
- });
613
- }, "de_GetAccountActivityResponse");
614
- var de_GetAccountPlanStateResponse = /* @__PURE__ */ __name((output, context) => {
615
- return (0, import_smithy_client.take)(output, {
616
- accountId: import_smithy_client.expectString,
617
- accountPlanExpirationDate: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)), "accountPlanExpirationDate"),
618
- accountPlanRemainingCredits: /* @__PURE__ */ __name((_) => de_MonetaryAmount(_, context), "accountPlanRemainingCredits"),
619
- accountPlanStatus: import_smithy_client.expectString,
620
- accountPlanType: import_smithy_client.expectString
621
- });
622
- }, "de_GetAccountPlanStateResponse");
623
- var de_GetFreeTierUsageResponse = /* @__PURE__ */ __name((output, context) => {
624
- return (0, import_smithy_client.take)(output, {
625
- freeTierUsages: /* @__PURE__ */ __name((_) => de_FreeTierUsages(_, context), "freeTierUsages"),
626
- nextToken: import_smithy_client.expectString
627
- });
628
- }, "de_GetFreeTierUsageResponse");
629
- var de_ListAccountActivitiesResponse = /* @__PURE__ */ __name((output, context) => {
630
- return (0, import_smithy_client.take)(output, {
631
- activities: /* @__PURE__ */ __name((_) => de_Activities(_, context), "activities"),
632
- nextToken: import_smithy_client.expectString
633
- });
634
- }, "de_ListAccountActivitiesResponse");
635
- var de_MonetaryAmount = /* @__PURE__ */ __name((output, context) => {
636
- return (0, import_smithy_client.take)(output, {
637
- amount: import_smithy_client.limitedParseDouble,
638
- unit: import_smithy_client.expectString
639
- });
640
- }, "de_MonetaryAmount");
641
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
642
- httpStatusCode: output.statusCode,
643
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
644
- extendedRequestId: output.headers["x-amz-id-2"],
645
- cfId: output.headers["x-amz-cf-id"]
646
- }), "deserializeMetadata");
647
- var throwDefaultError = (0, import_smithy_client.withBaseException)(FreeTierServiceException);
648
- var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
649
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
650
- const contents = {
651
- protocol,
652
- hostname,
653
- port,
654
- method: "POST",
655
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
656
- headers
657
- };
658
- if (resolvedHostname !== void 0) {
659
- contents.hostname = resolvedHostname;
660
- }
661
- if (body !== void 0) {
662
- contents.body = body;
663
- }
664
- return new import_protocol_http.HttpRequest(contents);
665
- }, "buildHttpRpcRequest");
666
- function sharedHeaders(operation) {
667
- return {
668
- "content-type": "application/x-amz-json-1.0",
669
- "x-amz-target": `AWSFreeTierService.${operation}`
670
- };
671
- }
672
- __name(sharedHeaders, "sharedHeaders");
673
-
674
- // src/commands/GetAccountActivityCommand.ts
675
- var GetAccountActivityCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
676
- return [
677
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
678
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
679
- ];
680
- }).s("AWSFreeTierService", "GetAccountActivity", {}).n("FreeTierClient", "GetAccountActivityCommand").f(void 0, void 0).ser(se_GetAccountActivityCommand).de(de_GetAccountActivityCommand).build() {
681
- static {
682
- __name(this, "GetAccountActivityCommand");
683
- }
407
+ const se_Expression = (input, context) => {
408
+ return smithyClient.take(input, {
409
+ And: (_) => se_Expressions(_),
410
+ Dimensions: smithyClient._json,
411
+ Not: (_) => se_Expression(_),
412
+ Or: (_) => se_Expressions(_),
413
+ });
684
414
  };
685
-
686
- // src/commands/GetAccountPlanStateCommand.ts
687
-
688
-
689
-
690
- var GetAccountPlanStateCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
691
- return [
692
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
693
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
694
- ];
695
- }).s("AWSFreeTierService", "GetAccountPlanState", {}).n("FreeTierClient", "GetAccountPlanStateCommand").f(void 0, void 0).ser(se_GetAccountPlanStateCommand).de(de_GetAccountPlanStateCommand).build() {
696
- static {
697
- __name(this, "GetAccountPlanStateCommand");
698
- }
415
+ const se_Expressions = (input, context) => {
416
+ return input
417
+ .filter((e) => e != null)
418
+ .map((entry) => {
419
+ return se_Expression(entry);
420
+ });
699
421
  };
700
-
701
- // src/commands/GetFreeTierUsageCommand.ts
702
-
703
-
704
-
705
- var GetFreeTierUsageCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
706
- return [
707
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
708
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
709
- ];
710
- }).s("AWSFreeTierService", "GetFreeTierUsage", {}).n("FreeTierClient", "GetFreeTierUsageCommand").f(void 0, void 0).ser(se_GetFreeTierUsageCommand).de(de_GetFreeTierUsageCommand).build() {
711
- static {
712
- __name(this, "GetFreeTierUsageCommand");
713
- }
422
+ const se_GetFreeTierUsageRequest = (input, context) => {
423
+ return smithyClient.take(input, {
424
+ filter: (_) => se_Expression(_),
425
+ maxResults: [],
426
+ nextToken: [],
427
+ });
714
428
  };
715
-
716
- // src/commands/ListAccountActivitiesCommand.ts
717
-
718
-
719
-
720
- var ListAccountActivitiesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
721
- return [
722
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
723
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
724
- ];
725
- }).s("AWSFreeTierService", "ListAccountActivities", {}).n("FreeTierClient", "ListAccountActivitiesCommand").f(void 0, void 0).ser(se_ListAccountActivitiesCommand).de(de_ListAccountActivitiesCommand).build() {
726
- static {
727
- __name(this, "ListAccountActivitiesCommand");
728
- }
429
+ const de_Activities = (output, context) => {
430
+ const retVal = (output || [])
431
+ .filter((e) => e != null)
432
+ .map((entry) => {
433
+ return de_ActivitySummary(entry);
434
+ });
435
+ return retVal;
729
436
  };
437
+ const de_ActivityReward = (output, context) => {
438
+ if (output.credit != null) {
439
+ return {
440
+ credit: de_MonetaryAmount(output.credit),
441
+ };
442
+ }
443
+ return { $unknown: Object.entries(output)[0] };
444
+ };
445
+ const de_ActivitySummary = (output, context) => {
446
+ return smithyClient.take(output, {
447
+ activityId: smithyClient.expectString,
448
+ reward: (_) => de_ActivityReward(core$1.awsExpectUnion(_)),
449
+ status: smithyClient.expectString,
450
+ title: smithyClient.expectString,
451
+ });
452
+ };
453
+ const de_FreeTierUsage = (output, context) => {
454
+ return smithyClient.take(output, {
455
+ actualUsageAmount: smithyClient.limitedParseDouble,
456
+ description: smithyClient.expectString,
457
+ forecastedUsageAmount: smithyClient.limitedParseDouble,
458
+ freeTierType: smithyClient.expectString,
459
+ limit: smithyClient.limitedParseDouble,
460
+ operation: smithyClient.expectString,
461
+ region: smithyClient.expectString,
462
+ service: smithyClient.expectString,
463
+ unit: smithyClient.expectString,
464
+ usageType: smithyClient.expectString,
465
+ });
466
+ };
467
+ const de_FreeTierUsages = (output, context) => {
468
+ const retVal = (output || [])
469
+ .filter((e) => e != null)
470
+ .map((entry) => {
471
+ return de_FreeTierUsage(entry);
472
+ });
473
+ return retVal;
474
+ };
475
+ const de_GetAccountActivityResponse = (output, context) => {
476
+ return smithyClient.take(output, {
477
+ activityId: smithyClient.expectString,
478
+ completedAt: (_) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_)),
479
+ description: smithyClient.expectString,
480
+ estimatedTimeToCompleteInMinutes: smithyClient.expectInt32,
481
+ expiresAt: (_) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_)),
482
+ instructionsUrl: smithyClient.expectString,
483
+ reward: (_) => de_ActivityReward(core$1.awsExpectUnion(_)),
484
+ startedAt: (_) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_)),
485
+ status: smithyClient.expectString,
486
+ title: smithyClient.expectString,
487
+ });
488
+ };
489
+ const de_GetAccountPlanStateResponse = (output, context) => {
490
+ return smithyClient.take(output, {
491
+ accountId: smithyClient.expectString,
492
+ accountPlanExpirationDate: (_) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_)),
493
+ accountPlanRemainingCredits: (_) => de_MonetaryAmount(_),
494
+ accountPlanStatus: smithyClient.expectString,
495
+ accountPlanType: smithyClient.expectString,
496
+ });
497
+ };
498
+ const de_GetFreeTierUsageResponse = (output, context) => {
499
+ return smithyClient.take(output, {
500
+ freeTierUsages: (_) => de_FreeTierUsages(_),
501
+ nextToken: smithyClient.expectString,
502
+ });
503
+ };
504
+ const de_ListAccountActivitiesResponse = (output, context) => {
505
+ return smithyClient.take(output, {
506
+ activities: (_) => de_Activities(_),
507
+ nextToken: smithyClient.expectString,
508
+ });
509
+ };
510
+ const de_MonetaryAmount = (output, context) => {
511
+ return smithyClient.take(output, {
512
+ amount: smithyClient.limitedParseDouble,
513
+ unit: smithyClient.expectString,
514
+ });
515
+ };
516
+ const deserializeMetadata = (output) => ({
517
+ httpStatusCode: output.statusCode,
518
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
519
+ extendedRequestId: output.headers["x-amz-id-2"],
520
+ cfId: output.headers["x-amz-cf-id"],
521
+ });
522
+ const throwDefaultError = smithyClient.withBaseException(FreeTierServiceException);
523
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
524
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
525
+ const contents = {
526
+ protocol,
527
+ hostname,
528
+ port,
529
+ method: "POST",
530
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
531
+ headers,
532
+ };
533
+ if (body !== undefined) {
534
+ contents.body = body;
535
+ }
536
+ return new protocolHttp.HttpRequest(contents);
537
+ };
538
+ function sharedHeaders(operation) {
539
+ return {
540
+ "content-type": "application/x-amz-json-1.0",
541
+ "x-amz-target": `AWSFreeTierService.${operation}`,
542
+ };
543
+ }
730
544
 
731
- // src/commands/UpgradeAccountPlanCommand.ts
732
-
545
+ class GetAccountActivityCommand extends smithyClient.Command
546
+ .classBuilder()
547
+ .ep(commonParams)
548
+ .m(function (Command, cs, config, o) {
549
+ return [
550
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
551
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
552
+ ];
553
+ })
554
+ .s("AWSFreeTierService", "GetAccountActivity", {})
555
+ .n("FreeTierClient", "GetAccountActivityCommand")
556
+ .f(void 0, void 0)
557
+ .ser(se_GetAccountActivityCommand)
558
+ .de(de_GetAccountActivityCommand)
559
+ .build() {
560
+ }
733
561
 
562
+ class GetAccountPlanStateCommand extends smithyClient.Command
563
+ .classBuilder()
564
+ .ep(commonParams)
565
+ .m(function (Command, cs, config, o) {
566
+ return [
567
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
568
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
569
+ ];
570
+ })
571
+ .s("AWSFreeTierService", "GetAccountPlanState", {})
572
+ .n("FreeTierClient", "GetAccountPlanStateCommand")
573
+ .f(void 0, void 0)
574
+ .ser(se_GetAccountPlanStateCommand)
575
+ .de(de_GetAccountPlanStateCommand)
576
+ .build() {
577
+ }
734
578
 
735
- var UpgradeAccountPlanCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
736
- return [
737
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
738
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
739
- ];
740
- }).s("AWSFreeTierService", "UpgradeAccountPlan", {}).n("FreeTierClient", "UpgradeAccountPlanCommand").f(void 0, void 0).ser(se_UpgradeAccountPlanCommand).de(de_UpgradeAccountPlanCommand).build() {
741
- static {
742
- __name(this, "UpgradeAccountPlanCommand");
743
- }
744
- };
579
+ class GetFreeTierUsageCommand extends smithyClient.Command
580
+ .classBuilder()
581
+ .ep(commonParams)
582
+ .m(function (Command, cs, config, o) {
583
+ return [
584
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
585
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
586
+ ];
587
+ })
588
+ .s("AWSFreeTierService", "GetFreeTierUsage", {})
589
+ .n("FreeTierClient", "GetFreeTierUsageCommand")
590
+ .f(void 0, void 0)
591
+ .ser(se_GetFreeTierUsageCommand)
592
+ .de(de_GetFreeTierUsageCommand)
593
+ .build() {
594
+ }
745
595
 
746
- // src/FreeTier.ts
747
- var commands = {
748
- GetAccountActivityCommand,
749
- GetAccountPlanStateCommand,
750
- GetFreeTierUsageCommand,
751
- ListAccountActivitiesCommand,
752
- UpgradeAccountPlanCommand
753
- };
754
- var FreeTier = class extends FreeTierClient {
755
- static {
756
- __name(this, "FreeTier");
757
- }
758
- };
759
- (0, import_smithy_client.createAggregatedClient)(commands, FreeTier);
596
+ class ListAccountActivitiesCommand extends smithyClient.Command
597
+ .classBuilder()
598
+ .ep(commonParams)
599
+ .m(function (Command, cs, config, o) {
600
+ return [
601
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
602
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
603
+ ];
604
+ })
605
+ .s("AWSFreeTierService", "ListAccountActivities", {})
606
+ .n("FreeTierClient", "ListAccountActivitiesCommand")
607
+ .f(void 0, void 0)
608
+ .ser(se_ListAccountActivitiesCommand)
609
+ .de(de_ListAccountActivitiesCommand)
610
+ .build() {
611
+ }
760
612
 
761
- // src/pagination/GetFreeTierUsagePaginator.ts
613
+ class UpgradeAccountPlanCommand extends smithyClient.Command
614
+ .classBuilder()
615
+ .ep(commonParams)
616
+ .m(function (Command, cs, config, o) {
617
+ return [
618
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
619
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
620
+ ];
621
+ })
622
+ .s("AWSFreeTierService", "UpgradeAccountPlan", {})
623
+ .n("FreeTierClient", "UpgradeAccountPlanCommand")
624
+ .f(void 0, void 0)
625
+ .ser(se_UpgradeAccountPlanCommand)
626
+ .de(de_UpgradeAccountPlanCommand)
627
+ .build() {
628
+ }
762
629
 
763
- var paginateGetFreeTierUsage = (0, import_core.createPaginator)(FreeTierClient, GetFreeTierUsageCommand, "nextToken", "nextToken", "maxResults");
630
+ const commands = {
631
+ GetAccountActivityCommand,
632
+ GetAccountPlanStateCommand,
633
+ GetFreeTierUsageCommand,
634
+ ListAccountActivitiesCommand,
635
+ UpgradeAccountPlanCommand,
636
+ };
637
+ class FreeTier extends FreeTierClient {
638
+ }
639
+ smithyClient.createAggregatedClient(commands, FreeTier);
764
640
 
765
- // src/pagination/ListAccountActivitiesPaginator.ts
641
+ const paginateGetFreeTierUsage = core.createPaginator(FreeTierClient, GetFreeTierUsageCommand, "nextToken", "nextToken", "maxResults");
766
642
 
767
- var paginateListAccountActivities = (0, import_core.createPaginator)(FreeTierClient, ListAccountActivitiesCommand, "nextToken", "nextToken", "maxResults");
768
- // Annotate the CommonJS export names for ESM import in node:
643
+ const paginateListAccountActivities = core.createPaginator(FreeTierClient, ListAccountActivitiesCommand, "nextToken", "nextToken", "maxResults");
769
644
 
770
- 0 && (module.exports = {
771
- FreeTierServiceException,
772
- __Client,
773
- FreeTierClient,
774
- FreeTier,
775
- $Command,
776
- GetAccountActivityCommand,
777
- GetAccountPlanStateCommand,
778
- GetFreeTierUsageCommand,
779
- ListAccountActivitiesCommand,
780
- UpgradeAccountPlanCommand,
781
- paginateGetFreeTierUsage,
782
- paginateListAccountActivities,
783
- AccessDeniedException,
784
- AccountPlanStatus,
785
- AccountPlanType,
786
- CurrencyCode,
787
- ActivityReward,
788
- ActivityStatus,
789
- LanguageCode,
790
- InternalServerException,
791
- ResourceNotFoundException,
792
- ThrottlingException,
793
- ValidationException,
794
- Dimension,
795
- MatchOption
645
+ Object.defineProperty(exports, "$Command", {
646
+ enumerable: true,
647
+ get: function () { return smithyClient.Command; }
796
648
  });
797
-
649
+ Object.defineProperty(exports, "__Client", {
650
+ enumerable: true,
651
+ get: function () { return smithyClient.Client; }
652
+ });
653
+ exports.AccessDeniedException = AccessDeniedException;
654
+ exports.AccountPlanStatus = AccountPlanStatus;
655
+ exports.AccountPlanType = AccountPlanType;
656
+ exports.ActivityStatus = ActivityStatus;
657
+ exports.CurrencyCode = CurrencyCode;
658
+ exports.Dimension = Dimension;
659
+ exports.FreeTier = FreeTier;
660
+ exports.FreeTierClient = FreeTierClient;
661
+ exports.FreeTierServiceException = FreeTierServiceException;
662
+ exports.GetAccountActivityCommand = GetAccountActivityCommand;
663
+ exports.GetAccountPlanStateCommand = GetAccountPlanStateCommand;
664
+ exports.GetFreeTierUsageCommand = GetFreeTierUsageCommand;
665
+ exports.InternalServerException = InternalServerException;
666
+ exports.LanguageCode = LanguageCode;
667
+ exports.ListAccountActivitiesCommand = ListAccountActivitiesCommand;
668
+ exports.MatchOption = MatchOption;
669
+ exports.ResourceNotFoundException = ResourceNotFoundException;
670
+ exports.ThrottlingException = ThrottlingException;
671
+ exports.UpgradeAccountPlanCommand = UpgradeAccountPlanCommand;
672
+ exports.ValidationException = ValidationException;
673
+ exports.paginateGetFreeTierUsage = paginateGetFreeTierUsage;
674
+ exports.paginateListAccountActivities = paginateListAccountActivities;