@aws-sdk/client-s3outposts 3.141.0 → 3.142.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
7
+
8
+
9
+ ### Features
10
+
11
+ * **codegen:** general data mapping function ([#3830](https://github.com/aws/aws-sdk-js-v3/issues/3830)) ([9417eae](https://github.com/aws/aws-sdk-js-v3/commit/9417eae722806799fb4c15c07921574268c1165c))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
7
18
 
8
19
 
@@ -34,10 +34,10 @@ const serializeAws_restJson1DeleteEndpointCommand = async (input, context) => {
34
34
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
35
35
  const headers = {};
36
36
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/DeleteEndpoint";
37
- const query = {
38
- ...(input.EndpointId !== undefined && { endpointId: input.EndpointId }),
39
- ...(input.OutpostId !== undefined && { outpostId: input.OutpostId }),
40
- };
37
+ const query = map({
38
+ endpointId: [, input.EndpointId],
39
+ outpostId: [, input.OutpostId],
40
+ });
41
41
  let body;
42
42
  return new protocol_http_1.HttpRequest({
43
43
  protocol,
@@ -55,10 +55,10 @@ const serializeAws_restJson1ListEndpointsCommand = async (input, context) => {
55
55
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
56
56
  const headers = {};
57
57
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/ListEndpoints";
58
- const query = {
59
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
60
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
61
- };
58
+ const query = map({
59
+ nextToken: [, input.NextToken],
60
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
61
+ });
62
62
  let body;
63
63
  return new protocol_http_1.HttpRequest({
64
64
  protocol,
@@ -76,11 +76,11 @@ const serializeAws_restJson1ListSharedEndpointsCommand = async (input, context)
76
76
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
77
77
  const headers = {};
78
78
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/ListSharedEndpoints";
79
- const query = {
80
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
81
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
82
- ...(input.OutpostId !== undefined && { outpostId: input.OutpostId }),
83
- };
79
+ const query = map({
80
+ nextToken: [, input.NextToken],
81
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
82
+ outpostId: [, input.OutpostId],
83
+ });
84
84
  let body;
85
85
  return new protocol_http_1.HttpRequest({
86
86
  protocol,
@@ -98,15 +98,14 @@ const deserializeAws_restJson1CreateEndpointCommand = async (output, context) =>
98
98
  if (output.statusCode !== 200 && output.statusCode >= 300) {
99
99
  return deserializeAws_restJson1CreateEndpointCommandError(output, context);
100
100
  }
101
- const contents = {
101
+ const contents = map({
102
102
  $metadata: deserializeMetadata(output),
103
- EndpointArn: undefined,
104
- };
103
+ });
105
104
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
106
- if (data.EndpointArn !== undefined && data.EndpointArn !== null) {
105
+ if (data.EndpointArn != null) {
107
106
  contents.EndpointArn = (0, smithy_client_1.expectString)(data.EndpointArn);
108
107
  }
109
- return Promise.resolve(contents);
108
+ return contents;
110
109
  };
111
110
  exports.deserializeAws_restJson1CreateEndpointCommand = deserializeAws_restJson1CreateEndpointCommand;
112
111
  const deserializeAws_restJson1CreateEndpointCommandError = async (output, context) => {
@@ -114,7 +113,6 @@ const deserializeAws_restJson1CreateEndpointCommandError = async (output, contex
114
113
  ...output,
115
114
  body: await parseBody(output.body, context),
116
115
  };
117
- let response;
118
116
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
119
117
  switch (errorCode) {
120
118
  case "AccessDeniedException":
@@ -134,25 +132,23 @@ const deserializeAws_restJson1CreateEndpointCommandError = async (output, contex
134
132
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
135
133
  default:
136
134
  const parsedBody = parsedOutput.body;
137
- const $metadata = deserializeMetadata(output);
138
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
139
- response = new S3OutpostsServiceException_1.S3OutpostsServiceException({
140
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
141
- $fault: "client",
142
- $metadata,
135
+ (0, smithy_client_1.throwDefaultError)({
136
+ output,
137
+ parsedBody,
138
+ exceptionCtor: S3OutpostsServiceException_1.S3OutpostsServiceException,
139
+ errorCode,
143
140
  });
144
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
145
141
  }
146
142
  };
147
143
  const deserializeAws_restJson1DeleteEndpointCommand = async (output, context) => {
148
144
  if (output.statusCode !== 200 && output.statusCode >= 300) {
149
145
  return deserializeAws_restJson1DeleteEndpointCommandError(output, context);
150
146
  }
151
- const contents = {
147
+ const contents = map({
152
148
  $metadata: deserializeMetadata(output),
153
- };
149
+ });
154
150
  await collectBody(output.body, context);
155
- return Promise.resolve(contents);
151
+ return contents;
156
152
  };
157
153
  exports.deserializeAws_restJson1DeleteEndpointCommand = deserializeAws_restJson1DeleteEndpointCommand;
158
154
  const deserializeAws_restJson1DeleteEndpointCommandError = async (output, context) => {
@@ -160,7 +156,6 @@ const deserializeAws_restJson1DeleteEndpointCommandError = async (output, contex
160
156
  ...output,
161
157
  body: await parseBody(output.body, context),
162
158
  };
163
- let response;
164
159
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
165
160
  switch (errorCode) {
166
161
  case "AccessDeniedException":
@@ -177,33 +172,29 @@ const deserializeAws_restJson1DeleteEndpointCommandError = async (output, contex
177
172
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
178
173
  default:
179
174
  const parsedBody = parsedOutput.body;
180
- const $metadata = deserializeMetadata(output);
181
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
182
- response = new S3OutpostsServiceException_1.S3OutpostsServiceException({
183
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
184
- $fault: "client",
185
- $metadata,
175
+ (0, smithy_client_1.throwDefaultError)({
176
+ output,
177
+ parsedBody,
178
+ exceptionCtor: S3OutpostsServiceException_1.S3OutpostsServiceException,
179
+ errorCode,
186
180
  });
187
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
188
181
  }
189
182
  };
190
183
  const deserializeAws_restJson1ListEndpointsCommand = async (output, context) => {
191
184
  if (output.statusCode !== 200 && output.statusCode >= 300) {
192
185
  return deserializeAws_restJson1ListEndpointsCommandError(output, context);
193
186
  }
194
- const contents = {
187
+ const contents = map({
195
188
  $metadata: deserializeMetadata(output),
196
- Endpoints: undefined,
197
- NextToken: undefined,
198
- };
189
+ });
199
190
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
200
- if (data.Endpoints !== undefined && data.Endpoints !== null) {
191
+ if (data.Endpoints != null) {
201
192
  contents.Endpoints = deserializeAws_restJson1Endpoints(data.Endpoints, context);
202
193
  }
203
- if (data.NextToken !== undefined && data.NextToken !== null) {
194
+ if (data.NextToken != null) {
204
195
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
205
196
  }
206
- return Promise.resolve(contents);
197
+ return contents;
207
198
  };
208
199
  exports.deserializeAws_restJson1ListEndpointsCommand = deserializeAws_restJson1ListEndpointsCommand;
209
200
  const deserializeAws_restJson1ListEndpointsCommandError = async (output, context) => {
@@ -211,7 +202,6 @@ const deserializeAws_restJson1ListEndpointsCommandError = async (output, context
211
202
  ...output,
212
203
  body: await parseBody(output.body, context),
213
204
  };
214
- let response;
215
205
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
216
206
  switch (errorCode) {
217
207
  case "AccessDeniedException":
@@ -228,33 +218,29 @@ const deserializeAws_restJson1ListEndpointsCommandError = async (output, context
228
218
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
229
219
  default:
230
220
  const parsedBody = parsedOutput.body;
231
- const $metadata = deserializeMetadata(output);
232
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
233
- response = new S3OutpostsServiceException_1.S3OutpostsServiceException({
234
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
235
- $fault: "client",
236
- $metadata,
221
+ (0, smithy_client_1.throwDefaultError)({
222
+ output,
223
+ parsedBody,
224
+ exceptionCtor: S3OutpostsServiceException_1.S3OutpostsServiceException,
225
+ errorCode,
237
226
  });
238
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
239
227
  }
240
228
  };
241
229
  const deserializeAws_restJson1ListSharedEndpointsCommand = async (output, context) => {
242
230
  if (output.statusCode !== 200 && output.statusCode >= 300) {
243
231
  return deserializeAws_restJson1ListSharedEndpointsCommandError(output, context);
244
232
  }
245
- const contents = {
233
+ const contents = map({
246
234
  $metadata: deserializeMetadata(output),
247
- Endpoints: undefined,
248
- NextToken: undefined,
249
- };
235
+ });
250
236
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
251
- if (data.Endpoints !== undefined && data.Endpoints !== null) {
237
+ if (data.Endpoints != null) {
252
238
  contents.Endpoints = deserializeAws_restJson1Endpoints(data.Endpoints, context);
253
239
  }
254
- if (data.NextToken !== undefined && data.NextToken !== null) {
240
+ if (data.NextToken != null) {
255
241
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
256
242
  }
257
- return Promise.resolve(contents);
243
+ return contents;
258
244
  };
259
245
  exports.deserializeAws_restJson1ListSharedEndpointsCommand = deserializeAws_restJson1ListSharedEndpointsCommand;
260
246
  const deserializeAws_restJson1ListSharedEndpointsCommandError = async (output, context) => {
@@ -262,7 +248,6 @@ const deserializeAws_restJson1ListSharedEndpointsCommandError = async (output, c
262
248
  ...output,
263
249
  body: await parseBody(output.body, context),
264
250
  };
265
- let response;
266
251
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
267
252
  switch (errorCode) {
268
253
  case "AccessDeniedException":
@@ -279,20 +264,19 @@ const deserializeAws_restJson1ListSharedEndpointsCommandError = async (output, c
279
264
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
280
265
  default:
281
266
  const parsedBody = parsedOutput.body;
282
- const $metadata = deserializeMetadata(output);
283
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
284
- response = new S3OutpostsServiceException_1.S3OutpostsServiceException({
285
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
286
- $fault: "client",
287
- $metadata,
267
+ (0, smithy_client_1.throwDefaultError)({
268
+ output,
269
+ parsedBody,
270
+ exceptionCtor: S3OutpostsServiceException_1.S3OutpostsServiceException,
271
+ errorCode,
288
272
  });
289
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
290
273
  }
291
274
  };
275
+ const map = smithy_client_1.map;
292
276
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
293
- const contents = {};
277
+ const contents = map({});
294
278
  const data = parsedOutput.body;
295
- if (data.Message !== undefined && data.Message !== null) {
279
+ if (data.Message != null) {
296
280
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
297
281
  }
298
282
  const exception = new models_0_1.AccessDeniedException({
@@ -302,9 +286,9 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
302
286
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
303
287
  };
304
288
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
305
- const contents = {};
289
+ const contents = map({});
306
290
  const data = parsedOutput.body;
307
- if (data.Message !== undefined && data.Message !== null) {
291
+ if (data.Message != null) {
308
292
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
309
293
  }
310
294
  const exception = new models_0_1.ConflictException({
@@ -314,9 +298,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
314
298
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
315
299
  };
316
300
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
317
- const contents = {};
301
+ const contents = map({});
318
302
  const data = parsedOutput.body;
319
- if (data.Message !== undefined && data.Message !== null) {
303
+ if (data.Message != null) {
320
304
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
321
305
  }
322
306
  const exception = new models_0_1.InternalServerException({
@@ -326,9 +310,9 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
326
310
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
327
311
  };
328
312
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
329
- const contents = {};
313
+ const contents = map({});
330
314
  const data = parsedOutput.body;
331
- if (data.Message !== undefined && data.Message !== null) {
315
+ if (data.Message != null) {
332
316
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
333
317
  }
334
318
  const exception = new models_0_1.ResourceNotFoundException({
@@ -338,9 +322,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
338
322
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
339
323
  };
340
324
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
341
- const contents = {};
325
+ const contents = map({});
342
326
  const data = parsedOutput.body;
343
- if (data.Message !== undefined && data.Message !== null) {
327
+ if (data.Message != null) {
344
328
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
345
329
  }
346
330
  const exception = new models_0_1.ValidationException({
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
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";
4
4
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
5
5
  import { S3OutpostsServiceException as __BaseException } from "../models/S3OutpostsServiceException";
6
6
  export var serializeAws_restJson1CreateEndpointCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -36,7 +36,10 @@ export var serializeAws_restJson1DeleteEndpointCommand = function (input, contex
36
36
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
37
37
  headers = {};
38
38
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/S3Outposts/DeleteEndpoint";
39
- query = __assign(__assign({}, (input.EndpointId !== undefined && { endpointId: input.EndpointId })), (input.OutpostId !== undefined && { outpostId: input.OutpostId }));
39
+ query = map({
40
+ endpointId: [, input.EndpointId],
41
+ outpostId: [, input.OutpostId],
42
+ });
40
43
  return [2, new __HttpRequest({
41
44
  protocol: protocol,
42
45
  hostname: hostname,
@@ -59,7 +62,10 @@ export var serializeAws_restJson1ListEndpointsCommand = function (input, context
59
62
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
60
63
  headers = {};
61
64
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/S3Outposts/ListEndpoints";
62
- query = __assign(__assign({}, (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }));
65
+ query = map({
66
+ nextToken: [, input.NextToken],
67
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
68
+ });
63
69
  return [2, new __HttpRequest({
64
70
  protocol: protocol,
65
71
  hostname: hostname,
@@ -82,7 +88,11 @@ export var serializeAws_restJson1ListSharedEndpointsCommand = function (input, c
82
88
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
83
89
  headers = {};
84
90
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/S3Outposts/ListSharedEndpoints";
85
- query = __assign(__assign(__assign({}, (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.OutpostId !== undefined && { outpostId: input.OutpostId }));
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
+ });
86
96
  return [2, new __HttpRequest({
87
97
  protocol: protocol,
88
98
  hostname: hostname,
@@ -104,24 +114,23 @@ export var deserializeAws_restJson1CreateEndpointCommand = function (output, con
104
114
  if (output.statusCode !== 200 && output.statusCode >= 300) {
105
115
  return [2, deserializeAws_restJson1CreateEndpointCommandError(output, context)];
106
116
  }
107
- contents = {
117
+ contents = map({
108
118
  $metadata: deserializeMetadata(output),
109
- EndpointArn: undefined,
110
- };
119
+ });
111
120
  _a = __expectNonNull;
112
121
  _b = __expectObject;
113
122
  return [4, parseBody(output.body, context)];
114
123
  case 1:
115
124
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
116
- if (data.EndpointArn !== undefined && data.EndpointArn !== null) {
125
+ if (data.EndpointArn != null) {
117
126
  contents.EndpointArn = __expectString(data.EndpointArn);
118
127
  }
119
- return [2, Promise.resolve(contents)];
128
+ return [2, contents];
120
129
  }
121
130
  });
122
131
  }); };
123
132
  var deserializeAws_restJson1CreateEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
124
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
133
+ var parsedOutput, _a, errorCode, _b, parsedBody;
125
134
  var _c;
126
135
  return __generator(this, function (_d) {
127
136
  switch (_d.label) {
@@ -158,14 +167,14 @@ var deserializeAws_restJson1CreateEndpointCommandError = function (output, conte
158
167
  case 11: throw _d.sent();
159
168
  case 12:
160
169
  parsedBody = parsedOutput.body;
161
- $metadata = deserializeMetadata(output);
162
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
163
- response = new __BaseException({
164
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
165
- $fault: "client",
166
- $metadata: $metadata,
170
+ throwDefaultError({
171
+ output: output,
172
+ parsedBody: parsedBody,
173
+ exceptionCtor: __BaseException,
174
+ errorCode: errorCode,
167
175
  });
168
- throw __decorateServiceException(response, parsedBody);
176
+ _d.label = 13;
177
+ case 13: return [2];
169
178
  }
170
179
  });
171
180
  }); };
@@ -177,18 +186,18 @@ export var deserializeAws_restJson1DeleteEndpointCommand = function (output, con
177
186
  if (output.statusCode !== 200 && output.statusCode >= 300) {
178
187
  return [2, deserializeAws_restJson1DeleteEndpointCommandError(output, context)];
179
188
  }
180
- contents = {
189
+ contents = map({
181
190
  $metadata: deserializeMetadata(output),
182
- };
191
+ });
183
192
  return [4, collectBody(output.body, context)];
184
193
  case 1:
185
194
  _a.sent();
186
- return [2, Promise.resolve(contents)];
195
+ return [2, contents];
187
196
  }
188
197
  });
189
198
  }); };
190
199
  var deserializeAws_restJson1DeleteEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
191
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
200
+ var parsedOutput, _a, errorCode, _b, parsedBody;
192
201
  var _c;
193
202
  return __generator(this, function (_d) {
194
203
  switch (_d.label) {
@@ -221,14 +230,14 @@ var deserializeAws_restJson1DeleteEndpointCommandError = function (output, conte
221
230
  case 9: throw _d.sent();
222
231
  case 10:
223
232
  parsedBody = parsedOutput.body;
224
- $metadata = deserializeMetadata(output);
225
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
226
- response = new __BaseException({
227
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
228
- $fault: "client",
229
- $metadata: $metadata,
233
+ throwDefaultError({
234
+ output: output,
235
+ parsedBody: parsedBody,
236
+ exceptionCtor: __BaseException,
237
+ errorCode: errorCode,
230
238
  });
231
- throw __decorateServiceException(response, parsedBody);
239
+ _d.label = 11;
240
+ case 11: return [2];
232
241
  }
233
242
  });
234
243
  }); };
@@ -240,28 +249,26 @@ export var deserializeAws_restJson1ListEndpointsCommand = function (output, cont
240
249
  if (output.statusCode !== 200 && output.statusCode >= 300) {
241
250
  return [2, deserializeAws_restJson1ListEndpointsCommandError(output, context)];
242
251
  }
243
- contents = {
252
+ contents = map({
244
253
  $metadata: deserializeMetadata(output),
245
- Endpoints: undefined,
246
- NextToken: undefined,
247
- };
254
+ });
248
255
  _a = __expectNonNull;
249
256
  _b = __expectObject;
250
257
  return [4, parseBody(output.body, context)];
251
258
  case 1:
252
259
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
253
- if (data.Endpoints !== undefined && data.Endpoints !== null) {
260
+ if (data.Endpoints != null) {
254
261
  contents.Endpoints = deserializeAws_restJson1Endpoints(data.Endpoints, context);
255
262
  }
256
- if (data.NextToken !== undefined && data.NextToken !== null) {
263
+ if (data.NextToken != null) {
257
264
  contents.NextToken = __expectString(data.NextToken);
258
265
  }
259
- return [2, Promise.resolve(contents)];
266
+ return [2, contents];
260
267
  }
261
268
  });
262
269
  }); };
263
270
  var deserializeAws_restJson1ListEndpointsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
264
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
271
+ var parsedOutput, _a, errorCode, _b, parsedBody;
265
272
  var _c;
266
273
  return __generator(this, function (_d) {
267
274
  switch (_d.label) {
@@ -294,14 +301,14 @@ var deserializeAws_restJson1ListEndpointsCommandError = function (output, contex
294
301
  case 9: throw _d.sent();
295
302
  case 10:
296
303
  parsedBody = parsedOutput.body;
297
- $metadata = deserializeMetadata(output);
298
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
299
- response = new __BaseException({
300
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
301
- $fault: "client",
302
- $metadata: $metadata,
304
+ throwDefaultError({
305
+ output: output,
306
+ parsedBody: parsedBody,
307
+ exceptionCtor: __BaseException,
308
+ errorCode: errorCode,
303
309
  });
304
- throw __decorateServiceException(response, parsedBody);
310
+ _d.label = 11;
311
+ case 11: return [2];
305
312
  }
306
313
  });
307
314
  }); };
@@ -313,28 +320,26 @@ export var deserializeAws_restJson1ListSharedEndpointsCommand = function (output
313
320
  if (output.statusCode !== 200 && output.statusCode >= 300) {
314
321
  return [2, deserializeAws_restJson1ListSharedEndpointsCommandError(output, context)];
315
322
  }
316
- contents = {
323
+ contents = map({
317
324
  $metadata: deserializeMetadata(output),
318
- Endpoints: undefined,
319
- NextToken: undefined,
320
- };
325
+ });
321
326
  _a = __expectNonNull;
322
327
  _b = __expectObject;
323
328
  return [4, parseBody(output.body, context)];
324
329
  case 1:
325
330
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
326
- if (data.Endpoints !== undefined && data.Endpoints !== null) {
331
+ if (data.Endpoints != null) {
327
332
  contents.Endpoints = deserializeAws_restJson1Endpoints(data.Endpoints, context);
328
333
  }
329
- if (data.NextToken !== undefined && data.NextToken !== null) {
334
+ if (data.NextToken != null) {
330
335
  contents.NextToken = __expectString(data.NextToken);
331
336
  }
332
- return [2, Promise.resolve(contents)];
337
+ return [2, contents];
333
338
  }
334
339
  });
335
340
  }); };
336
341
  var deserializeAws_restJson1ListSharedEndpointsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
337
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
342
+ var parsedOutput, _a, errorCode, _b, parsedBody;
338
343
  var _c;
339
344
  return __generator(this, function (_d) {
340
345
  switch (_d.label) {
@@ -367,23 +372,24 @@ var deserializeAws_restJson1ListSharedEndpointsCommandError = function (output,
367
372
  case 9: throw _d.sent();
368
373
  case 10:
369
374
  parsedBody = parsedOutput.body;
370
- $metadata = deserializeMetadata(output);
371
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
372
- response = new __BaseException({
373
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
374
- $fault: "client",
375
- $metadata: $metadata,
375
+ throwDefaultError({
376
+ output: output,
377
+ parsedBody: parsedBody,
378
+ exceptionCtor: __BaseException,
379
+ errorCode: errorCode,
376
380
  });
377
- throw __decorateServiceException(response, parsedBody);
381
+ _d.label = 11;
382
+ case 11: return [2];
378
383
  }
379
384
  });
380
385
  }); };
386
+ var map = __map;
381
387
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
382
388
  var contents, data, exception;
383
389
  return __generator(this, function (_a) {
384
- contents = {};
390
+ contents = map({});
385
391
  data = parsedOutput.body;
386
- if (data.Message !== undefined && data.Message !== null) {
392
+ if (data.Message != null) {
387
393
  contents.Message = __expectString(data.Message);
388
394
  }
389
395
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -393,9 +399,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
393
399
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
394
400
  var contents, data, exception;
395
401
  return __generator(this, function (_a) {
396
- contents = {};
402
+ contents = map({});
397
403
  data = parsedOutput.body;
398
- if (data.Message !== undefined && data.Message !== null) {
404
+ if (data.Message != null) {
399
405
  contents.Message = __expectString(data.Message);
400
406
  }
401
407
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -405,9 +411,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
405
411
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
406
412
  var contents, data, exception;
407
413
  return __generator(this, function (_a) {
408
- contents = {};
414
+ contents = map({});
409
415
  data = parsedOutput.body;
410
- if (data.Message !== undefined && data.Message !== null) {
416
+ if (data.Message != null) {
411
417
  contents.Message = __expectString(data.Message);
412
418
  }
413
419
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -417,9 +423,9 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
417
423
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
418
424
  var contents, data, exception;
419
425
  return __generator(this, function (_a) {
420
- contents = {};
426
+ contents = map({});
421
427
  data = parsedOutput.body;
422
- if (data.Message !== undefined && data.Message !== null) {
428
+ if (data.Message != null) {
423
429
  contents.Message = __expectString(data.Message);
424
430
  }
425
431
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -429,9 +435,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
429
435
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
430
436
  var contents, data, exception;
431
437
  return __generator(this, function (_a) {
432
- contents = {};
438
+ contents = map({});
433
439
  data = parsedOutput.body;
434
- if (data.Message !== undefined && data.Message !== null) {
440
+ if (data.Message != null) {
435
441
  contents.Message = __expectString(data.Message);
436
442
  }
437
443
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
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.141.0",
4
+ "version": "3.142.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",
@@ -18,9 +18,9 @@
18
18
  "dependencies": {
19
19
  "@aws-crypto/sha256-browser": "2.0.0",
20
20
  "@aws-crypto/sha256-js": "2.0.0",
21
- "@aws-sdk/client-sts": "3.141.0",
21
+ "@aws-sdk/client-sts": "3.142.0",
22
22
  "@aws-sdk/config-resolver": "3.130.0",
23
- "@aws-sdk/credential-provider-node": "3.141.0",
23
+ "@aws-sdk/credential-provider-node": "3.142.0",
24
24
  "@aws-sdk/fetch-http-handler": "3.131.0",
25
25
  "@aws-sdk/hash-node": "3.127.0",
26
26
  "@aws-sdk/invalid-dependency": "3.127.0",
@@ -36,15 +36,15 @@
36
36
  "@aws-sdk/node-config-provider": "3.127.0",
37
37
  "@aws-sdk/node-http-handler": "3.127.0",
38
38
  "@aws-sdk/protocol-http": "3.127.0",
39
- "@aws-sdk/smithy-client": "3.137.0",
39
+ "@aws-sdk/smithy-client": "3.142.0",
40
40
  "@aws-sdk/types": "3.127.0",
41
41
  "@aws-sdk/url-parser": "3.127.0",
42
42
  "@aws-sdk/util-base64-browser": "3.109.0",
43
43
  "@aws-sdk/util-base64-node": "3.55.0",
44
44
  "@aws-sdk/util-body-length-browser": "3.55.0",
45
45
  "@aws-sdk/util-body-length-node": "3.55.0",
46
- "@aws-sdk/util-defaults-mode-browser": "3.137.0",
47
- "@aws-sdk/util-defaults-mode-node": "3.137.0",
46
+ "@aws-sdk/util-defaults-mode-browser": "3.142.0",
47
+ "@aws-sdk/util-defaults-mode-node": "3.142.0",
48
48
  "@aws-sdk/util-user-agent-browser": "3.127.0",
49
49
  "@aws-sdk/util-user-agent-node": "3.127.0",
50
50
  "@aws-sdk/util-utf8-browser": "3.109.0",