@aws-sdk/client-mediastore-data 3.141.0 → 3.150.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,33 @@
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.150.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.149.0...v3.150.0) (2022-08-15)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-mediastore-data
9
+
10
+
11
+
12
+
13
+
14
+ # [3.145.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.144.0...v3.145.0) (2022-08-08)
15
+
16
+ **Note:** Version bump only for package @aws-sdk/client-mediastore-data
17
+
18
+
19
+
20
+
21
+
22
+ # [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
23
+
24
+
25
+ ### Features
26
+
27
+ * **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))
28
+
29
+
30
+
31
+
32
+
6
33
  # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
7
34
 
8
35
 
@@ -9,19 +9,7 @@ const serializeAws_restJson1DeleteObjectCommand = async (input, context) => {
9
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
10
  const headers = {};
11
11
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
12
- if (input.Path !== undefined) {
13
- const labelValue = input.Path;
14
- if (labelValue.length <= 0) {
15
- throw new Error("Empty value provided for input HTTP label: Path.");
16
- }
17
- resolvedPath = resolvedPath.replace("{Path+}", labelValue
18
- .split("/")
19
- .map((segment) => (0, smithy_client_1.extendedEncodeURIComponent)(segment))
20
- .join("/"));
21
- }
22
- else {
23
- throw new Error("No value provided for input HTTP label: Path.");
24
- }
12
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
25
13
  let body;
26
14
  return new protocol_http_1.HttpRequest({
27
15
  protocol,
@@ -38,19 +26,7 @@ const serializeAws_restJson1DescribeObjectCommand = async (input, context) => {
38
26
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
39
27
  const headers = {};
40
28
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
41
- if (input.Path !== undefined) {
42
- const labelValue = input.Path;
43
- if (labelValue.length <= 0) {
44
- throw new Error("Empty value provided for input HTTP label: Path.");
45
- }
46
- resolvedPath = resolvedPath.replace("{Path+}", labelValue
47
- .split("/")
48
- .map((segment) => (0, smithy_client_1.extendedEncodeURIComponent)(segment))
49
- .join("/"));
50
- }
51
- else {
52
- throw new Error("No value provided for input HTTP label: Path.");
53
- }
29
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
54
30
  let body;
55
31
  return new protocol_http_1.HttpRequest({
56
32
  protocol,
@@ -65,23 +41,11 @@ const serializeAws_restJson1DescribeObjectCommand = async (input, context) => {
65
41
  exports.serializeAws_restJson1DescribeObjectCommand = serializeAws_restJson1DescribeObjectCommand;
66
42
  const serializeAws_restJson1GetObjectCommand = async (input, context) => {
67
43
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
68
- const headers = {
69
- ...(isSerializableHeaderValue(input.Range) && { range: input.Range }),
70
- };
44
+ const headers = map({}, isSerializableHeaderValue, {
45
+ range: input.Range,
46
+ });
71
47
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
72
- if (input.Path !== undefined) {
73
- const labelValue = input.Path;
74
- if (labelValue.length <= 0) {
75
- throw new Error("Empty value provided for input HTTP label: Path.");
76
- }
77
- resolvedPath = resolvedPath.replace("{Path+}", labelValue
78
- .split("/")
79
- .map((segment) => (0, smithy_client_1.extendedEncodeURIComponent)(segment))
80
- .join("/"));
81
- }
82
- else {
83
- throw new Error("No value provided for input HTTP label: Path.");
84
- }
48
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
85
49
  let body;
86
50
  return new protocol_http_1.HttpRequest({
87
51
  protocol,
@@ -98,11 +62,11 @@ const serializeAws_restJson1ListItemsCommand = async (input, context) => {
98
62
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
99
63
  const headers = {};
100
64
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/";
101
- const query = {
102
- ...(input.Path !== undefined && { Path: input.Path }),
103
- ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }),
104
- ...(input.NextToken !== undefined && { NextToken: input.NextToken }),
105
- };
65
+ const query = map({
66
+ Path: [, input.Path],
67
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
68
+ NextToken: [, input.NextToken],
69
+ });
106
70
  let body;
107
71
  return new protocol_http_1.HttpRequest({
108
72
  protocol,
@@ -118,30 +82,15 @@ const serializeAws_restJson1ListItemsCommand = async (input, context) => {
118
82
  exports.serializeAws_restJson1ListItemsCommand = serializeAws_restJson1ListItemsCommand;
119
83
  const serializeAws_restJson1PutObjectCommand = async (input, context) => {
120
84
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
121
- const headers = {
122
- "content-type": "application/octet-stream",
85
+ const headers = map({}, isSerializableHeaderValue, {
123
86
  "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
124
- ...(isSerializableHeaderValue(input.ContentType) && { "content-type": input.ContentType }),
125
- ...(isSerializableHeaderValue(input.CacheControl) && { "cache-control": input.CacheControl }),
126
- ...(isSerializableHeaderValue(input.StorageClass) && { "x-amz-storage-class": input.StorageClass }),
127
- ...(isSerializableHeaderValue(input.UploadAvailability) && {
128
- "x-amz-upload-availability": input.UploadAvailability,
129
- }),
130
- };
87
+ "content-type": input.ContentType || "application/octet-stream",
88
+ "cache-control": input.CacheControl,
89
+ "x-amz-storage-class": input.StorageClass,
90
+ "x-amz-upload-availability": input.UploadAvailability,
91
+ });
131
92
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
132
- if (input.Path !== undefined) {
133
- const labelValue = input.Path;
134
- if (labelValue.length <= 0) {
135
- throw new Error("Empty value provided for input HTTP label: Path.");
136
- }
137
- resolvedPath = resolvedPath.replace("{Path+}", labelValue
138
- .split("/")
139
- .map((segment) => (0, smithy_client_1.extendedEncodeURIComponent)(segment))
140
- .join("/"));
141
- }
142
- else {
143
- throw new Error("No value provided for input HTTP label: Path.");
144
- }
93
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
145
94
  let body;
146
95
  if (input.Body !== undefined) {
147
96
  body = input.Body;
@@ -161,11 +110,11 @@ const deserializeAws_restJson1DeleteObjectCommand = async (output, context) => {
161
110
  if (output.statusCode !== 200 && output.statusCode >= 300) {
162
111
  return deserializeAws_restJson1DeleteObjectCommandError(output, context);
163
112
  }
164
- const contents = {
113
+ const contents = map({
165
114
  $metadata: deserializeMetadata(output),
166
- };
115
+ });
167
116
  await collectBody(output.body, context);
168
- return Promise.resolve(contents);
117
+ return contents;
169
118
  };
170
119
  exports.deserializeAws_restJson1DeleteObjectCommand = deserializeAws_restJson1DeleteObjectCommand;
171
120
  const deserializeAws_restJson1DeleteObjectCommandError = async (output, context) => {
@@ -173,7 +122,6 @@ const deserializeAws_restJson1DeleteObjectCommandError = async (output, context)
173
122
  ...output,
174
123
  body: await parseBody(output.body, context),
175
124
  };
176
- let response;
177
125
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
178
126
  switch (errorCode) {
179
127
  case "ContainerNotFoundException":
@@ -187,45 +135,34 @@ const deserializeAws_restJson1DeleteObjectCommandError = async (output, context)
187
135
  throw await deserializeAws_restJson1ObjectNotFoundExceptionResponse(parsedOutput, context);
188
136
  default:
189
137
  const parsedBody = parsedOutput.body;
190
- const $metadata = deserializeMetadata(output);
191
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
192
- response = new MediaStoreDataServiceException_1.MediaStoreDataServiceException({
193
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
194
- $fault: "client",
195
- $metadata,
138
+ (0, smithy_client_1.throwDefaultError)({
139
+ output,
140
+ parsedBody,
141
+ exceptionCtor: MediaStoreDataServiceException_1.MediaStoreDataServiceException,
142
+ errorCode,
196
143
  });
197
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
198
144
  }
199
145
  };
200
146
  const deserializeAws_restJson1DescribeObjectCommand = async (output, context) => {
201
147
  if (output.statusCode !== 200 && output.statusCode >= 300) {
202
148
  return deserializeAws_restJson1DescribeObjectCommandError(output, context);
203
149
  }
204
- const contents = {
150
+ const contents = map({
205
151
  $metadata: deserializeMetadata(output),
206
- CacheControl: undefined,
207
- ContentLength: undefined,
208
- ContentType: undefined,
209
- ETag: undefined,
210
- LastModified: undefined,
211
- };
212
- if (output.headers["etag"] !== undefined) {
213
- contents.ETag = output.headers["etag"];
214
- }
215
- if (output.headers["content-type"] !== undefined) {
216
- contents.ContentType = output.headers["content-type"];
217
- }
218
- if (output.headers["content-length"] !== undefined) {
219
- contents.ContentLength = (0, smithy_client_1.strictParseLong)(output.headers["content-length"]);
220
- }
221
- if (output.headers["cache-control"] !== undefined) {
222
- contents.CacheControl = output.headers["cache-control"];
223
- }
224
- if (output.headers["last-modified"] !== undefined) {
225
- contents.LastModified = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc7231DateTime)(output.headers["last-modified"]));
226
- }
152
+ ETag: [, output.headers["etag"]],
153
+ ContentType: [, output.headers["content-type"]],
154
+ ContentLength: [
155
+ () => void 0 !== output.headers["content-length"],
156
+ () => (0, smithy_client_1.strictParseLong)(output.headers["content-length"]),
157
+ ],
158
+ CacheControl: [, output.headers["cache-control"]],
159
+ LastModified: [
160
+ () => void 0 !== output.headers["last-modified"],
161
+ () => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc7231DateTime)(output.headers["last-modified"])),
162
+ ],
163
+ });
227
164
  await collectBody(output.body, context);
228
- return Promise.resolve(contents);
165
+ return contents;
229
166
  };
230
167
  exports.deserializeAws_restJson1DescribeObjectCommand = deserializeAws_restJson1DescribeObjectCommand;
231
168
  const deserializeAws_restJson1DescribeObjectCommandError = async (output, context) => {
@@ -233,7 +170,6 @@ const deserializeAws_restJson1DescribeObjectCommandError = async (output, contex
233
170
  ...output,
234
171
  body: await parseBody(output.body, context),
235
172
  };
236
- let response;
237
173
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
238
174
  switch (errorCode) {
239
175
  case "ContainerNotFoundException":
@@ -247,55 +183,39 @@ const deserializeAws_restJson1DescribeObjectCommandError = async (output, contex
247
183
  throw await deserializeAws_restJson1ObjectNotFoundExceptionResponse(parsedOutput, context);
248
184
  default:
249
185
  const parsedBody = parsedOutput.body;
250
- const $metadata = deserializeMetadata(output);
251
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
252
- response = new MediaStoreDataServiceException_1.MediaStoreDataServiceException({
253
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
254
- $fault: "client",
255
- $metadata,
186
+ (0, smithy_client_1.throwDefaultError)({
187
+ output,
188
+ parsedBody,
189
+ exceptionCtor: MediaStoreDataServiceException_1.MediaStoreDataServiceException,
190
+ errorCode,
256
191
  });
257
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
258
192
  }
259
193
  };
260
194
  const deserializeAws_restJson1GetObjectCommand = async (output, context) => {
261
195
  if (output.statusCode !== 200 && output.statusCode >= 300) {
262
196
  return deserializeAws_restJson1GetObjectCommandError(output, context);
263
197
  }
264
- const contents = {
198
+ const contents = map({
265
199
  $metadata: deserializeMetadata(output),
266
- Body: undefined,
267
- CacheControl: undefined,
268
- ContentLength: undefined,
269
- ContentRange: undefined,
270
- ContentType: undefined,
271
- ETag: undefined,
272
- LastModified: undefined,
273
- StatusCode: undefined,
274
- };
275
- if (output.headers["cache-control"] !== undefined) {
276
- contents.CacheControl = output.headers["cache-control"];
277
- }
278
- if (output.headers["content-range"] !== undefined) {
279
- contents.ContentRange = output.headers["content-range"];
280
- }
281
- if (output.headers["content-length"] !== undefined) {
282
- contents.ContentLength = (0, smithy_client_1.strictParseLong)(output.headers["content-length"]);
283
- }
284
- if (output.headers["content-type"] !== undefined) {
285
- contents.ContentType = output.headers["content-type"];
286
- }
287
- if (output.headers["etag"] !== undefined) {
288
- contents.ETag = output.headers["etag"];
289
- }
290
- if (output.headers["last-modified"] !== undefined) {
291
- contents.LastModified = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc7231DateTime)(output.headers["last-modified"]));
292
- }
200
+ CacheControl: [, output.headers["cache-control"]],
201
+ ContentRange: [, output.headers["content-range"]],
202
+ ContentLength: [
203
+ () => void 0 !== output.headers["content-length"],
204
+ () => (0, smithy_client_1.strictParseLong)(output.headers["content-length"]),
205
+ ],
206
+ ContentType: [, output.headers["content-type"]],
207
+ ETag: [, output.headers["etag"]],
208
+ LastModified: [
209
+ () => void 0 !== output.headers["last-modified"],
210
+ () => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc7231DateTime)(output.headers["last-modified"])),
211
+ ],
212
+ });
293
213
  const data = output.body;
294
214
  contents.Body = data;
295
- if (contents.StatusCode === undefined) {
296
- contents.StatusCode = output.statusCode;
297
- }
298
- return Promise.resolve(contents);
215
+ map(contents, {
216
+ StatusCode: [, output.statusCode],
217
+ });
218
+ return contents;
299
219
  };
300
220
  exports.deserializeAws_restJson1GetObjectCommand = deserializeAws_restJson1GetObjectCommand;
301
221
  const deserializeAws_restJson1GetObjectCommandError = async (output, context) => {
@@ -303,7 +223,6 @@ const deserializeAws_restJson1GetObjectCommandError = async (output, context) =>
303
223
  ...output,
304
224
  body: await parseBody(output.body, context),
305
225
  };
306
- let response;
307
226
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
308
227
  switch (errorCode) {
309
228
  case "ContainerNotFoundException":
@@ -320,33 +239,29 @@ const deserializeAws_restJson1GetObjectCommandError = async (output, context) =>
320
239
  throw await deserializeAws_restJson1RequestedRangeNotSatisfiableExceptionResponse(parsedOutput, context);
321
240
  default:
322
241
  const parsedBody = parsedOutput.body;
323
- const $metadata = deserializeMetadata(output);
324
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
325
- response = new MediaStoreDataServiceException_1.MediaStoreDataServiceException({
326
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
327
- $fault: "client",
328
- $metadata,
242
+ (0, smithy_client_1.throwDefaultError)({
243
+ output,
244
+ parsedBody,
245
+ exceptionCtor: MediaStoreDataServiceException_1.MediaStoreDataServiceException,
246
+ errorCode,
329
247
  });
330
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
331
248
  }
332
249
  };
333
250
  const deserializeAws_restJson1ListItemsCommand = async (output, context) => {
334
251
  if (output.statusCode !== 200 && output.statusCode >= 300) {
335
252
  return deserializeAws_restJson1ListItemsCommandError(output, context);
336
253
  }
337
- const contents = {
254
+ const contents = map({
338
255
  $metadata: deserializeMetadata(output),
339
- Items: undefined,
340
- NextToken: undefined,
341
- };
256
+ });
342
257
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
343
- if (data.Items !== undefined && data.Items !== null) {
258
+ if (data.Items != null) {
344
259
  contents.Items = deserializeAws_restJson1ItemList(data.Items, context);
345
260
  }
346
- if (data.NextToken !== undefined && data.NextToken !== null) {
261
+ if (data.NextToken != null) {
347
262
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
348
263
  }
349
- return Promise.resolve(contents);
264
+ return contents;
350
265
  };
351
266
  exports.deserializeAws_restJson1ListItemsCommand = deserializeAws_restJson1ListItemsCommand;
352
267
  const deserializeAws_restJson1ListItemsCommandError = async (output, context) => {
@@ -354,7 +269,6 @@ const deserializeAws_restJson1ListItemsCommandError = async (output, context) =>
354
269
  ...output,
355
270
  body: await parseBody(output.body, context),
356
271
  };
357
- let response;
358
272
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
359
273
  switch (errorCode) {
360
274
  case "ContainerNotFoundException":
@@ -365,37 +279,32 @@ const deserializeAws_restJson1ListItemsCommandError = async (output, context) =>
365
279
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
366
280
  default:
367
281
  const parsedBody = parsedOutput.body;
368
- const $metadata = deserializeMetadata(output);
369
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
370
- response = new MediaStoreDataServiceException_1.MediaStoreDataServiceException({
371
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
372
- $fault: "client",
373
- $metadata,
282
+ (0, smithy_client_1.throwDefaultError)({
283
+ output,
284
+ parsedBody,
285
+ exceptionCtor: MediaStoreDataServiceException_1.MediaStoreDataServiceException,
286
+ errorCode,
374
287
  });
375
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
376
288
  }
377
289
  };
378
290
  const deserializeAws_restJson1PutObjectCommand = async (output, context) => {
379
291
  if (output.statusCode !== 200 && output.statusCode >= 300) {
380
292
  return deserializeAws_restJson1PutObjectCommandError(output, context);
381
293
  }
382
- const contents = {
294
+ const contents = map({
383
295
  $metadata: deserializeMetadata(output),
384
- ContentSHA256: undefined,
385
- ETag: undefined,
386
- StorageClass: undefined,
387
- };
296
+ });
388
297
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
389
- if (data.ContentSHA256 !== undefined && data.ContentSHA256 !== null) {
298
+ if (data.ContentSHA256 != null) {
390
299
  contents.ContentSHA256 = (0, smithy_client_1.expectString)(data.ContentSHA256);
391
300
  }
392
- if (data.ETag !== undefined && data.ETag !== null) {
301
+ if (data.ETag != null) {
393
302
  contents.ETag = (0, smithy_client_1.expectString)(data.ETag);
394
303
  }
395
- if (data.StorageClass !== undefined && data.StorageClass !== null) {
304
+ if (data.StorageClass != null) {
396
305
  contents.StorageClass = (0, smithy_client_1.expectString)(data.StorageClass);
397
306
  }
398
- return Promise.resolve(contents);
307
+ return contents;
399
308
  };
400
309
  exports.deserializeAws_restJson1PutObjectCommand = deserializeAws_restJson1PutObjectCommand;
401
310
  const deserializeAws_restJson1PutObjectCommandError = async (output, context) => {
@@ -403,7 +312,6 @@ const deserializeAws_restJson1PutObjectCommandError = async (output, context) =>
403
312
  ...output,
404
313
  body: await parseBody(output.body, context),
405
314
  };
406
- let response;
407
315
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
408
316
  switch (errorCode) {
409
317
  case "ContainerNotFoundException":
@@ -414,20 +322,19 @@ const deserializeAws_restJson1PutObjectCommandError = async (output, context) =>
414
322
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
415
323
  default:
416
324
  const parsedBody = parsedOutput.body;
417
- const $metadata = deserializeMetadata(output);
418
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
419
- response = new MediaStoreDataServiceException_1.MediaStoreDataServiceException({
420
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
421
- $fault: "client",
422
- $metadata,
325
+ (0, smithy_client_1.throwDefaultError)({
326
+ output,
327
+ parsedBody,
328
+ exceptionCtor: MediaStoreDataServiceException_1.MediaStoreDataServiceException,
329
+ errorCode,
423
330
  });
424
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
425
331
  }
426
332
  };
333
+ const map = smithy_client_1.map;
427
334
  const deserializeAws_restJson1ContainerNotFoundExceptionResponse = async (parsedOutput, context) => {
428
- const contents = {};
335
+ const contents = map({});
429
336
  const data = parsedOutput.body;
430
- if (data.Message !== undefined && data.Message !== null) {
337
+ if (data.Message != null) {
431
338
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
432
339
  }
433
340
  const exception = new models_0_1.ContainerNotFoundException({
@@ -437,9 +344,9 @@ const deserializeAws_restJson1ContainerNotFoundExceptionResponse = async (parsed
437
344
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
438
345
  };
439
346
  const deserializeAws_restJson1InternalServerErrorResponse = async (parsedOutput, context) => {
440
- const contents = {};
347
+ const contents = map({});
441
348
  const data = parsedOutput.body;
442
- if (data.Message !== undefined && data.Message !== null) {
349
+ if (data.Message != null) {
443
350
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
444
351
  }
445
352
  const exception = new models_0_1.InternalServerError({
@@ -449,9 +356,9 @@ const deserializeAws_restJson1InternalServerErrorResponse = async (parsedOutput,
449
356
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
450
357
  };
451
358
  const deserializeAws_restJson1ObjectNotFoundExceptionResponse = async (parsedOutput, context) => {
452
- const contents = {};
359
+ const contents = map({});
453
360
  const data = parsedOutput.body;
454
- if (data.Message !== undefined && data.Message !== null) {
361
+ if (data.Message != null) {
455
362
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
456
363
  }
457
364
  const exception = new models_0_1.ObjectNotFoundException({
@@ -461,9 +368,9 @@ const deserializeAws_restJson1ObjectNotFoundExceptionResponse = async (parsedOut
461
368
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
462
369
  };
463
370
  const deserializeAws_restJson1RequestedRangeNotSatisfiableExceptionResponse = async (parsedOutput, context) => {
464
- const contents = {};
371
+ const contents = map({});
465
372
  const data = parsedOutput.body;
466
- if (data.Message !== undefined && data.Message !== null) {
373
+ if (data.Message != null) {
467
374
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
468
375
  }
469
376
  const exception = new models_0_1.RequestedRangeNotSatisfiableException({
@@ -1,10 +1,10 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, parseRfc7231DateTime as __parseRfc7231DateTime, strictParseLong as __strictParseLong, } from "@aws-sdk/smithy-client";
3
+ 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, parseRfc7231DateTime as __parseRfc7231DateTime, resolvedPath as __resolvedPath, strictParseLong as __strictParseLong, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { MediaStoreDataServiceException as __BaseException } from "../models/MediaStoreDataServiceException";
5
5
  import { ContainerNotFoundException, InternalServerError, ObjectNotFoundException, RequestedRangeNotSatisfiableException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1DeleteObjectCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
8
  return __generator(this, function (_c) {
9
9
  switch (_c.label) {
10
10
  case 0: return [4, context.endpoint()];
@@ -12,19 +12,7 @@ export var serializeAws_restJson1DeleteObjectCommand = function (input, context)
12
12
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
13
  headers = {};
14
14
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/{Path+}";
15
- if (input.Path !== undefined) {
16
- labelValue = input.Path;
17
- if (labelValue.length <= 0) {
18
- throw new Error("Empty value provided for input HTTP label: Path.");
19
- }
20
- resolvedPath = resolvedPath.replace("{Path+}", labelValue
21
- .split("/")
22
- .map(function (segment) { return __extendedEncodeURIComponent(segment); })
23
- .join("/"));
24
- }
25
- else {
26
- throw new Error("No value provided for input HTTP label: Path.");
27
- }
15
+ resolvedPath = __resolvedPath(resolvedPath, input, "Path", function () { return input.Path; }, "{Path+}", true);
28
16
  return [2, new __HttpRequest({
29
17
  protocol: protocol,
30
18
  hostname: hostname,
@@ -38,7 +26,7 @@ export var serializeAws_restJson1DeleteObjectCommand = function (input, context)
38
26
  });
39
27
  }); };
40
28
  export var serializeAws_restJson1DescribeObjectCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
41
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
29
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
42
30
  return __generator(this, function (_c) {
43
31
  switch (_c.label) {
44
32
  case 0: return [4, context.endpoint()];
@@ -46,19 +34,7 @@ export var serializeAws_restJson1DescribeObjectCommand = function (input, contex
46
34
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
47
35
  headers = {};
48
36
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/{Path+}";
49
- if (input.Path !== undefined) {
50
- labelValue = input.Path;
51
- if (labelValue.length <= 0) {
52
- throw new Error("Empty value provided for input HTTP label: Path.");
53
- }
54
- resolvedPath = resolvedPath.replace("{Path+}", labelValue
55
- .split("/")
56
- .map(function (segment) { return __extendedEncodeURIComponent(segment); })
57
- .join("/"));
58
- }
59
- else {
60
- throw new Error("No value provided for input HTTP label: Path.");
61
- }
37
+ resolvedPath = __resolvedPath(resolvedPath, input, "Path", function () { return input.Path; }, "{Path+}", true);
62
38
  return [2, new __HttpRequest({
63
39
  protocol: protocol,
64
40
  hostname: hostname,
@@ -72,27 +48,17 @@ export var serializeAws_restJson1DescribeObjectCommand = function (input, contex
72
48
  });
73
49
  }); };
74
50
  export var serializeAws_restJson1GetObjectCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
75
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
51
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
76
52
  return __generator(this, function (_c) {
77
53
  switch (_c.label) {
78
54
  case 0: return [4, context.endpoint()];
79
55
  case 1:
80
56
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
81
- headers = __assign({}, (isSerializableHeaderValue(input.Range) && { range: input.Range }));
57
+ headers = map({}, isSerializableHeaderValue, {
58
+ range: input.Range,
59
+ });
82
60
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/{Path+}";
83
- if (input.Path !== undefined) {
84
- labelValue = input.Path;
85
- if (labelValue.length <= 0) {
86
- throw new Error("Empty value provided for input HTTP label: Path.");
87
- }
88
- resolvedPath = resolvedPath.replace("{Path+}", labelValue
89
- .split("/")
90
- .map(function (segment) { return __extendedEncodeURIComponent(segment); })
91
- .join("/"));
92
- }
93
- else {
94
- throw new Error("No value provided for input HTTP label: Path.");
95
- }
61
+ resolvedPath = __resolvedPath(resolvedPath, input, "Path", function () { return input.Path; }, "{Path+}", true);
96
62
  return [2, new __HttpRequest({
97
63
  protocol: protocol,
98
64
  hostname: hostname,
@@ -114,7 +80,11 @@ export var serializeAws_restJson1ListItemsCommand = function (input, context) {
114
80
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
115
81
  headers = {};
116
82
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/";
117
- query = __assign(__assign(__assign({}, (input.Path !== undefined && { Path: input.Path })), (input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { NextToken: input.NextToken }));
83
+ query = map({
84
+ Path: [, input.Path],
85
+ MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
86
+ NextToken: [, input.NextToken],
87
+ });
118
88
  return [2, new __HttpRequest({
119
89
  protocol: protocol,
120
90
  hostname: hostname,
@@ -129,29 +99,21 @@ export var serializeAws_restJson1ListItemsCommand = function (input, context) {
129
99
  });
130
100
  }); };
131
101
  export var serializeAws_restJson1PutObjectCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
132
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
102
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
133
103
  return __generator(this, function (_c) {
134
104
  switch (_c.label) {
135
105
  case 0: return [4, context.endpoint()];
136
106
  case 1:
137
107
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
138
- headers = __assign(__assign(__assign(__assign({ "content-type": "application/octet-stream", "x-amz-content-sha256": "UNSIGNED-PAYLOAD" }, (isSerializableHeaderValue(input.ContentType) && { "content-type": input.ContentType })), (isSerializableHeaderValue(input.CacheControl) && { "cache-control": input.CacheControl })), (isSerializableHeaderValue(input.StorageClass) && { "x-amz-storage-class": input.StorageClass })), (isSerializableHeaderValue(input.UploadAvailability) && {
108
+ headers = map({}, isSerializableHeaderValue, {
109
+ "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
110
+ "content-type": input.ContentType || "application/octet-stream",
111
+ "cache-control": input.CacheControl,
112
+ "x-amz-storage-class": input.StorageClass,
139
113
  "x-amz-upload-availability": input.UploadAvailability,
140
- }));
114
+ });
141
115
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/{Path+}";
142
- if (input.Path !== undefined) {
143
- labelValue = input.Path;
144
- if (labelValue.length <= 0) {
145
- throw new Error("Empty value provided for input HTTP label: Path.");
146
- }
147
- resolvedPath = resolvedPath.replace("{Path+}", labelValue
148
- .split("/")
149
- .map(function (segment) { return __extendedEncodeURIComponent(segment); })
150
- .join("/"));
151
- }
152
- else {
153
- throw new Error("No value provided for input HTTP label: Path.");
154
- }
116
+ resolvedPath = __resolvedPath(resolvedPath, input, "Path", function () { return input.Path; }, "{Path+}", true);
155
117
  if (input.Body !== undefined) {
156
118
  body = input.Body;
157
119
  }
@@ -175,18 +137,18 @@ export var deserializeAws_restJson1DeleteObjectCommand = function (output, conte
175
137
  if (output.statusCode !== 200 && output.statusCode >= 300) {
176
138
  return [2, deserializeAws_restJson1DeleteObjectCommandError(output, context)];
177
139
  }
178
- contents = {
140
+ contents = map({
179
141
  $metadata: deserializeMetadata(output),
180
- };
142
+ });
181
143
  return [4, collectBody(output.body, context)];
182
144
  case 1:
183
145
  _a.sent();
184
- return [2, Promise.resolve(contents)];
146
+ return [2, contents];
185
147
  }
186
148
  });
187
149
  }); };
188
150
  var deserializeAws_restJson1DeleteObjectCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
189
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
151
+ var parsedOutput, _a, errorCode, _b, parsedBody;
190
152
  var _c;
191
153
  return __generator(this, function (_d) {
192
154
  switch (_d.label) {
@@ -215,14 +177,14 @@ var deserializeAws_restJson1DeleteObjectCommandError = function (output, context
215
177
  case 7: throw _d.sent();
216
178
  case 8:
217
179
  parsedBody = parsedOutput.body;
218
- $metadata = deserializeMetadata(output);
219
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
220
- response = new __BaseException({
221
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
222
- $fault: "client",
223
- $metadata: $metadata,
180
+ throwDefaultError({
181
+ output: output,
182
+ parsedBody: parsedBody,
183
+ exceptionCtor: __BaseException,
184
+ errorCode: errorCode,
224
185
  });
225
- throw __decorateServiceException(response, parsedBody);
186
+ _d.label = 9;
187
+ case 9: return [2];
226
188
  }
227
189
  });
228
190
  }); };
@@ -234,38 +196,29 @@ export var deserializeAws_restJson1DescribeObjectCommand = function (output, con
234
196
  if (output.statusCode !== 200 && output.statusCode >= 300) {
235
197
  return [2, deserializeAws_restJson1DescribeObjectCommandError(output, context)];
236
198
  }
237
- contents = {
199
+ contents = map({
238
200
  $metadata: deserializeMetadata(output),
239
- CacheControl: undefined,
240
- ContentLength: undefined,
241
- ContentType: undefined,
242
- ETag: undefined,
243
- LastModified: undefined,
244
- };
245
- if (output.headers["etag"] !== undefined) {
246
- contents.ETag = output.headers["etag"];
247
- }
248
- if (output.headers["content-type"] !== undefined) {
249
- contents.ContentType = output.headers["content-type"];
250
- }
251
- if (output.headers["content-length"] !== undefined) {
252
- contents.ContentLength = __strictParseLong(output.headers["content-length"]);
253
- }
254
- if (output.headers["cache-control"] !== undefined) {
255
- contents.CacheControl = output.headers["cache-control"];
256
- }
257
- if (output.headers["last-modified"] !== undefined) {
258
- contents.LastModified = __expectNonNull(__parseRfc7231DateTime(output.headers["last-modified"]));
259
- }
201
+ ETag: [, output.headers["etag"]],
202
+ ContentType: [, output.headers["content-type"]],
203
+ ContentLength: [
204
+ function () { return void 0 !== output.headers["content-length"]; },
205
+ function () { return __strictParseLong(output.headers["content-length"]); },
206
+ ],
207
+ CacheControl: [, output.headers["cache-control"]],
208
+ LastModified: [
209
+ function () { return void 0 !== output.headers["last-modified"]; },
210
+ function () { return __expectNonNull(__parseRfc7231DateTime(output.headers["last-modified"])); },
211
+ ],
212
+ });
260
213
  return [4, collectBody(output.body, context)];
261
214
  case 1:
262
215
  _a.sent();
263
- return [2, Promise.resolve(contents)];
216
+ return [2, contents];
264
217
  }
265
218
  });
266
219
  }); };
267
220
  var deserializeAws_restJson1DescribeObjectCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
268
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
221
+ var parsedOutput, _a, errorCode, _b, parsedBody;
269
222
  var _c;
270
223
  return __generator(this, function (_d) {
271
224
  switch (_d.label) {
@@ -294,14 +247,14 @@ var deserializeAws_restJson1DescribeObjectCommandError = function (output, conte
294
247
  case 7: throw _d.sent();
295
248
  case 8:
296
249
  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,
250
+ throwDefaultError({
251
+ output: output,
252
+ parsedBody: parsedBody,
253
+ exceptionCtor: __BaseException,
254
+ errorCode: errorCode,
303
255
  });
304
- throw __decorateServiceException(response, parsedBody);
256
+ _d.label = 9;
257
+ case 9: return [2];
305
258
  }
306
259
  });
307
260
  }); };
@@ -311,45 +264,31 @@ export var deserializeAws_restJson1GetObjectCommand = function (output, context)
311
264
  if (output.statusCode !== 200 && output.statusCode >= 300) {
312
265
  return [2, deserializeAws_restJson1GetObjectCommandError(output, context)];
313
266
  }
314
- contents = {
267
+ contents = map({
315
268
  $metadata: deserializeMetadata(output),
316
- Body: undefined,
317
- CacheControl: undefined,
318
- ContentLength: undefined,
319
- ContentRange: undefined,
320
- ContentType: undefined,
321
- ETag: undefined,
322
- LastModified: undefined,
323
- StatusCode: undefined,
324
- };
325
- if (output.headers["cache-control"] !== undefined) {
326
- contents.CacheControl = output.headers["cache-control"];
327
- }
328
- if (output.headers["content-range"] !== undefined) {
329
- contents.ContentRange = output.headers["content-range"];
330
- }
331
- if (output.headers["content-length"] !== undefined) {
332
- contents.ContentLength = __strictParseLong(output.headers["content-length"]);
333
- }
334
- if (output.headers["content-type"] !== undefined) {
335
- contents.ContentType = output.headers["content-type"];
336
- }
337
- if (output.headers["etag"] !== undefined) {
338
- contents.ETag = output.headers["etag"];
339
- }
340
- if (output.headers["last-modified"] !== undefined) {
341
- contents.LastModified = __expectNonNull(__parseRfc7231DateTime(output.headers["last-modified"]));
342
- }
269
+ CacheControl: [, output.headers["cache-control"]],
270
+ ContentRange: [, output.headers["content-range"]],
271
+ ContentLength: [
272
+ function () { return void 0 !== output.headers["content-length"]; },
273
+ function () { return __strictParseLong(output.headers["content-length"]); },
274
+ ],
275
+ ContentType: [, output.headers["content-type"]],
276
+ ETag: [, output.headers["etag"]],
277
+ LastModified: [
278
+ function () { return void 0 !== output.headers["last-modified"]; },
279
+ function () { return __expectNonNull(__parseRfc7231DateTime(output.headers["last-modified"])); },
280
+ ],
281
+ });
343
282
  data = output.body;
344
283
  contents.Body = data;
345
- if (contents.StatusCode === undefined) {
346
- contents.StatusCode = output.statusCode;
347
- }
348
- return [2, Promise.resolve(contents)];
284
+ map(contents, {
285
+ StatusCode: [, output.statusCode],
286
+ });
287
+ return [2, contents];
349
288
  });
350
289
  }); };
351
290
  var deserializeAws_restJson1GetObjectCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
352
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
291
+ var parsedOutput, _a, errorCode, _b, parsedBody;
353
292
  var _c;
354
293
  return __generator(this, function (_d) {
355
294
  switch (_d.label) {
@@ -382,14 +321,14 @@ var deserializeAws_restJson1GetObjectCommandError = function (output, context) {
382
321
  case 9: throw _d.sent();
383
322
  case 10:
384
323
  parsedBody = parsedOutput.body;
385
- $metadata = deserializeMetadata(output);
386
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
387
- response = new __BaseException({
388
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
389
- $fault: "client",
390
- $metadata: $metadata,
324
+ throwDefaultError({
325
+ output: output,
326
+ parsedBody: parsedBody,
327
+ exceptionCtor: __BaseException,
328
+ errorCode: errorCode,
391
329
  });
392
- throw __decorateServiceException(response, parsedBody);
330
+ _d.label = 11;
331
+ case 11: return [2];
393
332
  }
394
333
  });
395
334
  }); };
@@ -401,28 +340,26 @@ export var deserializeAws_restJson1ListItemsCommand = function (output, context)
401
340
  if (output.statusCode !== 200 && output.statusCode >= 300) {
402
341
  return [2, deserializeAws_restJson1ListItemsCommandError(output, context)];
403
342
  }
404
- contents = {
343
+ contents = map({
405
344
  $metadata: deserializeMetadata(output),
406
- Items: undefined,
407
- NextToken: undefined,
408
- };
345
+ });
409
346
  _a = __expectNonNull;
410
347
  _b = __expectObject;
411
348
  return [4, parseBody(output.body, context)];
412
349
  case 1:
413
350
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
414
- if (data.Items !== undefined && data.Items !== null) {
351
+ if (data.Items != null) {
415
352
  contents.Items = deserializeAws_restJson1ItemList(data.Items, context);
416
353
  }
417
- if (data.NextToken !== undefined && data.NextToken !== null) {
354
+ if (data.NextToken != null) {
418
355
  contents.NextToken = __expectString(data.NextToken);
419
356
  }
420
- return [2, Promise.resolve(contents)];
357
+ return [2, contents];
421
358
  }
422
359
  });
423
360
  }); };
424
361
  var deserializeAws_restJson1ListItemsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
425
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
362
+ var parsedOutput, _a, errorCode, _b, parsedBody;
426
363
  var _c;
427
364
  return __generator(this, function (_d) {
428
365
  switch (_d.label) {
@@ -447,14 +384,14 @@ var deserializeAws_restJson1ListItemsCommandError = function (output, context) {
447
384
  case 5: throw _d.sent();
448
385
  case 6:
449
386
  parsedBody = parsedOutput.body;
450
- $metadata = deserializeMetadata(output);
451
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
452
- response = new __BaseException({
453
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
454
- $fault: "client",
455
- $metadata: $metadata,
387
+ throwDefaultError({
388
+ output: output,
389
+ parsedBody: parsedBody,
390
+ exceptionCtor: __BaseException,
391
+ errorCode: errorCode,
456
392
  });
457
- throw __decorateServiceException(response, parsedBody);
393
+ _d.label = 7;
394
+ case 7: return [2];
458
395
  }
459
396
  });
460
397
  }); };
@@ -466,32 +403,29 @@ export var deserializeAws_restJson1PutObjectCommand = function (output, context)
466
403
  if (output.statusCode !== 200 && output.statusCode >= 300) {
467
404
  return [2, deserializeAws_restJson1PutObjectCommandError(output, context)];
468
405
  }
469
- contents = {
406
+ contents = map({
470
407
  $metadata: deserializeMetadata(output),
471
- ContentSHA256: undefined,
472
- ETag: undefined,
473
- StorageClass: undefined,
474
- };
408
+ });
475
409
  _a = __expectNonNull;
476
410
  _b = __expectObject;
477
411
  return [4, parseBody(output.body, context)];
478
412
  case 1:
479
413
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
480
- if (data.ContentSHA256 !== undefined && data.ContentSHA256 !== null) {
414
+ if (data.ContentSHA256 != null) {
481
415
  contents.ContentSHA256 = __expectString(data.ContentSHA256);
482
416
  }
483
- if (data.ETag !== undefined && data.ETag !== null) {
417
+ if (data.ETag != null) {
484
418
  contents.ETag = __expectString(data.ETag);
485
419
  }
486
- if (data.StorageClass !== undefined && data.StorageClass !== null) {
420
+ if (data.StorageClass != null) {
487
421
  contents.StorageClass = __expectString(data.StorageClass);
488
422
  }
489
- return [2, Promise.resolve(contents)];
423
+ return [2, contents];
490
424
  }
491
425
  });
492
426
  }); };
493
427
  var deserializeAws_restJson1PutObjectCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
494
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
428
+ var parsedOutput, _a, errorCode, _b, parsedBody;
495
429
  var _c;
496
430
  return __generator(this, function (_d) {
497
431
  switch (_d.label) {
@@ -516,23 +450,24 @@ var deserializeAws_restJson1PutObjectCommandError = function (output, context) {
516
450
  case 5: throw _d.sent();
517
451
  case 6:
518
452
  parsedBody = parsedOutput.body;
519
- $metadata = deserializeMetadata(output);
520
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
521
- response = new __BaseException({
522
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
523
- $fault: "client",
524
- $metadata: $metadata,
453
+ throwDefaultError({
454
+ output: output,
455
+ parsedBody: parsedBody,
456
+ exceptionCtor: __BaseException,
457
+ errorCode: errorCode,
525
458
  });
526
- throw __decorateServiceException(response, parsedBody);
459
+ _d.label = 7;
460
+ case 7: return [2];
527
461
  }
528
462
  });
529
463
  }); };
464
+ var map = __map;
530
465
  var deserializeAws_restJson1ContainerNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
531
466
  var contents, data, exception;
532
467
  return __generator(this, function (_a) {
533
- contents = {};
468
+ contents = map({});
534
469
  data = parsedOutput.body;
535
- if (data.Message !== undefined && data.Message !== null) {
470
+ if (data.Message != null) {
536
471
  contents.Message = __expectString(data.Message);
537
472
  }
538
473
  exception = new ContainerNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -542,9 +477,9 @@ var deserializeAws_restJson1ContainerNotFoundExceptionResponse = function (parse
542
477
  var deserializeAws_restJson1InternalServerErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
543
478
  var contents, data, exception;
544
479
  return __generator(this, function (_a) {
545
- contents = {};
480
+ contents = map({});
546
481
  data = parsedOutput.body;
547
- if (data.Message !== undefined && data.Message !== null) {
482
+ if (data.Message != null) {
548
483
  contents.Message = __expectString(data.Message);
549
484
  }
550
485
  exception = new InternalServerError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -554,9 +489,9 @@ var deserializeAws_restJson1InternalServerErrorResponse = function (parsedOutput
554
489
  var deserializeAws_restJson1ObjectNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
555
490
  var contents, data, exception;
556
491
  return __generator(this, function (_a) {
557
- contents = {};
492
+ contents = map({});
558
493
  data = parsedOutput.body;
559
- if (data.Message !== undefined && data.Message !== null) {
494
+ if (data.Message != null) {
560
495
  contents.Message = __expectString(data.Message);
561
496
  }
562
497
  exception = new ObjectNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -566,9 +501,9 @@ var deserializeAws_restJson1ObjectNotFoundExceptionResponse = function (parsedOu
566
501
  var deserializeAws_restJson1RequestedRangeNotSatisfiableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
567
502
  var contents, data, exception;
568
503
  return __generator(this, function (_a) {
569
- contents = {};
504
+ contents = map({});
570
505
  data = parsedOutput.body;
571
- if (data.Message !== undefined && data.Message !== null) {
506
+ if (data.Message != null) {
572
507
  contents.Message = __expectString(data.Message);
573
508
  }
574
509
  exception = new RequestedRangeNotSatisfiableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-mediastore-data",
3
3
  "description": "AWS SDK for JavaScript Mediastore Data Client for Node.js, Browser and React Native",
4
- "version": "3.141.0",
4
+ "version": "3.150.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",
@@ -20,9 +20,9 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "2.0.0",
22
22
  "@aws-crypto/sha256-js": "2.0.0",
23
- "@aws-sdk/client-sts": "3.141.0",
23
+ "@aws-sdk/client-sts": "3.150.0",
24
24
  "@aws-sdk/config-resolver": "3.130.0",
25
- "@aws-sdk/credential-provider-node": "3.141.0",
25
+ "@aws-sdk/credential-provider-node": "3.150.0",
26
26
  "@aws-sdk/fetch-http-handler": "3.131.0",
27
27
  "@aws-sdk/hash-node": "3.127.0",
28
28
  "@aws-sdk/invalid-dependency": "3.127.0",
@@ -38,15 +38,15 @@
38
38
  "@aws-sdk/node-config-provider": "3.127.0",
39
39
  "@aws-sdk/node-http-handler": "3.127.0",
40
40
  "@aws-sdk/protocol-http": "3.127.0",
41
- "@aws-sdk/smithy-client": "3.137.0",
41
+ "@aws-sdk/smithy-client": "3.142.0",
42
42
  "@aws-sdk/types": "3.127.0",
43
43
  "@aws-sdk/url-parser": "3.127.0",
44
44
  "@aws-sdk/util-base64-browser": "3.109.0",
45
45
  "@aws-sdk/util-base64-node": "3.55.0",
46
46
  "@aws-sdk/util-body-length-browser": "3.55.0",
47
47
  "@aws-sdk/util-body-length-node": "3.55.0",
48
- "@aws-sdk/util-defaults-mode-browser": "3.137.0",
49
- "@aws-sdk/util-defaults-mode-node": "3.137.0",
48
+ "@aws-sdk/util-defaults-mode-browser": "3.142.0",
49
+ "@aws-sdk/util-defaults-mode-node": "3.142.0",
50
50
  "@aws-sdk/util-user-agent-browser": "3.127.0",
51
51
  "@aws-sdk/util-user-agent-node": "3.127.0",
52
52
  "@aws-sdk/util-utf8-browser": "3.109.0",
@@ -65,6 +65,11 @@
65
65
  "typedoc": "0.19.2",
66
66
  "typescript": "~4.6.2"
67
67
  },
68
+ "overrides": {
69
+ "typedoc": {
70
+ "typescript": "~4.6.2"
71
+ }
72
+ },
68
73
  "engines": {
69
74
  "node": ">=12.0.0"
70
75
  },