@aws-sdk/client-mediastore-data 3.312.0 → 3.316.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,82 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MediaStoreData = void 0;
4
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
4
5
  const DeleteObjectCommand_1 = require("./commands/DeleteObjectCommand");
5
6
  const DescribeObjectCommand_1 = require("./commands/DescribeObjectCommand");
6
7
  const GetObjectCommand_1 = require("./commands/GetObjectCommand");
7
8
  const ListItemsCommand_1 = require("./commands/ListItemsCommand");
8
9
  const PutObjectCommand_1 = require("./commands/PutObjectCommand");
9
10
  const MediaStoreDataClient_1 = require("./MediaStoreDataClient");
11
+ const commands = {
12
+ DeleteObjectCommand: DeleteObjectCommand_1.DeleteObjectCommand,
13
+ DescribeObjectCommand: DescribeObjectCommand_1.DescribeObjectCommand,
14
+ GetObjectCommand: GetObjectCommand_1.GetObjectCommand,
15
+ ListItemsCommand: ListItemsCommand_1.ListItemsCommand,
16
+ PutObjectCommand: PutObjectCommand_1.PutObjectCommand,
17
+ };
10
18
  class MediaStoreData extends MediaStoreDataClient_1.MediaStoreDataClient {
11
- deleteObject(args, optionsOrCb, cb) {
12
- const command = new DeleteObjectCommand_1.DeleteObjectCommand(args);
13
- if (typeof optionsOrCb === "function") {
14
- this.send(command, optionsOrCb);
15
- }
16
- else if (typeof cb === "function") {
17
- if (typeof optionsOrCb !== "object")
18
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
19
- this.send(command, optionsOrCb || {}, cb);
20
- }
21
- else {
22
- return this.send(command, optionsOrCb);
23
- }
24
- }
25
- describeObject(args, optionsOrCb, cb) {
26
- const command = new DescribeObjectCommand_1.DescribeObjectCommand(args);
27
- if (typeof optionsOrCb === "function") {
28
- this.send(command, optionsOrCb);
29
- }
30
- else if (typeof cb === "function") {
31
- if (typeof optionsOrCb !== "object")
32
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
33
- this.send(command, optionsOrCb || {}, cb);
34
- }
35
- else {
36
- return this.send(command, optionsOrCb);
37
- }
38
- }
39
- getObject(args, optionsOrCb, cb) {
40
- const command = new GetObjectCommand_1.GetObjectCommand(args);
41
- if (typeof optionsOrCb === "function") {
42
- this.send(command, optionsOrCb);
43
- }
44
- else if (typeof cb === "function") {
45
- if (typeof optionsOrCb !== "object")
46
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
47
- this.send(command, optionsOrCb || {}, cb);
48
- }
49
- else {
50
- return this.send(command, optionsOrCb);
51
- }
52
- }
53
- listItems(args, optionsOrCb, cb) {
54
- const command = new ListItemsCommand_1.ListItemsCommand(args);
55
- if (typeof optionsOrCb === "function") {
56
- this.send(command, optionsOrCb);
57
- }
58
- else if (typeof cb === "function") {
59
- if (typeof optionsOrCb !== "object")
60
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
61
- this.send(command, optionsOrCb || {}, cb);
62
- }
63
- else {
64
- return this.send(command, optionsOrCb);
65
- }
66
- }
67
- putObject(args, optionsOrCb, cb) {
68
- const command = new PutObjectCommand_1.PutObjectCommand(args);
69
- if (typeof optionsOrCb === "function") {
70
- this.send(command, optionsOrCb);
71
- }
72
- else if (typeof cb === "function") {
73
- if (typeof optionsOrCb !== "object")
74
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
75
- this.send(command, optionsOrCb || {}, cb);
76
- }
77
- else {
78
- return this.send(command, optionsOrCb);
79
- }
80
- }
81
19
  }
82
20
  exports.MediaStoreData = MediaStoreData;
21
+ (0, smithy_client_1.createAggregatedClient)(commands, MediaStoreData);
@@ -41,7 +41,7 @@ const se_DescribeObjectCommand = async (input, context) => {
41
41
  exports.se_DescribeObjectCommand = se_DescribeObjectCommand;
42
42
  const se_GetObjectCommand = async (input, context) => {
43
43
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
44
- const headers = map({}, isSerializableHeaderValue, {
44
+ const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
45
45
  range: input.Range,
46
46
  });
47
47
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
@@ -62,7 +62,7 @@ const se_ListItemsCommand = async (input, context) => {
62
62
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
63
63
  const headers = {};
64
64
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
65
- const query = map({
65
+ const query = (0, smithy_client_1.map)({
66
66
  Path: [, input.Path],
67
67
  MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
68
68
  NextToken: [, input.NextToken],
@@ -82,7 +82,7 @@ const se_ListItemsCommand = async (input, context) => {
82
82
  exports.se_ListItemsCommand = se_ListItemsCommand;
83
83
  const se_PutObjectCommand = async (input, context) => {
84
84
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
85
- const headers = map({}, isSerializableHeaderValue, {
85
+ const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
86
86
  "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
87
87
  "content-type": input.ContentType || "application/octet-stream",
88
88
  "cache-control": input.CacheControl,
@@ -110,7 +110,7 @@ const de_DeleteObjectCommand = async (output, context) => {
110
110
  if (output.statusCode !== 200 && output.statusCode >= 300) {
111
111
  return de_DeleteObjectCommandError(output, context);
112
112
  }
113
- const contents = map({
113
+ const contents = (0, smithy_client_1.map)({
114
114
  $metadata: deserializeMetadata(output),
115
115
  });
116
116
  await collectBody(output.body, context);
@@ -135,10 +135,9 @@ const de_DeleteObjectCommandError = async (output, context) => {
135
135
  throw await de_ObjectNotFoundExceptionRes(parsedOutput, context);
136
136
  default:
137
137
  const parsedBody = parsedOutput.body;
138
- (0, smithy_client_1.throwDefaultError)({
138
+ return throwDefaultError({
139
139
  output,
140
140
  parsedBody,
141
- exceptionCtor: MediaStoreDataServiceException_1.MediaStoreDataServiceException,
142
141
  errorCode,
143
142
  });
144
143
  }
@@ -147,7 +146,7 @@ const de_DescribeObjectCommand = async (output, context) => {
147
146
  if (output.statusCode !== 200 && output.statusCode >= 300) {
148
147
  return de_DescribeObjectCommandError(output, context);
149
148
  }
150
- const contents = map({
149
+ const contents = (0, smithy_client_1.map)({
151
150
  $metadata: deserializeMetadata(output),
152
151
  ETag: [, output.headers["etag"]],
153
152
  ContentType: [, output.headers["content-type"]],
@@ -183,10 +182,9 @@ const de_DescribeObjectCommandError = async (output, context) => {
183
182
  throw await de_ObjectNotFoundExceptionRes(parsedOutput, context);
184
183
  default:
185
184
  const parsedBody = parsedOutput.body;
186
- (0, smithy_client_1.throwDefaultError)({
185
+ return throwDefaultError({
187
186
  output,
188
187
  parsedBody,
189
- exceptionCtor: MediaStoreDataServiceException_1.MediaStoreDataServiceException,
190
188
  errorCode,
191
189
  });
192
190
  }
@@ -195,7 +193,7 @@ const de_GetObjectCommand = async (output, context) => {
195
193
  if (output.statusCode !== 200 && output.statusCode >= 300) {
196
194
  return de_GetObjectCommandError(output, context);
197
195
  }
198
- const contents = map({
196
+ const contents = (0, smithy_client_1.map)({
199
197
  $metadata: deserializeMetadata(output),
200
198
  CacheControl: [, output.headers["cache-control"]],
201
199
  ContentRange: [, output.headers["content-range"]],
@@ -213,7 +211,7 @@ const de_GetObjectCommand = async (output, context) => {
213
211
  const data = output.body;
214
212
  context.sdkStreamMixin(data);
215
213
  contents.Body = data;
216
- map(contents, {
214
+ (0, smithy_client_1.map)(contents, {
217
215
  StatusCode: [, output.statusCode],
218
216
  });
219
217
  return contents;
@@ -240,10 +238,9 @@ const de_GetObjectCommandError = async (output, context) => {
240
238
  throw await de_RequestedRangeNotSatisfiableExceptionRes(parsedOutput, context);
241
239
  default:
242
240
  const parsedBody = parsedOutput.body;
243
- (0, smithy_client_1.throwDefaultError)({
241
+ return throwDefaultError({
244
242
  output,
245
243
  parsedBody,
246
- exceptionCtor: MediaStoreDataServiceException_1.MediaStoreDataServiceException,
247
244
  errorCode,
248
245
  });
249
246
  }
@@ -252,16 +249,15 @@ const de_ListItemsCommand = async (output, context) => {
252
249
  if (output.statusCode !== 200 && output.statusCode >= 300) {
253
250
  return de_ListItemsCommandError(output, context);
254
251
  }
255
- const contents = map({
252
+ const contents = (0, smithy_client_1.map)({
256
253
  $metadata: deserializeMetadata(output),
257
254
  });
258
255
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
259
- if (data.Items != null) {
260
- contents.Items = de_ItemList(data.Items, context);
261
- }
262
- if (data.NextToken != null) {
263
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
264
- }
256
+ const doc = (0, smithy_client_1.take)(data, {
257
+ Items: (_) => de_ItemList(_, context),
258
+ NextToken: smithy_client_1.expectString,
259
+ });
260
+ Object.assign(contents, doc);
265
261
  return contents;
266
262
  };
267
263
  exports.de_ListItemsCommand = de_ListItemsCommand;
@@ -280,10 +276,9 @@ const de_ListItemsCommandError = async (output, context) => {
280
276
  throw await de_InternalServerErrorRes(parsedOutput, context);
281
277
  default:
282
278
  const parsedBody = parsedOutput.body;
283
- (0, smithy_client_1.throwDefaultError)({
279
+ return throwDefaultError({
284
280
  output,
285
281
  parsedBody,
286
- exceptionCtor: MediaStoreDataServiceException_1.MediaStoreDataServiceException,
287
282
  errorCode,
288
283
  });
289
284
  }
@@ -292,19 +287,16 @@ const de_PutObjectCommand = async (output, context) => {
292
287
  if (output.statusCode !== 200 && output.statusCode >= 300) {
293
288
  return de_PutObjectCommandError(output, context);
294
289
  }
295
- const contents = map({
290
+ const contents = (0, smithy_client_1.map)({
296
291
  $metadata: deserializeMetadata(output),
297
292
  });
298
293
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
299
- if (data.ContentSHA256 != null) {
300
- contents.ContentSHA256 = (0, smithy_client_1.expectString)(data.ContentSHA256);
301
- }
302
- if (data.ETag != null) {
303
- contents.ETag = (0, smithy_client_1.expectString)(data.ETag);
304
- }
305
- if (data.StorageClass != null) {
306
- contents.StorageClass = (0, smithy_client_1.expectString)(data.StorageClass);
307
- }
294
+ const doc = (0, smithy_client_1.take)(data, {
295
+ ContentSHA256: smithy_client_1.expectString,
296
+ ETag: smithy_client_1.expectString,
297
+ StorageClass: smithy_client_1.expectString,
298
+ });
299
+ Object.assign(contents, doc);
308
300
  return contents;
309
301
  };
310
302
  exports.de_PutObjectCommand = de_PutObjectCommand;
@@ -323,21 +315,21 @@ const de_PutObjectCommandError = async (output, context) => {
323
315
  throw await de_InternalServerErrorRes(parsedOutput, context);
324
316
  default:
325
317
  const parsedBody = parsedOutput.body;
326
- (0, smithy_client_1.throwDefaultError)({
318
+ return throwDefaultError({
327
319
  output,
328
320
  parsedBody,
329
- exceptionCtor: MediaStoreDataServiceException_1.MediaStoreDataServiceException,
330
321
  errorCode,
331
322
  });
332
323
  }
333
324
  };
334
- const map = smithy_client_1.map;
325
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(MediaStoreDataServiceException_1.MediaStoreDataServiceException);
335
326
  const de_ContainerNotFoundExceptionRes = async (parsedOutput, context) => {
336
- const contents = map({});
327
+ const contents = (0, smithy_client_1.map)({});
337
328
  const data = parsedOutput.body;
338
- if (data.Message != null) {
339
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
340
- }
329
+ const doc = (0, smithy_client_1.take)(data, {
330
+ Message: smithy_client_1.expectString,
331
+ });
332
+ Object.assign(contents, doc);
341
333
  const exception = new models_0_1.ContainerNotFoundException({
342
334
  $metadata: deserializeMetadata(parsedOutput),
343
335
  ...contents,
@@ -345,11 +337,12 @@ const de_ContainerNotFoundExceptionRes = async (parsedOutput, context) => {
345
337
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
346
338
  };
347
339
  const de_InternalServerErrorRes = async (parsedOutput, context) => {
348
- const contents = map({});
340
+ const contents = (0, smithy_client_1.map)({});
349
341
  const data = parsedOutput.body;
350
- if (data.Message != null) {
351
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
352
- }
342
+ const doc = (0, smithy_client_1.take)(data, {
343
+ Message: smithy_client_1.expectString,
344
+ });
345
+ Object.assign(contents, doc);
353
346
  const exception = new models_0_1.InternalServerError({
354
347
  $metadata: deserializeMetadata(parsedOutput),
355
348
  ...contents,
@@ -357,11 +350,12 @@ const de_InternalServerErrorRes = async (parsedOutput, context) => {
357
350
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
358
351
  };
359
352
  const de_ObjectNotFoundExceptionRes = async (parsedOutput, context) => {
360
- const contents = map({});
353
+ const contents = (0, smithy_client_1.map)({});
361
354
  const data = parsedOutput.body;
362
- if (data.Message != null) {
363
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
364
- }
355
+ const doc = (0, smithy_client_1.take)(data, {
356
+ Message: smithy_client_1.expectString,
357
+ });
358
+ Object.assign(contents, doc);
365
359
  const exception = new models_0_1.ObjectNotFoundException({
366
360
  $metadata: deserializeMetadata(parsedOutput),
367
361
  ...contents,
@@ -369,11 +363,12 @@ const de_ObjectNotFoundExceptionRes = async (parsedOutput, context) => {
369
363
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
370
364
  };
371
365
  const de_RequestedRangeNotSatisfiableExceptionRes = async (parsedOutput, context) => {
372
- const contents = map({});
366
+ const contents = (0, smithy_client_1.map)({});
373
367
  const data = parsedOutput.body;
374
- if (data.Message != null) {
375
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
376
- }
368
+ const doc = (0, smithy_client_1.take)(data, {
369
+ Message: smithy_client_1.expectString,
370
+ });
371
+ Object.assign(contents, doc);
377
372
  const exception = new models_0_1.RequestedRangeNotSatisfiableException({
378
373
  $metadata: deserializeMetadata(parsedOutput),
379
374
  ...contents,
@@ -381,24 +376,19 @@ const de_RequestedRangeNotSatisfiableExceptionRes = async (parsedOutput, context
381
376
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
382
377
  };
383
378
  const de_Item = (output, context) => {
384
- return {
385
- ContentLength: (0, smithy_client_1.expectLong)(output.ContentLength),
386
- ContentType: (0, smithy_client_1.expectString)(output.ContentType),
387
- ETag: (0, smithy_client_1.expectString)(output.ETag),
388
- LastModified: output.LastModified != null
389
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastModified)))
390
- : undefined,
391
- Name: (0, smithy_client_1.expectString)(output.Name),
392
- Type: (0, smithy_client_1.expectString)(output.Type),
393
- };
379
+ return (0, smithy_client_1.take)(output, {
380
+ ContentLength: smithy_client_1.expectLong,
381
+ ContentType: smithy_client_1.expectString,
382
+ ETag: smithy_client_1.expectString,
383
+ LastModified: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
384
+ Name: smithy_client_1.expectString,
385
+ Type: smithy_client_1.expectString,
386
+ });
394
387
  };
395
388
  const de_ItemList = (output, context) => {
396
389
  const retVal = (output || [])
397
390
  .filter((e) => e != null)
398
391
  .map((entry) => {
399
- if (entry === null) {
400
- return null;
401
- }
402
392
  return de_Item(entry, context);
403
393
  });
404
394
  return retVal;
@@ -1,78 +1,17 @@
1
+ import { createAggregatedClient } from "@aws-sdk/smithy-client";
1
2
  import { DeleteObjectCommand, } from "./commands/DeleteObjectCommand";
2
3
  import { DescribeObjectCommand, } from "./commands/DescribeObjectCommand";
3
4
  import { GetObjectCommand } from "./commands/GetObjectCommand";
4
5
  import { ListItemsCommand } from "./commands/ListItemsCommand";
5
6
  import { PutObjectCommand } from "./commands/PutObjectCommand";
6
7
  import { MediaStoreDataClient } from "./MediaStoreDataClient";
8
+ const commands = {
9
+ DeleteObjectCommand,
10
+ DescribeObjectCommand,
11
+ GetObjectCommand,
12
+ ListItemsCommand,
13
+ PutObjectCommand,
14
+ };
7
15
  export class MediaStoreData extends MediaStoreDataClient {
8
- deleteObject(args, optionsOrCb, cb) {
9
- const command = new DeleteObjectCommand(args);
10
- if (typeof optionsOrCb === "function") {
11
- this.send(command, optionsOrCb);
12
- }
13
- else if (typeof cb === "function") {
14
- if (typeof optionsOrCb !== "object")
15
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
16
- this.send(command, optionsOrCb || {}, cb);
17
- }
18
- else {
19
- return this.send(command, optionsOrCb);
20
- }
21
- }
22
- describeObject(args, optionsOrCb, cb) {
23
- const command = new DescribeObjectCommand(args);
24
- if (typeof optionsOrCb === "function") {
25
- this.send(command, optionsOrCb);
26
- }
27
- else if (typeof cb === "function") {
28
- if (typeof optionsOrCb !== "object")
29
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
30
- this.send(command, optionsOrCb || {}, cb);
31
- }
32
- else {
33
- return this.send(command, optionsOrCb);
34
- }
35
- }
36
- getObject(args, optionsOrCb, cb) {
37
- const command = new GetObjectCommand(args);
38
- if (typeof optionsOrCb === "function") {
39
- this.send(command, optionsOrCb);
40
- }
41
- else if (typeof cb === "function") {
42
- if (typeof optionsOrCb !== "object")
43
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
44
- this.send(command, optionsOrCb || {}, cb);
45
- }
46
- else {
47
- return this.send(command, optionsOrCb);
48
- }
49
- }
50
- listItems(args, optionsOrCb, cb) {
51
- const command = new ListItemsCommand(args);
52
- if (typeof optionsOrCb === "function") {
53
- this.send(command, optionsOrCb);
54
- }
55
- else if (typeof cb === "function") {
56
- if (typeof optionsOrCb !== "object")
57
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
58
- this.send(command, optionsOrCb || {}, cb);
59
- }
60
- else {
61
- return this.send(command, optionsOrCb);
62
- }
63
- }
64
- putObject(args, optionsOrCb, cb) {
65
- const command = new PutObjectCommand(args);
66
- if (typeof optionsOrCb === "function") {
67
- this.send(command, optionsOrCb);
68
- }
69
- else if (typeof cb === "function") {
70
- if (typeof optionsOrCb !== "object")
71
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
72
- this.send(command, optionsOrCb || {}, cb);
73
- }
74
- else {
75
- return this.send(command, optionsOrCb);
76
- }
77
- }
78
16
  }
17
+ createAggregatedClient(commands, MediaStoreData);
@@ -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, parseRfc7231DateTime as __parseRfc7231DateTime, resolvedPath as __resolvedPath, strictParseLong as __strictParseLong, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, parseRfc7231DateTime as __parseRfc7231DateTime, resolvedPath as __resolvedPath, strictParseLong as __strictParseLong, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { MediaStoreDataServiceException as __BaseException } from "../models/MediaStoreDataServiceException";
4
4
  import { ContainerNotFoundException, InternalServerError, ObjectNotFoundException, RequestedRangeNotSatisfiableException, } from "../models/models_0";
5
5
  export const se_DeleteObjectCommand = async (input, context) => {
@@ -126,10 +126,9 @@ const de_DeleteObjectCommandError = async (output, context) => {
126
126
  throw await de_ObjectNotFoundExceptionRes(parsedOutput, context);
127
127
  default:
128
128
  const parsedBody = parsedOutput.body;
129
- throwDefaultError({
129
+ return throwDefaultError({
130
130
  output,
131
131
  parsedBody,
132
- exceptionCtor: __BaseException,
133
132
  errorCode,
134
133
  });
135
134
  }
@@ -173,10 +172,9 @@ const de_DescribeObjectCommandError = async (output, context) => {
173
172
  throw await de_ObjectNotFoundExceptionRes(parsedOutput, context);
174
173
  default:
175
174
  const parsedBody = parsedOutput.body;
176
- throwDefaultError({
175
+ return throwDefaultError({
177
176
  output,
178
177
  parsedBody,
179
- exceptionCtor: __BaseException,
180
178
  errorCode,
181
179
  });
182
180
  }
@@ -229,10 +227,9 @@ const de_GetObjectCommandError = async (output, context) => {
229
227
  throw await de_RequestedRangeNotSatisfiableExceptionRes(parsedOutput, context);
230
228
  default:
231
229
  const parsedBody = parsedOutput.body;
232
- throwDefaultError({
230
+ return throwDefaultError({
233
231
  output,
234
232
  parsedBody,
235
- exceptionCtor: __BaseException,
236
233
  errorCode,
237
234
  });
238
235
  }
@@ -245,12 +242,11 @@ export const de_ListItemsCommand = async (output, context) => {
245
242
  $metadata: deserializeMetadata(output),
246
243
  });
247
244
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
248
- if (data.Items != null) {
249
- contents.Items = de_ItemList(data.Items, context);
250
- }
251
- if (data.NextToken != null) {
252
- contents.NextToken = __expectString(data.NextToken);
253
- }
245
+ const doc = take(data, {
246
+ Items: (_) => de_ItemList(_, context),
247
+ NextToken: __expectString,
248
+ });
249
+ Object.assign(contents, doc);
254
250
  return contents;
255
251
  };
256
252
  const de_ListItemsCommandError = async (output, context) => {
@@ -268,10 +264,9 @@ const de_ListItemsCommandError = async (output, context) => {
268
264
  throw await de_InternalServerErrorRes(parsedOutput, context);
269
265
  default:
270
266
  const parsedBody = parsedOutput.body;
271
- throwDefaultError({
267
+ return throwDefaultError({
272
268
  output,
273
269
  parsedBody,
274
- exceptionCtor: __BaseException,
275
270
  errorCode,
276
271
  });
277
272
  }
@@ -284,15 +279,12 @@ export const de_PutObjectCommand = async (output, context) => {
284
279
  $metadata: deserializeMetadata(output),
285
280
  });
286
281
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
287
- if (data.ContentSHA256 != null) {
288
- contents.ContentSHA256 = __expectString(data.ContentSHA256);
289
- }
290
- if (data.ETag != null) {
291
- contents.ETag = __expectString(data.ETag);
292
- }
293
- if (data.StorageClass != null) {
294
- contents.StorageClass = __expectString(data.StorageClass);
295
- }
282
+ const doc = take(data, {
283
+ ContentSHA256: __expectString,
284
+ ETag: __expectString,
285
+ StorageClass: __expectString,
286
+ });
287
+ Object.assign(contents, doc);
296
288
  return contents;
297
289
  };
298
290
  const de_PutObjectCommandError = async (output, context) => {
@@ -310,21 +302,21 @@ const de_PutObjectCommandError = async (output, context) => {
310
302
  throw await de_InternalServerErrorRes(parsedOutput, context);
311
303
  default:
312
304
  const parsedBody = parsedOutput.body;
313
- throwDefaultError({
305
+ return throwDefaultError({
314
306
  output,
315
307
  parsedBody,
316
- exceptionCtor: __BaseException,
317
308
  errorCode,
318
309
  });
319
310
  }
320
311
  };
321
- const map = __map;
312
+ const throwDefaultError = withBaseException(__BaseException);
322
313
  const de_ContainerNotFoundExceptionRes = async (parsedOutput, context) => {
323
314
  const contents = map({});
324
315
  const data = parsedOutput.body;
325
- if (data.Message != null) {
326
- contents.Message = __expectString(data.Message);
327
- }
316
+ const doc = take(data, {
317
+ Message: __expectString,
318
+ });
319
+ Object.assign(contents, doc);
328
320
  const exception = new ContainerNotFoundException({
329
321
  $metadata: deserializeMetadata(parsedOutput),
330
322
  ...contents,
@@ -334,9 +326,10 @@ const de_ContainerNotFoundExceptionRes = async (parsedOutput, context) => {
334
326
  const de_InternalServerErrorRes = async (parsedOutput, context) => {
335
327
  const contents = map({});
336
328
  const data = parsedOutput.body;
337
- if (data.Message != null) {
338
- contents.Message = __expectString(data.Message);
339
- }
329
+ const doc = take(data, {
330
+ Message: __expectString,
331
+ });
332
+ Object.assign(contents, doc);
340
333
  const exception = new InternalServerError({
341
334
  $metadata: deserializeMetadata(parsedOutput),
342
335
  ...contents,
@@ -346,9 +339,10 @@ const de_InternalServerErrorRes = async (parsedOutput, context) => {
346
339
  const de_ObjectNotFoundExceptionRes = async (parsedOutput, context) => {
347
340
  const contents = map({});
348
341
  const data = parsedOutput.body;
349
- if (data.Message != null) {
350
- contents.Message = __expectString(data.Message);
351
- }
342
+ const doc = take(data, {
343
+ Message: __expectString,
344
+ });
345
+ Object.assign(contents, doc);
352
346
  const exception = new ObjectNotFoundException({
353
347
  $metadata: deserializeMetadata(parsedOutput),
354
348
  ...contents,
@@ -358,9 +352,10 @@ const de_ObjectNotFoundExceptionRes = async (parsedOutput, context) => {
358
352
  const de_RequestedRangeNotSatisfiableExceptionRes = async (parsedOutput, context) => {
359
353
  const contents = map({});
360
354
  const data = parsedOutput.body;
361
- if (data.Message != null) {
362
- contents.Message = __expectString(data.Message);
363
- }
355
+ const doc = take(data, {
356
+ Message: __expectString,
357
+ });
358
+ Object.assign(contents, doc);
364
359
  const exception = new RequestedRangeNotSatisfiableException({
365
360
  $metadata: deserializeMetadata(parsedOutput),
366
361
  ...contents,
@@ -368,24 +363,19 @@ const de_RequestedRangeNotSatisfiableExceptionRes = async (parsedOutput, context
368
363
  return __decorateServiceException(exception, parsedOutput.body);
369
364
  };
370
365
  const de_Item = (output, context) => {
371
- return {
372
- ContentLength: __expectLong(output.ContentLength),
373
- ContentType: __expectString(output.ContentType),
374
- ETag: __expectString(output.ETag),
375
- LastModified: output.LastModified != null
376
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastModified)))
377
- : undefined,
378
- Name: __expectString(output.Name),
379
- Type: __expectString(output.Type),
380
- };
366
+ return take(output, {
367
+ ContentLength: __expectLong,
368
+ ContentType: __expectString,
369
+ ETag: __expectString,
370
+ LastModified: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
371
+ Name: __expectString,
372
+ Type: __expectString,
373
+ });
381
374
  };
382
375
  const de_ItemList = (output, context) => {
383
376
  const retVal = (output || [])
384
377
  .filter((e) => e != null)
385
378
  .map((entry) => {
386
- if (entry === null) {
387
- return null;
388
- }
389
379
  return de_Item(entry, context);
390
380
  });
391
381
  return retVal;
@@ -5,47 +5,43 @@ import { GetObjectCommandInput, GetObjectCommandOutput } from "./commands/GetObj
5
5
  import { ListItemsCommandInput, ListItemsCommandOutput } from "./commands/ListItemsCommand";
6
6
  import { PutObjectCommandInput, PutObjectCommandOutput } from "./commands/PutObjectCommand";
7
7
  import { MediaStoreDataClient } from "./MediaStoreDataClient";
8
- /**
9
- * @public
10
- * <p>An AWS Elemental MediaStore asset is an object, similar to an object in the Amazon S3
11
- * service. Objects are the fundamental entities that are stored in AWS Elemental
12
- * MediaStore.</p>
13
- */
14
- export declare class MediaStoreData extends MediaStoreDataClient {
8
+ export interface MediaStoreData {
15
9
  /**
16
- * @public
17
- * <p>Deletes an object at the specified path.</p>
10
+ * @see {@link DeleteObjectCommand}
18
11
  */
19
12
  deleteObject(args: DeleteObjectCommandInput, options?: __HttpHandlerOptions): Promise<DeleteObjectCommandOutput>;
20
13
  deleteObject(args: DeleteObjectCommandInput, cb: (err: any, data?: DeleteObjectCommandOutput) => void): void;
21
14
  deleteObject(args: DeleteObjectCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteObjectCommandOutput) => void): void;
22
15
  /**
23
- * @public
24
- * <p>Gets the headers for an object at the specified path.</p>
16
+ * @see {@link DescribeObjectCommand}
25
17
  */
26
18
  describeObject(args: DescribeObjectCommandInput, options?: __HttpHandlerOptions): Promise<DescribeObjectCommandOutput>;
27
19
  describeObject(args: DescribeObjectCommandInput, cb: (err: any, data?: DescribeObjectCommandOutput) => void): void;
28
20
  describeObject(args: DescribeObjectCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeObjectCommandOutput) => void): void;
29
21
  /**
30
- * @public
31
- * <p>Downloads the object at the specified path. If the object’s upload availability is set to <code>streaming</code>, AWS Elemental MediaStore downloads the object even if it’s still uploading the object.</p>
22
+ * @see {@link GetObjectCommand}
32
23
  */
33
24
  getObject(args: GetObjectCommandInput, options?: __HttpHandlerOptions): Promise<GetObjectCommandOutput>;
34
25
  getObject(args: GetObjectCommandInput, cb: (err: any, data?: GetObjectCommandOutput) => void): void;
35
26
  getObject(args: GetObjectCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetObjectCommandOutput) => void): void;
36
27
  /**
37
- * @public
38
- * <p>Provides a list of metadata entries about folders and objects in the specified
39
- * folder.</p>
28
+ * @see {@link ListItemsCommand}
40
29
  */
41
30
  listItems(args: ListItemsCommandInput, options?: __HttpHandlerOptions): Promise<ListItemsCommandOutput>;
42
31
  listItems(args: ListItemsCommandInput, cb: (err: any, data?: ListItemsCommandOutput) => void): void;
43
32
  listItems(args: ListItemsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListItemsCommandOutput) => void): void;
44
33
  /**
45
- * @public
46
- * <p>Uploads an object to the specified path. Object sizes are limited to 25 MB for standard upload availability and 10 MB for streaming upload availability.</p>
34
+ * @see {@link PutObjectCommand}
47
35
  */
48
36
  putObject(args: PutObjectCommandInput, options?: __HttpHandlerOptions): Promise<PutObjectCommandOutput>;
49
37
  putObject(args: PutObjectCommandInput, cb: (err: any, data?: PutObjectCommandOutput) => void): void;
50
38
  putObject(args: PutObjectCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutObjectCommandOutput) => void): void;
51
39
  }
40
+ /**
41
+ * @public
42
+ * <p>An AWS Elemental MediaStore asset is an object, similar to an object in the Amazon S3
43
+ * service. Objects are the fundamental entities that are stored in AWS Elemental
44
+ * MediaStore.</p>
45
+ */
46
+ export declare class MediaStoreData extends MediaStoreDataClient implements MediaStoreData {
47
+ }
@@ -20,7 +20,7 @@ import {
20
20
  PutObjectCommandOutput,
21
21
  } from "./commands/PutObjectCommand";
22
22
  import { MediaStoreDataClient } from "./MediaStoreDataClient";
23
- export declare class MediaStoreData extends MediaStoreDataClient {
23
+ export interface MediaStoreData {
24
24
  deleteObject(
25
25
  args: DeleteObjectCommandInput,
26
26
  options?: __HttpHandlerOptions
@@ -87,3 +87,6 @@ export declare class MediaStoreData extends MediaStoreDataClient {
87
87
  cb: (err: any, data?: PutObjectCommandOutput) => void
88
88
  ): void;
89
89
  }
90
+ export declare class MediaStoreData
91
+ extends MediaStoreDataClient
92
+ implements MediaStoreData {}
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.312.0",
4
+ "version": "3.316.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",
@@ -23,9 +23,9 @@
23
23
  "dependencies": {
24
24
  "@aws-crypto/sha256-browser": "3.0.0",
25
25
  "@aws-crypto/sha256-js": "3.0.0",
26
- "@aws-sdk/client-sts": "3.312.0",
26
+ "@aws-sdk/client-sts": "3.316.0",
27
27
  "@aws-sdk/config-resolver": "3.310.0",
28
- "@aws-sdk/credential-provider-node": "3.310.0",
28
+ "@aws-sdk/credential-provider-node": "3.316.0",
29
29
  "@aws-sdk/fetch-http-handler": "3.310.0",
30
30
  "@aws-sdk/hash-node": "3.310.0",
31
31
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -42,14 +42,14 @@
42
42
  "@aws-sdk/node-config-provider": "3.310.0",
43
43
  "@aws-sdk/node-http-handler": "3.310.0",
44
44
  "@aws-sdk/protocol-http": "3.310.0",
45
- "@aws-sdk/smithy-client": "3.310.0",
45
+ "@aws-sdk/smithy-client": "3.316.0",
46
46
  "@aws-sdk/types": "3.310.0",
47
47
  "@aws-sdk/url-parser": "3.310.0",
48
48
  "@aws-sdk/util-base64": "3.310.0",
49
49
  "@aws-sdk/util-body-length-browser": "3.310.0",
50
50
  "@aws-sdk/util-body-length-node": "3.310.0",
51
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
52
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
51
+ "@aws-sdk/util-defaults-mode-browser": "3.316.0",
52
+ "@aws-sdk/util-defaults-mode-node": "3.316.0",
53
53
  "@aws-sdk/util-endpoints": "3.310.0",
54
54
  "@aws-sdk/util-retry": "3.310.0",
55
55
  "@aws-sdk/util-stream-browser": "3.310.0",