@aws-sdk/client-marketplace-entitlement-service 3.901.0 → 3.906.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist-cjs/index.js +309 -417
  2. package/package.json +5 -5
package/dist-cjs/index.js CHANGED
@@ -1,444 +1,336 @@
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
- $Command: () => import_smithy_client.Command,
25
- GetEntitlementFilterName: () => GetEntitlementFilterName,
26
- GetEntitlementsCommand: () => GetEntitlementsCommand,
27
- InternalServiceErrorException: () => InternalServiceErrorException,
28
- InvalidParameterException: () => InvalidParameterException,
29
- MarketplaceEntitlementService: () => MarketplaceEntitlementService,
30
- MarketplaceEntitlementServiceClient: () => MarketplaceEntitlementServiceClient,
31
- MarketplaceEntitlementServiceServiceException: () => MarketplaceEntitlementServiceServiceException,
32
- ThrottlingException: () => ThrottlingException,
33
- __Client: () => import_smithy_client.Client,
34
- paginateGetEntitlements: () => paginateGetEntitlements
35
- });
36
- module.exports = __toCommonJS(index_exports);
1
+ 'use strict';
37
2
 
38
- // src/MarketplaceEntitlementServiceClient.ts
39
- var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
40
- var import_middleware_logger = require("@aws-sdk/middleware-logger");
41
- var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
42
- var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
43
- var import_config_resolver = require("@smithy/config-resolver");
44
- var import_core = require("@smithy/core");
45
- var import_middleware_content_length = require("@smithy/middleware-content-length");
46
- var import_middleware_endpoint = require("@smithy/middleware-endpoint");
47
- var import_middleware_retry = require("@smithy/middleware-retry");
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');
48
19
 
49
- var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
50
-
51
- // src/endpoint/EndpointParameters.ts
52
- var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
53
- return Object.assign(options, {
54
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
55
- useFipsEndpoint: options.useFipsEndpoint ?? false,
56
- defaultSigningName: "aws-marketplace"
57
- });
58
- }, "resolveClientEndpointParameters");
59
- var commonParams = {
60
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
61
- Endpoint: { type: "builtInParams", name: "endpoint" },
62
- Region: { type: "builtInParams", name: "region" },
63
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
20
+ const resolveClientEndpointParameters = (options) => {
21
+ return Object.assign(options, {
22
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
23
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
24
+ defaultSigningName: "aws-marketplace",
25
+ });
26
+ };
27
+ const commonParams = {
28
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
29
+ Endpoint: { type: "builtInParams", name: "endpoint" },
30
+ Region: { type: "builtInParams", name: "region" },
31
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
64
32
  };
65
33
 
66
- // src/MarketplaceEntitlementServiceClient.ts
67
- var import_runtimeConfig = require("././runtimeConfig");
34
+ const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
35
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
36
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
37
+ let _credentials = runtimeConfig.credentials;
38
+ return {
39
+ setHttpAuthScheme(httpAuthScheme) {
40
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
41
+ if (index === -1) {
42
+ _httpAuthSchemes.push(httpAuthScheme);
43
+ }
44
+ else {
45
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
46
+ }
47
+ },
48
+ httpAuthSchemes() {
49
+ return _httpAuthSchemes;
50
+ },
51
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
52
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
53
+ },
54
+ httpAuthSchemeProvider() {
55
+ return _httpAuthSchemeProvider;
56
+ },
57
+ setCredentials(credentials) {
58
+ _credentials = credentials;
59
+ },
60
+ credentials() {
61
+ return _credentials;
62
+ },
63
+ };
64
+ };
65
+ const resolveHttpAuthRuntimeConfig = (config) => {
66
+ return {
67
+ httpAuthSchemes: config.httpAuthSchemes(),
68
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
69
+ credentials: config.credentials(),
70
+ };
71
+ };
68
72
 
69
- // src/runtimeExtensions.ts
70
- var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
71
- var import_protocol_http = require("@smithy/protocol-http");
72
- 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
+ };
73
78
 
74
- // src/auth/httpAuthExtensionConfiguration.ts
75
- var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
76
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
77
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
78
- let _credentials = runtimeConfig.credentials;
79
- return {
80
- setHttpAuthScheme(httpAuthScheme) {
81
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
82
- if (index === -1) {
83
- _httpAuthSchemes.push(httpAuthScheme);
84
- } else {
85
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
86
- }
87
- },
88
- httpAuthSchemes() {
89
- return _httpAuthSchemes;
90
- },
91
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
92
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
93
- },
94
- httpAuthSchemeProvider() {
95
- return _httpAuthSchemeProvider;
96
- },
97
- setCredentials(credentials) {
98
- _credentials = credentials;
99
- },
100
- credentials() {
101
- return _credentials;
79
+ class MarketplaceEntitlementServiceClient 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.defaultMarketplaceEntitlementServiceHttpAuthSchemeParametersProvider,
102
+ identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
103
+ "aws.auth#sigv4": config.credentials,
104
+ }),
105
+ }));
106
+ this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
102
107
  }
103
- };
104
- }, "getHttpAuthExtensionConfiguration");
105
- var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
106
- return {
107
- httpAuthSchemes: config.httpAuthSchemes(),
108
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
109
- credentials: config.credentials()
110
- };
111
- }, "resolveHttpAuthRuntimeConfig");
108
+ destroy() {
109
+ super.destroy();
110
+ }
111
+ }
112
112
 
113
- // src/runtimeExtensions.ts
114
- var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
115
- const extensionConfiguration = Object.assign(
116
- (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
117
- (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
118
- (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
119
- getHttpAuthExtensionConfiguration(runtimeConfig)
120
- );
121
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
122
- return Object.assign(
123
- runtimeConfig,
124
- (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
125
- (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
126
- (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
127
- resolveHttpAuthRuntimeConfig(extensionConfiguration)
128
- );
129
- }, "resolveRuntimeExtensions");
113
+ class MarketplaceEntitlementServiceServiceException extends smithyClient.ServiceException {
114
+ constructor(options) {
115
+ super(options);
116
+ Object.setPrototypeOf(this, MarketplaceEntitlementServiceServiceException.prototype);
117
+ }
118
+ }
130
119
 
131
- // src/MarketplaceEntitlementServiceClient.ts
132
- var MarketplaceEntitlementServiceClient = class extends import_smithy_client.Client {
133
- static {
134
- __name(this, "MarketplaceEntitlementServiceClient");
135
- }
136
- /**
137
- * The resolved configuration of MarketplaceEntitlementServiceClient class. This is resolved and normalized from the {@link MarketplaceEntitlementServiceClientConfig | constructor configuration interface}.
138
- */
139
- config;
140
- constructor(...[configuration]) {
141
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
142
- super(_config_0);
143
- this.initConfig = _config_0;
144
- const _config_1 = resolveClientEndpointParameters(_config_0);
145
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
146
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
147
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
148
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
149
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
150
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
151
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
152
- this.config = _config_8;
153
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
154
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
155
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
156
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
157
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
158
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
159
- this.middlewareStack.use(
160
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
161
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultMarketplaceEntitlementServiceHttpAuthSchemeParametersProvider,
162
- identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
163
- "aws.auth#sigv4": config.credentials
164
- }), "identityProviderConfigProvider")
165
- })
166
- );
167
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
168
- }
169
- /**
170
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
171
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
172
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
173
- */
174
- destroy() {
175
- super.destroy();
176
- }
120
+ const GetEntitlementFilterName = {
121
+ CUSTOMER_AWS_ACCOUNT_ID: "CUSTOMER_AWS_ACCOUNT_ID",
122
+ CUSTOMER_IDENTIFIER: "CUSTOMER_IDENTIFIER",
123
+ DIMENSION: "DIMENSION",
177
124
  };
125
+ class InternalServiceErrorException extends MarketplaceEntitlementServiceServiceException {
126
+ name = "InternalServiceErrorException";
127
+ $fault = "server";
128
+ constructor(opts) {
129
+ super({
130
+ name: "InternalServiceErrorException",
131
+ $fault: "server",
132
+ ...opts,
133
+ });
134
+ Object.setPrototypeOf(this, InternalServiceErrorException.prototype);
135
+ }
136
+ }
137
+ class InvalidParameterException extends MarketplaceEntitlementServiceServiceException {
138
+ name = "InvalidParameterException";
139
+ $fault = "client";
140
+ constructor(opts) {
141
+ super({
142
+ name: "InvalidParameterException",
143
+ $fault: "client",
144
+ ...opts,
145
+ });
146
+ Object.setPrototypeOf(this, InvalidParameterException.prototype);
147
+ }
148
+ }
149
+ class ThrottlingException extends MarketplaceEntitlementServiceServiceException {
150
+ name = "ThrottlingException";
151
+ $fault = "client";
152
+ constructor(opts) {
153
+ super({
154
+ name: "ThrottlingException",
155
+ $fault: "client",
156
+ ...opts,
157
+ });
158
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
159
+ }
160
+ }
178
161
 
179
- // src/MarketplaceEntitlementService.ts
180
-
181
-
182
- // src/commands/GetEntitlementsCommand.ts
183
-
184
- var import_middleware_serde = require("@smithy/middleware-serde");
185
-
186
-
187
- // src/protocols/Aws_json1_1.ts
188
- var import_core2 = require("@aws-sdk/core");
189
-
190
-
191
-
192
- // src/models/MarketplaceEntitlementServiceServiceException.ts
193
-
194
- var MarketplaceEntitlementServiceServiceException = class _MarketplaceEntitlementServiceServiceException extends import_smithy_client.ServiceException {
195
- static {
196
- __name(this, "MarketplaceEntitlementServiceServiceException");
197
- }
198
- /**
199
- * @internal
200
- */
201
- constructor(options) {
202
- super(options);
203
- Object.setPrototypeOf(this, _MarketplaceEntitlementServiceServiceException.prototype);
204
- }
162
+ const se_GetEntitlementsCommand = async (input, context) => {
163
+ const headers = sharedHeaders("GetEntitlements");
164
+ let body;
165
+ body = JSON.stringify(smithyClient._json(input));
166
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
205
167
  };
206
-
207
- // src/models/models_0.ts
208
- var GetEntitlementFilterName = {
209
- CUSTOMER_AWS_ACCOUNT_ID: "CUSTOMER_AWS_ACCOUNT_ID",
210
- CUSTOMER_IDENTIFIER: "CUSTOMER_IDENTIFIER",
211
- DIMENSION: "DIMENSION"
168
+ const de_GetEntitlementsCommand = async (output, context) => {
169
+ if (output.statusCode >= 300) {
170
+ return de_CommandError(output, context);
171
+ }
172
+ const data = await core$1.parseJsonBody(output.body, context);
173
+ let contents = {};
174
+ contents = de_GetEntitlementsResult(data);
175
+ const response = {
176
+ $metadata: deserializeMetadata(output),
177
+ ...contents,
178
+ };
179
+ return response;
180
+ };
181
+ const de_CommandError = async (output, context) => {
182
+ const parsedOutput = {
183
+ ...output,
184
+ body: await core$1.parseJsonErrorBody(output.body, context),
185
+ };
186
+ const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
187
+ switch (errorCode) {
188
+ case "InternalServiceErrorException":
189
+ case "com.amazonaws.marketplaceentitlementservice#InternalServiceErrorException":
190
+ throw await de_InternalServiceErrorExceptionRes(parsedOutput);
191
+ case "InvalidParameterException":
192
+ case "com.amazonaws.marketplaceentitlementservice#InvalidParameterException":
193
+ throw await de_InvalidParameterExceptionRes(parsedOutput);
194
+ case "ThrottlingException":
195
+ case "com.amazonaws.marketplaceentitlementservice#ThrottlingException":
196
+ throw await de_ThrottlingExceptionRes(parsedOutput);
197
+ default:
198
+ const parsedBody = parsedOutput.body;
199
+ return throwDefaultError({
200
+ output,
201
+ parsedBody,
202
+ errorCode,
203
+ });
204
+ }
212
205
  };
213
- var InternalServiceErrorException = class _InternalServiceErrorException extends MarketplaceEntitlementServiceServiceException {
214
- static {
215
- __name(this, "InternalServiceErrorException");
216
- }
217
- name = "InternalServiceErrorException";
218
- $fault = "server";
219
- /**
220
- * @internal
221
- */
222
- constructor(opts) {
223
- super({
224
- name: "InternalServiceErrorException",
225
- $fault: "server",
226
- ...opts
206
+ const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
207
+ const body = parsedOutput.body;
208
+ const deserialized = smithyClient._json(body);
209
+ const exception = new InternalServiceErrorException({
210
+ $metadata: deserializeMetadata(parsedOutput),
211
+ ...deserialized,
227
212
  });
228
- Object.setPrototypeOf(this, _InternalServiceErrorException.prototype);
229
- }
213
+ return smithyClient.decorateServiceException(exception, body);
230
214
  };
231
- var InvalidParameterException = class _InvalidParameterException extends MarketplaceEntitlementServiceServiceException {
232
- static {
233
- __name(this, "InvalidParameterException");
234
- }
235
- name = "InvalidParameterException";
236
- $fault = "client";
237
- /**
238
- * @internal
239
- */
240
- constructor(opts) {
241
- super({
242
- name: "InvalidParameterException",
243
- $fault: "client",
244
- ...opts
215
+ const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
216
+ const body = parsedOutput.body;
217
+ const deserialized = smithyClient._json(body);
218
+ const exception = new InvalidParameterException({
219
+ $metadata: deserializeMetadata(parsedOutput),
220
+ ...deserialized,
245
221
  });
246
- Object.setPrototypeOf(this, _InvalidParameterException.prototype);
247
- }
222
+ return smithyClient.decorateServiceException(exception, body);
248
223
  };
249
- var ThrottlingException = class _ThrottlingException extends MarketplaceEntitlementServiceServiceException {
250
- static {
251
- __name(this, "ThrottlingException");
252
- }
253
- name = "ThrottlingException";
254
- $fault = "client";
255
- /**
256
- * @internal
257
- */
258
- constructor(opts) {
259
- super({
260
- name: "ThrottlingException",
261
- $fault: "client",
262
- ...opts
224
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
225
+ const body = parsedOutput.body;
226
+ const deserialized = smithyClient._json(body);
227
+ const exception = new ThrottlingException({
228
+ $metadata: deserializeMetadata(parsedOutput),
229
+ ...deserialized,
263
230
  });
264
- Object.setPrototypeOf(this, _ThrottlingException.prototype);
265
- }
231
+ return smithyClient.decorateServiceException(exception, body);
232
+ };
233
+ const de_Entitlement = (output, context) => {
234
+ return smithyClient.take(output, {
235
+ CustomerAWSAccountId: smithyClient.expectString,
236
+ CustomerIdentifier: smithyClient.expectString,
237
+ Dimension: smithyClient.expectString,
238
+ ExpirationDate: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
239
+ ProductCode: smithyClient.expectString,
240
+ Value: (_) => de_EntitlementValue(_),
241
+ });
242
+ };
243
+ const de_EntitlementList = (output, context) => {
244
+ const retVal = (output || [])
245
+ .filter((e) => e != null)
246
+ .map((entry) => {
247
+ return de_Entitlement(entry);
248
+ });
249
+ return retVal;
250
+ };
251
+ const de_EntitlementValue = (output, context) => {
252
+ return smithyClient.take(output, {
253
+ BooleanValue: smithyClient.expectBoolean,
254
+ DoubleValue: smithyClient.limitedParseDouble,
255
+ IntegerValue: smithyClient.expectInt32,
256
+ StringValue: smithyClient.expectString,
257
+ });
258
+ };
259
+ const de_GetEntitlementsResult = (output, context) => {
260
+ return smithyClient.take(output, {
261
+ Entitlements: (_) => de_EntitlementList(_),
262
+ NextToken: smithyClient.expectString,
263
+ });
264
+ };
265
+ const deserializeMetadata = (output) => ({
266
+ httpStatusCode: output.statusCode,
267
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
268
+ extendedRequestId: output.headers["x-amz-id-2"],
269
+ cfId: output.headers["x-amz-cf-id"],
270
+ });
271
+ const throwDefaultError = smithyClient.withBaseException(MarketplaceEntitlementServiceServiceException);
272
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
273
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
274
+ const contents = {
275
+ protocol,
276
+ hostname,
277
+ port,
278
+ method: "POST",
279
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
280
+ headers,
281
+ };
282
+ if (body !== undefined) {
283
+ contents.body = body;
284
+ }
285
+ return new protocolHttp.HttpRequest(contents);
266
286
  };
267
-
268
- // src/protocols/Aws_json1_1.ts
269
- var se_GetEntitlementsCommand = /* @__PURE__ */ __name(async (input, context) => {
270
- const headers = sharedHeaders("GetEntitlements");
271
- let body;
272
- body = JSON.stringify((0, import_smithy_client._json)(input));
273
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
274
- }, "se_GetEntitlementsCommand");
275
- var de_GetEntitlementsCommand = /* @__PURE__ */ __name(async (output, context) => {
276
- if (output.statusCode >= 300) {
277
- return de_CommandError(output, context);
278
- }
279
- const data = await (0, import_core2.parseJsonBody)(output.body, context);
280
- let contents = {};
281
- contents = de_GetEntitlementsResult(data, context);
282
- const response = {
283
- $metadata: deserializeMetadata(output),
284
- ...contents
285
- };
286
- return response;
287
- }, "de_GetEntitlementsCommand");
288
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
289
- const parsedOutput = {
290
- ...output,
291
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
292
- };
293
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
294
- switch (errorCode) {
295
- case "InternalServiceErrorException":
296
- case "com.amazonaws.marketplaceentitlementservice#InternalServiceErrorException":
297
- throw await de_InternalServiceErrorExceptionRes(parsedOutput, context);
298
- case "InvalidParameterException":
299
- case "com.amazonaws.marketplaceentitlementservice#InvalidParameterException":
300
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
301
- case "ThrottlingException":
302
- case "com.amazonaws.marketplaceentitlementservice#ThrottlingException":
303
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
304
- default:
305
- const parsedBody = parsedOutput.body;
306
- return throwDefaultError({
307
- output,
308
- parsedBody,
309
- errorCode
310
- });
311
- }
312
- }, "de_CommandError");
313
- var de_InternalServiceErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
314
- const body = parsedOutput.body;
315
- const deserialized = (0, import_smithy_client._json)(body);
316
- const exception = new InternalServiceErrorException({
317
- $metadata: deserializeMetadata(parsedOutput),
318
- ...deserialized
319
- });
320
- return (0, import_smithy_client.decorateServiceException)(exception, body);
321
- }, "de_InternalServiceErrorExceptionRes");
322
- var de_InvalidParameterExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
323
- const body = parsedOutput.body;
324
- const deserialized = (0, import_smithy_client._json)(body);
325
- const exception = new InvalidParameterException({
326
- $metadata: deserializeMetadata(parsedOutput),
327
- ...deserialized
328
- });
329
- return (0, import_smithy_client.decorateServiceException)(exception, body);
330
- }, "de_InvalidParameterExceptionRes");
331
- var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
332
- const body = parsedOutput.body;
333
- const deserialized = (0, import_smithy_client._json)(body);
334
- const exception = new ThrottlingException({
335
- $metadata: deserializeMetadata(parsedOutput),
336
- ...deserialized
337
- });
338
- return (0, import_smithy_client.decorateServiceException)(exception, body);
339
- }, "de_ThrottlingExceptionRes");
340
- var de_Entitlement = /* @__PURE__ */ __name((output, context) => {
341
- return (0, import_smithy_client.take)(output, {
342
- CustomerAWSAccountId: import_smithy_client.expectString,
343
- CustomerIdentifier: import_smithy_client.expectString,
344
- Dimension: import_smithy_client.expectString,
345
- ExpirationDate: /* @__PURE__ */ __name((_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))), "ExpirationDate"),
346
- ProductCode: import_smithy_client.expectString,
347
- Value: /* @__PURE__ */ __name((_) => de_EntitlementValue(_, context), "Value")
348
- });
349
- }, "de_Entitlement");
350
- var de_EntitlementList = /* @__PURE__ */ __name((output, context) => {
351
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
352
- return de_Entitlement(entry, context);
353
- });
354
- return retVal;
355
- }, "de_EntitlementList");
356
- var de_EntitlementValue = /* @__PURE__ */ __name((output, context) => {
357
- return (0, import_smithy_client.take)(output, {
358
- BooleanValue: import_smithy_client.expectBoolean,
359
- DoubleValue: import_smithy_client.limitedParseDouble,
360
- IntegerValue: import_smithy_client.expectInt32,
361
- StringValue: import_smithy_client.expectString
362
- });
363
- }, "de_EntitlementValue");
364
- var de_GetEntitlementsResult = /* @__PURE__ */ __name((output, context) => {
365
- return (0, import_smithy_client.take)(output, {
366
- Entitlements: /* @__PURE__ */ __name((_) => de_EntitlementList(_, context), "Entitlements"),
367
- NextToken: import_smithy_client.expectString
368
- });
369
- }, "de_GetEntitlementsResult");
370
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
371
- httpStatusCode: output.statusCode,
372
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
373
- extendedRequestId: output.headers["x-amz-id-2"],
374
- cfId: output.headers["x-amz-cf-id"]
375
- }), "deserializeMetadata");
376
- var throwDefaultError = (0, import_smithy_client.withBaseException)(MarketplaceEntitlementServiceServiceException);
377
- var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
378
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
379
- const contents = {
380
- protocol,
381
- hostname,
382
- port,
383
- method: "POST",
384
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
385
- headers
386
- };
387
- if (resolvedHostname !== void 0) {
388
- contents.hostname = resolvedHostname;
389
- }
390
- if (body !== void 0) {
391
- contents.body = body;
392
- }
393
- return new import_protocol_http.HttpRequest(contents);
394
- }, "buildHttpRpcRequest");
395
287
  function sharedHeaders(operation) {
396
- return {
397
- "content-type": "application/x-amz-json-1.1",
398
- "x-amz-target": `AWSMPEntitlementService.${operation}`
399
- };
288
+ return {
289
+ "content-type": "application/x-amz-json-1.1",
290
+ "x-amz-target": `AWSMPEntitlementService.${operation}`,
291
+ };
400
292
  }
401
- __name(sharedHeaders, "sharedHeaders");
402
293
 
403
- // src/commands/GetEntitlementsCommand.ts
404
- var GetEntitlementsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
405
- return [
406
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
407
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
408
- ];
409
- }).s("AWSMPEntitlementService", "GetEntitlements", {}).n("MarketplaceEntitlementServiceClient", "GetEntitlementsCommand").f(void 0, void 0).ser(se_GetEntitlementsCommand).de(de_GetEntitlementsCommand).build() {
410
- static {
411
- __name(this, "GetEntitlementsCommand");
412
- }
413
- };
294
+ class GetEntitlementsCommand extends smithyClient.Command
295
+ .classBuilder()
296
+ .ep(commonParams)
297
+ .m(function (Command, cs, config, o) {
298
+ return [
299
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
300
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
301
+ ];
302
+ })
303
+ .s("AWSMPEntitlementService", "GetEntitlements", {})
304
+ .n("MarketplaceEntitlementServiceClient", "GetEntitlementsCommand")
305
+ .f(void 0, void 0)
306
+ .ser(se_GetEntitlementsCommand)
307
+ .de(de_GetEntitlementsCommand)
308
+ .build() {
309
+ }
414
310
 
415
- // src/MarketplaceEntitlementService.ts
416
- var commands = {
417
- GetEntitlementsCommand
418
- };
419
- var MarketplaceEntitlementService = class extends MarketplaceEntitlementServiceClient {
420
- static {
421
- __name(this, "MarketplaceEntitlementService");
422
- }
311
+ const commands = {
312
+ GetEntitlementsCommand,
423
313
  };
424
- (0, import_smithy_client.createAggregatedClient)(commands, MarketplaceEntitlementService);
425
-
426
- // src/pagination/GetEntitlementsPaginator.ts
314
+ class MarketplaceEntitlementService extends MarketplaceEntitlementServiceClient {
315
+ }
316
+ smithyClient.createAggregatedClient(commands, MarketplaceEntitlementService);
427
317
 
428
- var paginateGetEntitlements = (0, import_core.createPaginator)(MarketplaceEntitlementServiceClient, GetEntitlementsCommand, "NextToken", "NextToken", "MaxResults");
429
- // Annotate the CommonJS export names for ESM import in node:
318
+ const paginateGetEntitlements = core.createPaginator(MarketplaceEntitlementServiceClient, GetEntitlementsCommand, "NextToken", "NextToken", "MaxResults");
430
319
 
431
- 0 && (module.exports = {
432
- MarketplaceEntitlementServiceServiceException,
433
- __Client,
434
- MarketplaceEntitlementServiceClient,
435
- MarketplaceEntitlementService,
436
- $Command,
437
- GetEntitlementsCommand,
438
- paginateGetEntitlements,
439
- GetEntitlementFilterName,
440
- InternalServiceErrorException,
441
- InvalidParameterException,
442
- ThrottlingException
320
+ Object.defineProperty(exports, "$Command", {
321
+ enumerable: true,
322
+ get: function () { return smithyClient.Command; }
443
323
  });
444
-
324
+ Object.defineProperty(exports, "__Client", {
325
+ enumerable: true,
326
+ get: function () { return smithyClient.Client; }
327
+ });
328
+ exports.GetEntitlementFilterName = GetEntitlementFilterName;
329
+ exports.GetEntitlementsCommand = GetEntitlementsCommand;
330
+ exports.InternalServiceErrorException = InternalServiceErrorException;
331
+ exports.InvalidParameterException = InvalidParameterException;
332
+ exports.MarketplaceEntitlementService = MarketplaceEntitlementService;
333
+ exports.MarketplaceEntitlementServiceClient = MarketplaceEntitlementServiceClient;
334
+ exports.MarketplaceEntitlementServiceServiceException = MarketplaceEntitlementServiceServiceException;
335
+ exports.ThrottlingException = ThrottlingException;
336
+ exports.paginateGetEntitlements = paginateGetEntitlements;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-marketplace-entitlement-service",
3
3
  "description": "AWS SDK for JavaScript Marketplace Entitlement Service Client for Node.js, Browser and React Native",
4
- "version": "3.901.0",
4
+ "version": "3.906.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-marketplace-entitlement-service",
@@ -20,17 +20,17 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
- "@aws-sdk/core": "3.901.0",
24
- "@aws-sdk/credential-provider-node": "3.901.0",
23
+ "@aws-sdk/core": "3.906.0",
24
+ "@aws-sdk/credential-provider-node": "3.906.0",
25
25
  "@aws-sdk/middleware-host-header": "3.901.0",
26
26
  "@aws-sdk/middleware-logger": "3.901.0",
27
27
  "@aws-sdk/middleware-recursion-detection": "3.901.0",
28
- "@aws-sdk/middleware-user-agent": "3.901.0",
28
+ "@aws-sdk/middleware-user-agent": "3.906.0",
29
29
  "@aws-sdk/region-config-resolver": "3.901.0",
30
30
  "@aws-sdk/types": "3.901.0",
31
31
  "@aws-sdk/util-endpoints": "3.901.0",
32
32
  "@aws-sdk/util-user-agent-browser": "3.901.0",
33
- "@aws-sdk/util-user-agent-node": "3.901.0",
33
+ "@aws-sdk/util-user-agent-node": "3.906.0",
34
34
  "@smithy/config-resolver": "^4.3.0",
35
35
  "@smithy/core": "^3.14.0",
36
36
  "@smithy/fetch-http-handler": "^5.3.0",