@aws-sdk/client-s3outposts 3.310.0 → 3.315.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,13 +12,13 @@ const se_CreateEndpointCommand = async (input, context) => {
12
12
  };
13
13
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/CreateEndpoint";
14
14
  let body;
15
- body = JSON.stringify({
16
- ...(input.AccessType != null && { AccessType: input.AccessType }),
17
- ...(input.CustomerOwnedIpv4Pool != null && { CustomerOwnedIpv4Pool: input.CustomerOwnedIpv4Pool }),
18
- ...(input.OutpostId != null && { OutpostId: input.OutpostId }),
19
- ...(input.SecurityGroupId != null && { SecurityGroupId: input.SecurityGroupId }),
20
- ...(input.SubnetId != null && { SubnetId: input.SubnetId }),
21
- });
15
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
16
+ AccessType: [],
17
+ CustomerOwnedIpv4Pool: [],
18
+ OutpostId: [],
19
+ SecurityGroupId: [],
20
+ SubnetId: [],
21
+ }));
22
22
  return new protocol_http_1.HttpRequest({
23
23
  protocol,
24
24
  hostname,
@@ -34,7 +34,7 @@ const se_DeleteEndpointCommand = async (input, context) => {
34
34
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
35
35
  const headers = {};
36
36
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/DeleteEndpoint";
37
- const query = map({
37
+ const query = (0, smithy_client_1.map)({
38
38
  endpointId: [, (0, smithy_client_1.expectNonNull)(input.EndpointId, `EndpointId`)],
39
39
  outpostId: [, (0, smithy_client_1.expectNonNull)(input.OutpostId, `OutpostId`)],
40
40
  });
@@ -55,7 +55,7 @@ const se_ListEndpointsCommand = async (input, context) => {
55
55
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
56
56
  const headers = {};
57
57
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/ListEndpoints";
58
- const query = map({
58
+ const query = (0, smithy_client_1.map)({
59
59
  nextToken: [, input.NextToken],
60
60
  maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
61
61
  });
@@ -76,7 +76,7 @@ const se_ListOutpostsWithS3Command = async (input, context) => {
76
76
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
77
77
  const headers = {};
78
78
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/ListOutpostsWithS3";
79
- const query = map({
79
+ const query = (0, smithy_client_1.map)({
80
80
  nextToken: [, input.NextToken],
81
81
  maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
82
82
  });
@@ -97,7 +97,7 @@ const se_ListSharedEndpointsCommand = async (input, context) => {
97
97
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
98
98
  const headers = {};
99
99
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/ListSharedEndpoints";
100
- const query = map({
100
+ const query = (0, smithy_client_1.map)({
101
101
  nextToken: [, input.NextToken],
102
102
  maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
103
103
  outpostId: [, (0, smithy_client_1.expectNonNull)(input.OutpostId, `OutpostId`)],
@@ -119,13 +119,14 @@ const de_CreateEndpointCommand = async (output, context) => {
119
119
  if (output.statusCode !== 200 && output.statusCode >= 300) {
120
120
  return de_CreateEndpointCommandError(output, context);
121
121
  }
122
- const contents = map({
122
+ const contents = (0, smithy_client_1.map)({
123
123
  $metadata: deserializeMetadata(output),
124
124
  });
125
125
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
126
- if (data.EndpointArn != null) {
127
- contents.EndpointArn = (0, smithy_client_1.expectString)(data.EndpointArn);
128
- }
126
+ const doc = (0, smithy_client_1.take)(data, {
127
+ EndpointArn: smithy_client_1.expectString,
128
+ });
129
+ Object.assign(contents, doc);
129
130
  return contents;
130
131
  };
131
132
  exports.de_CreateEndpointCommand = de_CreateEndpointCommand;
@@ -159,10 +160,9 @@ const de_CreateEndpointCommandError = async (output, context) => {
159
160
  throw await de_ValidationExceptionRes(parsedOutput, context);
160
161
  default:
161
162
  const parsedBody = parsedOutput.body;
162
- (0, smithy_client_1.throwDefaultError)({
163
+ return throwDefaultError({
163
164
  output,
164
165
  parsedBody,
165
- exceptionCtor: S3OutpostsServiceException_1.S3OutpostsServiceException,
166
166
  errorCode,
167
167
  });
168
168
  }
@@ -171,7 +171,7 @@ const de_DeleteEndpointCommand = async (output, context) => {
171
171
  if (output.statusCode !== 200 && output.statusCode >= 300) {
172
172
  return de_DeleteEndpointCommandError(output, context);
173
173
  }
174
- const contents = map({
174
+ const contents = (0, smithy_client_1.map)({
175
175
  $metadata: deserializeMetadata(output),
176
176
  });
177
177
  await collectBody(output.body, context);
@@ -205,10 +205,9 @@ const de_DeleteEndpointCommandError = async (output, context) => {
205
205
  throw await de_ValidationExceptionRes(parsedOutput, context);
206
206
  default:
207
207
  const parsedBody = parsedOutput.body;
208
- (0, smithy_client_1.throwDefaultError)({
208
+ return throwDefaultError({
209
209
  output,
210
210
  parsedBody,
211
- exceptionCtor: S3OutpostsServiceException_1.S3OutpostsServiceException,
212
211
  errorCode,
213
212
  });
214
213
  }
@@ -217,16 +216,15 @@ const de_ListEndpointsCommand = async (output, context) => {
217
216
  if (output.statusCode !== 200 && output.statusCode >= 300) {
218
217
  return de_ListEndpointsCommandError(output, context);
219
218
  }
220
- const contents = map({
219
+ const contents = (0, smithy_client_1.map)({
221
220
  $metadata: deserializeMetadata(output),
222
221
  });
223
222
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
224
- if (data.Endpoints != null) {
225
- contents.Endpoints = de_Endpoints(data.Endpoints, context);
226
- }
227
- if (data.NextToken != null) {
228
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
229
- }
223
+ const doc = (0, smithy_client_1.take)(data, {
224
+ Endpoints: (_) => de_Endpoints(_, context),
225
+ NextToken: smithy_client_1.expectString,
226
+ });
227
+ Object.assign(contents, doc);
230
228
  return contents;
231
229
  };
232
230
  exports.de_ListEndpointsCommand = de_ListEndpointsCommand;
@@ -254,10 +252,9 @@ const de_ListEndpointsCommandError = async (output, context) => {
254
252
  throw await de_ValidationExceptionRes(parsedOutput, context);
255
253
  default:
256
254
  const parsedBody = parsedOutput.body;
257
- (0, smithy_client_1.throwDefaultError)({
255
+ return throwDefaultError({
258
256
  output,
259
257
  parsedBody,
260
- exceptionCtor: S3OutpostsServiceException_1.S3OutpostsServiceException,
261
258
  errorCode,
262
259
  });
263
260
  }
@@ -266,16 +263,15 @@ const de_ListOutpostsWithS3Command = async (output, context) => {
266
263
  if (output.statusCode !== 200 && output.statusCode >= 300) {
267
264
  return de_ListOutpostsWithS3CommandError(output, context);
268
265
  }
269
- const contents = map({
266
+ const contents = (0, smithy_client_1.map)({
270
267
  $metadata: deserializeMetadata(output),
271
268
  });
272
269
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
273
- if (data.NextToken != null) {
274
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
275
- }
276
- if (data.Outposts != null) {
277
- contents.Outposts = de_Outposts(data.Outposts, context);
278
- }
270
+ const doc = (0, smithy_client_1.take)(data, {
271
+ NextToken: smithy_client_1.expectString,
272
+ Outposts: smithy_client_1._json,
273
+ });
274
+ Object.assign(contents, doc);
279
275
  return contents;
280
276
  };
281
277
  exports.de_ListOutpostsWithS3Command = de_ListOutpostsWithS3Command;
@@ -300,10 +296,9 @@ const de_ListOutpostsWithS3CommandError = async (output, context) => {
300
296
  throw await de_ValidationExceptionRes(parsedOutput, context);
301
297
  default:
302
298
  const parsedBody = parsedOutput.body;
303
- (0, smithy_client_1.throwDefaultError)({
299
+ return throwDefaultError({
304
300
  output,
305
301
  parsedBody,
306
- exceptionCtor: S3OutpostsServiceException_1.S3OutpostsServiceException,
307
302
  errorCode,
308
303
  });
309
304
  }
@@ -312,16 +307,15 @@ const de_ListSharedEndpointsCommand = async (output, context) => {
312
307
  if (output.statusCode !== 200 && output.statusCode >= 300) {
313
308
  return de_ListSharedEndpointsCommandError(output, context);
314
309
  }
315
- const contents = map({
310
+ const contents = (0, smithy_client_1.map)({
316
311
  $metadata: deserializeMetadata(output),
317
312
  });
318
313
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
319
- if (data.Endpoints != null) {
320
- contents.Endpoints = de_Endpoints(data.Endpoints, context);
321
- }
322
- if (data.NextToken != null) {
323
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
324
- }
314
+ const doc = (0, smithy_client_1.take)(data, {
315
+ Endpoints: (_) => de_Endpoints(_, context),
316
+ NextToken: smithy_client_1.expectString,
317
+ });
318
+ Object.assign(contents, doc);
325
319
  return contents;
326
320
  };
327
321
  exports.de_ListSharedEndpointsCommand = de_ListSharedEndpointsCommand;
@@ -349,21 +343,21 @@ const de_ListSharedEndpointsCommandError = async (output, context) => {
349
343
  throw await de_ValidationExceptionRes(parsedOutput, context);
350
344
  default:
351
345
  const parsedBody = parsedOutput.body;
352
- (0, smithy_client_1.throwDefaultError)({
346
+ return throwDefaultError({
353
347
  output,
354
348
  parsedBody,
355
- exceptionCtor: S3OutpostsServiceException_1.S3OutpostsServiceException,
356
349
  errorCode,
357
350
  });
358
351
  }
359
352
  };
360
- const map = smithy_client_1.map;
353
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(S3OutpostsServiceException_1.S3OutpostsServiceException);
361
354
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
362
- const contents = map({});
355
+ const contents = (0, smithy_client_1.map)({});
363
356
  const data = parsedOutput.body;
364
- if (data.Message != null) {
365
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
366
- }
357
+ const doc = (0, smithy_client_1.take)(data, {
358
+ Message: smithy_client_1.expectString,
359
+ });
360
+ Object.assign(contents, doc);
367
361
  const exception = new models_0_1.AccessDeniedException({
368
362
  $metadata: deserializeMetadata(parsedOutput),
369
363
  ...contents,
@@ -371,11 +365,12 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
371
365
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
372
366
  };
373
367
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
374
- const contents = map({});
368
+ const contents = (0, smithy_client_1.map)({});
375
369
  const data = parsedOutput.body;
376
- if (data.Message != null) {
377
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
378
- }
370
+ const doc = (0, smithy_client_1.take)(data, {
371
+ Message: smithy_client_1.expectString,
372
+ });
373
+ Object.assign(contents, doc);
379
374
  const exception = new models_0_1.ConflictException({
380
375
  $metadata: deserializeMetadata(parsedOutput),
381
376
  ...contents,
@@ -383,11 +378,12 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
383
378
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
384
379
  };
385
380
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
386
- const contents = map({});
381
+ const contents = (0, smithy_client_1.map)({});
387
382
  const data = parsedOutput.body;
388
- if (data.Message != null) {
389
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
390
- }
383
+ const doc = (0, smithy_client_1.take)(data, {
384
+ Message: smithy_client_1.expectString,
385
+ });
386
+ Object.assign(contents, doc);
391
387
  const exception = new models_0_1.InternalServerException({
392
388
  $metadata: deserializeMetadata(parsedOutput),
393
389
  ...contents,
@@ -395,11 +391,12 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
395
391
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
396
392
  };
397
393
  const de_OutpostOfflineExceptionRes = async (parsedOutput, context) => {
398
- const contents = map({});
394
+ const contents = (0, smithy_client_1.map)({});
399
395
  const data = parsedOutput.body;
400
- if (data.Message != null) {
401
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
402
- }
396
+ const doc = (0, smithy_client_1.take)(data, {
397
+ Message: smithy_client_1.expectString,
398
+ });
399
+ Object.assign(contents, doc);
403
400
  const exception = new models_0_1.OutpostOfflineException({
404
401
  $metadata: deserializeMetadata(parsedOutput),
405
402
  ...contents,
@@ -407,11 +404,12 @@ const de_OutpostOfflineExceptionRes = async (parsedOutput, context) => {
407
404
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
408
405
  };
409
406
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
410
- const contents = map({});
407
+ const contents = (0, smithy_client_1.map)({});
411
408
  const data = parsedOutput.body;
412
- if (data.Message != null) {
413
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
414
- }
409
+ const doc = (0, smithy_client_1.take)(data, {
410
+ Message: smithy_client_1.expectString,
411
+ });
412
+ Object.assign(contents, doc);
415
413
  const exception = new models_0_1.ResourceNotFoundException({
416
414
  $metadata: deserializeMetadata(parsedOutput),
417
415
  ...contents,
@@ -419,11 +417,12 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
419
417
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
420
418
  };
421
419
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
422
- const contents = map({});
420
+ const contents = (0, smithy_client_1.map)({});
423
421
  const data = parsedOutput.body;
424
- if (data.Message != null) {
425
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
426
- }
422
+ const doc = (0, smithy_client_1.take)(data, {
423
+ Message: smithy_client_1.expectString,
424
+ });
425
+ Object.assign(contents, doc);
427
426
  const exception = new models_0_1.ThrottlingException({
428
427
  $metadata: deserializeMetadata(parsedOutput),
429
428
  ...contents,
@@ -431,11 +430,12 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
431
430
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
432
431
  };
433
432
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
434
- const contents = map({});
433
+ const contents = (0, smithy_client_1.map)({});
435
434
  const data = parsedOutput.body;
436
- if (data.Message != null) {
437
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
438
- }
435
+ const doc = (0, smithy_client_1.take)(data, {
436
+ Message: smithy_client_1.expectString,
437
+ });
438
+ Object.assign(contents, doc);
439
439
  const exception = new models_0_1.ValidationException({
440
440
  $metadata: deserializeMetadata(parsedOutput),
441
441
  ...contents,
@@ -443,75 +443,29 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
443
443
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
444
444
  };
445
445
  const de_Endpoint = (output, context) => {
446
- return {
447
- AccessType: (0, smithy_client_1.expectString)(output.AccessType),
448
- CidrBlock: (0, smithy_client_1.expectString)(output.CidrBlock),
449
- CreationTime: output.CreationTime != null
450
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreationTime)))
451
- : undefined,
452
- CustomerOwnedIpv4Pool: (0, smithy_client_1.expectString)(output.CustomerOwnedIpv4Pool),
453
- EndpointArn: (0, smithy_client_1.expectString)(output.EndpointArn),
454
- FailedReason: output.FailedReason != null ? de_FailedReason(output.FailedReason, context) : undefined,
455
- NetworkInterfaces: output.NetworkInterfaces != null ? de_NetworkInterfaces(output.NetworkInterfaces, context) : undefined,
456
- OutpostsId: (0, smithy_client_1.expectString)(output.OutpostsId),
457
- SecurityGroupId: (0, smithy_client_1.expectString)(output.SecurityGroupId),
458
- Status: (0, smithy_client_1.expectString)(output.Status),
459
- SubnetId: (0, smithy_client_1.expectString)(output.SubnetId),
460
- VpcId: (0, smithy_client_1.expectString)(output.VpcId),
461
- };
446
+ return (0, smithy_client_1.take)(output, {
447
+ AccessType: smithy_client_1.expectString,
448
+ CidrBlock: smithy_client_1.expectString,
449
+ CreationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
450
+ CustomerOwnedIpv4Pool: smithy_client_1.expectString,
451
+ EndpointArn: smithy_client_1.expectString,
452
+ FailedReason: smithy_client_1._json,
453
+ NetworkInterfaces: smithy_client_1._json,
454
+ OutpostsId: smithy_client_1.expectString,
455
+ SecurityGroupId: smithy_client_1.expectString,
456
+ Status: smithy_client_1.expectString,
457
+ SubnetId: smithy_client_1.expectString,
458
+ VpcId: smithy_client_1.expectString,
459
+ });
462
460
  };
463
461
  const de_Endpoints = (output, context) => {
464
462
  const retVal = (output || [])
465
463
  .filter((e) => e != null)
466
464
  .map((entry) => {
467
- if (entry === null) {
468
- return null;
469
- }
470
465
  return de_Endpoint(entry, context);
471
466
  });
472
467
  return retVal;
473
468
  };
474
- const de_FailedReason = (output, context) => {
475
- return {
476
- ErrorCode: (0, smithy_client_1.expectString)(output.ErrorCode),
477
- Message: (0, smithy_client_1.expectString)(output.Message),
478
- };
479
- };
480
- const de_NetworkInterface = (output, context) => {
481
- return {
482
- NetworkInterfaceId: (0, smithy_client_1.expectString)(output.NetworkInterfaceId),
483
- };
484
- };
485
- const de_NetworkInterfaces = (output, context) => {
486
- const retVal = (output || [])
487
- .filter((e) => e != null)
488
- .map((entry) => {
489
- if (entry === null) {
490
- return null;
491
- }
492
- return de_NetworkInterface(entry, context);
493
- });
494
- return retVal;
495
- };
496
- const de_Outpost = (output, context) => {
497
- return {
498
- CapacityInBytes: (0, smithy_client_1.expectLong)(output.CapacityInBytes),
499
- OutpostArn: (0, smithy_client_1.expectString)(output.OutpostArn),
500
- OutpostId: (0, smithy_client_1.expectString)(output.OutpostId),
501
- OwnerId: (0, smithy_client_1.expectString)(output.OwnerId),
502
- };
503
- };
504
- const de_Outposts = (output, context) => {
505
- const retVal = (output || [])
506
- .filter((e) => e != null)
507
- .map((entry) => {
508
- if (entry === null) {
509
- return null;
510
- }
511
- return de_Outpost(entry, context);
512
- });
513
- return retVal;
514
- };
515
469
  const deserializeMetadata = (output) => ({
516
470
  httpStatusCode: output.statusCode,
517
471
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { AccessDeniedException, ConflictException, InternalServerException, OutpostOfflineException, ResourceNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
4
4
  import { S3OutpostsServiceException as __BaseException } from "../models/S3OutpostsServiceException";
5
5
  export const se_CreateEndpointCommand = async (input, context) => {
@@ -9,13 +9,13 @@ export const se_CreateEndpointCommand = async (input, context) => {
9
9
  };
10
10
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/CreateEndpoint";
11
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 }),
18
- });
12
+ body = JSON.stringify(take(input, {
13
+ AccessType: [],
14
+ CustomerOwnedIpv4Pool: [],
15
+ OutpostId: [],
16
+ SecurityGroupId: [],
17
+ SubnetId: [],
18
+ }));
19
19
  return new __HttpRequest({
20
20
  protocol,
21
21
  hostname,
@@ -115,9 +115,10 @@ export const de_CreateEndpointCommand = async (output, context) => {
115
115
  $metadata: deserializeMetadata(output),
116
116
  });
117
117
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
118
- if (data.EndpointArn != null) {
119
- contents.EndpointArn = __expectString(data.EndpointArn);
120
- }
118
+ const doc = take(data, {
119
+ EndpointArn: __expectString,
120
+ });
121
+ Object.assign(contents, doc);
121
122
  return contents;
122
123
  };
123
124
  const de_CreateEndpointCommandError = async (output, context) => {
@@ -150,10 +151,9 @@ const de_CreateEndpointCommandError = async (output, context) => {
150
151
  throw await de_ValidationExceptionRes(parsedOutput, context);
151
152
  default:
152
153
  const parsedBody = parsedOutput.body;
153
- throwDefaultError({
154
+ return throwDefaultError({
154
155
  output,
155
156
  parsedBody,
156
- exceptionCtor: __BaseException,
157
157
  errorCode,
158
158
  });
159
159
  }
@@ -195,10 +195,9 @@ const de_DeleteEndpointCommandError = async (output, context) => {
195
195
  throw await de_ValidationExceptionRes(parsedOutput, context);
196
196
  default:
197
197
  const parsedBody = parsedOutput.body;
198
- throwDefaultError({
198
+ return throwDefaultError({
199
199
  output,
200
200
  parsedBody,
201
- exceptionCtor: __BaseException,
202
201
  errorCode,
203
202
  });
204
203
  }
@@ -211,12 +210,11 @@ export const de_ListEndpointsCommand = async (output, context) => {
211
210
  $metadata: deserializeMetadata(output),
212
211
  });
213
212
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
214
- if (data.Endpoints != null) {
215
- contents.Endpoints = de_Endpoints(data.Endpoints, context);
216
- }
217
- if (data.NextToken != null) {
218
- contents.NextToken = __expectString(data.NextToken);
219
- }
213
+ const doc = take(data, {
214
+ Endpoints: (_) => de_Endpoints(_, context),
215
+ NextToken: __expectString,
216
+ });
217
+ Object.assign(contents, doc);
220
218
  return contents;
221
219
  };
222
220
  const de_ListEndpointsCommandError = async (output, context) => {
@@ -243,10 +241,9 @@ const de_ListEndpointsCommandError = async (output, context) => {
243
241
  throw await de_ValidationExceptionRes(parsedOutput, context);
244
242
  default:
245
243
  const parsedBody = parsedOutput.body;
246
- throwDefaultError({
244
+ return throwDefaultError({
247
245
  output,
248
246
  parsedBody,
249
- exceptionCtor: __BaseException,
250
247
  errorCode,
251
248
  });
252
249
  }
@@ -259,12 +256,11 @@ export const de_ListOutpostsWithS3Command = async (output, context) => {
259
256
  $metadata: deserializeMetadata(output),
260
257
  });
261
258
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
262
- if (data.NextToken != null) {
263
- contents.NextToken = __expectString(data.NextToken);
264
- }
265
- if (data.Outposts != null) {
266
- contents.Outposts = de_Outposts(data.Outposts, context);
267
- }
259
+ const doc = take(data, {
260
+ NextToken: __expectString,
261
+ Outposts: _json,
262
+ });
263
+ Object.assign(contents, doc);
268
264
  return contents;
269
265
  };
270
266
  const de_ListOutpostsWithS3CommandError = async (output, context) => {
@@ -288,10 +284,9 @@ const de_ListOutpostsWithS3CommandError = async (output, context) => {
288
284
  throw await de_ValidationExceptionRes(parsedOutput, context);
289
285
  default:
290
286
  const parsedBody = parsedOutput.body;
291
- throwDefaultError({
287
+ return throwDefaultError({
292
288
  output,
293
289
  parsedBody,
294
- exceptionCtor: __BaseException,
295
290
  errorCode,
296
291
  });
297
292
  }
@@ -304,12 +299,11 @@ export const de_ListSharedEndpointsCommand = async (output, context) => {
304
299
  $metadata: deserializeMetadata(output),
305
300
  });
306
301
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
307
- if (data.Endpoints != null) {
308
- contents.Endpoints = de_Endpoints(data.Endpoints, context);
309
- }
310
- if (data.NextToken != null) {
311
- contents.NextToken = __expectString(data.NextToken);
312
- }
302
+ const doc = take(data, {
303
+ Endpoints: (_) => de_Endpoints(_, context),
304
+ NextToken: __expectString,
305
+ });
306
+ Object.assign(contents, doc);
313
307
  return contents;
314
308
  };
315
309
  const de_ListSharedEndpointsCommandError = async (output, context) => {
@@ -336,21 +330,21 @@ const de_ListSharedEndpointsCommandError = async (output, context) => {
336
330
  throw await de_ValidationExceptionRes(parsedOutput, context);
337
331
  default:
338
332
  const parsedBody = parsedOutput.body;
339
- throwDefaultError({
333
+ return throwDefaultError({
340
334
  output,
341
335
  parsedBody,
342
- exceptionCtor: __BaseException,
343
336
  errorCode,
344
337
  });
345
338
  }
346
339
  };
347
- const map = __map;
340
+ const throwDefaultError = withBaseException(__BaseException);
348
341
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
349
342
  const contents = map({});
350
343
  const data = parsedOutput.body;
351
- if (data.Message != null) {
352
- contents.Message = __expectString(data.Message);
353
- }
344
+ const doc = take(data, {
345
+ Message: __expectString,
346
+ });
347
+ Object.assign(contents, doc);
354
348
  const exception = new AccessDeniedException({
355
349
  $metadata: deserializeMetadata(parsedOutput),
356
350
  ...contents,
@@ -360,9 +354,10 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
360
354
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
361
355
  const contents = map({});
362
356
  const data = parsedOutput.body;
363
- if (data.Message != null) {
364
- contents.Message = __expectString(data.Message);
365
- }
357
+ const doc = take(data, {
358
+ Message: __expectString,
359
+ });
360
+ Object.assign(contents, doc);
366
361
  const exception = new ConflictException({
367
362
  $metadata: deserializeMetadata(parsedOutput),
368
363
  ...contents,
@@ -372,9 +367,10 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
372
367
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
373
368
  const contents = map({});
374
369
  const data = parsedOutput.body;
375
- if (data.Message != null) {
376
- contents.Message = __expectString(data.Message);
377
- }
370
+ const doc = take(data, {
371
+ Message: __expectString,
372
+ });
373
+ Object.assign(contents, doc);
378
374
  const exception = new InternalServerException({
379
375
  $metadata: deserializeMetadata(parsedOutput),
380
376
  ...contents,
@@ -384,9 +380,10 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
384
380
  const de_OutpostOfflineExceptionRes = async (parsedOutput, context) => {
385
381
  const contents = map({});
386
382
  const data = parsedOutput.body;
387
- if (data.Message != null) {
388
- contents.Message = __expectString(data.Message);
389
- }
383
+ const doc = take(data, {
384
+ Message: __expectString,
385
+ });
386
+ Object.assign(contents, doc);
390
387
  const exception = new OutpostOfflineException({
391
388
  $metadata: deserializeMetadata(parsedOutput),
392
389
  ...contents,
@@ -396,9 +393,10 @@ const de_OutpostOfflineExceptionRes = async (parsedOutput, context) => {
396
393
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
397
394
  const contents = map({});
398
395
  const data = parsedOutput.body;
399
- if (data.Message != null) {
400
- contents.Message = __expectString(data.Message);
401
- }
396
+ const doc = take(data, {
397
+ Message: __expectString,
398
+ });
399
+ Object.assign(contents, doc);
402
400
  const exception = new ResourceNotFoundException({
403
401
  $metadata: deserializeMetadata(parsedOutput),
404
402
  ...contents,
@@ -408,9 +406,10 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
408
406
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
409
407
  const contents = map({});
410
408
  const data = parsedOutput.body;
411
- if (data.Message != null) {
412
- contents.Message = __expectString(data.Message);
413
- }
409
+ const doc = take(data, {
410
+ Message: __expectString,
411
+ });
412
+ Object.assign(contents, doc);
414
413
  const exception = new ThrottlingException({
415
414
  $metadata: deserializeMetadata(parsedOutput),
416
415
  ...contents,
@@ -420,9 +419,10 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
420
419
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
421
420
  const contents = map({});
422
421
  const data = parsedOutput.body;
423
- if (data.Message != null) {
424
- contents.Message = __expectString(data.Message);
425
- }
422
+ const doc = take(data, {
423
+ Message: __expectString,
424
+ });
425
+ Object.assign(contents, doc);
426
426
  const exception = new ValidationException({
427
427
  $metadata: deserializeMetadata(parsedOutput),
428
428
  ...contents,
@@ -430,75 +430,29 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
430
430
  return __decorateServiceException(exception, parsedOutput.body);
431
431
  };
432
432
  const de_Endpoint = (output, context) => {
433
- return {
434
- AccessType: __expectString(output.AccessType),
435
- CidrBlock: __expectString(output.CidrBlock),
436
- CreationTime: output.CreationTime != null
437
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationTime)))
438
- : undefined,
439
- CustomerOwnedIpv4Pool: __expectString(output.CustomerOwnedIpv4Pool),
440
- EndpointArn: __expectString(output.EndpointArn),
441
- FailedReason: output.FailedReason != null ? de_FailedReason(output.FailedReason, context) : undefined,
442
- NetworkInterfaces: output.NetworkInterfaces != null ? de_NetworkInterfaces(output.NetworkInterfaces, context) : undefined,
443
- OutpostsId: __expectString(output.OutpostsId),
444
- SecurityGroupId: __expectString(output.SecurityGroupId),
445
- Status: __expectString(output.Status),
446
- SubnetId: __expectString(output.SubnetId),
447
- VpcId: __expectString(output.VpcId),
448
- };
433
+ return take(output, {
434
+ AccessType: __expectString,
435
+ CidrBlock: __expectString,
436
+ CreationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
437
+ CustomerOwnedIpv4Pool: __expectString,
438
+ EndpointArn: __expectString,
439
+ FailedReason: _json,
440
+ NetworkInterfaces: _json,
441
+ OutpostsId: __expectString,
442
+ SecurityGroupId: __expectString,
443
+ Status: __expectString,
444
+ SubnetId: __expectString,
445
+ VpcId: __expectString,
446
+ });
449
447
  };
450
448
  const de_Endpoints = (output, context) => {
451
449
  const retVal = (output || [])
452
450
  .filter((e) => e != null)
453
451
  .map((entry) => {
454
- if (entry === null) {
455
- return null;
456
- }
457
452
  return de_Endpoint(entry, context);
458
453
  });
459
454
  return retVal;
460
455
  };
461
- const de_FailedReason = (output, context) => {
462
- return {
463
- ErrorCode: __expectString(output.ErrorCode),
464
- Message: __expectString(output.Message),
465
- };
466
- };
467
- const de_NetworkInterface = (output, context) => {
468
- return {
469
- NetworkInterfaceId: __expectString(output.NetworkInterfaceId),
470
- };
471
- };
472
- const de_NetworkInterfaces = (output, context) => {
473
- const retVal = (output || [])
474
- .filter((e) => e != null)
475
- .map((entry) => {
476
- if (entry === null) {
477
- return null;
478
- }
479
- return de_NetworkInterface(entry, context);
480
- });
481
- return retVal;
482
- };
483
- const de_Outpost = (output, context) => {
484
- return {
485
- CapacityInBytes: __expectLong(output.CapacityInBytes),
486
- OutpostArn: __expectString(output.OutpostArn),
487
- OutpostId: __expectString(output.OutpostId),
488
- OwnerId: __expectString(output.OwnerId),
489
- };
490
- };
491
- const de_Outposts = (output, context) => {
492
- const retVal = (output || [])
493
- .filter((e) => e != null)
494
- .map((entry) => {
495
- if (entry === null) {
496
- return null;
497
- }
498
- return de_Outpost(entry, context);
499
- });
500
- return retVal;
501
- };
502
456
  const deserializeMetadata = (output) => ({
503
457
  httpStatusCode: output.statusCode,
504
458
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-s3outposts",
3
3
  "description": "AWS SDK for JavaScript S3outposts Client for Node.js, Browser and React Native",
4
- "version": "3.310.0",
4
+ "version": "3.315.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.310.0",
24
+ "@aws-sdk/client-sts": "3.315.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.315.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.315.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.315.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.315.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",