@aws-sdk/client-marketplace-metering 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 +785 -980
  2. package/package.json +37 -37
package/dist-cjs/index.js CHANGED
@@ -1,1038 +1,843 @@
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 });
1
+ 'use strict';
2
+
3
+ var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
4
+ var middlewareLogger = require('@aws-sdk/middleware-logger');
5
+ var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
6
+ var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
7
+ var configResolver = require('@smithy/config-resolver');
8
+ var core = require('@smithy/core');
9
+ var middlewareContentLength = require('@smithy/middleware-content-length');
10
+ var middlewareEndpoint = require('@smithy/middleware-endpoint');
11
+ var middlewareRetry = require('@smithy/middleware-retry');
12
+ var smithyClient = require('@smithy/smithy-client');
13
+ var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
14
+ var runtimeConfig = require('./runtimeConfig');
15
+ var regionConfigResolver = require('@aws-sdk/region-config-resolver');
16
+ var protocolHttp = require('@smithy/protocol-http');
17
+ var middlewareSerde = require('@smithy/middleware-serde');
18
+ var core$1 = require('@aws-sdk/core');
19
+
20
+ const resolveClientEndpointParameters = (options) => {
21
+ return Object.assign(options, {
22
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
23
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
24
+ defaultSigningName: "aws-marketplace",
25
+ });
10
26
  };
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;
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" },
18
32
  };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- BatchMeterUsageCommand: () => BatchMeterUsageCommand,
25
- CustomerNotEntitledException: () => CustomerNotEntitledException,
26
- DisabledApiException: () => DisabledApiException,
27
- DuplicateRequestException: () => DuplicateRequestException,
28
- ExpiredTokenException: () => ExpiredTokenException,
29
- InternalServiceErrorException: () => InternalServiceErrorException,
30
- InvalidCustomerIdentifierException: () => InvalidCustomerIdentifierException,
31
- InvalidEndpointRegionException: () => InvalidEndpointRegionException,
32
- InvalidProductCodeException: () => InvalidProductCodeException,
33
- InvalidPublicKeyVersionException: () => InvalidPublicKeyVersionException,
34
- InvalidRegionException: () => InvalidRegionException,
35
- InvalidTagException: () => InvalidTagException,
36
- InvalidTokenException: () => InvalidTokenException,
37
- InvalidUsageAllocationsException: () => InvalidUsageAllocationsException,
38
- InvalidUsageDimensionException: () => InvalidUsageDimensionException,
39
- MarketplaceMetering: () => MarketplaceMetering,
40
- MarketplaceMeteringClient: () => MarketplaceMeteringClient,
41
- MarketplaceMeteringServiceException: () => MarketplaceMeteringServiceException,
42
- MeterUsageCommand: () => MeterUsageCommand,
43
- PlatformNotSupportedException: () => PlatformNotSupportedException,
44
- RegisterUsageCommand: () => RegisterUsageCommand,
45
- ResolveCustomerCommand: () => ResolveCustomerCommand,
46
- ThrottlingException: () => ThrottlingException,
47
- TimestampOutOfBoundsException: () => TimestampOutOfBoundsException,
48
- UsageRecordResultStatus: () => UsageRecordResultStatus,
49
- __Client: () => import_smithy_client.Client
50
- });
51
- module.exports = __toCommonJS(index_exports);
52
-
53
- // src/MarketplaceMeteringClient.ts
54
- var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
55
- var import_middleware_logger = require("@aws-sdk/middleware-logger");
56
- var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
57
- var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
58
- var import_config_resolver = require("@smithy/config-resolver");
59
- var import_core = require("@smithy/core");
60
- var import_middleware_content_length = require("@smithy/middleware-content-length");
61
- var import_middleware_endpoint = require("@smithy/middleware-endpoint");
62
- var import_middleware_retry = require("@smithy/middleware-retry");
63
33
 
64
- var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
65
-
66
- // src/endpoint/EndpointParameters.ts
67
- var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
68
- return Object.assign(options, {
69
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
70
- useFipsEndpoint: options.useFipsEndpoint ?? false,
71
- defaultSigningName: "aws-marketplace"
72
- });
73
- }, "resolveClientEndpointParameters");
74
- var commonParams = {
75
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
76
- Endpoint: { type: "builtInParams", name: "endpoint" },
77
- Region: { type: "builtInParams", name: "region" },
78
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
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
+ };
79
71
  };
80
72
 
81
- // src/MarketplaceMeteringClient.ts
82
- var import_runtimeConfig = require("././runtimeConfig");
83
-
84
- // src/runtimeExtensions.ts
85
- var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
86
- var import_protocol_http = require("@smithy/protocol-http");
87
- 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
+ };
88
78
 
89
- // src/auth/httpAuthExtensionConfiguration.ts
90
- var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
91
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
92
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
93
- let _credentials = runtimeConfig.credentials;
94
- return {
95
- setHttpAuthScheme(httpAuthScheme) {
96
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
97
- if (index === -1) {
98
- _httpAuthSchemes.push(httpAuthScheme);
99
- } else {
100
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
101
- }
102
- },
103
- httpAuthSchemes() {
104
- return _httpAuthSchemes;
105
- },
106
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
107
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
108
- },
109
- httpAuthSchemeProvider() {
110
- return _httpAuthSchemeProvider;
111
- },
112
- setCredentials(credentials) {
113
- _credentials = credentials;
114
- },
115
- credentials() {
116
- return _credentials;
79
+ class MarketplaceMeteringClient 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.defaultMarketplaceMeteringHttpAuthSchemeParametersProvider,
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();
117
110
  }
118
- };
119
- }, "getHttpAuthExtensionConfiguration");
120
- var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
121
- return {
122
- httpAuthSchemes: config.httpAuthSchemes(),
123
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
124
- credentials: config.credentials()
125
- };
126
- }, "resolveHttpAuthRuntimeConfig");
111
+ }
127
112
 
128
- // src/runtimeExtensions.ts
129
- var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
130
- const extensionConfiguration = Object.assign(
131
- (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
132
- (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
133
- (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
134
- getHttpAuthExtensionConfiguration(runtimeConfig)
135
- );
136
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
137
- return Object.assign(
138
- runtimeConfig,
139
- (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
140
- (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
141
- (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
142
- resolveHttpAuthRuntimeConfig(extensionConfiguration)
143
- );
144
- }, "resolveRuntimeExtensions");
113
+ class MarketplaceMeteringServiceException extends smithyClient.ServiceException {
114
+ constructor(options) {
115
+ super(options);
116
+ Object.setPrototypeOf(this, MarketplaceMeteringServiceException.prototype);
117
+ }
118
+ }
145
119
 
146
- // src/MarketplaceMeteringClient.ts
147
- var MarketplaceMeteringClient = class extends import_smithy_client.Client {
148
- static {
149
- __name(this, "MarketplaceMeteringClient");
150
- }
151
- /**
152
- * The resolved configuration of MarketplaceMeteringClient class. This is resolved and normalized from the {@link MarketplaceMeteringClientConfig | constructor configuration interface}.
153
- */
154
- config;
155
- constructor(...[configuration]) {
156
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
157
- super(_config_0);
158
- this.initConfig = _config_0;
159
- const _config_1 = resolveClientEndpointParameters(_config_0);
160
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
161
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
162
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
163
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
164
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
165
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
166
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
167
- this.config = _config_8;
168
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
169
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
170
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
171
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
172
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
173
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
174
- this.middlewareStack.use(
175
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
176
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultMarketplaceMeteringHttpAuthSchemeParametersProvider,
177
- identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
178
- "aws.auth#sigv4": config.credentials
179
- }), "identityProviderConfigProvider")
180
- })
181
- );
182
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
183
- }
184
- /**
185
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
186
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
187
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
188
- */
189
- destroy() {
190
- super.destroy();
191
- }
120
+ const UsageRecordResultStatus = {
121
+ CUSTOMER_NOT_SUBSCRIBED: "CustomerNotSubscribed",
122
+ DUPLICATE_RECORD: "DuplicateRecord",
123
+ SUCCESS: "Success",
192
124
  };
125
+ class DisabledApiException extends MarketplaceMeteringServiceException {
126
+ name = "DisabledApiException";
127
+ $fault = "client";
128
+ constructor(opts) {
129
+ super({
130
+ name: "DisabledApiException",
131
+ $fault: "client",
132
+ ...opts,
133
+ });
134
+ Object.setPrototypeOf(this, DisabledApiException.prototype);
135
+ }
136
+ }
137
+ class InternalServiceErrorException extends MarketplaceMeteringServiceException {
138
+ name = "InternalServiceErrorException";
139
+ $fault = "server";
140
+ constructor(opts) {
141
+ super({
142
+ name: "InternalServiceErrorException",
143
+ $fault: "server",
144
+ ...opts,
145
+ });
146
+ Object.setPrototypeOf(this, InternalServiceErrorException.prototype);
147
+ }
148
+ }
149
+ class InvalidCustomerIdentifierException extends MarketplaceMeteringServiceException {
150
+ name = "InvalidCustomerIdentifierException";
151
+ $fault = "client";
152
+ constructor(opts) {
153
+ super({
154
+ name: "InvalidCustomerIdentifierException",
155
+ $fault: "client",
156
+ ...opts,
157
+ });
158
+ Object.setPrototypeOf(this, InvalidCustomerIdentifierException.prototype);
159
+ }
160
+ }
161
+ class InvalidProductCodeException extends MarketplaceMeteringServiceException {
162
+ name = "InvalidProductCodeException";
163
+ $fault = "client";
164
+ constructor(opts) {
165
+ super({
166
+ name: "InvalidProductCodeException",
167
+ $fault: "client",
168
+ ...opts,
169
+ });
170
+ Object.setPrototypeOf(this, InvalidProductCodeException.prototype);
171
+ }
172
+ }
173
+ class InvalidTagException extends MarketplaceMeteringServiceException {
174
+ name = "InvalidTagException";
175
+ $fault = "client";
176
+ constructor(opts) {
177
+ super({
178
+ name: "InvalidTagException",
179
+ $fault: "client",
180
+ ...opts,
181
+ });
182
+ Object.setPrototypeOf(this, InvalidTagException.prototype);
183
+ }
184
+ }
185
+ class InvalidUsageAllocationsException extends MarketplaceMeteringServiceException {
186
+ name = "InvalidUsageAllocationsException";
187
+ $fault = "client";
188
+ constructor(opts) {
189
+ super({
190
+ name: "InvalidUsageAllocationsException",
191
+ $fault: "client",
192
+ ...opts,
193
+ });
194
+ Object.setPrototypeOf(this, InvalidUsageAllocationsException.prototype);
195
+ }
196
+ }
197
+ class InvalidUsageDimensionException extends MarketplaceMeteringServiceException {
198
+ name = "InvalidUsageDimensionException";
199
+ $fault = "client";
200
+ constructor(opts) {
201
+ super({
202
+ name: "InvalidUsageDimensionException",
203
+ $fault: "client",
204
+ ...opts,
205
+ });
206
+ Object.setPrototypeOf(this, InvalidUsageDimensionException.prototype);
207
+ }
208
+ }
209
+ class ThrottlingException extends MarketplaceMeteringServiceException {
210
+ name = "ThrottlingException";
211
+ $fault = "client";
212
+ constructor(opts) {
213
+ super({
214
+ name: "ThrottlingException",
215
+ $fault: "client",
216
+ ...opts,
217
+ });
218
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
219
+ }
220
+ }
221
+ class TimestampOutOfBoundsException extends MarketplaceMeteringServiceException {
222
+ name = "TimestampOutOfBoundsException";
223
+ $fault = "client";
224
+ constructor(opts) {
225
+ super({
226
+ name: "TimestampOutOfBoundsException",
227
+ $fault: "client",
228
+ ...opts,
229
+ });
230
+ Object.setPrototypeOf(this, TimestampOutOfBoundsException.prototype);
231
+ }
232
+ }
233
+ class CustomerNotEntitledException extends MarketplaceMeteringServiceException {
234
+ name = "CustomerNotEntitledException";
235
+ $fault = "client";
236
+ constructor(opts) {
237
+ super({
238
+ name: "CustomerNotEntitledException",
239
+ $fault: "client",
240
+ ...opts,
241
+ });
242
+ Object.setPrototypeOf(this, CustomerNotEntitledException.prototype);
243
+ }
244
+ }
245
+ class DuplicateRequestException extends MarketplaceMeteringServiceException {
246
+ name = "DuplicateRequestException";
247
+ $fault = "client";
248
+ constructor(opts) {
249
+ super({
250
+ name: "DuplicateRequestException",
251
+ $fault: "client",
252
+ ...opts,
253
+ });
254
+ Object.setPrototypeOf(this, DuplicateRequestException.prototype);
255
+ }
256
+ }
257
+ class InvalidEndpointRegionException extends MarketplaceMeteringServiceException {
258
+ name = "InvalidEndpointRegionException";
259
+ $fault = "client";
260
+ constructor(opts) {
261
+ super({
262
+ name: "InvalidEndpointRegionException",
263
+ $fault: "client",
264
+ ...opts,
265
+ });
266
+ Object.setPrototypeOf(this, InvalidEndpointRegionException.prototype);
267
+ }
268
+ }
269
+ class InvalidPublicKeyVersionException extends MarketplaceMeteringServiceException {
270
+ name = "InvalidPublicKeyVersionException";
271
+ $fault = "client";
272
+ constructor(opts) {
273
+ super({
274
+ name: "InvalidPublicKeyVersionException",
275
+ $fault: "client",
276
+ ...opts,
277
+ });
278
+ Object.setPrototypeOf(this, InvalidPublicKeyVersionException.prototype);
279
+ }
280
+ }
281
+ class InvalidRegionException extends MarketplaceMeteringServiceException {
282
+ name = "InvalidRegionException";
283
+ $fault = "client";
284
+ constructor(opts) {
285
+ super({
286
+ name: "InvalidRegionException",
287
+ $fault: "client",
288
+ ...opts,
289
+ });
290
+ Object.setPrototypeOf(this, InvalidRegionException.prototype);
291
+ }
292
+ }
293
+ class PlatformNotSupportedException extends MarketplaceMeteringServiceException {
294
+ name = "PlatformNotSupportedException";
295
+ $fault = "client";
296
+ constructor(opts) {
297
+ super({
298
+ name: "PlatformNotSupportedException",
299
+ $fault: "client",
300
+ ...opts,
301
+ });
302
+ Object.setPrototypeOf(this, PlatformNotSupportedException.prototype);
303
+ }
304
+ }
305
+ class ExpiredTokenException extends MarketplaceMeteringServiceException {
306
+ name = "ExpiredTokenException";
307
+ $fault = "client";
308
+ constructor(opts) {
309
+ super({
310
+ name: "ExpiredTokenException",
311
+ $fault: "client",
312
+ ...opts,
313
+ });
314
+ Object.setPrototypeOf(this, ExpiredTokenException.prototype);
315
+ }
316
+ }
317
+ class InvalidTokenException extends MarketplaceMeteringServiceException {
318
+ name = "InvalidTokenException";
319
+ $fault = "client";
320
+ constructor(opts) {
321
+ super({
322
+ name: "InvalidTokenException",
323
+ $fault: "client",
324
+ ...opts,
325
+ });
326
+ Object.setPrototypeOf(this, InvalidTokenException.prototype);
327
+ }
328
+ }
193
329
 
194
- // src/MarketplaceMetering.ts
195
-
196
-
197
- // src/commands/BatchMeterUsageCommand.ts
198
-
199
- var import_middleware_serde = require("@smithy/middleware-serde");
200
-
201
-
202
- // src/protocols/Aws_json1_1.ts
203
- var import_core2 = require("@aws-sdk/core");
204
-
205
-
206
-
207
- // src/models/MarketplaceMeteringServiceException.ts
208
-
209
- var MarketplaceMeteringServiceException = class _MarketplaceMeteringServiceException extends import_smithy_client.ServiceException {
210
- static {
211
- __name(this, "MarketplaceMeteringServiceException");
212
- }
213
- /**
214
- * @internal
215
- */
216
- constructor(options) {
217
- super(options);
218
- Object.setPrototypeOf(this, _MarketplaceMeteringServiceException.prototype);
219
- }
330
+ const se_BatchMeterUsageCommand = async (input, context) => {
331
+ const headers = sharedHeaders("BatchMeterUsage");
332
+ let body;
333
+ body = JSON.stringify(se_BatchMeterUsageRequest(input));
334
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
220
335
  };
221
-
222
- // src/models/models_0.ts
223
- var UsageRecordResultStatus = {
224
- CUSTOMER_NOT_SUBSCRIBED: "CustomerNotSubscribed",
225
- DUPLICATE_RECORD: "DuplicateRecord",
226
- SUCCESS: "Success"
336
+ const se_MeterUsageCommand = async (input, context) => {
337
+ const headers = sharedHeaders("MeterUsage");
338
+ let body;
339
+ body = JSON.stringify(se_MeterUsageRequest(input));
340
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
227
341
  };
228
- var DisabledApiException = class _DisabledApiException extends MarketplaceMeteringServiceException {
229
- static {
230
- __name(this, "DisabledApiException");
231
- }
232
- name = "DisabledApiException";
233
- $fault = "client";
234
- /**
235
- * @internal
236
- */
237
- constructor(opts) {
238
- super({
239
- name: "DisabledApiException",
240
- $fault: "client",
241
- ...opts
342
+ const se_RegisterUsageCommand = async (input, context) => {
343
+ const headers = sharedHeaders("RegisterUsage");
344
+ let body;
345
+ body = JSON.stringify(smithyClient._json(input));
346
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
347
+ };
348
+ const se_ResolveCustomerCommand = async (input, context) => {
349
+ const headers = sharedHeaders("ResolveCustomer");
350
+ let body;
351
+ body = JSON.stringify(smithyClient._json(input));
352
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
353
+ };
354
+ const de_BatchMeterUsageCommand = async (output, context) => {
355
+ if (output.statusCode >= 300) {
356
+ return de_CommandError(output, context);
357
+ }
358
+ const data = await core$1.parseJsonBody(output.body, context);
359
+ let contents = {};
360
+ contents = de_BatchMeterUsageResult(data);
361
+ const response = {
362
+ $metadata: deserializeMetadata(output),
363
+ ...contents,
364
+ };
365
+ return response;
366
+ };
367
+ const de_MeterUsageCommand = async (output, context) => {
368
+ if (output.statusCode >= 300) {
369
+ return de_CommandError(output, context);
370
+ }
371
+ const data = await core$1.parseJsonBody(output.body, context);
372
+ let contents = {};
373
+ contents = smithyClient._json(data);
374
+ const response = {
375
+ $metadata: deserializeMetadata(output),
376
+ ...contents,
377
+ };
378
+ return response;
379
+ };
380
+ const de_RegisterUsageCommand = async (output, context) => {
381
+ if (output.statusCode >= 300) {
382
+ return de_CommandError(output, context);
383
+ }
384
+ const data = await core$1.parseJsonBody(output.body, context);
385
+ let contents = {};
386
+ contents = de_RegisterUsageResult(data);
387
+ const response = {
388
+ $metadata: deserializeMetadata(output),
389
+ ...contents,
390
+ };
391
+ return response;
392
+ };
393
+ const de_ResolveCustomerCommand = async (output, context) => {
394
+ if (output.statusCode >= 300) {
395
+ return de_CommandError(output, context);
396
+ }
397
+ const data = await core$1.parseJsonBody(output.body, context);
398
+ let contents = {};
399
+ contents = smithyClient._json(data);
400
+ const response = {
401
+ $metadata: deserializeMetadata(output),
402
+ ...contents,
403
+ };
404
+ return response;
405
+ };
406
+ const de_CommandError = async (output, context) => {
407
+ const parsedOutput = {
408
+ ...output,
409
+ body: await core$1.parseJsonErrorBody(output.body, context),
410
+ };
411
+ const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
412
+ switch (errorCode) {
413
+ case "DisabledApiException":
414
+ case "com.amazonaws.marketplacemetering#DisabledApiException":
415
+ throw await de_DisabledApiExceptionRes(parsedOutput);
416
+ case "InternalServiceErrorException":
417
+ case "com.amazonaws.marketplacemetering#InternalServiceErrorException":
418
+ throw await de_InternalServiceErrorExceptionRes(parsedOutput);
419
+ case "InvalidCustomerIdentifierException":
420
+ case "com.amazonaws.marketplacemetering#InvalidCustomerIdentifierException":
421
+ throw await de_InvalidCustomerIdentifierExceptionRes(parsedOutput);
422
+ case "InvalidProductCodeException":
423
+ case "com.amazonaws.marketplacemetering#InvalidProductCodeException":
424
+ throw await de_InvalidProductCodeExceptionRes(parsedOutput);
425
+ case "InvalidTagException":
426
+ case "com.amazonaws.marketplacemetering#InvalidTagException":
427
+ throw await de_InvalidTagExceptionRes(parsedOutput);
428
+ case "InvalidUsageAllocationsException":
429
+ case "com.amazonaws.marketplacemetering#InvalidUsageAllocationsException":
430
+ throw await de_InvalidUsageAllocationsExceptionRes(parsedOutput);
431
+ case "InvalidUsageDimensionException":
432
+ case "com.amazonaws.marketplacemetering#InvalidUsageDimensionException":
433
+ throw await de_InvalidUsageDimensionExceptionRes(parsedOutput);
434
+ case "ThrottlingException":
435
+ case "com.amazonaws.marketplacemetering#ThrottlingException":
436
+ throw await de_ThrottlingExceptionRes(parsedOutput);
437
+ case "TimestampOutOfBoundsException":
438
+ case "com.amazonaws.marketplacemetering#TimestampOutOfBoundsException":
439
+ throw await de_TimestampOutOfBoundsExceptionRes(parsedOutput);
440
+ case "CustomerNotEntitledException":
441
+ case "com.amazonaws.marketplacemetering#CustomerNotEntitledException":
442
+ throw await de_CustomerNotEntitledExceptionRes(parsedOutput);
443
+ case "DuplicateRequestException":
444
+ case "com.amazonaws.marketplacemetering#DuplicateRequestException":
445
+ throw await de_DuplicateRequestExceptionRes(parsedOutput);
446
+ case "InvalidEndpointRegionException":
447
+ case "com.amazonaws.marketplacemetering#InvalidEndpointRegionException":
448
+ throw await de_InvalidEndpointRegionExceptionRes(parsedOutput);
449
+ case "InvalidPublicKeyVersionException":
450
+ case "com.amazonaws.marketplacemetering#InvalidPublicKeyVersionException":
451
+ throw await de_InvalidPublicKeyVersionExceptionRes(parsedOutput);
452
+ case "InvalidRegionException":
453
+ case "com.amazonaws.marketplacemetering#InvalidRegionException":
454
+ throw await de_InvalidRegionExceptionRes(parsedOutput);
455
+ case "PlatformNotSupportedException":
456
+ case "com.amazonaws.marketplacemetering#PlatformNotSupportedException":
457
+ throw await de_PlatformNotSupportedExceptionRes(parsedOutput);
458
+ case "ExpiredTokenException":
459
+ case "com.amazonaws.marketplacemetering#ExpiredTokenException":
460
+ throw await de_ExpiredTokenExceptionRes(parsedOutput);
461
+ case "InvalidTokenException":
462
+ case "com.amazonaws.marketplacemetering#InvalidTokenException":
463
+ throw await de_InvalidTokenExceptionRes(parsedOutput);
464
+ default:
465
+ const parsedBody = parsedOutput.body;
466
+ return throwDefaultError({
467
+ output,
468
+ parsedBody,
469
+ errorCode,
470
+ });
471
+ }
472
+ };
473
+ const de_CustomerNotEntitledExceptionRes = async (parsedOutput, context) => {
474
+ const body = parsedOutput.body;
475
+ const deserialized = smithyClient._json(body);
476
+ const exception = new CustomerNotEntitledException({
477
+ $metadata: deserializeMetadata(parsedOutput),
478
+ ...deserialized,
242
479
  });
243
- Object.setPrototypeOf(this, _DisabledApiException.prototype);
244
- }
480
+ return smithyClient.decorateServiceException(exception, body);
245
481
  };
246
- var InternalServiceErrorException = class _InternalServiceErrorException extends MarketplaceMeteringServiceException {
247
- static {
248
- __name(this, "InternalServiceErrorException");
249
- }
250
- name = "InternalServiceErrorException";
251
- $fault = "server";
252
- /**
253
- * @internal
254
- */
255
- constructor(opts) {
256
- super({
257
- name: "InternalServiceErrorException",
258
- $fault: "server",
259
- ...opts
482
+ const de_DisabledApiExceptionRes = async (parsedOutput, context) => {
483
+ const body = parsedOutput.body;
484
+ const deserialized = smithyClient._json(body);
485
+ const exception = new DisabledApiException({
486
+ $metadata: deserializeMetadata(parsedOutput),
487
+ ...deserialized,
260
488
  });
261
- Object.setPrototypeOf(this, _InternalServiceErrorException.prototype);
262
- }
489
+ return smithyClient.decorateServiceException(exception, body);
263
490
  };
264
- var InvalidCustomerIdentifierException = class _InvalidCustomerIdentifierException extends MarketplaceMeteringServiceException {
265
- static {
266
- __name(this, "InvalidCustomerIdentifierException");
267
- }
268
- name = "InvalidCustomerIdentifierException";
269
- $fault = "client";
270
- /**
271
- * @internal
272
- */
273
- constructor(opts) {
274
- super({
275
- name: "InvalidCustomerIdentifierException",
276
- $fault: "client",
277
- ...opts
491
+ const de_DuplicateRequestExceptionRes = async (parsedOutput, context) => {
492
+ const body = parsedOutput.body;
493
+ const deserialized = smithyClient._json(body);
494
+ const exception = new DuplicateRequestException({
495
+ $metadata: deserializeMetadata(parsedOutput),
496
+ ...deserialized,
278
497
  });
279
- Object.setPrototypeOf(this, _InvalidCustomerIdentifierException.prototype);
280
- }
498
+ return smithyClient.decorateServiceException(exception, body);
281
499
  };
282
- var InvalidProductCodeException = class _InvalidProductCodeException extends MarketplaceMeteringServiceException {
283
- static {
284
- __name(this, "InvalidProductCodeException");
285
- }
286
- name = "InvalidProductCodeException";
287
- $fault = "client";
288
- /**
289
- * @internal
290
- */
291
- constructor(opts) {
292
- super({
293
- name: "InvalidProductCodeException",
294
- $fault: "client",
295
- ...opts
500
+ const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
501
+ const body = parsedOutput.body;
502
+ const deserialized = smithyClient._json(body);
503
+ const exception = new ExpiredTokenException({
504
+ $metadata: deserializeMetadata(parsedOutput),
505
+ ...deserialized,
296
506
  });
297
- Object.setPrototypeOf(this, _InvalidProductCodeException.prototype);
298
- }
507
+ return smithyClient.decorateServiceException(exception, body);
299
508
  };
300
- var InvalidTagException = class _InvalidTagException extends MarketplaceMeteringServiceException {
301
- static {
302
- __name(this, "InvalidTagException");
303
- }
304
- name = "InvalidTagException";
305
- $fault = "client";
306
- /**
307
- * @internal
308
- */
309
- constructor(opts) {
310
- super({
311
- name: "InvalidTagException",
312
- $fault: "client",
313
- ...opts
509
+ const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
510
+ const body = parsedOutput.body;
511
+ const deserialized = smithyClient._json(body);
512
+ const exception = new InternalServiceErrorException({
513
+ $metadata: deserializeMetadata(parsedOutput),
514
+ ...deserialized,
314
515
  });
315
- Object.setPrototypeOf(this, _InvalidTagException.prototype);
316
- }
516
+ return smithyClient.decorateServiceException(exception, body);
317
517
  };
318
- var InvalidUsageAllocationsException = class _InvalidUsageAllocationsException extends MarketplaceMeteringServiceException {
319
- static {
320
- __name(this, "InvalidUsageAllocationsException");
321
- }
322
- name = "InvalidUsageAllocationsException";
323
- $fault = "client";
324
- /**
325
- * @internal
326
- */
327
- constructor(opts) {
328
- super({
329
- name: "InvalidUsageAllocationsException",
330
- $fault: "client",
331
- ...opts
518
+ const de_InvalidCustomerIdentifierExceptionRes = async (parsedOutput, context) => {
519
+ const body = parsedOutput.body;
520
+ const deserialized = smithyClient._json(body);
521
+ const exception = new InvalidCustomerIdentifierException({
522
+ $metadata: deserializeMetadata(parsedOutput),
523
+ ...deserialized,
332
524
  });
333
- Object.setPrototypeOf(this, _InvalidUsageAllocationsException.prototype);
334
- }
525
+ return smithyClient.decorateServiceException(exception, body);
335
526
  };
336
- var InvalidUsageDimensionException = class _InvalidUsageDimensionException extends MarketplaceMeteringServiceException {
337
- static {
338
- __name(this, "InvalidUsageDimensionException");
339
- }
340
- name = "InvalidUsageDimensionException";
341
- $fault = "client";
342
- /**
343
- * @internal
344
- */
345
- constructor(opts) {
346
- super({
347
- name: "InvalidUsageDimensionException",
348
- $fault: "client",
349
- ...opts
527
+ const de_InvalidEndpointRegionExceptionRes = async (parsedOutput, context) => {
528
+ const body = parsedOutput.body;
529
+ const deserialized = smithyClient._json(body);
530
+ const exception = new InvalidEndpointRegionException({
531
+ $metadata: deserializeMetadata(parsedOutput),
532
+ ...deserialized,
350
533
  });
351
- Object.setPrototypeOf(this, _InvalidUsageDimensionException.prototype);
352
- }
534
+ return smithyClient.decorateServiceException(exception, body);
353
535
  };
354
- var ThrottlingException = class _ThrottlingException extends MarketplaceMeteringServiceException {
355
- static {
356
- __name(this, "ThrottlingException");
357
- }
358
- name = "ThrottlingException";
359
- $fault = "client";
360
- /**
361
- * @internal
362
- */
363
- constructor(opts) {
364
- super({
365
- name: "ThrottlingException",
366
- $fault: "client",
367
- ...opts
536
+ const de_InvalidProductCodeExceptionRes = async (parsedOutput, context) => {
537
+ const body = parsedOutput.body;
538
+ const deserialized = smithyClient._json(body);
539
+ const exception = new InvalidProductCodeException({
540
+ $metadata: deserializeMetadata(parsedOutput),
541
+ ...deserialized,
368
542
  });
369
- Object.setPrototypeOf(this, _ThrottlingException.prototype);
370
- }
543
+ return smithyClient.decorateServiceException(exception, body);
371
544
  };
372
- var TimestampOutOfBoundsException = class _TimestampOutOfBoundsException extends MarketplaceMeteringServiceException {
373
- static {
374
- __name(this, "TimestampOutOfBoundsException");
375
- }
376
- name = "TimestampOutOfBoundsException";
377
- $fault = "client";
378
- /**
379
- * @internal
380
- */
381
- constructor(opts) {
382
- super({
383
- name: "TimestampOutOfBoundsException",
384
- $fault: "client",
385
- ...opts
545
+ const de_InvalidPublicKeyVersionExceptionRes = async (parsedOutput, context) => {
546
+ const body = parsedOutput.body;
547
+ const deserialized = smithyClient._json(body);
548
+ const exception = new InvalidPublicKeyVersionException({
549
+ $metadata: deserializeMetadata(parsedOutput),
550
+ ...deserialized,
386
551
  });
387
- Object.setPrototypeOf(this, _TimestampOutOfBoundsException.prototype);
388
- }
552
+ return smithyClient.decorateServiceException(exception, body);
389
553
  };
390
- var CustomerNotEntitledException = class _CustomerNotEntitledException extends MarketplaceMeteringServiceException {
391
- static {
392
- __name(this, "CustomerNotEntitledException");
393
- }
394
- name = "CustomerNotEntitledException";
395
- $fault = "client";
396
- /**
397
- * @internal
398
- */
399
- constructor(opts) {
400
- super({
401
- name: "CustomerNotEntitledException",
402
- $fault: "client",
403
- ...opts
554
+ const de_InvalidRegionExceptionRes = async (parsedOutput, context) => {
555
+ const body = parsedOutput.body;
556
+ const deserialized = smithyClient._json(body);
557
+ const exception = new InvalidRegionException({
558
+ $metadata: deserializeMetadata(parsedOutput),
559
+ ...deserialized,
404
560
  });
405
- Object.setPrototypeOf(this, _CustomerNotEntitledException.prototype);
406
- }
561
+ return smithyClient.decorateServiceException(exception, body);
407
562
  };
408
- var DuplicateRequestException = class _DuplicateRequestException extends MarketplaceMeteringServiceException {
409
- static {
410
- __name(this, "DuplicateRequestException");
411
- }
412
- name = "DuplicateRequestException";
413
- $fault = "client";
414
- /**
415
- * @internal
416
- */
417
- constructor(opts) {
418
- super({
419
- name: "DuplicateRequestException",
420
- $fault: "client",
421
- ...opts
563
+ const de_InvalidTagExceptionRes = async (parsedOutput, context) => {
564
+ const body = parsedOutput.body;
565
+ const deserialized = smithyClient._json(body);
566
+ const exception = new InvalidTagException({
567
+ $metadata: deserializeMetadata(parsedOutput),
568
+ ...deserialized,
422
569
  });
423
- Object.setPrototypeOf(this, _DuplicateRequestException.prototype);
424
- }
570
+ return smithyClient.decorateServiceException(exception, body);
425
571
  };
426
- var InvalidEndpointRegionException = class _InvalidEndpointRegionException extends MarketplaceMeteringServiceException {
427
- static {
428
- __name(this, "InvalidEndpointRegionException");
429
- }
430
- name = "InvalidEndpointRegionException";
431
- $fault = "client";
432
- /**
433
- * @internal
434
- */
435
- constructor(opts) {
436
- super({
437
- name: "InvalidEndpointRegionException",
438
- $fault: "client",
439
- ...opts
572
+ const de_InvalidTokenExceptionRes = async (parsedOutput, context) => {
573
+ const body = parsedOutput.body;
574
+ const deserialized = smithyClient._json(body);
575
+ const exception = new InvalidTokenException({
576
+ $metadata: deserializeMetadata(parsedOutput),
577
+ ...deserialized,
440
578
  });
441
- Object.setPrototypeOf(this, _InvalidEndpointRegionException.prototype);
442
- }
579
+ return smithyClient.decorateServiceException(exception, body);
443
580
  };
444
- var InvalidPublicKeyVersionException = class _InvalidPublicKeyVersionException extends MarketplaceMeteringServiceException {
445
- static {
446
- __name(this, "InvalidPublicKeyVersionException");
447
- }
448
- name = "InvalidPublicKeyVersionException";
449
- $fault = "client";
450
- /**
451
- * @internal
452
- */
453
- constructor(opts) {
454
- super({
455
- name: "InvalidPublicKeyVersionException",
456
- $fault: "client",
457
- ...opts
581
+ const de_InvalidUsageAllocationsExceptionRes = async (parsedOutput, context) => {
582
+ const body = parsedOutput.body;
583
+ const deserialized = smithyClient._json(body);
584
+ const exception = new InvalidUsageAllocationsException({
585
+ $metadata: deserializeMetadata(parsedOutput),
586
+ ...deserialized,
458
587
  });
459
- Object.setPrototypeOf(this, _InvalidPublicKeyVersionException.prototype);
460
- }
588
+ return smithyClient.decorateServiceException(exception, body);
461
589
  };
462
- var InvalidRegionException = class _InvalidRegionException extends MarketplaceMeteringServiceException {
463
- static {
464
- __name(this, "InvalidRegionException");
465
- }
466
- name = "InvalidRegionException";
467
- $fault = "client";
468
- /**
469
- * @internal
470
- */
471
- constructor(opts) {
472
- super({
473
- name: "InvalidRegionException",
474
- $fault: "client",
475
- ...opts
590
+ const de_InvalidUsageDimensionExceptionRes = async (parsedOutput, context) => {
591
+ const body = parsedOutput.body;
592
+ const deserialized = smithyClient._json(body);
593
+ const exception = new InvalidUsageDimensionException({
594
+ $metadata: deserializeMetadata(parsedOutput),
595
+ ...deserialized,
476
596
  });
477
- Object.setPrototypeOf(this, _InvalidRegionException.prototype);
478
- }
597
+ return smithyClient.decorateServiceException(exception, body);
479
598
  };
480
- var PlatformNotSupportedException = class _PlatformNotSupportedException extends MarketplaceMeteringServiceException {
481
- static {
482
- __name(this, "PlatformNotSupportedException");
483
- }
484
- name = "PlatformNotSupportedException";
485
- $fault = "client";
486
- /**
487
- * @internal
488
- */
489
- constructor(opts) {
490
- super({
491
- name: "PlatformNotSupportedException",
492
- $fault: "client",
493
- ...opts
599
+ const de_PlatformNotSupportedExceptionRes = async (parsedOutput, context) => {
600
+ const body = parsedOutput.body;
601
+ const deserialized = smithyClient._json(body);
602
+ const exception = new PlatformNotSupportedException({
603
+ $metadata: deserializeMetadata(parsedOutput),
604
+ ...deserialized,
494
605
  });
495
- Object.setPrototypeOf(this, _PlatformNotSupportedException.prototype);
496
- }
606
+ return smithyClient.decorateServiceException(exception, body);
497
607
  };
498
- var ExpiredTokenException = class _ExpiredTokenException extends MarketplaceMeteringServiceException {
499
- static {
500
- __name(this, "ExpiredTokenException");
501
- }
502
- name = "ExpiredTokenException";
503
- $fault = "client";
504
- /**
505
- * @internal
506
- */
507
- constructor(opts) {
508
- super({
509
- name: "ExpiredTokenException",
510
- $fault: "client",
511
- ...opts
608
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
609
+ const body = parsedOutput.body;
610
+ const deserialized = smithyClient._json(body);
611
+ const exception = new ThrottlingException({
612
+ $metadata: deserializeMetadata(parsedOutput),
613
+ ...deserialized,
512
614
  });
513
- Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
514
- }
615
+ return smithyClient.decorateServiceException(exception, body);
515
616
  };
516
- var InvalidTokenException = class _InvalidTokenException extends MarketplaceMeteringServiceException {
517
- static {
518
- __name(this, "InvalidTokenException");
519
- }
520
- name = "InvalidTokenException";
521
- $fault = "client";
522
- /**
523
- * @internal
524
- */
525
- constructor(opts) {
526
- super({
527
- name: "InvalidTokenException",
528
- $fault: "client",
529
- ...opts
617
+ const de_TimestampOutOfBoundsExceptionRes = async (parsedOutput, context) => {
618
+ const body = parsedOutput.body;
619
+ const deserialized = smithyClient._json(body);
620
+ const exception = new TimestampOutOfBoundsException({
621
+ $metadata: deserializeMetadata(parsedOutput),
622
+ ...deserialized,
530
623
  });
531
- Object.setPrototypeOf(this, _InvalidTokenException.prototype);
532
- }
624
+ return smithyClient.decorateServiceException(exception, body);
533
625
  };
534
-
535
- // src/protocols/Aws_json1_1.ts
536
- var se_BatchMeterUsageCommand = /* @__PURE__ */ __name(async (input, context) => {
537
- const headers = sharedHeaders("BatchMeterUsage");
538
- let body;
539
- body = JSON.stringify(se_BatchMeterUsageRequest(input, context));
540
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
541
- }, "se_BatchMeterUsageCommand");
542
- var se_MeterUsageCommand = /* @__PURE__ */ __name(async (input, context) => {
543
- const headers = sharedHeaders("MeterUsage");
544
- let body;
545
- body = JSON.stringify(se_MeterUsageRequest(input, context));
546
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
547
- }, "se_MeterUsageCommand");
548
- var se_RegisterUsageCommand = /* @__PURE__ */ __name(async (input, context) => {
549
- const headers = sharedHeaders("RegisterUsage");
550
- let body;
551
- body = JSON.stringify((0, import_smithy_client._json)(input));
552
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
553
- }, "se_RegisterUsageCommand");
554
- var se_ResolveCustomerCommand = /* @__PURE__ */ __name(async (input, context) => {
555
- const headers = sharedHeaders("ResolveCustomer");
556
- let body;
557
- body = JSON.stringify((0, import_smithy_client._json)(input));
558
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
559
- }, "se_ResolveCustomerCommand");
560
- var de_BatchMeterUsageCommand = /* @__PURE__ */ __name(async (output, context) => {
561
- if (output.statusCode >= 300) {
562
- return de_CommandError(output, context);
563
- }
564
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
565
- let contents = {};
566
- contents = de_BatchMeterUsageResult(data, context);
567
- const response = {
568
- $metadata: deserializeMetadata(output),
569
- ...contents
570
- };
571
- return response;
572
- }, "de_BatchMeterUsageCommand");
573
- var de_MeterUsageCommand = /* @__PURE__ */ __name(async (output, context) => {
574
- if (output.statusCode >= 300) {
575
- return de_CommandError(output, context);
576
- }
577
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
578
- let contents = {};
579
- contents = (0, import_smithy_client._json)(data);
580
- const response = {
581
- $metadata: deserializeMetadata(output),
582
- ...contents
583
- };
584
- return response;
585
- }, "de_MeterUsageCommand");
586
- var de_RegisterUsageCommand = /* @__PURE__ */ __name(async (output, context) => {
587
- if (output.statusCode >= 300) {
588
- return de_CommandError(output, context);
589
- }
590
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
591
- let contents = {};
592
- contents = de_RegisterUsageResult(data, context);
593
- const response = {
594
- $metadata: deserializeMetadata(output),
595
- ...contents
596
- };
597
- return response;
598
- }, "de_RegisterUsageCommand");
599
- var de_ResolveCustomerCommand = /* @__PURE__ */ __name(async (output, context) => {
600
- if (output.statusCode >= 300) {
601
- return de_CommandError(output, context);
602
- }
603
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
604
- let contents = {};
605
- contents = (0, import_smithy_client._json)(data);
606
- const response = {
607
- $metadata: deserializeMetadata(output),
608
- ...contents
609
- };
610
- return response;
611
- }, "de_ResolveCustomerCommand");
612
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
613
- const parsedOutput = {
614
- ...output,
615
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
616
- };
617
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
618
- switch (errorCode) {
619
- case "DisabledApiException":
620
- case "com.amazonaws.marketplacemetering#DisabledApiException":
621
- throw await de_DisabledApiExceptionRes(parsedOutput, context);
622
- case "InternalServiceErrorException":
623
- case "com.amazonaws.marketplacemetering#InternalServiceErrorException":
624
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
625
- case "InvalidCustomerIdentifierException":
626
- case "com.amazonaws.marketplacemetering#InvalidCustomerIdentifierException":
627
- throw await de_InvalidCustomerIdentifierExceptionRes(parsedOutput, context);
628
- case "InvalidProductCodeException":
629
- case "com.amazonaws.marketplacemetering#InvalidProductCodeException":
630
- throw await de_InvalidProductCodeExceptionRes(parsedOutput, context);
631
- case "InvalidTagException":
632
- case "com.amazonaws.marketplacemetering#InvalidTagException":
633
- throw await de_InvalidTagExceptionRes(parsedOutput, context);
634
- case "InvalidUsageAllocationsException":
635
- case "com.amazonaws.marketplacemetering#InvalidUsageAllocationsException":
636
- throw await de_InvalidUsageAllocationsExceptionRes(parsedOutput, context);
637
- case "InvalidUsageDimensionException":
638
- case "com.amazonaws.marketplacemetering#InvalidUsageDimensionException":
639
- throw await de_InvalidUsageDimensionExceptionRes(parsedOutput, context);
640
- case "ThrottlingException":
641
- case "com.amazonaws.marketplacemetering#ThrottlingException":
642
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
643
- case "TimestampOutOfBoundsException":
644
- case "com.amazonaws.marketplacemetering#TimestampOutOfBoundsException":
645
- throw await de_TimestampOutOfBoundsExceptionRes(parsedOutput, context);
646
- case "CustomerNotEntitledException":
647
- case "com.amazonaws.marketplacemetering#CustomerNotEntitledException":
648
- throw await de_CustomerNotEntitledExceptionRes(parsedOutput, context);
649
- case "DuplicateRequestException":
650
- case "com.amazonaws.marketplacemetering#DuplicateRequestException":
651
- throw await de_DuplicateRequestExceptionRes(parsedOutput, context);
652
- case "InvalidEndpointRegionException":
653
- case "com.amazonaws.marketplacemetering#InvalidEndpointRegionException":
654
- throw await de_InvalidEndpointRegionExceptionRes(parsedOutput, context);
655
- case "InvalidPublicKeyVersionException":
656
- case "com.amazonaws.marketplacemetering#InvalidPublicKeyVersionException":
657
- throw await de_InvalidPublicKeyVersionExceptionRes(parsedOutput, context);
658
- case "InvalidRegionException":
659
- case "com.amazonaws.marketplacemetering#InvalidRegionException":
660
- throw await de_InvalidRegionExceptionRes(parsedOutput, context);
661
- case "PlatformNotSupportedException":
662
- case "com.amazonaws.marketplacemetering#PlatformNotSupportedException":
663
- throw await de_PlatformNotSupportedExceptionRes(parsedOutput, context);
664
- case "ExpiredTokenException":
665
- case "com.amazonaws.marketplacemetering#ExpiredTokenException":
666
- throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
667
- case "InvalidTokenException":
668
- case "com.amazonaws.marketplacemetering#InvalidTokenException":
669
- throw await de_InvalidTokenExceptionRes(parsedOutput, context);
670
- default:
671
- const parsedBody = parsedOutput.body;
672
- return throwDefaultError({
673
- output,
674
- parsedBody,
675
- errorCode
676
- });
677
- }
678
- }, "de_CommandError");
679
- var de_CustomerNotEntitledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
680
- const body = parsedOutput.body;
681
- const deserialized = (0, import_smithy_client._json)(body);
682
- const exception = new CustomerNotEntitledException({
683
- $metadata: deserializeMetadata(parsedOutput),
684
- ...deserialized
685
- });
686
- return (0, import_smithy_client.decorateServiceException)(exception, body);
687
- }, "de_CustomerNotEntitledExceptionRes");
688
- var de_DisabledApiExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
689
- const body = parsedOutput.body;
690
- const deserialized = (0, import_smithy_client._json)(body);
691
- const exception = new DisabledApiException({
692
- $metadata: deserializeMetadata(parsedOutput),
693
- ...deserialized
694
- });
695
- return (0, import_smithy_client.decorateServiceException)(exception, body);
696
- }, "de_DisabledApiExceptionRes");
697
- var de_DuplicateRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
698
- const body = parsedOutput.body;
699
- const deserialized = (0, import_smithy_client._json)(body);
700
- const exception = new DuplicateRequestException({
701
- $metadata: deserializeMetadata(parsedOutput),
702
- ...deserialized
703
- });
704
- return (0, import_smithy_client.decorateServiceException)(exception, body);
705
- }, "de_DuplicateRequestExceptionRes");
706
- var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
707
- const body = parsedOutput.body;
708
- const deserialized = (0, import_smithy_client._json)(body);
709
- const exception = new ExpiredTokenException({
710
- $metadata: deserializeMetadata(parsedOutput),
711
- ...deserialized
712
- });
713
- return (0, import_smithy_client.decorateServiceException)(exception, body);
714
- }, "de_ExpiredTokenExceptionRes");
715
- var de_InternalServiceErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
716
- const body = parsedOutput.body;
717
- const deserialized = (0, import_smithy_client._json)(body);
718
- const exception = new InternalServiceErrorException({
719
- $metadata: deserializeMetadata(parsedOutput),
720
- ...deserialized
721
- });
722
- return (0, import_smithy_client.decorateServiceException)(exception, body);
723
- }, "de_InternalServiceErrorExceptionRes");
724
- var de_InvalidCustomerIdentifierExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
725
- const body = parsedOutput.body;
726
- const deserialized = (0, import_smithy_client._json)(body);
727
- const exception = new InvalidCustomerIdentifierException({
728
- $metadata: deserializeMetadata(parsedOutput),
729
- ...deserialized
730
- });
731
- return (0, import_smithy_client.decorateServiceException)(exception, body);
732
- }, "de_InvalidCustomerIdentifierExceptionRes");
733
- var de_InvalidEndpointRegionExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
734
- const body = parsedOutput.body;
735
- const deserialized = (0, import_smithy_client._json)(body);
736
- const exception = new InvalidEndpointRegionException({
737
- $metadata: deserializeMetadata(parsedOutput),
738
- ...deserialized
739
- });
740
- return (0, import_smithy_client.decorateServiceException)(exception, body);
741
- }, "de_InvalidEndpointRegionExceptionRes");
742
- var de_InvalidProductCodeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
743
- const body = parsedOutput.body;
744
- const deserialized = (0, import_smithy_client._json)(body);
745
- const exception = new InvalidProductCodeException({
746
- $metadata: deserializeMetadata(parsedOutput),
747
- ...deserialized
748
- });
749
- return (0, import_smithy_client.decorateServiceException)(exception, body);
750
- }, "de_InvalidProductCodeExceptionRes");
751
- var de_InvalidPublicKeyVersionExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
752
- const body = parsedOutput.body;
753
- const deserialized = (0, import_smithy_client._json)(body);
754
- const exception = new InvalidPublicKeyVersionException({
755
- $metadata: deserializeMetadata(parsedOutput),
756
- ...deserialized
757
- });
758
- return (0, import_smithy_client.decorateServiceException)(exception, body);
759
- }, "de_InvalidPublicKeyVersionExceptionRes");
760
- var de_InvalidRegionExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
761
- const body = parsedOutput.body;
762
- const deserialized = (0, import_smithy_client._json)(body);
763
- const exception = new InvalidRegionException({
764
- $metadata: deserializeMetadata(parsedOutput),
765
- ...deserialized
766
- });
767
- return (0, import_smithy_client.decorateServiceException)(exception, body);
768
- }, "de_InvalidRegionExceptionRes");
769
- var de_InvalidTagExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
770
- const body = parsedOutput.body;
771
- const deserialized = (0, import_smithy_client._json)(body);
772
- const exception = new InvalidTagException({
773
- $metadata: deserializeMetadata(parsedOutput),
774
- ...deserialized
775
- });
776
- return (0, import_smithy_client.decorateServiceException)(exception, body);
777
- }, "de_InvalidTagExceptionRes");
778
- var de_InvalidTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
779
- const body = parsedOutput.body;
780
- const deserialized = (0, import_smithy_client._json)(body);
781
- const exception = new InvalidTokenException({
782
- $metadata: deserializeMetadata(parsedOutput),
783
- ...deserialized
784
- });
785
- return (0, import_smithy_client.decorateServiceException)(exception, body);
786
- }, "de_InvalidTokenExceptionRes");
787
- var de_InvalidUsageAllocationsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
788
- const body = parsedOutput.body;
789
- const deserialized = (0, import_smithy_client._json)(body);
790
- const exception = new InvalidUsageAllocationsException({
791
- $metadata: deserializeMetadata(parsedOutput),
792
- ...deserialized
793
- });
794
- return (0, import_smithy_client.decorateServiceException)(exception, body);
795
- }, "de_InvalidUsageAllocationsExceptionRes");
796
- var de_InvalidUsageDimensionExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
797
- const body = parsedOutput.body;
798
- const deserialized = (0, import_smithy_client._json)(body);
799
- const exception = new InvalidUsageDimensionException({
800
- $metadata: deserializeMetadata(parsedOutput),
801
- ...deserialized
802
- });
803
- return (0, import_smithy_client.decorateServiceException)(exception, body);
804
- }, "de_InvalidUsageDimensionExceptionRes");
805
- var de_PlatformNotSupportedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
806
- const body = parsedOutput.body;
807
- const deserialized = (0, import_smithy_client._json)(body);
808
- const exception = new PlatformNotSupportedException({
809
- $metadata: deserializeMetadata(parsedOutput),
810
- ...deserialized
811
- });
812
- return (0, import_smithy_client.decorateServiceException)(exception, body);
813
- }, "de_PlatformNotSupportedExceptionRes");
814
- var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
815
- const body = parsedOutput.body;
816
- const deserialized = (0, import_smithy_client._json)(body);
817
- const exception = new ThrottlingException({
818
- $metadata: deserializeMetadata(parsedOutput),
819
- ...deserialized
820
- });
821
- return (0, import_smithy_client.decorateServiceException)(exception, body);
822
- }, "de_ThrottlingExceptionRes");
823
- var de_TimestampOutOfBoundsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
824
- const body = parsedOutput.body;
825
- const deserialized = (0, import_smithy_client._json)(body);
826
- const exception = new TimestampOutOfBoundsException({
827
- $metadata: deserializeMetadata(parsedOutput),
828
- ...deserialized
829
- });
830
- return (0, import_smithy_client.decorateServiceException)(exception, body);
831
- }, "de_TimestampOutOfBoundsExceptionRes");
832
- var se_BatchMeterUsageRequest = /* @__PURE__ */ __name((input, context) => {
833
- return (0, import_smithy_client.take)(input, {
834
- ProductCode: [],
835
- UsageRecords: /* @__PURE__ */ __name((_) => se_UsageRecordList(_, context), "UsageRecords")
836
- });
837
- }, "se_BatchMeterUsageRequest");
838
- var se_MeterUsageRequest = /* @__PURE__ */ __name((input, context) => {
839
- return (0, import_smithy_client.take)(input, {
840
- DryRun: [],
841
- ProductCode: [],
842
- Timestamp: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "Timestamp"),
843
- UsageAllocations: import_smithy_client._json,
844
- UsageDimension: [],
845
- UsageQuantity: []
846
- });
847
- }, "se_MeterUsageRequest");
848
- var se_UsageRecord = /* @__PURE__ */ __name((input, context) => {
849
- return (0, import_smithy_client.take)(input, {
850
- CustomerAWSAccountId: [],
851
- CustomerIdentifier: [],
852
- Dimension: [],
853
- Quantity: [],
854
- Timestamp: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "Timestamp"),
855
- UsageAllocations: import_smithy_client._json
856
- });
857
- }, "se_UsageRecord");
858
- var se_UsageRecordList = /* @__PURE__ */ __name((input, context) => {
859
- return input.filter((e) => e != null).map((entry) => {
860
- return se_UsageRecord(entry, context);
861
- });
862
- }, "se_UsageRecordList");
863
- var de_BatchMeterUsageResult = /* @__PURE__ */ __name((output, context) => {
864
- return (0, import_smithy_client.take)(output, {
865
- Results: /* @__PURE__ */ __name((_) => de_UsageRecordResultList(_, context), "Results"),
866
- UnprocessedRecords: /* @__PURE__ */ __name((_) => de_UsageRecordList(_, context), "UnprocessedRecords")
867
- });
868
- }, "de_BatchMeterUsageResult");
869
- var de_RegisterUsageResult = /* @__PURE__ */ __name((output, context) => {
870
- return (0, import_smithy_client.take)(output, {
871
- PublicKeyRotationTimestamp: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), "PublicKeyRotationTimestamp"),
872
- Signature: import_smithy_client.expectString
873
- });
874
- }, "de_RegisterUsageResult");
875
- var de_UsageRecord = /* @__PURE__ */ __name((output, context) => {
876
- return (0, import_smithy_client.take)(output, {
877
- CustomerAWSAccountId: import_smithy_client.expectString,
878
- CustomerIdentifier: import_smithy_client.expectString,
879
- Dimension: import_smithy_client.expectString,
880
- Quantity: import_smithy_client.expectInt32,
881
- Timestamp: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), "Timestamp"),
882
- UsageAllocations: import_smithy_client._json
883
- });
884
- }, "de_UsageRecord");
885
- var de_UsageRecordList = /* @__PURE__ */ __name((output, context) => {
886
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
887
- return de_UsageRecord(entry, context);
888
- });
889
- return retVal;
890
- }, "de_UsageRecordList");
891
- var de_UsageRecordResult = /* @__PURE__ */ __name((output, context) => {
892
- return (0, import_smithy_client.take)(output, {
893
- MeteringRecordId: import_smithy_client.expectString,
894
- Status: import_smithy_client.expectString,
895
- UsageRecord: /* @__PURE__ */ __name((_) => de_UsageRecord(_, context), "UsageRecord")
896
- });
897
- }, "de_UsageRecordResult");
898
- var de_UsageRecordResultList = /* @__PURE__ */ __name((output, context) => {
899
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
900
- return de_UsageRecordResult(entry, context);
901
- });
902
- return retVal;
903
- }, "de_UsageRecordResultList");
904
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
905
- httpStatusCode: output.statusCode,
906
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
907
- extendedRequestId: output.headers["x-amz-id-2"],
908
- cfId: output.headers["x-amz-cf-id"]
909
- }), "deserializeMetadata");
910
- var throwDefaultError = (0, import_smithy_client.withBaseException)(MarketplaceMeteringServiceException);
911
- var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
912
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
913
- const contents = {
914
- protocol,
915
- hostname,
916
- port,
917
- method: "POST",
918
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
919
- headers
920
- };
921
- if (resolvedHostname !== void 0) {
922
- contents.hostname = resolvedHostname;
923
- }
924
- if (body !== void 0) {
925
- contents.body = body;
926
- }
927
- return new import_protocol_http.HttpRequest(contents);
928
- }, "buildHttpRpcRequest");
929
- function sharedHeaders(operation) {
930
- return {
931
- "content-type": "application/x-amz-json-1.1",
932
- "x-amz-target": `AWSMPMeteringService.${operation}`
933
- };
934
- }
935
- __name(sharedHeaders, "sharedHeaders");
936
-
937
- // src/commands/BatchMeterUsageCommand.ts
938
- var BatchMeterUsageCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
939
- return [
940
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
941
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
942
- ];
943
- }).s("AWSMPMeteringService", "BatchMeterUsage", {}).n("MarketplaceMeteringClient", "BatchMeterUsageCommand").f(void 0, void 0).ser(se_BatchMeterUsageCommand).de(de_BatchMeterUsageCommand).build() {
944
- static {
945
- __name(this, "BatchMeterUsageCommand");
946
- }
626
+ const se_BatchMeterUsageRequest = (input, context) => {
627
+ return smithyClient.take(input, {
628
+ ProductCode: [],
629
+ UsageRecords: (_) => se_UsageRecordList(_),
630
+ });
947
631
  };
948
-
949
- // src/commands/MeterUsageCommand.ts
950
-
951
-
952
-
953
- var MeterUsageCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
954
- return [
955
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
956
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
957
- ];
958
- }).s("AWSMPMeteringService", "MeterUsage", {}).n("MarketplaceMeteringClient", "MeterUsageCommand").f(void 0, void 0).ser(se_MeterUsageCommand).de(de_MeterUsageCommand).build() {
959
- static {
960
- __name(this, "MeterUsageCommand");
961
- }
632
+ const se_MeterUsageRequest = (input, context) => {
633
+ return smithyClient.take(input, {
634
+ DryRun: [],
635
+ ProductCode: [],
636
+ Timestamp: (_) => _.getTime() / 1_000,
637
+ UsageAllocations: smithyClient._json,
638
+ UsageDimension: [],
639
+ UsageQuantity: [],
640
+ });
962
641
  };
963
-
964
- // src/commands/RegisterUsageCommand.ts
965
-
966
-
967
-
968
- var RegisterUsageCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
969
- return [
970
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
971
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
972
- ];
973
- }).s("AWSMPMeteringService", "RegisterUsage", {}).n("MarketplaceMeteringClient", "RegisterUsageCommand").f(void 0, void 0).ser(se_RegisterUsageCommand).de(de_RegisterUsageCommand).build() {
974
- static {
975
- __name(this, "RegisterUsageCommand");
976
- }
642
+ const se_UsageRecord = (input, context) => {
643
+ return smithyClient.take(input, {
644
+ CustomerAWSAccountId: [],
645
+ CustomerIdentifier: [],
646
+ Dimension: [],
647
+ Quantity: [],
648
+ Timestamp: (_) => _.getTime() / 1_000,
649
+ UsageAllocations: smithyClient._json,
650
+ });
977
651
  };
652
+ const se_UsageRecordList = (input, context) => {
653
+ return input
654
+ .filter((e) => e != null)
655
+ .map((entry) => {
656
+ return se_UsageRecord(entry);
657
+ });
658
+ };
659
+ const de_BatchMeterUsageResult = (output, context) => {
660
+ return smithyClient.take(output, {
661
+ Results: (_) => de_UsageRecordResultList(_),
662
+ UnprocessedRecords: (_) => de_UsageRecordList(_),
663
+ });
664
+ };
665
+ const de_RegisterUsageResult = (output, context) => {
666
+ return smithyClient.take(output, {
667
+ PublicKeyRotationTimestamp: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
668
+ Signature: smithyClient.expectString,
669
+ });
670
+ };
671
+ const de_UsageRecord = (output, context) => {
672
+ return smithyClient.take(output, {
673
+ CustomerAWSAccountId: smithyClient.expectString,
674
+ CustomerIdentifier: smithyClient.expectString,
675
+ Dimension: smithyClient.expectString,
676
+ Quantity: smithyClient.expectInt32,
677
+ Timestamp: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
678
+ UsageAllocations: smithyClient._json,
679
+ });
680
+ };
681
+ const de_UsageRecordList = (output, context) => {
682
+ const retVal = (output || [])
683
+ .filter((e) => e != null)
684
+ .map((entry) => {
685
+ return de_UsageRecord(entry);
686
+ });
687
+ return retVal;
688
+ };
689
+ const de_UsageRecordResult = (output, context) => {
690
+ return smithyClient.take(output, {
691
+ MeteringRecordId: smithyClient.expectString,
692
+ Status: smithyClient.expectString,
693
+ UsageRecord: (_) => de_UsageRecord(_),
694
+ });
695
+ };
696
+ const de_UsageRecordResultList = (output, context) => {
697
+ const retVal = (output || [])
698
+ .filter((e) => e != null)
699
+ .map((entry) => {
700
+ return de_UsageRecordResult(entry);
701
+ });
702
+ return retVal;
703
+ };
704
+ const deserializeMetadata = (output) => ({
705
+ httpStatusCode: output.statusCode,
706
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
707
+ extendedRequestId: output.headers["x-amz-id-2"],
708
+ cfId: output.headers["x-amz-cf-id"],
709
+ });
710
+ const throwDefaultError = smithyClient.withBaseException(MarketplaceMeteringServiceException);
711
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
712
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
713
+ const contents = {
714
+ protocol,
715
+ hostname,
716
+ port,
717
+ method: "POST",
718
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
719
+ headers,
720
+ };
721
+ if (body !== undefined) {
722
+ contents.body = body;
723
+ }
724
+ return new protocolHttp.HttpRequest(contents);
725
+ };
726
+ function sharedHeaders(operation) {
727
+ return {
728
+ "content-type": "application/x-amz-json-1.1",
729
+ "x-amz-target": `AWSMPMeteringService.${operation}`,
730
+ };
731
+ }
978
732
 
979
- // src/commands/ResolveCustomerCommand.ts
733
+ class BatchMeterUsageCommand extends smithyClient.Command
734
+ .classBuilder()
735
+ .ep(commonParams)
736
+ .m(function (Command, cs, config, o) {
737
+ return [
738
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
739
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
740
+ ];
741
+ })
742
+ .s("AWSMPMeteringService", "BatchMeterUsage", {})
743
+ .n("MarketplaceMeteringClient", "BatchMeterUsageCommand")
744
+ .f(void 0, void 0)
745
+ .ser(se_BatchMeterUsageCommand)
746
+ .de(de_BatchMeterUsageCommand)
747
+ .build() {
748
+ }
980
749
 
750
+ class MeterUsageCommand extends smithyClient.Command
751
+ .classBuilder()
752
+ .ep(commonParams)
753
+ .m(function (Command, cs, config, o) {
754
+ return [
755
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
756
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
757
+ ];
758
+ })
759
+ .s("AWSMPMeteringService", "MeterUsage", {})
760
+ .n("MarketplaceMeteringClient", "MeterUsageCommand")
761
+ .f(void 0, void 0)
762
+ .ser(se_MeterUsageCommand)
763
+ .de(de_MeterUsageCommand)
764
+ .build() {
765
+ }
981
766
 
767
+ class RegisterUsageCommand extends smithyClient.Command
768
+ .classBuilder()
769
+ .ep(commonParams)
770
+ .m(function (Command, cs, config, o) {
771
+ return [
772
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
773
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
774
+ ];
775
+ })
776
+ .s("AWSMPMeteringService", "RegisterUsage", {})
777
+ .n("MarketplaceMeteringClient", "RegisterUsageCommand")
778
+ .f(void 0, void 0)
779
+ .ser(se_RegisterUsageCommand)
780
+ .de(de_RegisterUsageCommand)
781
+ .build() {
782
+ }
982
783
 
983
- var ResolveCustomerCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
984
- return [
985
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
986
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
987
- ];
988
- }).s("AWSMPMeteringService", "ResolveCustomer", {}).n("MarketplaceMeteringClient", "ResolveCustomerCommand").f(void 0, void 0).ser(se_ResolveCustomerCommand).de(de_ResolveCustomerCommand).build() {
989
- static {
990
- __name(this, "ResolveCustomerCommand");
991
- }
992
- };
784
+ class ResolveCustomerCommand extends smithyClient.Command
785
+ .classBuilder()
786
+ .ep(commonParams)
787
+ .m(function (Command, cs, config, o) {
788
+ return [
789
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
790
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
791
+ ];
792
+ })
793
+ .s("AWSMPMeteringService", "ResolveCustomer", {})
794
+ .n("MarketplaceMeteringClient", "ResolveCustomerCommand")
795
+ .f(void 0, void 0)
796
+ .ser(se_ResolveCustomerCommand)
797
+ .de(de_ResolveCustomerCommand)
798
+ .build() {
799
+ }
993
800
 
994
- // src/MarketplaceMetering.ts
995
- var commands = {
996
- BatchMeterUsageCommand,
997
- MeterUsageCommand,
998
- RegisterUsageCommand,
999
- ResolveCustomerCommand
1000
- };
1001
- var MarketplaceMetering = class extends MarketplaceMeteringClient {
1002
- static {
1003
- __name(this, "MarketplaceMetering");
1004
- }
801
+ const commands = {
802
+ BatchMeterUsageCommand,
803
+ MeterUsageCommand,
804
+ RegisterUsageCommand,
805
+ ResolveCustomerCommand,
1005
806
  };
1006
- (0, import_smithy_client.createAggregatedClient)(commands, MarketplaceMetering);
1007
- // Annotate the CommonJS export names for ESM import in node:
807
+ class MarketplaceMetering extends MarketplaceMeteringClient {
808
+ }
809
+ smithyClient.createAggregatedClient(commands, MarketplaceMetering);
1008
810
 
1009
- 0 && (module.exports = {
1010
- MarketplaceMeteringServiceException,
1011
- __Client,
1012
- MarketplaceMeteringClient,
1013
- MarketplaceMetering,
1014
- $Command,
1015
- BatchMeterUsageCommand,
1016
- MeterUsageCommand,
1017
- RegisterUsageCommand,
1018
- ResolveCustomerCommand,
1019
- UsageRecordResultStatus,
1020
- DisabledApiException,
1021
- InternalServiceErrorException,
1022
- InvalidCustomerIdentifierException,
1023
- InvalidProductCodeException,
1024
- InvalidTagException,
1025
- InvalidUsageAllocationsException,
1026
- InvalidUsageDimensionException,
1027
- ThrottlingException,
1028
- TimestampOutOfBoundsException,
1029
- CustomerNotEntitledException,
1030
- DuplicateRequestException,
1031
- InvalidEndpointRegionException,
1032
- InvalidPublicKeyVersionException,
1033
- InvalidRegionException,
1034
- PlatformNotSupportedException,
1035
- ExpiredTokenException,
1036
- InvalidTokenException
811
+ Object.defineProperty(exports, "$Command", {
812
+ enumerable: true,
813
+ get: function () { return smithyClient.Command; }
1037
814
  });
1038
-
815
+ Object.defineProperty(exports, "__Client", {
816
+ enumerable: true,
817
+ get: function () { return smithyClient.Client; }
818
+ });
819
+ exports.BatchMeterUsageCommand = BatchMeterUsageCommand;
820
+ exports.CustomerNotEntitledException = CustomerNotEntitledException;
821
+ exports.DisabledApiException = DisabledApiException;
822
+ exports.DuplicateRequestException = DuplicateRequestException;
823
+ exports.ExpiredTokenException = ExpiredTokenException;
824
+ exports.InternalServiceErrorException = InternalServiceErrorException;
825
+ exports.InvalidCustomerIdentifierException = InvalidCustomerIdentifierException;
826
+ exports.InvalidEndpointRegionException = InvalidEndpointRegionException;
827
+ exports.InvalidProductCodeException = InvalidProductCodeException;
828
+ exports.InvalidPublicKeyVersionException = InvalidPublicKeyVersionException;
829
+ exports.InvalidRegionException = InvalidRegionException;
830
+ exports.InvalidTagException = InvalidTagException;
831
+ exports.InvalidTokenException = InvalidTokenException;
832
+ exports.InvalidUsageAllocationsException = InvalidUsageAllocationsException;
833
+ exports.InvalidUsageDimensionException = InvalidUsageDimensionException;
834
+ exports.MarketplaceMetering = MarketplaceMetering;
835
+ exports.MarketplaceMeteringClient = MarketplaceMeteringClient;
836
+ exports.MarketplaceMeteringServiceException = MarketplaceMeteringServiceException;
837
+ exports.MeterUsageCommand = MeterUsageCommand;
838
+ exports.PlatformNotSupportedException = PlatformNotSupportedException;
839
+ exports.RegisterUsageCommand = RegisterUsageCommand;
840
+ exports.ResolveCustomerCommand = ResolveCustomerCommand;
841
+ exports.ThrottlingException = ThrottlingException;
842
+ exports.TimestampOutOfBoundsException = TimestampOutOfBoundsException;
843
+ exports.UsageRecordResultStatus = UsageRecordResultStatus;