@aws-sdk/client-s3outposts 3.183.0 → 3.186.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.
@@ -1,328 +1,450 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  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";
3
4
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
4
5
  import { S3OutpostsServiceException as __BaseException } from "../models/S3OutpostsServiceException";
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 }),
6
+ export var serializeAws_restJson1CreateEndpointCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
+ return __generator(this, function (_c) {
9
+ switch (_c.label) {
10
+ case 0: return [4, context.endpoint()];
11
+ case 1:
12
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
+ headers = {
14
+ "content-type": "application/json",
15
+ };
16
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/S3Outposts/CreateEndpoint";
17
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.AccessType != null && { AccessType: input.AccessType })), (input.CustomerOwnedIpv4Pool != null && { CustomerOwnedIpv4Pool: input.CustomerOwnedIpv4Pool })), (input.OutpostId != null && { OutpostId: input.OutpostId })), (input.SecurityGroupId != null && { SecurityGroupId: input.SecurityGroupId })), (input.SubnetId != null && { SubnetId: input.SubnetId })));
18
+ return [2, new __HttpRequest({
19
+ protocol: protocol,
20
+ hostname: hostname,
21
+ port: port,
22
+ method: "POST",
23
+ headers: headers,
24
+ path: resolvedPath,
25
+ body: body,
26
+ })];
27
+ }
18
28
  });
19
- return new __HttpRequest({
20
- protocol,
21
- hostname,
22
- port,
23
- method: "POST",
24
- headers,
25
- path: resolvedPath,
26
- body,
29
+ }); };
30
+ export var serializeAws_restJson1DeleteEndpointCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
31
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
32
+ return __generator(this, function (_c) {
33
+ switch (_c.label) {
34
+ case 0: return [4, context.endpoint()];
35
+ case 1:
36
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
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
+ }
27
54
  });
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],
55
+ }); };
56
+ export var serializeAws_restJson1ListEndpointsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
57
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
58
+ return __generator(this, function (_c) {
59
+ switch (_c.label) {
60
+ case 0: return [4, context.endpoint()];
61
+ case 1:
62
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
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
+ }
36
80
  });
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,
81
+ }); };
82
+ export var serializeAws_restJson1ListSharedEndpointsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
83
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
84
+ return __generator(this, function (_c) {
85
+ switch (_c.label) {
86
+ case 0: return [4, context.endpoint()];
87
+ case 1:
88
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
89
+ headers = {};
90
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/S3Outposts/ListSharedEndpoints";
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
+ }
47
107
  });
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()],
108
+ }); };
109
+ export var deserializeAws_restJson1CreateEndpointCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
110
+ var contents, data, _a, _b;
111
+ return __generator(this, function (_c) {
112
+ switch (_c.label) {
113
+ case 0:
114
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
115
+ return [2, deserializeAws_restJson1CreateEndpointCommandError(output, context)];
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
+ }
56
130
  });
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,
131
+ }); };
132
+ var deserializeAws_restJson1CreateEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
133
+ var parsedOutput, _a, errorCode, _b, parsedBody;
134
+ var _c;
135
+ return __generator(this, function (_d) {
136
+ switch (_d.label) {
137
+ case 0:
138
+ _a = [__assign({}, output)];
139
+ _c = {};
140
+ return [4, parseErrorBody(output.body, context)];
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
+ }
67
179
  });
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],
180
+ }); };
181
+ export var deserializeAws_restJson1DeleteEndpointCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
182
+ var contents;
183
+ return __generator(this, function (_a) {
184
+ switch (_a.label) {
185
+ case 0:
186
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
187
+ return [2, deserializeAws_restJson1DeleteEndpointCommandError(output, context)];
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
+ }
77
197
  });
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,
198
+ }); };
199
+ var deserializeAws_restJson1DeleteEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
200
+ var parsedOutput, _a, errorCode, _b, parsedBody;
201
+ var _c;
202
+ return __generator(this, function (_d) {
203
+ switch (_d.label) {
204
+ case 0:
205
+ _a = [__assign({}, output)];
206
+ _c = {};
207
+ return [4, parseErrorBody(output.body, context)];
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
+ }
88
242
  });
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),
243
+ }); };
244
+ export var deserializeAws_restJson1ListEndpointsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
245
+ var contents, data, _a, _b;
246
+ return __generator(this, function (_c) {
247
+ switch (_c.label) {
248
+ case 0:
249
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
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
+ }
96
268
  });
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),
269
+ }); };
270
+ var deserializeAws_restJson1ListEndpointsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
271
+ var parsedOutput, _a, errorCode, _b, parsedBody;
272
+ var _c;
273
+ return __generator(this, function (_d) {
274
+ switch (_d.label) {
275
+ case 0:
276
+ _a = [__assign({}, output)];
277
+ _c = {};
278
+ return [4, parseErrorBody(output.body, context)];
279
+ case 1:
280
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
281
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
282
+ _b = errorCode;
283
+ switch (_b) {
284
+ case "AccessDeniedException": return [3, 2];
285
+ case "com.amazonaws.s3outposts#AccessDeniedException": return [3, 2];
286
+ case "InternalServerException": return [3, 4];
287
+ case "com.amazonaws.s3outposts#InternalServerException": return [3, 4];
288
+ case "ResourceNotFoundException": return [3, 6];
289
+ case "com.amazonaws.s3outposts#ResourceNotFoundException": return [3, 6];
290
+ case "ValidationException": return [3, 8];
291
+ case "com.amazonaws.s3outposts#ValidationException": return [3, 8];
292
+ }
293
+ return [3, 10];
294
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
295
+ case 3: throw _d.sent();
296
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
297
+ case 5: throw _d.sent();
298
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
299
+ case 7: throw _d.sent();
300
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
301
+ case 9: throw _d.sent();
302
+ case 10:
303
+ parsedBody = parsedOutput.body;
304
+ throwDefaultError({
305
+ output: output,
306
+ parsedBody: parsedBody,
307
+ exceptionCtor: __BaseException,
308
+ errorCode: errorCode,
309
+ });
310
+ _d.label = 11;
311
+ case 11: return [2];
312
+ }
141
313
  });
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),
314
+ }); };
315
+ export var deserializeAws_restJson1ListSharedEndpointsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
316
+ var contents, data, _a, _b;
317
+ return __generator(this, function (_c) {
318
+ switch (_c.label) {
319
+ case 0:
320
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
321
+ return [2, deserializeAws_restJson1ListSharedEndpointsCommandError(output, context)];
322
+ }
323
+ contents = map({
324
+ $metadata: deserializeMetadata(output),
325
+ });
326
+ _a = __expectNonNull;
327
+ _b = __expectObject;
328
+ return [4, parseBody(output.body, context)];
329
+ case 1:
330
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
331
+ if (data.Endpoints != null) {
332
+ contents.Endpoints = deserializeAws_restJson1Endpoints(data.Endpoints, context);
333
+ }
334
+ if (data.NextToken != null) {
335
+ contents.NextToken = __expectString(data.NextToken);
336
+ }
337
+ return [2, contents];
338
+ }
180
339
  });
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),
340
+ }); };
341
+ var deserializeAws_restJson1ListSharedEndpointsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
342
+ var parsedOutput, _a, errorCode, _b, parsedBody;
343
+ var _c;
344
+ return __generator(this, function (_d) {
345
+ switch (_d.label) {
346
+ case 0:
347
+ _a = [__assign({}, output)];
348
+ _c = {};
349
+ return [4, parseErrorBody(output.body, context)];
350
+ case 1:
351
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
352
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
353
+ _b = errorCode;
354
+ switch (_b) {
355
+ case "AccessDeniedException": return [3, 2];
356
+ case "com.amazonaws.s3outposts#AccessDeniedException": return [3, 2];
357
+ case "InternalServerException": return [3, 4];
358
+ case "com.amazonaws.s3outposts#InternalServerException": return [3, 4];
359
+ case "ResourceNotFoundException": return [3, 6];
360
+ case "com.amazonaws.s3outposts#ResourceNotFoundException": return [3, 6];
361
+ case "ValidationException": return [3, 8];
362
+ case "com.amazonaws.s3outposts#ValidationException": return [3, 8];
363
+ }
364
+ return [3, 10];
365
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
366
+ case 3: throw _d.sent();
367
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
368
+ case 5: throw _d.sent();
369
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
370
+ case 7: throw _d.sent();
371
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
372
+ case 9: throw _d.sent();
373
+ case 10:
374
+ parsedBody = parsedOutput.body;
375
+ throwDefaultError({
376
+ output: output,
377
+ parsedBody: parsedBody,
378
+ exceptionCtor: __BaseException,
379
+ errorCode: errorCode,
380
+ });
381
+ _d.label = 11;
382
+ case 11: return [2];
383
+ }
225
384
  });
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,
385
+ }); };
386
+ var map = __map;
387
+ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
388
+ var contents, data, exception;
389
+ return __generator(this, function (_a) {
390
+ contents = map({});
391
+ data = parsedOutput.body;
392
+ if (data.Message != null) {
393
+ contents.Message = __expectString(data.Message);
394
+ }
395
+ exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
396
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
274
397
  });
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,
398
+ }); };
399
+ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
400
+ var contents, data, exception;
401
+ return __generator(this, function (_a) {
402
+ contents = map({});
403
+ data = parsedOutput.body;
404
+ if (data.Message != null) {
405
+ contents.Message = __expectString(data.Message);
406
+ }
407
+ exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
408
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
286
409
  });
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,
410
+ }); };
411
+ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
412
+ var contents, data, exception;
413
+ return __generator(this, function (_a) {
414
+ contents = map({});
415
+ data = parsedOutput.body;
416
+ if (data.Message != null) {
417
+ contents.Message = __expectString(data.Message);
418
+ }
419
+ exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
420
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
298
421
  });
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,
422
+ }); };
423
+ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
424
+ var contents, data, exception;
425
+ return __generator(this, function (_a) {
426
+ contents = map({});
427
+ data = parsedOutput.body;
428
+ if (data.Message != null) {
429
+ contents.Message = __expectString(data.Message);
430
+ }
431
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
432
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
310
433
  });
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,
434
+ }); };
435
+ var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
436
+ var contents, data, exception;
437
+ return __generator(this, function (_a) {
438
+ contents = map({});
439
+ data = parsedOutput.body;
440
+ if (data.Message != null) {
441
+ contents.Message = __expectString(data.Message);
442
+ }
443
+ exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
444
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
322
445
  });
323
- return __decorateServiceException(exception, parsedOutput.body);
324
- };
325
- const deserializeAws_restJson1Endpoint = (output, context) => {
446
+ }); };
447
+ var deserializeAws_restJson1Endpoint = function (output, context) {
326
448
  return {
327
449
  AccessType: __expectString(output.AccessType),
328
450
  CidrBlock: __expectString(output.CidrBlock),
@@ -341,10 +463,10 @@ const deserializeAws_restJson1Endpoint = (output, context) => {
341
463
  VpcId: __expectString(output.VpcId),
342
464
  };
343
465
  };
344
- const deserializeAws_restJson1Endpoints = (output, context) => {
345
- const retVal = (output || [])
346
- .filter((e) => e != null)
347
- .map((entry) => {
466
+ var deserializeAws_restJson1Endpoints = function (output, context) {
467
+ var retVal = (output || [])
468
+ .filter(function (e) { return e != null; })
469
+ .map(function (entry) {
348
470
  if (entry === null) {
349
471
  return null;
350
472
  }
@@ -352,15 +474,15 @@ const deserializeAws_restJson1Endpoints = (output, context) => {
352
474
  });
353
475
  return retVal;
354
476
  };
355
- const deserializeAws_restJson1NetworkInterface = (output, context) => {
477
+ var deserializeAws_restJson1NetworkInterface = function (output, context) {
356
478
  return {
357
479
  NetworkInterfaceId: __expectString(output.NetworkInterfaceId),
358
480
  };
359
481
  };
360
- const deserializeAws_restJson1NetworkInterfaces = (output, context) => {
361
- const retVal = (output || [])
362
- .filter((e) => e != null)
363
- .map((entry) => {
482
+ var deserializeAws_restJson1NetworkInterfaces = function (output, context) {
483
+ var retVal = (output || [])
484
+ .filter(function (e) { return e != null; })
485
+ .map(function (entry) {
364
486
  if (entry === null) {
365
487
  return null;
366
488
  }
@@ -368,39 +490,57 @@ const deserializeAws_restJson1NetworkInterfaces = (output, context) => {
368
490
  });
369
491
  return retVal;
370
492
  };
371
- const deserializeMetadata = (output) => ({
372
- httpStatusCode: output.statusCode,
373
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-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) => {
493
+ var deserializeMetadata = function (output) {
494
+ var _a, _b;
495
+ return ({
496
+ httpStatusCode: output.statusCode,
497
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
498
+ extendedRequestId: output.headers["x-amz-id-2"],
499
+ cfId: output.headers["x-amz-cf-id"],
500
+ });
501
+ };
502
+ var collectBody = function (streamBody, context) {
503
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
378
504
  if (streamBody instanceof Uint8Array) {
379
505
  return Promise.resolve(streamBody);
380
506
  }
381
507
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
382
508
  };
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;
509
+ var collectBodyString = function (streamBody, context) {
510
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
511
+ };
512
+ var isSerializableHeaderValue = function (value) {
513
+ return value !== undefined &&
514
+ value !== null &&
515
+ value !== "" &&
516
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
517
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
518
+ };
519
+ var parseBody = function (streamBody, context) {
520
+ return collectBodyString(streamBody, context).then(function (encoded) {
521
+ if (encoded.length) {
522
+ return JSON.parse(encoded);
523
+ }
524
+ return {};
525
+ });
399
526
  };
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;
527
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
528
+ var value;
529
+ var _a;
530
+ return __generator(this, function (_b) {
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;
404
544
  if (typeof cleanValue === "number") {
405
545
  cleanValue = cleanValue.toString();
406
546
  }
@@ -415,7 +555,7 @@ const loadRestJsonErrorCode = (output, data) => {
415
555
  }
416
556
  return cleanValue;
417
557
  };
418
- const headerKey = findKey(output.headers, "x-amzn-errortype");
558
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
419
559
  if (headerKey !== undefined) {
420
560
  return sanitizeErrorCode(output.headers[headerKey]);
421
561
  }