@aws-sdk/client-marketplace-entitlement-service 3.310.0 → 3.315.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.
@@ -6,12 +6,9 @@ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const MarketplaceEntitlementServiceServiceException_1 = require("../models/MarketplaceEntitlementServiceServiceException");
7
7
  const models_0_1 = require("../models/models_0");
8
8
  const se_GetEntitlementsCommand = async (input, context) => {
9
- const headers = {
10
- "content-type": "application/x-amz-json-1.1",
11
- "x-amz-target": "AWSMPEntitlementService.GetEntitlements",
12
- };
9
+ const headers = sharedHeaders("GetEntitlements");
13
10
  let body;
14
- body = JSON.stringify(se_GetEntitlementsRequest(input, context));
11
+ body = JSON.stringify((0, smithy_client_1._json)(input));
15
12
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
13
  };
17
14
  exports.se_GetEntitlementsCommand = se_GetEntitlementsCommand;
@@ -26,7 +23,7 @@ const de_GetEntitlementsCommand = async (output, context) => {
26
23
  $metadata: deserializeMetadata(output),
27
24
  ...contents,
28
25
  };
29
- return Promise.resolve(response);
26
+ return response;
30
27
  };
31
28
  exports.de_GetEntitlementsCommand = de_GetEntitlementsCommand;
32
29
  const de_GetEntitlementsCommandError = async (output, context) => {
@@ -47,17 +44,16 @@ const de_GetEntitlementsCommandError = async (output, context) => {
47
44
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
48
45
  default:
49
46
  const parsedBody = parsedOutput.body;
50
- (0, smithy_client_1.throwDefaultError)({
47
+ return throwDefaultError({
51
48
  output,
52
49
  parsedBody,
53
- exceptionCtor: MarketplaceEntitlementServiceServiceException_1.MarketplaceEntitlementServiceServiceException,
54
50
  errorCode,
55
51
  });
56
52
  }
57
53
  };
58
54
  const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
59
55
  const body = parsedOutput.body;
60
- const deserialized = de_InternalServiceErrorException(body, context);
56
+ const deserialized = (0, smithy_client_1._json)(body);
61
57
  const exception = new models_0_1.InternalServiceErrorException({
62
58
  $metadata: deserializeMetadata(parsedOutput),
63
59
  ...deserialized,
@@ -66,7 +62,7 @@ const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
66
62
  };
67
63
  const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
68
64
  const body = parsedOutput.body;
69
- const deserialized = de_InvalidParameterException(body, context);
65
+ const deserialized = (0, smithy_client_1._json)(body);
70
66
  const exception = new models_0_1.InvalidParameterException({
71
67
  $metadata: deserializeMetadata(parsedOutput),
72
68
  ...deserialized,
@@ -75,87 +71,43 @@ const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
75
71
  };
76
72
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
77
73
  const body = parsedOutput.body;
78
- const deserialized = de_ThrottlingException(body, context);
74
+ const deserialized = (0, smithy_client_1._json)(body);
79
75
  const exception = new models_0_1.ThrottlingException({
80
76
  $metadata: deserializeMetadata(parsedOutput),
81
77
  ...deserialized,
82
78
  });
83
79
  return (0, smithy_client_1.decorateServiceException)(exception, body);
84
80
  };
85
- const se_FilterValueList = (input, context) => {
86
- return input
87
- .filter((e) => e != null)
88
- .map((entry) => {
89
- return entry;
90
- });
91
- };
92
- const se_GetEntitlementFilters = (input, context) => {
93
- return Object.entries(input).reduce((acc, [key, value]) => {
94
- if (value === null) {
95
- return acc;
96
- }
97
- acc[key] = se_FilterValueList(value, context);
98
- return acc;
99
- }, {});
100
- };
101
- const se_GetEntitlementsRequest = (input, context) => {
102
- return {
103
- ...(input.Filter != null && { Filter: se_GetEntitlementFilters(input.Filter, context) }),
104
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
105
- ...(input.NextToken != null && { NextToken: input.NextToken }),
106
- ...(input.ProductCode != null && { ProductCode: input.ProductCode }),
107
- };
108
- };
109
81
  const de_Entitlement = (output, context) => {
110
- return {
111
- CustomerIdentifier: (0, smithy_client_1.expectString)(output.CustomerIdentifier),
112
- Dimension: (0, smithy_client_1.expectString)(output.Dimension),
113
- ExpirationDate: output.ExpirationDate != null
114
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ExpirationDate)))
115
- : undefined,
116
- ProductCode: (0, smithy_client_1.expectString)(output.ProductCode),
117
- Value: output.Value != null ? de_EntitlementValue(output.Value, context) : undefined,
118
- };
82
+ return (0, smithy_client_1.take)(output, {
83
+ CustomerIdentifier: smithy_client_1.expectString,
84
+ Dimension: smithy_client_1.expectString,
85
+ ExpirationDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
86
+ ProductCode: smithy_client_1.expectString,
87
+ Value: (_) => de_EntitlementValue(_, context),
88
+ });
119
89
  };
120
90
  const de_EntitlementList = (output, context) => {
121
91
  const retVal = (output || [])
122
92
  .filter((e) => e != null)
123
93
  .map((entry) => {
124
- if (entry === null) {
125
- return null;
126
- }
127
94
  return de_Entitlement(entry, context);
128
95
  });
129
96
  return retVal;
130
97
  };
131
98
  const de_EntitlementValue = (output, context) => {
132
- return {
133
- BooleanValue: (0, smithy_client_1.expectBoolean)(output.BooleanValue),
134
- DoubleValue: (0, smithy_client_1.limitedParseDouble)(output.DoubleValue),
135
- IntegerValue: (0, smithy_client_1.expectInt32)(output.IntegerValue),
136
- StringValue: (0, smithy_client_1.expectString)(output.StringValue),
137
- };
99
+ return (0, smithy_client_1.take)(output, {
100
+ BooleanValue: smithy_client_1.expectBoolean,
101
+ DoubleValue: smithy_client_1.limitedParseDouble,
102
+ IntegerValue: smithy_client_1.expectInt32,
103
+ StringValue: smithy_client_1.expectString,
104
+ });
138
105
  };
139
106
  const de_GetEntitlementsResult = (output, context) => {
140
- return {
141
- Entitlements: output.Entitlements != null ? de_EntitlementList(output.Entitlements, context) : undefined,
142
- NextToken: (0, smithy_client_1.expectString)(output.NextToken),
143
- };
144
- };
145
- const de_InternalServiceErrorException = (output, context) => {
146
- return {
147
- message: (0, smithy_client_1.expectString)(output.message),
148
- };
149
- };
150
- const de_InvalidParameterException = (output, context) => {
151
- return {
152
- message: (0, smithy_client_1.expectString)(output.message),
153
- };
154
- };
155
- const de_ThrottlingException = (output, context) => {
156
- return {
157
- message: (0, smithy_client_1.expectString)(output.message),
158
- };
107
+ return (0, smithy_client_1.take)(output, {
108
+ Entitlements: (_) => de_EntitlementList(_, context),
109
+ NextToken: smithy_client_1.expectString,
110
+ });
159
111
  };
160
112
  const deserializeMetadata = (output) => ({
161
113
  httpStatusCode: output.statusCode,
@@ -170,6 +122,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
170
122
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
171
123
  };
172
124
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
125
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(MarketplaceEntitlementServiceServiceException_1.MarketplaceEntitlementServiceServiceException);
173
126
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
174
127
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
175
128
  const contents = {
@@ -188,6 +141,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
188
141
  }
189
142
  return new protocol_http_1.HttpRequest(contents);
190
143
  };
144
+ function sharedHeaders(operation) {
145
+ return {
146
+ "content-type": "application/x-amz-json-1.1",
147
+ "x-amz-target": `AWSMPEntitlementService.${operation}`,
148
+ };
149
+ }
191
150
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
192
151
  if (encoded.length) {
193
152
  return JSON.parse(encoded);
@@ -1,14 +1,11 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { MarketplaceEntitlementServiceServiceException as __BaseException } from "../models/MarketplaceEntitlementServiceServiceException";
4
4
  import { InternalServiceErrorException, InvalidParameterException, ThrottlingException, } from "../models/models_0";
5
5
  export const se_GetEntitlementsCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.1",
8
- "x-amz-target": "AWSMPEntitlementService.GetEntitlements",
9
- };
6
+ const headers = sharedHeaders("GetEntitlements");
10
7
  let body;
11
- body = JSON.stringify(se_GetEntitlementsRequest(input, context));
8
+ body = JSON.stringify(_json(input));
12
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
10
  };
14
11
  export const de_GetEntitlementsCommand = async (output, context) => {
@@ -22,7 +19,7 @@ export const de_GetEntitlementsCommand = async (output, context) => {
22
19
  $metadata: deserializeMetadata(output),
23
20
  ...contents,
24
21
  };
25
- return Promise.resolve(response);
22
+ return response;
26
23
  };
27
24
  const de_GetEntitlementsCommandError = async (output, context) => {
28
25
  const parsedOutput = {
@@ -42,17 +39,16 @@ const de_GetEntitlementsCommandError = async (output, context) => {
42
39
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
43
40
  default:
44
41
  const parsedBody = parsedOutput.body;
45
- throwDefaultError({
42
+ return throwDefaultError({
46
43
  output,
47
44
  parsedBody,
48
- exceptionCtor: __BaseException,
49
45
  errorCode,
50
46
  });
51
47
  }
52
48
  };
53
49
  const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
54
50
  const body = parsedOutput.body;
55
- const deserialized = de_InternalServiceErrorException(body, context);
51
+ const deserialized = _json(body);
56
52
  const exception = new InternalServiceErrorException({
57
53
  $metadata: deserializeMetadata(parsedOutput),
58
54
  ...deserialized,
@@ -61,7 +57,7 @@ const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
61
57
  };
62
58
  const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
63
59
  const body = parsedOutput.body;
64
- const deserialized = de_InvalidParameterException(body, context);
60
+ const deserialized = _json(body);
65
61
  const exception = new InvalidParameterException({
66
62
  $metadata: deserializeMetadata(parsedOutput),
67
63
  ...deserialized,
@@ -70,87 +66,43 @@ const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
70
66
  };
71
67
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
72
68
  const body = parsedOutput.body;
73
- const deserialized = de_ThrottlingException(body, context);
69
+ const deserialized = _json(body);
74
70
  const exception = new ThrottlingException({
75
71
  $metadata: deserializeMetadata(parsedOutput),
76
72
  ...deserialized,
77
73
  });
78
74
  return __decorateServiceException(exception, body);
79
75
  };
80
- const se_FilterValueList = (input, context) => {
81
- return input
82
- .filter((e) => e != null)
83
- .map((entry) => {
84
- return entry;
85
- });
86
- };
87
- const se_GetEntitlementFilters = (input, context) => {
88
- return Object.entries(input).reduce((acc, [key, value]) => {
89
- if (value === null) {
90
- return acc;
91
- }
92
- acc[key] = se_FilterValueList(value, context);
93
- return acc;
94
- }, {});
95
- };
96
- const se_GetEntitlementsRequest = (input, context) => {
97
- return {
98
- ...(input.Filter != null && { Filter: se_GetEntitlementFilters(input.Filter, context) }),
99
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
100
- ...(input.NextToken != null && { NextToken: input.NextToken }),
101
- ...(input.ProductCode != null && { ProductCode: input.ProductCode }),
102
- };
103
- };
104
76
  const de_Entitlement = (output, context) => {
105
- return {
106
- CustomerIdentifier: __expectString(output.CustomerIdentifier),
107
- Dimension: __expectString(output.Dimension),
108
- ExpirationDate: output.ExpirationDate != null
109
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ExpirationDate)))
110
- : undefined,
111
- ProductCode: __expectString(output.ProductCode),
112
- Value: output.Value != null ? de_EntitlementValue(output.Value, context) : undefined,
113
- };
77
+ return take(output, {
78
+ CustomerIdentifier: __expectString,
79
+ Dimension: __expectString,
80
+ ExpirationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
81
+ ProductCode: __expectString,
82
+ Value: (_) => de_EntitlementValue(_, context),
83
+ });
114
84
  };
115
85
  const de_EntitlementList = (output, context) => {
116
86
  const retVal = (output || [])
117
87
  .filter((e) => e != null)
118
88
  .map((entry) => {
119
- if (entry === null) {
120
- return null;
121
- }
122
89
  return de_Entitlement(entry, context);
123
90
  });
124
91
  return retVal;
125
92
  };
126
93
  const de_EntitlementValue = (output, context) => {
127
- return {
128
- BooleanValue: __expectBoolean(output.BooleanValue),
129
- DoubleValue: __limitedParseDouble(output.DoubleValue),
130
- IntegerValue: __expectInt32(output.IntegerValue),
131
- StringValue: __expectString(output.StringValue),
132
- };
94
+ return take(output, {
95
+ BooleanValue: __expectBoolean,
96
+ DoubleValue: __limitedParseDouble,
97
+ IntegerValue: __expectInt32,
98
+ StringValue: __expectString,
99
+ });
133
100
  };
134
101
  const de_GetEntitlementsResult = (output, context) => {
135
- return {
136
- Entitlements: output.Entitlements != null ? de_EntitlementList(output.Entitlements, context) : undefined,
137
- NextToken: __expectString(output.NextToken),
138
- };
139
- };
140
- const de_InternalServiceErrorException = (output, context) => {
141
- return {
142
- message: __expectString(output.message),
143
- };
144
- };
145
- const de_InvalidParameterException = (output, context) => {
146
- return {
147
- message: __expectString(output.message),
148
- };
149
- };
150
- const de_ThrottlingException = (output, context) => {
151
- return {
152
- message: __expectString(output.message),
153
- };
102
+ return take(output, {
103
+ Entitlements: (_) => de_EntitlementList(_, context),
104
+ NextToken: __expectString,
105
+ });
154
106
  };
155
107
  const deserializeMetadata = (output) => ({
156
108
  httpStatusCode: output.statusCode,
@@ -165,6 +117,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
165
117
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
166
118
  };
167
119
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
120
+ const throwDefaultError = withBaseException(__BaseException);
168
121
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
169
122
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
170
123
  const contents = {
@@ -183,6 +136,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
183
136
  }
184
137
  return new __HttpRequest(contents);
185
138
  };
139
+ function sharedHeaders(operation) {
140
+ return {
141
+ "content-type": "application/x-amz-json-1.1",
142
+ "x-amz-target": `AWSMPEntitlementService.${operation}`,
143
+ };
144
+ }
186
145
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
187
146
  if (encoded.length) {
188
147
  return JSON.parse(encoded);
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.310.0",
4
+ "version": "3.315.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.310.0",
24
+ "@aws-sdk/client-sts": "3.315.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.315.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.315.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.315.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.315.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",