@aws-sdk/client-marketplace-deployment 3.463.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.
- package/LICENSE +201 -0
- package/README.md +237 -0
- package/dist-cjs/MarketplaceDeployment.js +19 -0
- package/dist-cjs/MarketplaceDeploymentClient.js +43 -0
- package/dist-cjs/commands/ListTagsForResourceCommand.js +51 -0
- package/dist-cjs/commands/PutDeploymentParameterCommand.js +52 -0
- package/dist-cjs/commands/TagResourceCommand.js +51 -0
- package/dist-cjs/commands/UntagResourceCommand.js +51 -0
- package/dist-cjs/commands/index.js +7 -0
- package/dist-cjs/endpoint/EndpointParameters.js +12 -0
- package/dist-cjs/endpoint/endpointResolver.js +12 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/models/MarketplaceDeploymentServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +114 -0
- package/dist-cjs/protocols/Aws_restJson1.js +436 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +50 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +24 -0
- package/dist-cjs/runtimeExtensions.js +22 -0
- package/dist-es/MarketplaceDeployment.js +15 -0
- package/dist-es/MarketplaceDeploymentClient.js +39 -0
- package/dist-es/commands/ListTagsForResourceCommand.js +47 -0
- package/dist-es/commands/PutDeploymentParameterCommand.js +48 -0
- package/dist-es/commands/TagResourceCommand.js +47 -0
- package/dist-es/commands/UntagResourceCommand.js +47 -0
- package/dist-es/commands/index.js +4 -0
- package/dist-es/endpoint/EndpointParameters.js +8 -0
- package/dist-es/endpoint/endpointResolver.js +8 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +6 -0
- package/dist-es/models/MarketplaceDeploymentServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +102 -0
- package/dist-es/protocols/Aws_restJson1.js +425 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +45 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +20 -0
- package/dist-es/runtimeExtensions.js +18 -0
- package/dist-types/MarketplaceDeployment.d.ts +38 -0
- package/dist-types/MarketplaceDeploymentClient.d.ts +173 -0
- package/dist-types/commands/ListTagsForResourceCommand.d.ts +90 -0
- package/dist-types/commands/PutDeploymentParameterCommand.d.ts +110 -0
- package/dist-types/commands/TagResourceCommand.d.ts +92 -0
- package/dist-types/commands/UntagResourceCommand.d.ts +92 -0
- package/dist-types/commands/index.d.ts +4 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +22 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +8 -0
- package/dist-types/index.d.ts +14 -0
- package/dist-types/models/MarketplaceDeploymentServiceException.d.ts +13 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +250 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +38 -0
- package/dist-types/runtimeConfig.browser.d.ts +46 -0
- package/dist-types/runtimeConfig.d.ts +46 -0
- package/dist-types/runtimeConfig.native.d.ts +45 -0
- package/dist-types/runtimeConfig.shared.d.ts +19 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/MarketplaceDeployment.d.ts +75 -0
- package/dist-types/ts3.4/MarketplaceDeploymentClient.d.ts +145 -0
- package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/PutDeploymentParameterCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/index.d.ts +4 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +33 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
- package/dist-types/ts3.4/index.d.ts +9 -0
- package/dist-types/ts3.4/models/MarketplaceDeploymentServiceException.d.ts +8 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +96 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +53 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +99 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +99 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +90 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +13 -0
- package/package.json +104 -0
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
2
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, resolvedPath as __resolvedPath, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
|
+
import { v4 as generateIdempotencyToken } from "uuid";
|
|
4
|
+
import { MarketplaceDeploymentServiceException as __BaseException } from "../models/MarketplaceDeploymentServiceException";
|
|
5
|
+
import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
|
+
export const se_ListTagsForResourceCommand = async (input, context) => {
|
|
7
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
8
|
+
const headers = {};
|
|
9
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
10
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
11
|
+
let body;
|
|
12
|
+
return new __HttpRequest({
|
|
13
|
+
protocol,
|
|
14
|
+
hostname,
|
|
15
|
+
port,
|
|
16
|
+
method: "GET",
|
|
17
|
+
headers,
|
|
18
|
+
path: resolvedPath,
|
|
19
|
+
body,
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export const se_PutDeploymentParameterCommand = async (input, context) => {
|
|
23
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
24
|
+
const headers = {
|
|
25
|
+
"content-type": "application/json",
|
|
26
|
+
};
|
|
27
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
28
|
+
"/catalogs/{catalog}/products/{productId}/deployment-parameters";
|
|
29
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "catalog", () => input.catalog, "{catalog}", false);
|
|
30
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "productId", () => input.productId, "{productId}", false);
|
|
31
|
+
let body;
|
|
32
|
+
body = JSON.stringify(take(input, {
|
|
33
|
+
agreementId: [],
|
|
34
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
35
|
+
deploymentParameter: (_) => _json(_),
|
|
36
|
+
expirationDate: (_) => _.toISOString().split(".")[0] + "Z",
|
|
37
|
+
tags: (_) => _json(_),
|
|
38
|
+
}));
|
|
39
|
+
return new __HttpRequest({
|
|
40
|
+
protocol,
|
|
41
|
+
hostname,
|
|
42
|
+
port,
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers,
|
|
45
|
+
path: resolvedPath,
|
|
46
|
+
body,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
export const se_TagResourceCommand = async (input, context) => {
|
|
50
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
51
|
+
const headers = {
|
|
52
|
+
"content-type": "application/json",
|
|
53
|
+
};
|
|
54
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
55
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
56
|
+
let body;
|
|
57
|
+
body = JSON.stringify(take(input, {
|
|
58
|
+
tags: (_) => _json(_),
|
|
59
|
+
}));
|
|
60
|
+
return new __HttpRequest({
|
|
61
|
+
protocol,
|
|
62
|
+
hostname,
|
|
63
|
+
port,
|
|
64
|
+
method: "POST",
|
|
65
|
+
headers,
|
|
66
|
+
path: resolvedPath,
|
|
67
|
+
body,
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
export const se_UntagResourceCommand = async (input, context) => {
|
|
71
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
72
|
+
const headers = {};
|
|
73
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
74
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
75
|
+
const query = map({
|
|
76
|
+
tagKeys: [
|
|
77
|
+
__expectNonNull(input.tagKeys, `tagKeys`) != null,
|
|
78
|
+
() => (input.tagKeys || []).map((_entry) => _entry),
|
|
79
|
+
],
|
|
80
|
+
});
|
|
81
|
+
let body;
|
|
82
|
+
return new __HttpRequest({
|
|
83
|
+
protocol,
|
|
84
|
+
hostname,
|
|
85
|
+
port,
|
|
86
|
+
method: "DELETE",
|
|
87
|
+
headers,
|
|
88
|
+
path: resolvedPath,
|
|
89
|
+
query,
|
|
90
|
+
body,
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
export const de_ListTagsForResourceCommand = async (output, context) => {
|
|
94
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
95
|
+
return de_ListTagsForResourceCommandError(output, context);
|
|
96
|
+
}
|
|
97
|
+
const contents = map({
|
|
98
|
+
$metadata: deserializeMetadata(output),
|
|
99
|
+
});
|
|
100
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
101
|
+
const doc = take(data, {
|
|
102
|
+
tags: _json,
|
|
103
|
+
});
|
|
104
|
+
Object.assign(contents, doc);
|
|
105
|
+
return contents;
|
|
106
|
+
};
|
|
107
|
+
const de_ListTagsForResourceCommandError = async (output, context) => {
|
|
108
|
+
const parsedOutput = {
|
|
109
|
+
...output,
|
|
110
|
+
body: await parseErrorBody(output.body, context),
|
|
111
|
+
};
|
|
112
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
113
|
+
switch (errorCode) {
|
|
114
|
+
case "AccessDeniedException":
|
|
115
|
+
case "com.amazonaws.marketplacedeployment#AccessDeniedException":
|
|
116
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
117
|
+
case "InternalServerException":
|
|
118
|
+
case "com.amazonaws.marketplacedeployment#InternalServerException":
|
|
119
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
120
|
+
case "ResourceNotFoundException":
|
|
121
|
+
case "com.amazonaws.marketplacedeployment#ResourceNotFoundException":
|
|
122
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
123
|
+
case "ThrottlingException":
|
|
124
|
+
case "com.amazonaws.marketplacedeployment#ThrottlingException":
|
|
125
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
126
|
+
case "ValidationException":
|
|
127
|
+
case "com.amazonaws.marketplacedeployment#ValidationException":
|
|
128
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
129
|
+
default:
|
|
130
|
+
const parsedBody = parsedOutput.body;
|
|
131
|
+
return throwDefaultError({
|
|
132
|
+
output,
|
|
133
|
+
parsedBody,
|
|
134
|
+
errorCode,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
export const de_PutDeploymentParameterCommand = async (output, context) => {
|
|
139
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
140
|
+
return de_PutDeploymentParameterCommandError(output, context);
|
|
141
|
+
}
|
|
142
|
+
const contents = map({
|
|
143
|
+
$metadata: deserializeMetadata(output),
|
|
144
|
+
});
|
|
145
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
146
|
+
const doc = take(data, {
|
|
147
|
+
agreementId: __expectString,
|
|
148
|
+
deploymentParameterId: __expectString,
|
|
149
|
+
resourceArn: __expectString,
|
|
150
|
+
tags: _json,
|
|
151
|
+
});
|
|
152
|
+
Object.assign(contents, doc);
|
|
153
|
+
return contents;
|
|
154
|
+
};
|
|
155
|
+
const de_PutDeploymentParameterCommandError = async (output, context) => {
|
|
156
|
+
const parsedOutput = {
|
|
157
|
+
...output,
|
|
158
|
+
body: await parseErrorBody(output.body, context),
|
|
159
|
+
};
|
|
160
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
161
|
+
switch (errorCode) {
|
|
162
|
+
case "AccessDeniedException":
|
|
163
|
+
case "com.amazonaws.marketplacedeployment#AccessDeniedException":
|
|
164
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
165
|
+
case "ConflictException":
|
|
166
|
+
case "com.amazonaws.marketplacedeployment#ConflictException":
|
|
167
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
168
|
+
case "InternalServerException":
|
|
169
|
+
case "com.amazonaws.marketplacedeployment#InternalServerException":
|
|
170
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
171
|
+
case "ResourceNotFoundException":
|
|
172
|
+
case "com.amazonaws.marketplacedeployment#ResourceNotFoundException":
|
|
173
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
174
|
+
case "ServiceQuotaExceededException":
|
|
175
|
+
case "com.amazonaws.marketplacedeployment#ServiceQuotaExceededException":
|
|
176
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
177
|
+
case "ThrottlingException":
|
|
178
|
+
case "com.amazonaws.marketplacedeployment#ThrottlingException":
|
|
179
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
180
|
+
case "ValidationException":
|
|
181
|
+
case "com.amazonaws.marketplacedeployment#ValidationException":
|
|
182
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
183
|
+
default:
|
|
184
|
+
const parsedBody = parsedOutput.body;
|
|
185
|
+
return throwDefaultError({
|
|
186
|
+
output,
|
|
187
|
+
parsedBody,
|
|
188
|
+
errorCode,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
export const de_TagResourceCommand = async (output, context) => {
|
|
193
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
194
|
+
return de_TagResourceCommandError(output, context);
|
|
195
|
+
}
|
|
196
|
+
const contents = map({
|
|
197
|
+
$metadata: deserializeMetadata(output),
|
|
198
|
+
});
|
|
199
|
+
await collectBody(output.body, context);
|
|
200
|
+
return contents;
|
|
201
|
+
};
|
|
202
|
+
const de_TagResourceCommandError = async (output, context) => {
|
|
203
|
+
const parsedOutput = {
|
|
204
|
+
...output,
|
|
205
|
+
body: await parseErrorBody(output.body, context),
|
|
206
|
+
};
|
|
207
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
208
|
+
switch (errorCode) {
|
|
209
|
+
case "AccessDeniedException":
|
|
210
|
+
case "com.amazonaws.marketplacedeployment#AccessDeniedException":
|
|
211
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
212
|
+
case "ConflictException":
|
|
213
|
+
case "com.amazonaws.marketplacedeployment#ConflictException":
|
|
214
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
215
|
+
case "InternalServerException":
|
|
216
|
+
case "com.amazonaws.marketplacedeployment#InternalServerException":
|
|
217
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
218
|
+
case "ResourceNotFoundException":
|
|
219
|
+
case "com.amazonaws.marketplacedeployment#ResourceNotFoundException":
|
|
220
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
221
|
+
case "ThrottlingException":
|
|
222
|
+
case "com.amazonaws.marketplacedeployment#ThrottlingException":
|
|
223
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
224
|
+
case "ValidationException":
|
|
225
|
+
case "com.amazonaws.marketplacedeployment#ValidationException":
|
|
226
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
227
|
+
default:
|
|
228
|
+
const parsedBody = parsedOutput.body;
|
|
229
|
+
return throwDefaultError({
|
|
230
|
+
output,
|
|
231
|
+
parsedBody,
|
|
232
|
+
errorCode,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
export const de_UntagResourceCommand = async (output, context) => {
|
|
237
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
238
|
+
return de_UntagResourceCommandError(output, context);
|
|
239
|
+
}
|
|
240
|
+
const contents = map({
|
|
241
|
+
$metadata: deserializeMetadata(output),
|
|
242
|
+
});
|
|
243
|
+
await collectBody(output.body, context);
|
|
244
|
+
return contents;
|
|
245
|
+
};
|
|
246
|
+
const de_UntagResourceCommandError = async (output, context) => {
|
|
247
|
+
const parsedOutput = {
|
|
248
|
+
...output,
|
|
249
|
+
body: await parseErrorBody(output.body, context),
|
|
250
|
+
};
|
|
251
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
252
|
+
switch (errorCode) {
|
|
253
|
+
case "AccessDeniedException":
|
|
254
|
+
case "com.amazonaws.marketplacedeployment#AccessDeniedException":
|
|
255
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
256
|
+
case "ConflictException":
|
|
257
|
+
case "com.amazonaws.marketplacedeployment#ConflictException":
|
|
258
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
259
|
+
case "InternalServerException":
|
|
260
|
+
case "com.amazonaws.marketplacedeployment#InternalServerException":
|
|
261
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
262
|
+
case "ResourceNotFoundException":
|
|
263
|
+
case "com.amazonaws.marketplacedeployment#ResourceNotFoundException":
|
|
264
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
265
|
+
case "ThrottlingException":
|
|
266
|
+
case "com.amazonaws.marketplacedeployment#ThrottlingException":
|
|
267
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
268
|
+
case "ValidationException":
|
|
269
|
+
case "com.amazonaws.marketplacedeployment#ValidationException":
|
|
270
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
271
|
+
default:
|
|
272
|
+
const parsedBody = parsedOutput.body;
|
|
273
|
+
return throwDefaultError({
|
|
274
|
+
output,
|
|
275
|
+
parsedBody,
|
|
276
|
+
errorCode,
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
281
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
282
|
+
const contents = map({});
|
|
283
|
+
const data = parsedOutput.body;
|
|
284
|
+
const doc = take(data, {
|
|
285
|
+
message: __expectString,
|
|
286
|
+
});
|
|
287
|
+
Object.assign(contents, doc);
|
|
288
|
+
const exception = new AccessDeniedException({
|
|
289
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
290
|
+
...contents,
|
|
291
|
+
});
|
|
292
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
293
|
+
};
|
|
294
|
+
const de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
295
|
+
const contents = map({});
|
|
296
|
+
const data = parsedOutput.body;
|
|
297
|
+
const doc = take(data, {
|
|
298
|
+
message: __expectString,
|
|
299
|
+
resourceId: __expectString,
|
|
300
|
+
});
|
|
301
|
+
Object.assign(contents, doc);
|
|
302
|
+
const exception = new ConflictException({
|
|
303
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
304
|
+
...contents,
|
|
305
|
+
});
|
|
306
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
307
|
+
};
|
|
308
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
309
|
+
const contents = map({});
|
|
310
|
+
const data = parsedOutput.body;
|
|
311
|
+
const doc = take(data, {
|
|
312
|
+
message: __expectString,
|
|
313
|
+
});
|
|
314
|
+
Object.assign(contents, doc);
|
|
315
|
+
const exception = new InternalServerException({
|
|
316
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
317
|
+
...contents,
|
|
318
|
+
});
|
|
319
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
320
|
+
};
|
|
321
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
322
|
+
const contents = map({});
|
|
323
|
+
const data = parsedOutput.body;
|
|
324
|
+
const doc = take(data, {
|
|
325
|
+
message: __expectString,
|
|
326
|
+
});
|
|
327
|
+
Object.assign(contents, doc);
|
|
328
|
+
const exception = new ResourceNotFoundException({
|
|
329
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
330
|
+
...contents,
|
|
331
|
+
});
|
|
332
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
333
|
+
};
|
|
334
|
+
const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
|
|
335
|
+
const contents = map({});
|
|
336
|
+
const data = parsedOutput.body;
|
|
337
|
+
const doc = take(data, {
|
|
338
|
+
message: __expectString,
|
|
339
|
+
});
|
|
340
|
+
Object.assign(contents, doc);
|
|
341
|
+
const exception = new ServiceQuotaExceededException({
|
|
342
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
343
|
+
...contents,
|
|
344
|
+
});
|
|
345
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
346
|
+
};
|
|
347
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
348
|
+
const contents = map({});
|
|
349
|
+
const data = parsedOutput.body;
|
|
350
|
+
const doc = take(data, {
|
|
351
|
+
message: __expectString,
|
|
352
|
+
});
|
|
353
|
+
Object.assign(contents, doc);
|
|
354
|
+
const exception = new ThrottlingException({
|
|
355
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
356
|
+
...contents,
|
|
357
|
+
});
|
|
358
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
359
|
+
};
|
|
360
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
361
|
+
const contents = map({});
|
|
362
|
+
const data = parsedOutput.body;
|
|
363
|
+
const doc = take(data, {
|
|
364
|
+
fieldName: __expectString,
|
|
365
|
+
message: __expectString,
|
|
366
|
+
});
|
|
367
|
+
Object.assign(contents, doc);
|
|
368
|
+
const exception = new ValidationException({
|
|
369
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
370
|
+
...contents,
|
|
371
|
+
});
|
|
372
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
373
|
+
};
|
|
374
|
+
const deserializeMetadata = (output) => ({
|
|
375
|
+
httpStatusCode: output.statusCode,
|
|
376
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
377
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
378
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
379
|
+
});
|
|
380
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
381
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
382
|
+
value !== null &&
|
|
383
|
+
value !== "" &&
|
|
384
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
385
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
386
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
387
|
+
if (encoded.length) {
|
|
388
|
+
return JSON.parse(encoded);
|
|
389
|
+
}
|
|
390
|
+
return {};
|
|
391
|
+
});
|
|
392
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
393
|
+
const value = await parseBody(errorBody, context);
|
|
394
|
+
value.message = value.message ?? value.Message;
|
|
395
|
+
return value;
|
|
396
|
+
};
|
|
397
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
398
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
399
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
400
|
+
let cleanValue = rawValue;
|
|
401
|
+
if (typeof cleanValue === "number") {
|
|
402
|
+
cleanValue = cleanValue.toString();
|
|
403
|
+
}
|
|
404
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
405
|
+
cleanValue = cleanValue.split(",")[0];
|
|
406
|
+
}
|
|
407
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
408
|
+
cleanValue = cleanValue.split(":")[0];
|
|
409
|
+
}
|
|
410
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
411
|
+
cleanValue = cleanValue.split("#")[1];
|
|
412
|
+
}
|
|
413
|
+
return cleanValue;
|
|
414
|
+
};
|
|
415
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
416
|
+
if (headerKey !== undefined) {
|
|
417
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
418
|
+
}
|
|
419
|
+
if (data.code !== undefined) {
|
|
420
|
+
return sanitizeErrorCode(data.code);
|
|
421
|
+
}
|
|
422
|
+
if (data["__type"] !== undefined) {
|
|
423
|
+
return sanitizeErrorCode(data["__type"]);
|
|
424
|
+
}
|
|
425
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
+
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
|
|
4
|
+
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
6
|
+
import { invalidProvider } from "@smithy/invalid-dependency";
|
|
7
|
+
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
8
|
+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
9
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
10
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
11
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
|
|
12
|
+
export const getRuntimeConfig = (config) => {
|
|
13
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
14
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
15
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
+
return {
|
|
17
|
+
...clientSharedValues,
|
|
18
|
+
...config,
|
|
19
|
+
runtime: "browser",
|
|
20
|
+
defaultsMode,
|
|
21
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
22
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
23
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
24
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
25
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
26
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
27
|
+
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
28
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
29
|
+
sha256: config?.sha256 ?? Sha256,
|
|
30
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
31
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
32
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
|
|
3
|
+
import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
|
|
4
|
+
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
5
|
+
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
6
|
+
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
|
|
7
|
+
import { Hash } from "@smithy/hash-node";
|
|
8
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
9
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
10
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
11
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
12
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
13
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
14
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
15
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
16
|
+
import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
|
|
17
|
+
export const getRuntimeConfig = (config) => {
|
|
18
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
19
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
20
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
21
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
22
|
+
awsCheckVersion(process.version);
|
|
23
|
+
return {
|
|
24
|
+
...clientSharedValues,
|
|
25
|
+
...config,
|
|
26
|
+
runtime: "node",
|
|
27
|
+
defaultsMode,
|
|
28
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
29
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
|
|
30
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
31
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
32
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
33
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
34
|
+
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
35
|
+
retryMode: config?.retryMode ??
|
|
36
|
+
loadNodeConfig({
|
|
37
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
38
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
39
|
+
}),
|
|
40
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
41
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
42
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
|
43
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
+
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
3
|
+
export const getRuntimeConfig = (config) => {
|
|
4
|
+
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
5
|
+
return {
|
|
6
|
+
...browserDefaults,
|
|
7
|
+
...config,
|
|
8
|
+
runtime: "react-native",
|
|
9
|
+
sha256: config?.sha256 ?? Sha256,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NoOpLogger } from "@smithy/smithy-client";
|
|
2
|
+
import { parseUrl } from "@smithy/url-parser";
|
|
3
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
4
|
+
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
5
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
6
|
+
export const getRuntimeConfig = (config) => {
|
|
7
|
+
return {
|
|
8
|
+
apiVersion: "2023-01-25",
|
|
9
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
10
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
11
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
12
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
13
|
+
extensions: config?.extensions ?? [],
|
|
14
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
15
|
+
serviceId: config?.serviceId ?? "Marketplace Deployment",
|
|
16
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
17
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
18
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
|
|
2
|
+
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
|
|
3
|
+
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
|
|
4
|
+
const asPartial = (t) => t;
|
|
5
|
+
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
6
|
+
const extensionConfiguration = {
|
|
7
|
+
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
8
|
+
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
9
|
+
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
10
|
+
};
|
|
11
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
12
|
+
return {
|
|
13
|
+
...runtimeConfig,
|
|
14
|
+
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
15
|
+
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
16
|
+
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
2
|
+
import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } from "./commands/ListTagsForResourceCommand";
|
|
3
|
+
import { PutDeploymentParameterCommandInput, PutDeploymentParameterCommandOutput } from "./commands/PutDeploymentParameterCommand";
|
|
4
|
+
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
|
|
5
|
+
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
|
|
6
|
+
import { MarketplaceDeploymentClient } from "./MarketplaceDeploymentClient";
|
|
7
|
+
export interface MarketplaceDeployment {
|
|
8
|
+
/**
|
|
9
|
+
* @see {@link ListTagsForResourceCommand}
|
|
10
|
+
*/
|
|
11
|
+
listTagsForResource(args: ListTagsForResourceCommandInput, options?: __HttpHandlerOptions): Promise<ListTagsForResourceCommandOutput>;
|
|
12
|
+
listTagsForResource(args: ListTagsForResourceCommandInput, cb: (err: any, data?: ListTagsForResourceCommandOutput) => void): void;
|
|
13
|
+
listTagsForResource(args: ListTagsForResourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListTagsForResourceCommandOutput) => void): void;
|
|
14
|
+
/**
|
|
15
|
+
* @see {@link PutDeploymentParameterCommand}
|
|
16
|
+
*/
|
|
17
|
+
putDeploymentParameter(args: PutDeploymentParameterCommandInput, options?: __HttpHandlerOptions): Promise<PutDeploymentParameterCommandOutput>;
|
|
18
|
+
putDeploymentParameter(args: PutDeploymentParameterCommandInput, cb: (err: any, data?: PutDeploymentParameterCommandOutput) => void): void;
|
|
19
|
+
putDeploymentParameter(args: PutDeploymentParameterCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutDeploymentParameterCommandOutput) => void): void;
|
|
20
|
+
/**
|
|
21
|
+
* @see {@link TagResourceCommand}
|
|
22
|
+
*/
|
|
23
|
+
tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;
|
|
24
|
+
tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
|
|
25
|
+
tagResource(args: TagResourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
|
|
26
|
+
/**
|
|
27
|
+
* @see {@link UntagResourceCommand}
|
|
28
|
+
*/
|
|
29
|
+
untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise<UntagResourceCommandOutput>;
|
|
30
|
+
untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void;
|
|
31
|
+
untagResource(args: UntagResourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UntagResourceCommandOutput) => void): void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @public
|
|
35
|
+
* <p>The AWS Marketplace Deployment Service supports the Quick Launch experience, which is a deployment option for software as a service (SaaS) products. Quick Launch simplifies and reduces the time, resources, and steps required to configure, deploy, and launch a products. The AWS Marketplace Deployment Service provides sellers with a secure method for passing deployment parameters (for example, API keys and external IDs) to buyers during the Quick Launch experience.</p>
|
|
36
|
+
*/
|
|
37
|
+
export declare class MarketplaceDeployment extends MarketplaceDeploymentClient implements MarketplaceDeployment {
|
|
38
|
+
}
|