@aws-sdk/client-s3outposts 3.490.0 → 3.495.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,12 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.S3OutpostsServiceException = exports.__ServiceException = void 0;
4
- const smithy_client_1 = require("@smithy/smithy-client");
5
- Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
6
- class S3OutpostsServiceException extends smithy_client_1.ServiceException {
7
- constructor(options) {
8
- super(options);
9
- Object.setPrototypeOf(this, S3OutpostsServiceException.prototype);
10
- }
11
- }
12
- exports.S3OutpostsServiceException = S3OutpostsServiceException;
1
+ module.exports = require("../index.js");
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./models_0"), exports);
1
+ module.exports = require("../index.js");
@@ -1,113 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EndpointStatus = exports.ValidationException = exports.ThrottlingException = exports.ResourceNotFoundException = exports.OutpostOfflineException = exports.InternalServerException = exports.EndpointAccessType = exports.ConflictException = exports.AccessDeniedException = void 0;
4
- const S3OutpostsServiceException_1 = require("./S3OutpostsServiceException");
5
- class AccessDeniedException extends S3OutpostsServiceException_1.S3OutpostsServiceException {
6
- constructor(opts) {
7
- super({
8
- name: "AccessDeniedException",
9
- $fault: "client",
10
- ...opts,
11
- });
12
- this.name = "AccessDeniedException";
13
- this.$fault = "client";
14
- Object.setPrototypeOf(this, AccessDeniedException.prototype);
15
- this.Message = opts.Message;
16
- }
17
- }
18
- exports.AccessDeniedException = AccessDeniedException;
19
- class ConflictException extends S3OutpostsServiceException_1.S3OutpostsServiceException {
20
- constructor(opts) {
21
- super({
22
- name: "ConflictException",
23
- $fault: "client",
24
- ...opts,
25
- });
26
- this.name = "ConflictException";
27
- this.$fault = "client";
28
- Object.setPrototypeOf(this, ConflictException.prototype);
29
- this.Message = opts.Message;
30
- }
31
- }
32
- exports.ConflictException = ConflictException;
33
- exports.EndpointAccessType = {
34
- CUSTOMER_OWNED_IP: "CustomerOwnedIp",
35
- PRIVATE: "Private",
36
- };
37
- class InternalServerException extends S3OutpostsServiceException_1.S3OutpostsServiceException {
38
- constructor(opts) {
39
- super({
40
- name: "InternalServerException",
41
- $fault: "server",
42
- ...opts,
43
- });
44
- this.name = "InternalServerException";
45
- this.$fault = "server";
46
- Object.setPrototypeOf(this, InternalServerException.prototype);
47
- this.Message = opts.Message;
48
- }
49
- }
50
- exports.InternalServerException = InternalServerException;
51
- class OutpostOfflineException extends S3OutpostsServiceException_1.S3OutpostsServiceException {
52
- constructor(opts) {
53
- super({
54
- name: "OutpostOfflineException",
55
- $fault: "client",
56
- ...opts,
57
- });
58
- this.name = "OutpostOfflineException";
59
- this.$fault = "client";
60
- Object.setPrototypeOf(this, OutpostOfflineException.prototype);
61
- this.Message = opts.Message;
62
- }
63
- }
64
- exports.OutpostOfflineException = OutpostOfflineException;
65
- class ResourceNotFoundException extends S3OutpostsServiceException_1.S3OutpostsServiceException {
66
- constructor(opts) {
67
- super({
68
- name: "ResourceNotFoundException",
69
- $fault: "client",
70
- ...opts,
71
- });
72
- this.name = "ResourceNotFoundException";
73
- this.$fault = "client";
74
- Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
75
- this.Message = opts.Message;
76
- }
77
- }
78
- exports.ResourceNotFoundException = ResourceNotFoundException;
79
- class ThrottlingException extends S3OutpostsServiceException_1.S3OutpostsServiceException {
80
- constructor(opts) {
81
- super({
82
- name: "ThrottlingException",
83
- $fault: "client",
84
- ...opts,
85
- });
86
- this.name = "ThrottlingException";
87
- this.$fault = "client";
88
- Object.setPrototypeOf(this, ThrottlingException.prototype);
89
- this.Message = opts.Message;
90
- }
91
- }
92
- exports.ThrottlingException = ThrottlingException;
93
- class ValidationException extends S3OutpostsServiceException_1.S3OutpostsServiceException {
94
- constructor(opts) {
95
- super({
96
- name: "ValidationException",
97
- $fault: "client",
98
- ...opts,
99
- });
100
- this.name = "ValidationException";
101
- this.$fault = "client";
102
- Object.setPrototypeOf(this, ValidationException.prototype);
103
- this.Message = opts.Message;
104
- }
105
- }
106
- exports.ValidationException = ValidationException;
107
- exports.EndpointStatus = {
108
- AVAILABLE: "Available",
109
- CREATE_FAILED: "Create_Failed",
110
- DELETE_FAILED: "Delete_Failed",
111
- DELETING: "Deleting",
112
- PENDING: "Pending",
113
- };
1
+ module.exports = require("../index.js");
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ module.exports = require("../index.js");
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.paginateListEndpoints = void 0;
4
- const core_1 = require("@smithy/core");
5
- const ListEndpointsCommand_1 = require("../commands/ListEndpointsCommand");
6
- const S3OutpostsClient_1 = require("../S3OutpostsClient");
7
- exports.paginateListEndpoints = (0, core_1.createPaginator)(S3OutpostsClient_1.S3OutpostsClient, ListEndpointsCommand_1.ListEndpointsCommand, "NextToken", "NextToken", "MaxResults");
1
+ module.exports = require("../index.js");
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.paginateListOutpostsWithS3 = void 0;
4
- const core_1 = require("@smithy/core");
5
- const ListOutpostsWithS3Command_1 = require("../commands/ListOutpostsWithS3Command");
6
- const S3OutpostsClient_1 = require("../S3OutpostsClient");
7
- exports.paginateListOutpostsWithS3 = (0, core_1.createPaginator)(S3OutpostsClient_1.S3OutpostsClient, ListOutpostsWithS3Command_1.ListOutpostsWithS3Command, "NextToken", "NextToken", "MaxResults");
1
+ module.exports = require("../index.js");
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.paginateListSharedEndpoints = void 0;
4
- const core_1 = require("@smithy/core");
5
- const ListSharedEndpointsCommand_1 = require("../commands/ListSharedEndpointsCommand");
6
- const S3OutpostsClient_1 = require("../S3OutpostsClient");
7
- exports.paginateListSharedEndpoints = (0, core_1.createPaginator)(S3OutpostsClient_1.S3OutpostsClient, ListSharedEndpointsCommand_1.ListSharedEndpointsCommand, "NextToken", "NextToken", "MaxResults");
1
+ module.exports = require("../index.js");
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./Interfaces"), exports);
5
- tslib_1.__exportStar(require("./ListEndpointsPaginator"), exports);
6
- tslib_1.__exportStar(require("./ListOutpostsWithS3Paginator"), exports);
7
- tslib_1.__exportStar(require("./ListSharedEndpointsPaginator"), exports);
1
+ module.exports = require("../index.js");
@@ -1,489 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_ListSharedEndpointsCommand = exports.de_ListOutpostsWithS3Command = exports.de_ListEndpointsCommand = exports.de_DeleteEndpointCommand = exports.de_CreateEndpointCommand = exports.se_ListSharedEndpointsCommand = exports.se_ListOutpostsWithS3Command = exports.se_ListEndpointsCommand = exports.se_DeleteEndpointCommand = exports.se_CreateEndpointCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const models_0_1 = require("../models/models_0");
7
- const S3OutpostsServiceException_1 = require("../models/S3OutpostsServiceException");
8
- const se_CreateEndpointCommand = async (input, context) => {
9
- const b = (0, core_1.requestBuilder)(input, context);
10
- const headers = {
11
- "content-type": "application/json",
12
- };
13
- b.bp("/S3Outposts/CreateEndpoint");
14
- let body;
15
- body = JSON.stringify((0, smithy_client_1.take)(input, {
16
- AccessType: [],
17
- CustomerOwnedIpv4Pool: [],
18
- OutpostId: [],
19
- SecurityGroupId: [],
20
- SubnetId: [],
21
- }));
22
- b.m("POST").h(headers).b(body);
23
- return b.build();
24
- };
25
- exports.se_CreateEndpointCommand = se_CreateEndpointCommand;
26
- const se_DeleteEndpointCommand = async (input, context) => {
27
- const b = (0, core_1.requestBuilder)(input, context);
28
- const headers = {};
29
- b.bp("/S3Outposts/DeleteEndpoint");
30
- const query = (0, smithy_client_1.map)({
31
- [_eI]: [, (0, smithy_client_1.expectNonNull)(input[_EI], `EndpointId`)],
32
- [_oI]: [, (0, smithy_client_1.expectNonNull)(input[_OI], `OutpostId`)],
33
- });
34
- let body;
35
- b.m("DELETE").h(headers).q(query).b(body);
36
- return b.build();
37
- };
38
- exports.se_DeleteEndpointCommand = se_DeleteEndpointCommand;
39
- const se_ListEndpointsCommand = async (input, context) => {
40
- const b = (0, core_1.requestBuilder)(input, context);
41
- const headers = {};
42
- b.bp("/S3Outposts/ListEndpoints");
43
- const query = (0, smithy_client_1.map)({
44
- [_nT]: [, input[_NT]],
45
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
46
- });
47
- let body;
48
- b.m("GET").h(headers).q(query).b(body);
49
- return b.build();
50
- };
51
- exports.se_ListEndpointsCommand = se_ListEndpointsCommand;
52
- const se_ListOutpostsWithS3Command = async (input, context) => {
53
- const b = (0, core_1.requestBuilder)(input, context);
54
- const headers = {};
55
- b.bp("/S3Outposts/ListOutpostsWithS3");
56
- const query = (0, smithy_client_1.map)({
57
- [_nT]: [, input[_NT]],
58
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
59
- });
60
- let body;
61
- b.m("GET").h(headers).q(query).b(body);
62
- return b.build();
63
- };
64
- exports.se_ListOutpostsWithS3Command = se_ListOutpostsWithS3Command;
65
- const se_ListSharedEndpointsCommand = async (input, context) => {
66
- const b = (0, core_1.requestBuilder)(input, context);
67
- const headers = {};
68
- b.bp("/S3Outposts/ListSharedEndpoints");
69
- const query = (0, smithy_client_1.map)({
70
- [_nT]: [, input[_NT]],
71
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
72
- [_oI]: [, (0, smithy_client_1.expectNonNull)(input[_OI], `OutpostId`)],
73
- });
74
- let body;
75
- b.m("GET").h(headers).q(query).b(body);
76
- return b.build();
77
- };
78
- exports.se_ListSharedEndpointsCommand = se_ListSharedEndpointsCommand;
79
- const de_CreateEndpointCommand = async (output, context) => {
80
- if (output.statusCode !== 200 && output.statusCode >= 300) {
81
- return de_CreateEndpointCommandError(output, context);
82
- }
83
- const contents = (0, smithy_client_1.map)({
84
- $metadata: deserializeMetadata(output),
85
- });
86
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
87
- const doc = (0, smithy_client_1.take)(data, {
88
- EndpointArn: smithy_client_1.expectString,
89
- });
90
- Object.assign(contents, doc);
91
- return contents;
92
- };
93
- exports.de_CreateEndpointCommand = de_CreateEndpointCommand;
94
- const de_CreateEndpointCommandError = async (output, context) => {
95
- const parsedOutput = {
96
- ...output,
97
- body: await parseErrorBody(output.body, context),
98
- };
99
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
100
- switch (errorCode) {
101
- case "AccessDeniedException":
102
- case "com.amazonaws.s3outposts#AccessDeniedException":
103
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
104
- case "ConflictException":
105
- case "com.amazonaws.s3outposts#ConflictException":
106
- throw await de_ConflictExceptionRes(parsedOutput, context);
107
- case "InternalServerException":
108
- case "com.amazonaws.s3outposts#InternalServerException":
109
- throw await de_InternalServerExceptionRes(parsedOutput, context);
110
- case "OutpostOfflineException":
111
- case "com.amazonaws.s3outposts#OutpostOfflineException":
112
- throw await de_OutpostOfflineExceptionRes(parsedOutput, context);
113
- case "ResourceNotFoundException":
114
- case "com.amazonaws.s3outposts#ResourceNotFoundException":
115
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
116
- case "ThrottlingException":
117
- case "com.amazonaws.s3outposts#ThrottlingException":
118
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
119
- case "ValidationException":
120
- case "com.amazonaws.s3outposts#ValidationException":
121
- throw await de_ValidationExceptionRes(parsedOutput, context);
122
- default:
123
- const parsedBody = parsedOutput.body;
124
- return throwDefaultError({
125
- output,
126
- parsedBody,
127
- errorCode,
128
- });
129
- }
130
- };
131
- const de_DeleteEndpointCommand = async (output, context) => {
132
- if (output.statusCode !== 200 && output.statusCode >= 300) {
133
- return de_DeleteEndpointCommandError(output, context);
134
- }
135
- const contents = (0, smithy_client_1.map)({
136
- $metadata: deserializeMetadata(output),
137
- });
138
- await (0, smithy_client_1.collectBody)(output.body, context);
139
- return contents;
140
- };
141
- exports.de_DeleteEndpointCommand = de_DeleteEndpointCommand;
142
- const de_DeleteEndpointCommandError = async (output, context) => {
143
- const parsedOutput = {
144
- ...output,
145
- body: await parseErrorBody(output.body, context),
146
- };
147
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
148
- switch (errorCode) {
149
- case "AccessDeniedException":
150
- case "com.amazonaws.s3outposts#AccessDeniedException":
151
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
152
- case "InternalServerException":
153
- case "com.amazonaws.s3outposts#InternalServerException":
154
- throw await de_InternalServerExceptionRes(parsedOutput, context);
155
- case "OutpostOfflineException":
156
- case "com.amazonaws.s3outposts#OutpostOfflineException":
157
- throw await de_OutpostOfflineExceptionRes(parsedOutput, context);
158
- case "ResourceNotFoundException":
159
- case "com.amazonaws.s3outposts#ResourceNotFoundException":
160
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
161
- case "ThrottlingException":
162
- case "com.amazonaws.s3outposts#ThrottlingException":
163
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
164
- case "ValidationException":
165
- case "com.amazonaws.s3outposts#ValidationException":
166
- throw await de_ValidationExceptionRes(parsedOutput, context);
167
- default:
168
- const parsedBody = parsedOutput.body;
169
- return throwDefaultError({
170
- output,
171
- parsedBody,
172
- errorCode,
173
- });
174
- }
175
- };
176
- const de_ListEndpointsCommand = async (output, context) => {
177
- if (output.statusCode !== 200 && output.statusCode >= 300) {
178
- return de_ListEndpointsCommandError(output, context);
179
- }
180
- const contents = (0, smithy_client_1.map)({
181
- $metadata: deserializeMetadata(output),
182
- });
183
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
184
- const doc = (0, smithy_client_1.take)(data, {
185
- Endpoints: (_) => de_Endpoints(_, context),
186
- NextToken: smithy_client_1.expectString,
187
- });
188
- Object.assign(contents, doc);
189
- return contents;
190
- };
191
- exports.de_ListEndpointsCommand = de_ListEndpointsCommand;
192
- const de_ListEndpointsCommandError = async (output, context) => {
193
- const parsedOutput = {
194
- ...output,
195
- body: await parseErrorBody(output.body, context),
196
- };
197
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
198
- switch (errorCode) {
199
- case "AccessDeniedException":
200
- case "com.amazonaws.s3outposts#AccessDeniedException":
201
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
202
- case "InternalServerException":
203
- case "com.amazonaws.s3outposts#InternalServerException":
204
- throw await de_InternalServerExceptionRes(parsedOutput, context);
205
- case "ResourceNotFoundException":
206
- case "com.amazonaws.s3outposts#ResourceNotFoundException":
207
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
208
- case "ThrottlingException":
209
- case "com.amazonaws.s3outposts#ThrottlingException":
210
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
211
- case "ValidationException":
212
- case "com.amazonaws.s3outposts#ValidationException":
213
- throw await de_ValidationExceptionRes(parsedOutput, context);
214
- default:
215
- const parsedBody = parsedOutput.body;
216
- return throwDefaultError({
217
- output,
218
- parsedBody,
219
- errorCode,
220
- });
221
- }
222
- };
223
- const de_ListOutpostsWithS3Command = async (output, context) => {
224
- if (output.statusCode !== 200 && output.statusCode >= 300) {
225
- return de_ListOutpostsWithS3CommandError(output, context);
226
- }
227
- const contents = (0, smithy_client_1.map)({
228
- $metadata: deserializeMetadata(output),
229
- });
230
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
231
- const doc = (0, smithy_client_1.take)(data, {
232
- NextToken: smithy_client_1.expectString,
233
- Outposts: smithy_client_1._json,
234
- });
235
- Object.assign(contents, doc);
236
- return contents;
237
- };
238
- exports.de_ListOutpostsWithS3Command = de_ListOutpostsWithS3Command;
239
- const de_ListOutpostsWithS3CommandError = async (output, context) => {
240
- const parsedOutput = {
241
- ...output,
242
- body: await parseErrorBody(output.body, context),
243
- };
244
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
245
- switch (errorCode) {
246
- case "AccessDeniedException":
247
- case "com.amazonaws.s3outposts#AccessDeniedException":
248
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
249
- case "InternalServerException":
250
- case "com.amazonaws.s3outposts#InternalServerException":
251
- throw await de_InternalServerExceptionRes(parsedOutput, context);
252
- case "ThrottlingException":
253
- case "com.amazonaws.s3outposts#ThrottlingException":
254
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
255
- case "ValidationException":
256
- case "com.amazonaws.s3outposts#ValidationException":
257
- throw await de_ValidationExceptionRes(parsedOutput, context);
258
- default:
259
- const parsedBody = parsedOutput.body;
260
- return throwDefaultError({
261
- output,
262
- parsedBody,
263
- errorCode,
264
- });
265
- }
266
- };
267
- const de_ListSharedEndpointsCommand = async (output, context) => {
268
- if (output.statusCode !== 200 && output.statusCode >= 300) {
269
- return de_ListSharedEndpointsCommandError(output, context);
270
- }
271
- const contents = (0, smithy_client_1.map)({
272
- $metadata: deserializeMetadata(output),
273
- });
274
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
275
- const doc = (0, smithy_client_1.take)(data, {
276
- Endpoints: (_) => de_Endpoints(_, context),
277
- NextToken: smithy_client_1.expectString,
278
- });
279
- Object.assign(contents, doc);
280
- return contents;
281
- };
282
- exports.de_ListSharedEndpointsCommand = de_ListSharedEndpointsCommand;
283
- const de_ListSharedEndpointsCommandError = async (output, context) => {
284
- const parsedOutput = {
285
- ...output,
286
- body: await parseErrorBody(output.body, context),
287
- };
288
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
289
- switch (errorCode) {
290
- case "AccessDeniedException":
291
- case "com.amazonaws.s3outposts#AccessDeniedException":
292
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
293
- case "InternalServerException":
294
- case "com.amazonaws.s3outposts#InternalServerException":
295
- throw await de_InternalServerExceptionRes(parsedOutput, context);
296
- case "ResourceNotFoundException":
297
- case "com.amazonaws.s3outposts#ResourceNotFoundException":
298
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
299
- case "ThrottlingException":
300
- case "com.amazonaws.s3outposts#ThrottlingException":
301
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
302
- case "ValidationException":
303
- case "com.amazonaws.s3outposts#ValidationException":
304
- throw await de_ValidationExceptionRes(parsedOutput, context);
305
- default:
306
- const parsedBody = parsedOutput.body;
307
- return throwDefaultError({
308
- output,
309
- parsedBody,
310
- errorCode,
311
- });
312
- }
313
- };
314
- const throwDefaultError = (0, smithy_client_1.withBaseException)(S3OutpostsServiceException_1.S3OutpostsServiceException);
315
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
316
- const contents = (0, smithy_client_1.map)({});
317
- const data = parsedOutput.body;
318
- const doc = (0, smithy_client_1.take)(data, {
319
- Message: smithy_client_1.expectString,
320
- });
321
- Object.assign(contents, doc);
322
- const exception = new models_0_1.AccessDeniedException({
323
- $metadata: deserializeMetadata(parsedOutput),
324
- ...contents,
325
- });
326
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
327
- };
328
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
329
- const contents = (0, smithy_client_1.map)({});
330
- const data = parsedOutput.body;
331
- const doc = (0, smithy_client_1.take)(data, {
332
- Message: smithy_client_1.expectString,
333
- });
334
- Object.assign(contents, doc);
335
- const exception = new models_0_1.ConflictException({
336
- $metadata: deserializeMetadata(parsedOutput),
337
- ...contents,
338
- });
339
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
340
- };
341
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
342
- const contents = (0, smithy_client_1.map)({});
343
- const data = parsedOutput.body;
344
- const doc = (0, smithy_client_1.take)(data, {
345
- Message: smithy_client_1.expectString,
346
- });
347
- Object.assign(contents, doc);
348
- const exception = new models_0_1.InternalServerException({
349
- $metadata: deserializeMetadata(parsedOutput),
350
- ...contents,
351
- });
352
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
353
- };
354
- const de_OutpostOfflineExceptionRes = async (parsedOutput, context) => {
355
- const contents = (0, smithy_client_1.map)({});
356
- const data = parsedOutput.body;
357
- const doc = (0, smithy_client_1.take)(data, {
358
- Message: smithy_client_1.expectString,
359
- });
360
- Object.assign(contents, doc);
361
- const exception = new models_0_1.OutpostOfflineException({
362
- $metadata: deserializeMetadata(parsedOutput),
363
- ...contents,
364
- });
365
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
366
- };
367
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
368
- const contents = (0, smithy_client_1.map)({});
369
- const data = parsedOutput.body;
370
- const doc = (0, smithy_client_1.take)(data, {
371
- Message: smithy_client_1.expectString,
372
- });
373
- Object.assign(contents, doc);
374
- const exception = new models_0_1.ResourceNotFoundException({
375
- $metadata: deserializeMetadata(parsedOutput),
376
- ...contents,
377
- });
378
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
379
- };
380
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
381
- const contents = (0, smithy_client_1.map)({});
382
- const data = parsedOutput.body;
383
- const doc = (0, smithy_client_1.take)(data, {
384
- Message: smithy_client_1.expectString,
385
- });
386
- Object.assign(contents, doc);
387
- const exception = new models_0_1.ThrottlingException({
388
- $metadata: deserializeMetadata(parsedOutput),
389
- ...contents,
390
- });
391
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
392
- };
393
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
394
- const contents = (0, smithy_client_1.map)({});
395
- const data = parsedOutput.body;
396
- const doc = (0, smithy_client_1.take)(data, {
397
- Message: smithy_client_1.expectString,
398
- });
399
- Object.assign(contents, doc);
400
- const exception = new models_0_1.ValidationException({
401
- $metadata: deserializeMetadata(parsedOutput),
402
- ...contents,
403
- });
404
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
405
- };
406
- const de_Endpoint = (output, context) => {
407
- return (0, smithy_client_1.take)(output, {
408
- AccessType: smithy_client_1.expectString,
409
- CidrBlock: smithy_client_1.expectString,
410
- CreationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
411
- CustomerOwnedIpv4Pool: smithy_client_1.expectString,
412
- EndpointArn: smithy_client_1.expectString,
413
- FailedReason: smithy_client_1._json,
414
- NetworkInterfaces: smithy_client_1._json,
415
- OutpostsId: smithy_client_1.expectString,
416
- SecurityGroupId: smithy_client_1.expectString,
417
- Status: smithy_client_1.expectString,
418
- SubnetId: smithy_client_1.expectString,
419
- VpcId: smithy_client_1.expectString,
420
- });
421
- };
422
- const de_Endpoints = (output, context) => {
423
- const retVal = (output || [])
424
- .filter((e) => e != null)
425
- .map((entry) => {
426
- return de_Endpoint(entry, context);
427
- });
428
- return retVal;
429
- };
430
- const deserializeMetadata = (output) => ({
431
- httpStatusCode: output.statusCode,
432
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
433
- extendedRequestId: output.headers["x-amz-id-2"],
434
- cfId: output.headers["x-amz-cf-id"],
435
- });
436
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
437
- const isSerializableHeaderValue = (value) => value !== undefined &&
438
- value !== null &&
439
- value !== "" &&
440
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
441
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
442
- const _EI = "EndpointId";
443
- const _MR = "MaxResults";
444
- const _NT = "NextToken";
445
- const _OI = "OutpostId";
446
- const _eI = "endpointId";
447
- const _mR = "maxResults";
448
- const _nT = "nextToken";
449
- const _oI = "outpostId";
450
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
451
- if (encoded.length) {
452
- return JSON.parse(encoded);
453
- }
454
- return {};
455
- });
456
- const parseErrorBody = async (errorBody, context) => {
457
- const value = await parseBody(errorBody, context);
458
- value.message = value.message ?? value.Message;
459
- return value;
460
- };
461
- const loadRestJsonErrorCode = (output, data) => {
462
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
463
- const sanitizeErrorCode = (rawValue) => {
464
- let cleanValue = rawValue;
465
- if (typeof cleanValue === "number") {
466
- cleanValue = cleanValue.toString();
467
- }
468
- if (cleanValue.indexOf(",") >= 0) {
469
- cleanValue = cleanValue.split(",")[0];
470
- }
471
- if (cleanValue.indexOf(":") >= 0) {
472
- cleanValue = cleanValue.split(":")[0];
473
- }
474
- if (cleanValue.indexOf("#") >= 0) {
475
- cleanValue = cleanValue.split("#")[1];
476
- }
477
- return cleanValue;
478
- };
479
- const headerKey = findKey(output.headers, "x-amzn-errortype");
480
- if (headerKey !== undefined) {
481
- return sanitizeErrorCode(output.headers[headerKey]);
482
- }
483
- if (data.code !== undefined) {
484
- return sanitizeErrorCode(data.code);
485
- }
486
- if (data["__type"] !== undefined) {
487
- return sanitizeErrorCode(data["__type"]);
488
- }
489
- };
1
+ module.exports = require("../index.js");