@aws-sdk/client-s3outposts 3.185.0 → 3.188.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/CHANGELOG.md +16 -0
- package/dist-es/S3Outposts.js +18 -25
- package/dist-es/S3OutpostsClient.js +22 -28
- package/dist-es/commands/CreateEndpointCommand.js +21 -28
- package/dist-es/commands/DeleteEndpointCommand.js +22 -29
- package/dist-es/commands/ListEndpointsCommand.js +21 -28
- package/dist-es/commands/ListSharedEndpointsCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/S3OutpostsServiceException.js +5 -10
- package/dist-es/models/models_0.js +87 -70
- package/dist-es/pagination/ListEndpointsPaginator.js +25 -68
- package/dist-es/pagination/ListSharedEndpointsPaginator.js +25 -68
- package/dist-es/protocols/Aws_restJson1.js +341 -481
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,450 +1,328 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
|
|
5
4
|
import { S3OutpostsServiceException as __BaseException } from "../models/S3OutpostsServiceException";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
protocol: protocol,
|
|
20
|
-
hostname: hostname,
|
|
21
|
-
port: port,
|
|
22
|
-
method: "POST",
|
|
23
|
-
headers: headers,
|
|
24
|
-
path: resolvedPath,
|
|
25
|
-
body: body,
|
|
26
|
-
})];
|
|
27
|
-
}
|
|
5
|
+
export const serializeAws_restJson1CreateEndpointCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {
|
|
8
|
+
"content-type": "application/json",
|
|
9
|
+
};
|
|
10
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/CreateEndpoint";
|
|
11
|
+
let body;
|
|
12
|
+
body = JSON.stringify({
|
|
13
|
+
...(input.AccessType != null && { AccessType: input.AccessType }),
|
|
14
|
+
...(input.CustomerOwnedIpv4Pool != null && { CustomerOwnedIpv4Pool: input.CustomerOwnedIpv4Pool }),
|
|
15
|
+
...(input.OutpostId != null && { OutpostId: input.OutpostId }),
|
|
16
|
+
...(input.SecurityGroupId != null && { SecurityGroupId: input.SecurityGroupId }),
|
|
17
|
+
...(input.SubnetId != null && { SubnetId: input.SubnetId }),
|
|
28
18
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
headers = {};
|
|
38
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/S3Outposts/DeleteEndpoint";
|
|
39
|
-
query = map({
|
|
40
|
-
endpointId: [, input.EndpointId],
|
|
41
|
-
outpostId: [, input.OutpostId],
|
|
42
|
-
});
|
|
43
|
-
return [2, new __HttpRequest({
|
|
44
|
-
protocol: protocol,
|
|
45
|
-
hostname: hostname,
|
|
46
|
-
port: port,
|
|
47
|
-
method: "DELETE",
|
|
48
|
-
headers: headers,
|
|
49
|
-
path: resolvedPath,
|
|
50
|
-
query: query,
|
|
51
|
-
body: body,
|
|
52
|
-
})];
|
|
53
|
-
}
|
|
19
|
+
return new __HttpRequest({
|
|
20
|
+
protocol,
|
|
21
|
+
hostname,
|
|
22
|
+
port,
|
|
23
|
+
method: "POST",
|
|
24
|
+
headers,
|
|
25
|
+
path: resolvedPath,
|
|
26
|
+
body,
|
|
54
27
|
});
|
|
55
|
-
}
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
headers = {};
|
|
64
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/S3Outposts/ListEndpoints";
|
|
65
|
-
query = map({
|
|
66
|
-
nextToken: [, input.NextToken],
|
|
67
|
-
maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
|
|
68
|
-
});
|
|
69
|
-
return [2, new __HttpRequest({
|
|
70
|
-
protocol: protocol,
|
|
71
|
-
hostname: hostname,
|
|
72
|
-
port: port,
|
|
73
|
-
method: "GET",
|
|
74
|
-
headers: headers,
|
|
75
|
-
path: resolvedPath,
|
|
76
|
-
query: query,
|
|
77
|
-
body: body,
|
|
78
|
-
})];
|
|
79
|
-
}
|
|
28
|
+
};
|
|
29
|
+
export const serializeAws_restJson1DeleteEndpointCommand = async (input, context) => {
|
|
30
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
31
|
+
const headers = {};
|
|
32
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/DeleteEndpoint";
|
|
33
|
+
const query = map({
|
|
34
|
+
endpointId: [, input.EndpointId],
|
|
35
|
+
outpostId: [, input.OutpostId],
|
|
80
36
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
query = map({
|
|
92
|
-
nextToken: [, input.NextToken],
|
|
93
|
-
maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
|
|
94
|
-
outpostId: [, input.OutpostId],
|
|
95
|
-
});
|
|
96
|
-
return [2, new __HttpRequest({
|
|
97
|
-
protocol: protocol,
|
|
98
|
-
hostname: hostname,
|
|
99
|
-
port: port,
|
|
100
|
-
method: "GET",
|
|
101
|
-
headers: headers,
|
|
102
|
-
path: resolvedPath,
|
|
103
|
-
query: query,
|
|
104
|
-
body: body,
|
|
105
|
-
})];
|
|
106
|
-
}
|
|
37
|
+
let body;
|
|
38
|
+
return new __HttpRequest({
|
|
39
|
+
protocol,
|
|
40
|
+
hostname,
|
|
41
|
+
port,
|
|
42
|
+
method: "DELETE",
|
|
43
|
+
headers,
|
|
44
|
+
path: resolvedPath,
|
|
45
|
+
query,
|
|
46
|
+
body,
|
|
107
47
|
});
|
|
108
|
-
}
|
|
109
|
-
export
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
contents = map({
|
|
118
|
-
$metadata: deserializeMetadata(output),
|
|
119
|
-
});
|
|
120
|
-
_a = __expectNonNull;
|
|
121
|
-
_b = __expectObject;
|
|
122
|
-
return [4, parseBody(output.body, context)];
|
|
123
|
-
case 1:
|
|
124
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
125
|
-
if (data.EndpointArn != null) {
|
|
126
|
-
contents.EndpointArn = __expectString(data.EndpointArn);
|
|
127
|
-
}
|
|
128
|
-
return [2, contents];
|
|
129
|
-
}
|
|
48
|
+
};
|
|
49
|
+
export const serializeAws_restJson1ListEndpointsCommand = async (input, context) => {
|
|
50
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
51
|
+
const headers = {};
|
|
52
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/ListEndpoints";
|
|
53
|
+
const query = map({
|
|
54
|
+
nextToken: [, input.NextToken],
|
|
55
|
+
maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
|
|
130
56
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
case 1:
|
|
142
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
143
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
144
|
-
_b = errorCode;
|
|
145
|
-
switch (_b) {
|
|
146
|
-
case "AccessDeniedException": return [3, 2];
|
|
147
|
-
case "com.amazonaws.s3outposts#AccessDeniedException": return [3, 2];
|
|
148
|
-
case "ConflictException": return [3, 4];
|
|
149
|
-
case "com.amazonaws.s3outposts#ConflictException": return [3, 4];
|
|
150
|
-
case "InternalServerException": return [3, 6];
|
|
151
|
-
case "com.amazonaws.s3outposts#InternalServerException": return [3, 6];
|
|
152
|
-
case "ResourceNotFoundException": return [3, 8];
|
|
153
|
-
case "com.amazonaws.s3outposts#ResourceNotFoundException": return [3, 8];
|
|
154
|
-
case "ValidationException": return [3, 10];
|
|
155
|
-
case "com.amazonaws.s3outposts#ValidationException": return [3, 10];
|
|
156
|
-
}
|
|
157
|
-
return [3, 12];
|
|
158
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
159
|
-
case 3: throw _d.sent();
|
|
160
|
-
case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
161
|
-
case 5: throw _d.sent();
|
|
162
|
-
case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
163
|
-
case 7: throw _d.sent();
|
|
164
|
-
case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
165
|
-
case 9: throw _d.sent();
|
|
166
|
-
case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
167
|
-
case 11: throw _d.sent();
|
|
168
|
-
case 12:
|
|
169
|
-
parsedBody = parsedOutput.body;
|
|
170
|
-
throwDefaultError({
|
|
171
|
-
output: output,
|
|
172
|
-
parsedBody: parsedBody,
|
|
173
|
-
exceptionCtor: __BaseException,
|
|
174
|
-
errorCode: errorCode,
|
|
175
|
-
});
|
|
176
|
-
_d.label = 13;
|
|
177
|
-
case 13: return [2];
|
|
178
|
-
}
|
|
57
|
+
let body;
|
|
58
|
+
return new __HttpRequest({
|
|
59
|
+
protocol,
|
|
60
|
+
hostname,
|
|
61
|
+
port,
|
|
62
|
+
method: "GET",
|
|
63
|
+
headers,
|
|
64
|
+
path: resolvedPath,
|
|
65
|
+
query,
|
|
66
|
+
body,
|
|
179
67
|
});
|
|
180
|
-
}
|
|
181
|
-
export
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
contents = map({
|
|
190
|
-
$metadata: deserializeMetadata(output),
|
|
191
|
-
});
|
|
192
|
-
return [4, collectBody(output.body, context)];
|
|
193
|
-
case 1:
|
|
194
|
-
_a.sent();
|
|
195
|
-
return [2, contents];
|
|
196
|
-
}
|
|
68
|
+
};
|
|
69
|
+
export const serializeAws_restJson1ListSharedEndpointsCommand = async (input, context) => {
|
|
70
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
71
|
+
const headers = {};
|
|
72
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/ListSharedEndpoints";
|
|
73
|
+
const query = map({
|
|
74
|
+
nextToken: [, input.NextToken],
|
|
75
|
+
maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
|
|
76
|
+
outpostId: [, input.OutpostId],
|
|
197
77
|
});
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
case 1:
|
|
209
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
210
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
211
|
-
_b = errorCode;
|
|
212
|
-
switch (_b) {
|
|
213
|
-
case "AccessDeniedException": return [3, 2];
|
|
214
|
-
case "com.amazonaws.s3outposts#AccessDeniedException": return [3, 2];
|
|
215
|
-
case "InternalServerException": return [3, 4];
|
|
216
|
-
case "com.amazonaws.s3outposts#InternalServerException": return [3, 4];
|
|
217
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
218
|
-
case "com.amazonaws.s3outposts#ResourceNotFoundException": return [3, 6];
|
|
219
|
-
case "ValidationException": return [3, 8];
|
|
220
|
-
case "com.amazonaws.s3outposts#ValidationException": return [3, 8];
|
|
221
|
-
}
|
|
222
|
-
return [3, 10];
|
|
223
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
224
|
-
case 3: throw _d.sent();
|
|
225
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
226
|
-
case 5: throw _d.sent();
|
|
227
|
-
case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
228
|
-
case 7: throw _d.sent();
|
|
229
|
-
case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
230
|
-
case 9: throw _d.sent();
|
|
231
|
-
case 10:
|
|
232
|
-
parsedBody = parsedOutput.body;
|
|
233
|
-
throwDefaultError({
|
|
234
|
-
output: output,
|
|
235
|
-
parsedBody: parsedBody,
|
|
236
|
-
exceptionCtor: __BaseException,
|
|
237
|
-
errorCode: errorCode,
|
|
238
|
-
});
|
|
239
|
-
_d.label = 11;
|
|
240
|
-
case 11: return [2];
|
|
241
|
-
}
|
|
78
|
+
let body;
|
|
79
|
+
return new __HttpRequest({
|
|
80
|
+
protocol,
|
|
81
|
+
hostname,
|
|
82
|
+
port,
|
|
83
|
+
method: "GET",
|
|
84
|
+
headers,
|
|
85
|
+
path: resolvedPath,
|
|
86
|
+
query,
|
|
87
|
+
body,
|
|
242
88
|
});
|
|
243
|
-
}
|
|
244
|
-
export
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
return [2, deserializeAws_restJson1ListEndpointsCommandError(output, context)];
|
|
251
|
-
}
|
|
252
|
-
contents = map({
|
|
253
|
-
$metadata: deserializeMetadata(output),
|
|
254
|
-
});
|
|
255
|
-
_a = __expectNonNull;
|
|
256
|
-
_b = __expectObject;
|
|
257
|
-
return [4, parseBody(output.body, context)];
|
|
258
|
-
case 1:
|
|
259
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
260
|
-
if (data.Endpoints != null) {
|
|
261
|
-
contents.Endpoints = deserializeAws_restJson1Endpoints(data.Endpoints, context);
|
|
262
|
-
}
|
|
263
|
-
if (data.NextToken != null) {
|
|
264
|
-
contents.NextToken = __expectString(data.NextToken);
|
|
265
|
-
}
|
|
266
|
-
return [2, contents];
|
|
267
|
-
}
|
|
89
|
+
};
|
|
90
|
+
export const deserializeAws_restJson1CreateEndpointCommand = async (output, context) => {
|
|
91
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
92
|
+
return deserializeAws_restJson1CreateEndpointCommandError(output, context);
|
|
93
|
+
}
|
|
94
|
+
const contents = map({
|
|
95
|
+
$metadata: deserializeMetadata(output),
|
|
268
96
|
});
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
return
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
97
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
98
|
+
if (data.EndpointArn != null) {
|
|
99
|
+
contents.EndpointArn = __expectString(data.EndpointArn);
|
|
100
|
+
}
|
|
101
|
+
return contents;
|
|
102
|
+
};
|
|
103
|
+
const deserializeAws_restJson1CreateEndpointCommandError = async (output, context) => {
|
|
104
|
+
const parsedOutput = {
|
|
105
|
+
...output,
|
|
106
|
+
body: await parseErrorBody(output.body, context),
|
|
107
|
+
};
|
|
108
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
109
|
+
switch (errorCode) {
|
|
110
|
+
case "AccessDeniedException":
|
|
111
|
+
case "com.amazonaws.s3outposts#AccessDeniedException":
|
|
112
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
113
|
+
case "ConflictException":
|
|
114
|
+
case "com.amazonaws.s3outposts#ConflictException":
|
|
115
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
116
|
+
case "InternalServerException":
|
|
117
|
+
case "com.amazonaws.s3outposts#InternalServerException":
|
|
118
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
119
|
+
case "ResourceNotFoundException":
|
|
120
|
+
case "com.amazonaws.s3outposts#ResourceNotFoundException":
|
|
121
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
122
|
+
case "ValidationException":
|
|
123
|
+
case "com.amazonaws.s3outposts#ValidationException":
|
|
124
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
125
|
+
default:
|
|
126
|
+
const parsedBody = parsedOutput.body;
|
|
127
|
+
throwDefaultError({
|
|
128
|
+
output,
|
|
129
|
+
parsedBody,
|
|
130
|
+
exceptionCtor: __BaseException,
|
|
131
|
+
errorCode,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
export const deserializeAws_restJson1DeleteEndpointCommand = async (output, context) => {
|
|
136
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
137
|
+
return deserializeAws_restJson1DeleteEndpointCommandError(output, context);
|
|
138
|
+
}
|
|
139
|
+
const contents = map({
|
|
140
|
+
$metadata: deserializeMetadata(output),
|
|
313
141
|
});
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
142
|
+
await collectBody(output.body, context);
|
|
143
|
+
return contents;
|
|
144
|
+
};
|
|
145
|
+
const deserializeAws_restJson1DeleteEndpointCommandError = async (output, context) => {
|
|
146
|
+
const parsedOutput = {
|
|
147
|
+
...output,
|
|
148
|
+
body: await parseErrorBody(output.body, context),
|
|
149
|
+
};
|
|
150
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
151
|
+
switch (errorCode) {
|
|
152
|
+
case "AccessDeniedException":
|
|
153
|
+
case "com.amazonaws.s3outposts#AccessDeniedException":
|
|
154
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
155
|
+
case "InternalServerException":
|
|
156
|
+
case "com.amazonaws.s3outposts#InternalServerException":
|
|
157
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
158
|
+
case "ResourceNotFoundException":
|
|
159
|
+
case "com.amazonaws.s3outposts#ResourceNotFoundException":
|
|
160
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
161
|
+
case "ValidationException":
|
|
162
|
+
case "com.amazonaws.s3outposts#ValidationException":
|
|
163
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
164
|
+
default:
|
|
165
|
+
const parsedBody = parsedOutput.body;
|
|
166
|
+
throwDefaultError({
|
|
167
|
+
output,
|
|
168
|
+
parsedBody,
|
|
169
|
+
exceptionCtor: __BaseException,
|
|
170
|
+
errorCode,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
export const deserializeAws_restJson1ListEndpointsCommand = async (output, context) => {
|
|
175
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
176
|
+
return deserializeAws_restJson1ListEndpointsCommandError(output, context);
|
|
177
|
+
}
|
|
178
|
+
const contents = map({
|
|
179
|
+
$metadata: deserializeMetadata(output),
|
|
339
180
|
});
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
181
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
182
|
+
if (data.Endpoints != null) {
|
|
183
|
+
contents.Endpoints = deserializeAws_restJson1Endpoints(data.Endpoints, context);
|
|
184
|
+
}
|
|
185
|
+
if (data.NextToken != null) {
|
|
186
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
187
|
+
}
|
|
188
|
+
return contents;
|
|
189
|
+
};
|
|
190
|
+
const deserializeAws_restJson1ListEndpointsCommandError = async (output, context) => {
|
|
191
|
+
const parsedOutput = {
|
|
192
|
+
...output,
|
|
193
|
+
body: await parseErrorBody(output.body, context),
|
|
194
|
+
};
|
|
195
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
196
|
+
switch (errorCode) {
|
|
197
|
+
case "AccessDeniedException":
|
|
198
|
+
case "com.amazonaws.s3outposts#AccessDeniedException":
|
|
199
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
200
|
+
case "InternalServerException":
|
|
201
|
+
case "com.amazonaws.s3outposts#InternalServerException":
|
|
202
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
203
|
+
case "ResourceNotFoundException":
|
|
204
|
+
case "com.amazonaws.s3outposts#ResourceNotFoundException":
|
|
205
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
206
|
+
case "ValidationException":
|
|
207
|
+
case "com.amazonaws.s3outposts#ValidationException":
|
|
208
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
209
|
+
default:
|
|
210
|
+
const parsedBody = parsedOutput.body;
|
|
211
|
+
throwDefaultError({
|
|
212
|
+
output,
|
|
213
|
+
parsedBody,
|
|
214
|
+
exceptionCtor: __BaseException,
|
|
215
|
+
errorCode,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
export const deserializeAws_restJson1ListSharedEndpointsCommand = async (output, context) => {
|
|
220
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
221
|
+
return deserializeAws_restJson1ListSharedEndpointsCommandError(output, context);
|
|
222
|
+
}
|
|
223
|
+
const contents = map({
|
|
224
|
+
$metadata: deserializeMetadata(output),
|
|
384
225
|
});
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
contents =
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
226
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
227
|
+
if (data.Endpoints != null) {
|
|
228
|
+
contents.Endpoints = deserializeAws_restJson1Endpoints(data.Endpoints, context);
|
|
229
|
+
}
|
|
230
|
+
if (data.NextToken != null) {
|
|
231
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
232
|
+
}
|
|
233
|
+
return contents;
|
|
234
|
+
};
|
|
235
|
+
const deserializeAws_restJson1ListSharedEndpointsCommandError = async (output, context) => {
|
|
236
|
+
const parsedOutput = {
|
|
237
|
+
...output,
|
|
238
|
+
body: await parseErrorBody(output.body, context),
|
|
239
|
+
};
|
|
240
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
241
|
+
switch (errorCode) {
|
|
242
|
+
case "AccessDeniedException":
|
|
243
|
+
case "com.amazonaws.s3outposts#AccessDeniedException":
|
|
244
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
245
|
+
case "InternalServerException":
|
|
246
|
+
case "com.amazonaws.s3outposts#InternalServerException":
|
|
247
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
248
|
+
case "ResourceNotFoundException":
|
|
249
|
+
case "com.amazonaws.s3outposts#ResourceNotFoundException":
|
|
250
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
251
|
+
case "ValidationException":
|
|
252
|
+
case "com.amazonaws.s3outposts#ValidationException":
|
|
253
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
254
|
+
default:
|
|
255
|
+
const parsedBody = parsedOutput.body;
|
|
256
|
+
throwDefaultError({
|
|
257
|
+
output,
|
|
258
|
+
parsedBody,
|
|
259
|
+
exceptionCtor: __BaseException,
|
|
260
|
+
errorCode,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
const map = __map;
|
|
265
|
+
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
266
|
+
const contents = map({});
|
|
267
|
+
const data = parsedOutput.body;
|
|
268
|
+
if (data.Message != null) {
|
|
269
|
+
contents.Message = __expectString(data.Message);
|
|
270
|
+
}
|
|
271
|
+
const exception = new AccessDeniedException({
|
|
272
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
273
|
+
...contents,
|
|
397
274
|
});
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
275
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
276
|
+
};
|
|
277
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
278
|
+
const contents = map({});
|
|
279
|
+
const data = parsedOutput.body;
|
|
280
|
+
if (data.Message != null) {
|
|
281
|
+
contents.Message = __expectString(data.Message);
|
|
282
|
+
}
|
|
283
|
+
const exception = new ConflictException({
|
|
284
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
285
|
+
...contents,
|
|
409
286
|
});
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
287
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
288
|
+
};
|
|
289
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
290
|
+
const contents = map({});
|
|
291
|
+
const data = parsedOutput.body;
|
|
292
|
+
if (data.Message != null) {
|
|
293
|
+
contents.Message = __expectString(data.Message);
|
|
294
|
+
}
|
|
295
|
+
const exception = new InternalServerException({
|
|
296
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
297
|
+
...contents,
|
|
421
298
|
});
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
299
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
300
|
+
};
|
|
301
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
302
|
+
const contents = map({});
|
|
303
|
+
const data = parsedOutput.body;
|
|
304
|
+
if (data.Message != null) {
|
|
305
|
+
contents.Message = __expectString(data.Message);
|
|
306
|
+
}
|
|
307
|
+
const exception = new ResourceNotFoundException({
|
|
308
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
309
|
+
...contents,
|
|
433
310
|
});
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
311
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
312
|
+
};
|
|
313
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
314
|
+
const contents = map({});
|
|
315
|
+
const data = parsedOutput.body;
|
|
316
|
+
if (data.Message != null) {
|
|
317
|
+
contents.Message = __expectString(data.Message);
|
|
318
|
+
}
|
|
319
|
+
const exception = new ValidationException({
|
|
320
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
321
|
+
...contents,
|
|
445
322
|
});
|
|
446
|
-
|
|
447
|
-
|
|
323
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
324
|
+
};
|
|
325
|
+
const deserializeAws_restJson1Endpoint = (output, context) => {
|
|
448
326
|
return {
|
|
449
327
|
AccessType: __expectString(output.AccessType),
|
|
450
328
|
CidrBlock: __expectString(output.CidrBlock),
|
|
@@ -463,10 +341,10 @@ var deserializeAws_restJson1Endpoint = function (output, context) {
|
|
|
463
341
|
VpcId: __expectString(output.VpcId),
|
|
464
342
|
};
|
|
465
343
|
};
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
.filter(
|
|
469
|
-
.map(
|
|
344
|
+
const deserializeAws_restJson1Endpoints = (output, context) => {
|
|
345
|
+
const retVal = (output || [])
|
|
346
|
+
.filter((e) => e != null)
|
|
347
|
+
.map((entry) => {
|
|
470
348
|
if (entry === null) {
|
|
471
349
|
return null;
|
|
472
350
|
}
|
|
@@ -474,15 +352,15 @@ var deserializeAws_restJson1Endpoints = function (output, context) {
|
|
|
474
352
|
});
|
|
475
353
|
return retVal;
|
|
476
354
|
};
|
|
477
|
-
|
|
355
|
+
const deserializeAws_restJson1NetworkInterface = (output, context) => {
|
|
478
356
|
return {
|
|
479
357
|
NetworkInterfaceId: __expectString(output.NetworkInterfaceId),
|
|
480
358
|
};
|
|
481
359
|
};
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
.filter(
|
|
485
|
-
.map(
|
|
360
|
+
const deserializeAws_restJson1NetworkInterfaces = (output, context) => {
|
|
361
|
+
const retVal = (output || [])
|
|
362
|
+
.filter((e) => e != null)
|
|
363
|
+
.map((entry) => {
|
|
486
364
|
if (entry === null) {
|
|
487
365
|
return null;
|
|
488
366
|
}
|
|
@@ -490,57 +368,39 @@ var deserializeAws_restJson1NetworkInterfaces = function (output, context) {
|
|
|
490
368
|
});
|
|
491
369
|
return retVal;
|
|
492
370
|
};
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
});
|
|
501
|
-
};
|
|
502
|
-
var collectBody = function (streamBody, context) {
|
|
503
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
371
|
+
const deserializeMetadata = (output) => ({
|
|
372
|
+
httpStatusCode: output.statusCode,
|
|
373
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
374
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
375
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
376
|
+
});
|
|
377
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
504
378
|
if (streamBody instanceof Uint8Array) {
|
|
505
379
|
return Promise.resolve(streamBody);
|
|
506
380
|
}
|
|
507
381
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
508
382
|
};
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
});
|
|
383
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
384
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
385
|
+
value !== null &&
|
|
386
|
+
value !== "" &&
|
|
387
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
388
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
389
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
390
|
+
if (encoded.length) {
|
|
391
|
+
return JSON.parse(encoded);
|
|
392
|
+
}
|
|
393
|
+
return {};
|
|
394
|
+
});
|
|
395
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
396
|
+
const value = await parseBody(errorBody, context);
|
|
397
|
+
value.message = value.message ?? value.Message;
|
|
398
|
+
return value;
|
|
526
399
|
};
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
switch (_b.label) {
|
|
532
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
533
|
-
case 1:
|
|
534
|
-
value = _b.sent();
|
|
535
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
536
|
-
return [2, value];
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
}); };
|
|
540
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
541
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
542
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
543
|
-
var cleanValue = rawValue;
|
|
400
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
401
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
402
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
403
|
+
let cleanValue = rawValue;
|
|
544
404
|
if (typeof cleanValue === "number") {
|
|
545
405
|
cleanValue = cleanValue.toString();
|
|
546
406
|
}
|
|
@@ -555,7 +415,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
555
415
|
}
|
|
556
416
|
return cleanValue;
|
|
557
417
|
};
|
|
558
|
-
|
|
418
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
559
419
|
if (headerKey !== undefined) {
|
|
560
420
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
561
421
|
}
|