@aws-sdk/client-kinesis-video-archived-media 3.82.0 → 3.87.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,36 @@
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.87.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.86.0...v3.87.0) (2022-05-09)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-kinesis-video-archived-media
9
+
10
+
11
+
12
+
13
+
14
+ # [3.85.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.84.0...v3.85.0) (2022-05-05)
15
+
16
+
17
+ ### Features
18
+
19
+ * **codegen:** add codegen indicator comment to all generated files ([#3592](https://github.com/aws/aws-sdk-js-v3/issues/3592)) ([567a530](https://github.com/aws/aws-sdk-js-v3/commit/567a5304232fcc1f9db3fd3df545054de8336b4b))
20
+
21
+
22
+
23
+
24
+
25
+ # [3.83.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.82.0...v3.83.0) (2022-05-03)
26
+
27
+
28
+ ### Features
29
+
30
+ * **client-kinesis-video-archived-media:** Add support for GetImages API for retrieving images from a video stream ([a775394](https://github.com/aws/aws-sdk-js-v3/commit/a7753942b4a4d2d76a094a2253da537a34462cd7))
31
+
32
+
33
+
34
+
35
+
6
36
  # [3.82.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.81.0...v3.82.0) (2022-05-02)
7
37
 
8
38
  **Note:** Version bump only for package @aws-sdk/client-kinesis-video-archived-media
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ <!-- generated file, do not edit directly -->
2
+
1
3
  # @aws-sdk/client-kinesis-video-archived-media
2
4
 
3
5
  [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kinesis-video-archived-media/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-video-archived-media)
@@ -4,6 +4,7 @@ exports.KinesisVideoArchivedMedia = void 0;
4
4
  const GetClipCommand_1 = require("./commands/GetClipCommand");
5
5
  const GetDASHStreamingSessionURLCommand_1 = require("./commands/GetDASHStreamingSessionURLCommand");
6
6
  const GetHLSStreamingSessionURLCommand_1 = require("./commands/GetHLSStreamingSessionURLCommand");
7
+ const GetImagesCommand_1 = require("./commands/GetImagesCommand");
7
8
  const GetMediaForFragmentListCommand_1 = require("./commands/GetMediaForFragmentListCommand");
8
9
  const ListFragmentsCommand_1 = require("./commands/ListFragmentsCommand");
9
10
  const KinesisVideoArchivedMediaClient_1 = require("./KinesisVideoArchivedMediaClient");
@@ -50,6 +51,20 @@ class KinesisVideoArchivedMedia extends KinesisVideoArchivedMediaClient_1.Kinesi
50
51
  return this.send(command, optionsOrCb);
51
52
  }
52
53
  }
54
+ getImages(args, optionsOrCb, cb) {
55
+ const command = new GetImagesCommand_1.GetImagesCommand(args);
56
+ if (typeof optionsOrCb === "function") {
57
+ this.send(command, optionsOrCb);
58
+ }
59
+ else if (typeof cb === "function") {
60
+ if (typeof optionsOrCb !== "object")
61
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
62
+ this.send(command, optionsOrCb || {}, cb);
63
+ }
64
+ else {
65
+ return this.send(command, optionsOrCb);
66
+ }
67
+ }
53
68
  getMediaForFragmentList(args, optionsOrCb, cb) {
54
69
  const command = new GetMediaForFragmentListCommand_1.GetMediaForFragmentListCommand(args);
55
70
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetImagesCommand = void 0;
4
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
8
+ class GetImagesCommand extends smithy_client_1.Command {
9
+ constructor(input) {
10
+ super();
11
+ this.input = input;
12
+ }
13
+ resolveMiddleware(clientStack, configuration, options) {
14
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
15
+ const stack = clientStack.concat(this.middlewareStack);
16
+ const { logger } = configuration;
17
+ const clientName = "KinesisVideoArchivedMediaClient";
18
+ const commandName = "GetImagesCommand";
19
+ const handlerExecutionContext = {
20
+ logger,
21
+ clientName,
22
+ commandName,
23
+ inputFilterSensitiveLog: models_0_1.GetImagesInput.filterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.GetImagesOutput.filterSensitiveLog,
25
+ };
26
+ const { requestHandler } = configuration;
27
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
28
+ }
29
+ serialize(input, context) {
30
+ return (0, Aws_restJson1_1.serializeAws_restJson1GetImagesCommand)(input, context);
31
+ }
32
+ deserialize(output, context) {
33
+ return (0, Aws_restJson1_1.deserializeAws_restJson1GetImagesCommand)(output, context);
34
+ }
35
+ }
36
+ exports.GetImagesCommand = GetImagesCommand;
@@ -4,5 +4,6 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./GetClipCommand"), exports);
5
5
  tslib_1.__exportStar(require("./GetDASHStreamingSessionURLCommand"), exports);
6
6
  tslib_1.__exportStar(require("./GetHLSStreamingSessionURLCommand"), exports);
7
+ tslib_1.__exportStar(require("./GetImagesCommand"), exports);
7
8
  tslib_1.__exportStar(require("./GetMediaForFragmentListCommand"), exports);
8
9
  tslib_1.__exportStar(require("./ListFragmentsCommand"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListFragmentsOutput = exports.Fragment = exports.ListFragmentsInput = exports.FragmentSelector = exports.TimestampRange = exports.FragmentSelectorType = exports.GetMediaForFragmentListOutput = exports.GetMediaForFragmentListInput = exports.GetHLSStreamingSessionURLOutput = exports.GetHLSStreamingSessionURLInput = exports.HLSPlaybackMode = exports.HLSFragmentSelector = exports.HLSTimestampRange = exports.HLSFragmentSelectorType = exports.HLSDisplayFragmentTimestamp = exports.HLSDiscontinuityMode = exports.ContainerFormat = exports.GetDASHStreamingSessionURLOutput = exports.GetDASHStreamingSessionURLInput = exports.DASHPlaybackMode = exports.DASHDisplayFragmentTimestamp = exports.DASHDisplayFragmentNumber = exports.DASHFragmentSelector = exports.DASHTimestampRange = exports.DASHFragmentSelectorType = exports.UnsupportedStreamMediaTypeException = exports.ResourceNotFoundException = exports.NotAuthorizedException = exports.NoDataRetentionException = exports.MissingCodecPrivateDataException = exports.InvalidMediaFrameException = exports.InvalidCodecPrivateDataException = exports.InvalidArgumentException = exports.GetClipOutput = exports.GetClipInput = exports.ClipFragmentSelector = exports.ClipTimestampRange = exports.ClipFragmentSelectorType = exports.ClientLimitExceededException = void 0;
3
+ exports.ListFragmentsOutput = exports.Fragment = exports.ListFragmentsInput = exports.FragmentSelector = exports.TimestampRange = exports.FragmentSelectorType = exports.GetMediaForFragmentListOutput = exports.GetMediaForFragmentListInput = exports.GetImagesOutput = exports.Image = exports.ImageError = exports.GetImagesInput = exports.ImageSelectorType = exports.FormatConfigKey = exports.Format = exports.GetHLSStreamingSessionURLOutput = exports.GetHLSStreamingSessionURLInput = exports.HLSPlaybackMode = exports.HLSFragmentSelector = exports.HLSTimestampRange = exports.HLSFragmentSelectorType = exports.HLSDisplayFragmentTimestamp = exports.HLSDiscontinuityMode = exports.ContainerFormat = exports.GetDASHStreamingSessionURLOutput = exports.GetDASHStreamingSessionURLInput = exports.DASHPlaybackMode = exports.DASHDisplayFragmentTimestamp = exports.DASHDisplayFragmentNumber = exports.DASHFragmentSelector = exports.DASHTimestampRange = exports.DASHFragmentSelectorType = exports.UnsupportedStreamMediaTypeException = exports.ResourceNotFoundException = exports.NotAuthorizedException = exports.NoDataRetentionException = exports.MissingCodecPrivateDataException = exports.InvalidMediaFrameException = exports.InvalidCodecPrivateDataException = exports.InvalidArgumentException = exports.GetClipOutput = exports.GetClipInput = exports.ClipFragmentSelector = exports.ClipTimestampRange = exports.ClipFragmentSelectorType = exports.ClientLimitExceededException = void 0;
4
4
  const KinesisVideoArchivedMediaServiceException_1 = require("./KinesisVideoArchivedMediaServiceException");
5
5
  class ClientLimitExceededException extends KinesisVideoArchivedMediaServiceException_1.KinesisVideoArchivedMediaServiceException {
6
6
  constructor(opts) {
@@ -253,6 +253,43 @@ var GetHLSStreamingSessionURLOutput;
253
253
  ...obj,
254
254
  });
255
255
  })(GetHLSStreamingSessionURLOutput = exports.GetHLSStreamingSessionURLOutput || (exports.GetHLSStreamingSessionURLOutput = {}));
256
+ var Format;
257
+ (function (Format) {
258
+ Format["JPEG"] = "JPEG";
259
+ Format["PNG"] = "PNG";
260
+ })(Format = exports.Format || (exports.Format = {}));
261
+ var FormatConfigKey;
262
+ (function (FormatConfigKey) {
263
+ FormatConfigKey["JPEGQuality"] = "JPEGQuality";
264
+ })(FormatConfigKey = exports.FormatConfigKey || (exports.FormatConfigKey = {}));
265
+ var ImageSelectorType;
266
+ (function (ImageSelectorType) {
267
+ ImageSelectorType["PRODUCER_TIMESTAMP"] = "PRODUCER_TIMESTAMP";
268
+ ImageSelectorType["SERVER_TIMESTAMP"] = "SERVER_TIMESTAMP";
269
+ })(ImageSelectorType = exports.ImageSelectorType || (exports.ImageSelectorType = {}));
270
+ var GetImagesInput;
271
+ (function (GetImagesInput) {
272
+ GetImagesInput.filterSensitiveLog = (obj) => ({
273
+ ...obj,
274
+ });
275
+ })(GetImagesInput = exports.GetImagesInput || (exports.GetImagesInput = {}));
276
+ var ImageError;
277
+ (function (ImageError) {
278
+ ImageError["MEDIA_ERROR"] = "MEDIA_ERROR";
279
+ ImageError["NO_MEDIA"] = "NO_MEDIA";
280
+ })(ImageError = exports.ImageError || (exports.ImageError = {}));
281
+ var Image;
282
+ (function (Image) {
283
+ Image.filterSensitiveLog = (obj) => ({
284
+ ...obj,
285
+ });
286
+ })(Image = exports.Image || (exports.Image = {}));
287
+ var GetImagesOutput;
288
+ (function (GetImagesOutput) {
289
+ GetImagesOutput.filterSensitiveLog = (obj) => ({
290
+ ...obj,
291
+ });
292
+ })(GetImagesOutput = exports.GetImagesOutput || (exports.GetImagesOutput = {}));
256
293
  var GetMediaForFragmentListInput;
257
294
  (function (GetMediaForFragmentListInput) {
258
295
  GetMediaForFragmentListInput.filterSensitiveLog = (obj) => ({
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_restJson1ListFragmentsCommand = exports.deserializeAws_restJson1GetMediaForFragmentListCommand = exports.deserializeAws_restJson1GetHLSStreamingSessionURLCommand = exports.deserializeAws_restJson1GetDASHStreamingSessionURLCommand = exports.deserializeAws_restJson1GetClipCommand = exports.serializeAws_restJson1ListFragmentsCommand = exports.serializeAws_restJson1GetMediaForFragmentListCommand = exports.serializeAws_restJson1GetHLSStreamingSessionURLCommand = exports.serializeAws_restJson1GetDASHStreamingSessionURLCommand = exports.serializeAws_restJson1GetClipCommand = void 0;
3
+ exports.deserializeAws_restJson1ListFragmentsCommand = exports.deserializeAws_restJson1GetMediaForFragmentListCommand = exports.deserializeAws_restJson1GetImagesCommand = exports.deserializeAws_restJson1GetHLSStreamingSessionURLCommand = exports.deserializeAws_restJson1GetDASHStreamingSessionURLCommand = exports.deserializeAws_restJson1GetClipCommand = exports.serializeAws_restJson1ListFragmentsCommand = exports.serializeAws_restJson1GetMediaForFragmentListCommand = exports.serializeAws_restJson1GetImagesCommand = exports.serializeAws_restJson1GetHLSStreamingSessionURLCommand = exports.serializeAws_restJson1GetDASHStreamingSessionURLCommand = exports.serializeAws_restJson1GetClipCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const KinesisVideoArchivedMediaServiceException_1 = require("../models/KinesisVideoArchivedMediaServiceException");
@@ -103,6 +103,43 @@ const serializeAws_restJson1GetHLSStreamingSessionURLCommand = async (input, con
103
103
  });
104
104
  };
105
105
  exports.serializeAws_restJson1GetHLSStreamingSessionURLCommand = serializeAws_restJson1GetHLSStreamingSessionURLCommand;
106
+ const serializeAws_restJson1GetImagesCommand = async (input, context) => {
107
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
108
+ const headers = {
109
+ "content-type": "application/json",
110
+ };
111
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/getImages";
112
+ let body;
113
+ body = JSON.stringify({
114
+ ...(input.EndTimestamp !== undefined &&
115
+ input.EndTimestamp !== null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }),
116
+ ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }),
117
+ ...(input.FormatConfig !== undefined &&
118
+ input.FormatConfig !== null && { FormatConfig: serializeAws_restJson1FormatConfig(input.FormatConfig, context) }),
119
+ ...(input.HeightPixels !== undefined && input.HeightPixels !== null && { HeightPixels: input.HeightPixels }),
120
+ ...(input.ImageSelectorType !== undefined &&
121
+ input.ImageSelectorType !== null && { ImageSelectorType: input.ImageSelectorType }),
122
+ ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
123
+ ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
124
+ ...(input.SamplingInterval !== undefined &&
125
+ input.SamplingInterval !== null && { SamplingInterval: input.SamplingInterval }),
126
+ ...(input.StartTimestamp !== undefined &&
127
+ input.StartTimestamp !== null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
128
+ ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }),
129
+ ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }),
130
+ ...(input.WidthPixels !== undefined && input.WidthPixels !== null && { WidthPixels: input.WidthPixels }),
131
+ });
132
+ return new protocol_http_1.HttpRequest({
133
+ protocol,
134
+ hostname,
135
+ port,
136
+ method: "POST",
137
+ headers,
138
+ path: resolvedPath,
139
+ body,
140
+ });
141
+ };
142
+ exports.serializeAws_restJson1GetImagesCommand = serializeAws_restJson1GetImagesCommand;
106
143
  const serializeAws_restJson1GetMediaForFragmentListCommand = async (input, context) => {
107
144
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
108
145
  const headers = {
@@ -334,6 +371,56 @@ const deserializeAws_restJson1GetHLSStreamingSessionURLCommandError = async (out
334
371
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
335
372
  }
336
373
  };
374
+ const deserializeAws_restJson1GetImagesCommand = async (output, context) => {
375
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
376
+ return deserializeAws_restJson1GetImagesCommandError(output, context);
377
+ }
378
+ const contents = {
379
+ $metadata: deserializeMetadata(output),
380
+ Images: undefined,
381
+ NextToken: undefined,
382
+ };
383
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
384
+ if (data.Images !== undefined && data.Images !== null) {
385
+ contents.Images = deserializeAws_restJson1Images(data.Images, context);
386
+ }
387
+ if (data.NextToken !== undefined && data.NextToken !== null) {
388
+ contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
389
+ }
390
+ return Promise.resolve(contents);
391
+ };
392
+ exports.deserializeAws_restJson1GetImagesCommand = deserializeAws_restJson1GetImagesCommand;
393
+ const deserializeAws_restJson1GetImagesCommandError = async (output, context) => {
394
+ const parsedOutput = {
395
+ ...output,
396
+ body: await parseBody(output.body, context),
397
+ };
398
+ let response;
399
+ let errorCode = "UnknownError";
400
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
401
+ switch (errorCode) {
402
+ case "ClientLimitExceededException":
403
+ case "com.amazonaws.kinesisvideoarchivedmedia#ClientLimitExceededException":
404
+ throw await deserializeAws_restJson1ClientLimitExceededExceptionResponse(parsedOutput, context);
405
+ case "InvalidArgumentException":
406
+ case "com.amazonaws.kinesisvideoarchivedmedia#InvalidArgumentException":
407
+ throw await deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context);
408
+ case "NotAuthorizedException":
409
+ case "com.amazonaws.kinesisvideoarchivedmedia#NotAuthorizedException":
410
+ throw await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context);
411
+ case "ResourceNotFoundException":
412
+ case "com.amazonaws.kinesisvideoarchivedmedia#ResourceNotFoundException":
413
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
414
+ default:
415
+ const parsedBody = parsedOutput.body;
416
+ response = new KinesisVideoArchivedMediaServiceException_1.KinesisVideoArchivedMediaServiceException({
417
+ name: parsedBody.code || parsedBody.Code || errorCode,
418
+ $fault: "client",
419
+ $metadata: deserializeMetadata(output),
420
+ });
421
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
422
+ }
423
+ };
337
424
  const deserializeAws_restJson1GetMediaForFragmentListCommand = async (output, context) => {
338
425
  if (output.statusCode !== 200 && output.statusCode >= 300) {
339
426
  return deserializeAws_restJson1GetMediaForFragmentListCommandError(output, context);
@@ -576,6 +663,17 @@ const serializeAws_restJson1DASHTimestampRange = (input, context) => {
576
663
  input.StartTimestamp !== null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
577
664
  };
578
665
  };
666
+ const serializeAws_restJson1FormatConfig = (input, context) => {
667
+ return Object.entries(input).reduce((acc, [key, value]) => {
668
+ if (value === null) {
669
+ return acc;
670
+ }
671
+ return {
672
+ ...acc,
673
+ [key]: value,
674
+ };
675
+ }, {});
676
+ };
579
677
  const serializeAws_restJson1FragmentNumberList = (input, context) => {
580
678
  return input
581
679
  .filter((e) => e != null)
@@ -646,6 +744,26 @@ const deserializeAws_restJson1FragmentList = (output, context) => {
646
744
  });
647
745
  return retVal;
648
746
  };
747
+ const deserializeAws_restJson1Image = (output, context) => {
748
+ return {
749
+ Error: (0, smithy_client_1.expectString)(output.Error),
750
+ ImageContent: (0, smithy_client_1.expectString)(output.ImageContent),
751
+ TimeStamp: output.TimeStamp !== undefined && output.TimeStamp !== null
752
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.TimeStamp)))
753
+ : undefined,
754
+ };
755
+ };
756
+ const deserializeAws_restJson1Images = (output, context) => {
757
+ const retVal = (output || [])
758
+ .filter((e) => e != null)
759
+ .map((entry) => {
760
+ if (entry === null) {
761
+ return null;
762
+ }
763
+ return deserializeAws_restJson1Image(entry, context);
764
+ });
765
+ return retVal;
766
+ };
649
767
  const deserializeMetadata = (output) => {
650
768
  var _a;
651
769
  return ({
@@ -2,6 +2,7 @@ import { __extends } from "tslib";
2
2
  import { GetClipCommand } from "./commands/GetClipCommand";
3
3
  import { GetDASHStreamingSessionURLCommand, } from "./commands/GetDASHStreamingSessionURLCommand";
4
4
  import { GetHLSStreamingSessionURLCommand, } from "./commands/GetHLSStreamingSessionURLCommand";
5
+ import { GetImagesCommand } from "./commands/GetImagesCommand";
5
6
  import { GetMediaForFragmentListCommand, } from "./commands/GetMediaForFragmentListCommand";
6
7
  import { ListFragmentsCommand, } from "./commands/ListFragmentsCommand";
7
8
  import { KinesisVideoArchivedMediaClient } from "./KinesisVideoArchivedMediaClient";
@@ -52,6 +53,20 @@ var KinesisVideoArchivedMedia = (function (_super) {
52
53
  return this.send(command, optionsOrCb);
53
54
  }
54
55
  };
56
+ KinesisVideoArchivedMedia.prototype.getImages = function (args, optionsOrCb, cb) {
57
+ var command = new GetImagesCommand(args);
58
+ if (typeof optionsOrCb === "function") {
59
+ this.send(command, optionsOrCb);
60
+ }
61
+ else if (typeof cb === "function") {
62
+ if (typeof optionsOrCb !== "object")
63
+ throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
64
+ this.send(command, optionsOrCb || {}, cb);
65
+ }
66
+ else {
67
+ return this.send(command, optionsOrCb);
68
+ }
69
+ };
55
70
  KinesisVideoArchivedMedia.prototype.getMediaForFragmentList = function (args, optionsOrCb, cb) {
56
71
  var command = new GetMediaForFragmentListCommand(args);
57
72
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,39 @@
1
+ import { __extends } from "tslib";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { GetImagesInput, GetImagesOutput } from "../models/models_0";
5
+ import { deserializeAws_restJson1GetImagesCommand, serializeAws_restJson1GetImagesCommand, } from "../protocols/Aws_restJson1";
6
+ var GetImagesCommand = (function (_super) {
7
+ __extends(GetImagesCommand, _super);
8
+ function GetImagesCommand(input) {
9
+ var _this = _super.call(this) || this;
10
+ _this.input = input;
11
+ return _this;
12
+ }
13
+ GetImagesCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
14
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
+ var stack = clientStack.concat(this.middlewareStack);
16
+ var logger = configuration.logger;
17
+ var clientName = "KinesisVideoArchivedMediaClient";
18
+ var commandName = "GetImagesCommand";
19
+ var handlerExecutionContext = {
20
+ logger: logger,
21
+ clientName: clientName,
22
+ commandName: commandName,
23
+ inputFilterSensitiveLog: GetImagesInput.filterSensitiveLog,
24
+ outputFilterSensitiveLog: GetImagesOutput.filterSensitiveLog,
25
+ };
26
+ var requestHandler = configuration.requestHandler;
27
+ return stack.resolve(function (request) {
28
+ return requestHandler.handle(request.request, options || {});
29
+ }, handlerExecutionContext);
30
+ };
31
+ GetImagesCommand.prototype.serialize = function (input, context) {
32
+ return serializeAws_restJson1GetImagesCommand(input, context);
33
+ };
34
+ GetImagesCommand.prototype.deserialize = function (output, context) {
35
+ return deserializeAws_restJson1GetImagesCommand(output, context);
36
+ };
37
+ return GetImagesCommand;
38
+ }($Command));
39
+ export { GetImagesCommand };
@@ -1,5 +1,6 @@
1
1
  export * from "./GetClipCommand";
2
2
  export * from "./GetDASHStreamingSessionURLCommand";
3
3
  export * from "./GetHLSStreamingSessionURLCommand";
4
+ export * from "./GetImagesCommand";
4
5
  export * from "./GetMediaForFragmentListCommand";
5
6
  export * from "./ListFragmentsCommand";
@@ -218,6 +218,37 @@ export var GetHLSStreamingSessionURLOutput;
218
218
  (function (GetHLSStreamingSessionURLOutput) {
219
219
  GetHLSStreamingSessionURLOutput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
220
220
  })(GetHLSStreamingSessionURLOutput || (GetHLSStreamingSessionURLOutput = {}));
221
+ export var Format;
222
+ (function (Format) {
223
+ Format["JPEG"] = "JPEG";
224
+ Format["PNG"] = "PNG";
225
+ })(Format || (Format = {}));
226
+ export var FormatConfigKey;
227
+ (function (FormatConfigKey) {
228
+ FormatConfigKey["JPEGQuality"] = "JPEGQuality";
229
+ })(FormatConfigKey || (FormatConfigKey = {}));
230
+ export var ImageSelectorType;
231
+ (function (ImageSelectorType) {
232
+ ImageSelectorType["PRODUCER_TIMESTAMP"] = "PRODUCER_TIMESTAMP";
233
+ ImageSelectorType["SERVER_TIMESTAMP"] = "SERVER_TIMESTAMP";
234
+ })(ImageSelectorType || (ImageSelectorType = {}));
235
+ export var GetImagesInput;
236
+ (function (GetImagesInput) {
237
+ GetImagesInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
238
+ })(GetImagesInput || (GetImagesInput = {}));
239
+ export var ImageError;
240
+ (function (ImageError) {
241
+ ImageError["MEDIA_ERROR"] = "MEDIA_ERROR";
242
+ ImageError["NO_MEDIA"] = "NO_MEDIA";
243
+ })(ImageError || (ImageError = {}));
244
+ export var Image;
245
+ (function (Image) {
246
+ Image.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
247
+ })(Image || (Image = {}));
248
+ export var GetImagesOutput;
249
+ (function (GetImagesOutput) {
250
+ GetImagesOutput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
251
+ })(GetImagesOutput || (GetImagesOutput = {}));
221
252
  export var GetMediaForFragmentListInput;
222
253
  (function (GetMediaForFragmentListInput) {
223
254
  GetMediaForFragmentListInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -1,4 +1,4 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
1
+ import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
3
  import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
4
4
  import { KinesisVideoArchivedMediaServiceException as __BaseException } from "../models/KinesisVideoArchivedMediaServiceException";
@@ -93,6 +93,35 @@ export var serializeAws_restJson1GetHLSStreamingSessionURLCommand = function (in
93
93
  }
94
94
  });
95
95
  }); };
96
+ export var serializeAws_restJson1GetImagesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
97
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
98
+ return __generator(this, function (_c) {
99
+ switch (_c.label) {
100
+ case 0: return [4, context.endpoint()];
101
+ case 1:
102
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
103
+ headers = {
104
+ "content-type": "application/json",
105
+ };
106
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/getImages";
107
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.EndTimestamp !== undefined &&
108
+ input.EndTimestamp !== null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) })), (input.Format !== undefined && input.Format !== null && { Format: input.Format })), (input.FormatConfig !== undefined &&
109
+ input.FormatConfig !== null && { FormatConfig: serializeAws_restJson1FormatConfig(input.FormatConfig, context) })), (input.HeightPixels !== undefined && input.HeightPixels !== null && { HeightPixels: input.HeightPixels })), (input.ImageSelectorType !== undefined &&
110
+ input.ImageSelectorType !== null && { ImageSelectorType: input.ImageSelectorType })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })), (input.SamplingInterval !== undefined &&
111
+ input.SamplingInterval !== null && { SamplingInterval: input.SamplingInterval })), (input.StartTimestamp !== undefined &&
112
+ input.StartTimestamp !== null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) })), (input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN })), (input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName })), (input.WidthPixels !== undefined && input.WidthPixels !== null && { WidthPixels: input.WidthPixels })));
113
+ return [2, new __HttpRequest({
114
+ protocol: protocol,
115
+ hostname: hostname,
116
+ port: port,
117
+ method: "POST",
118
+ headers: headers,
119
+ path: resolvedPath,
120
+ body: body,
121
+ })];
122
+ }
123
+ });
124
+ }); };
96
125
  export var serializeAws_restJson1GetMediaForFragmentListCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
97
126
  var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
98
127
  return __generator(this, function (_c) {
@@ -396,6 +425,78 @@ var deserializeAws_restJson1GetHLSStreamingSessionURLCommandError = function (ou
396
425
  }
397
426
  });
398
427
  }); };
428
+ export var deserializeAws_restJson1GetImagesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
429
+ var contents, data, _a, _b;
430
+ return __generator(this, function (_c) {
431
+ switch (_c.label) {
432
+ case 0:
433
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
434
+ return [2, deserializeAws_restJson1GetImagesCommandError(output, context)];
435
+ }
436
+ contents = {
437
+ $metadata: deserializeMetadata(output),
438
+ Images: undefined,
439
+ NextToken: undefined,
440
+ };
441
+ _a = __expectNonNull;
442
+ _b = __expectObject;
443
+ return [4, parseBody(output.body, context)];
444
+ case 1:
445
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
446
+ if (data.Images !== undefined && data.Images !== null) {
447
+ contents.Images = deserializeAws_restJson1Images(data.Images, context);
448
+ }
449
+ if (data.NextToken !== undefined && data.NextToken !== null) {
450
+ contents.NextToken = __expectString(data.NextToken);
451
+ }
452
+ return [2, Promise.resolve(contents)];
453
+ }
454
+ });
455
+ }); };
456
+ var deserializeAws_restJson1GetImagesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
457
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
458
+ var _c;
459
+ return __generator(this, function (_d) {
460
+ switch (_d.label) {
461
+ case 0:
462
+ _a = [__assign({}, output)];
463
+ _c = {};
464
+ return [4, parseBody(output.body, context)];
465
+ case 1:
466
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
467
+ errorCode = "UnknownError";
468
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
469
+ _b = errorCode;
470
+ switch (_b) {
471
+ case "ClientLimitExceededException": return [3, 2];
472
+ case "com.amazonaws.kinesisvideoarchivedmedia#ClientLimitExceededException": return [3, 2];
473
+ case "InvalidArgumentException": return [3, 4];
474
+ case "com.amazonaws.kinesisvideoarchivedmedia#InvalidArgumentException": return [3, 4];
475
+ case "NotAuthorizedException": return [3, 6];
476
+ case "com.amazonaws.kinesisvideoarchivedmedia#NotAuthorizedException": return [3, 6];
477
+ case "ResourceNotFoundException": return [3, 8];
478
+ case "com.amazonaws.kinesisvideoarchivedmedia#ResourceNotFoundException": return [3, 8];
479
+ }
480
+ return [3, 10];
481
+ case 2: return [4, deserializeAws_restJson1ClientLimitExceededExceptionResponse(parsedOutput, context)];
482
+ case 3: throw _d.sent();
483
+ case 4: return [4, deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context)];
484
+ case 5: throw _d.sent();
485
+ case 6: return [4, deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)];
486
+ case 7: throw _d.sent();
487
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
488
+ case 9: throw _d.sent();
489
+ case 10:
490
+ parsedBody = parsedOutput.body;
491
+ response = new __BaseException({
492
+ name: parsedBody.code || parsedBody.Code || errorCode,
493
+ $fault: "client",
494
+ $metadata: deserializeMetadata(output),
495
+ });
496
+ throw __decorateServiceException(response, parsedBody);
497
+ }
498
+ });
499
+ }); };
399
500
  export var deserializeAws_restJson1GetMediaForFragmentListCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
400
501
  var contents, data;
401
502
  return __generator(this, function (_a) {
@@ -663,6 +764,16 @@ var serializeAws_restJson1DASHTimestampRange = function (input, context) {
663
764
  input.EndTimestamp !== null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) })), (input.StartTimestamp !== undefined &&
664
765
  input.StartTimestamp !== null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }));
665
766
  };
767
+ var serializeAws_restJson1FormatConfig = function (input, context) {
768
+ return Object.entries(input).reduce(function (acc, _a) {
769
+ var _b;
770
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
771
+ if (value === null) {
772
+ return acc;
773
+ }
774
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
775
+ }, {});
776
+ };
666
777
  var serializeAws_restJson1FragmentNumberList = function (input, context) {
667
778
  return input
668
779
  .filter(function (e) { return e != null; })
@@ -721,6 +832,26 @@ var deserializeAws_restJson1FragmentList = function (output, context) {
721
832
  });
722
833
  return retVal;
723
834
  };
835
+ var deserializeAws_restJson1Image = function (output, context) {
836
+ return {
837
+ Error: __expectString(output.Error),
838
+ ImageContent: __expectString(output.ImageContent),
839
+ TimeStamp: output.TimeStamp !== undefined && output.TimeStamp !== null
840
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.TimeStamp)))
841
+ : undefined,
842
+ };
843
+ };
844
+ var deserializeAws_restJson1Images = function (output, context) {
845
+ var retVal = (output || [])
846
+ .filter(function (e) { return e != null; })
847
+ .map(function (entry) {
848
+ if (entry === null) {
849
+ return null;
850
+ }
851
+ return deserializeAws_restJson1Image(entry, context);
852
+ });
853
+ return retVal;
854
+ };
724
855
  var deserializeMetadata = function (output) {
725
856
  var _a;
726
857
  return ({
@@ -2,6 +2,7 @@ import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
2
2
  import { GetClipCommandInput, GetClipCommandOutput } from "./commands/GetClipCommand";
3
3
  import { GetDASHStreamingSessionURLCommandInput, GetDASHStreamingSessionURLCommandOutput } from "./commands/GetDASHStreamingSessionURLCommand";
4
4
  import { GetHLSStreamingSessionURLCommandInput, GetHLSStreamingSessionURLCommandOutput } from "./commands/GetHLSStreamingSessionURLCommand";
5
+ import { GetImagesCommandInput, GetImagesCommandOutput } from "./commands/GetImagesCommand";
5
6
  import { GetMediaForFragmentListCommandInput, GetMediaForFragmentListCommandOutput } from "./commands/GetMediaForFragmentListCommand";
6
7
  import { ListFragmentsCommandInput, ListFragmentsCommandOutput } from "./commands/ListFragmentsCommand";
7
8
  import { KinesisVideoArchivedMediaClient } from "./KinesisVideoArchivedMediaClient";
@@ -392,6 +393,12 @@ export declare class KinesisVideoArchivedMedia extends KinesisVideoArchivedMedia
392
393
  getHLSStreamingSessionURL(args: GetHLSStreamingSessionURLCommandInput, options?: __HttpHandlerOptions): Promise<GetHLSStreamingSessionURLCommandOutput>;
393
394
  getHLSStreamingSessionURL(args: GetHLSStreamingSessionURLCommandInput, cb: (err: any, data?: GetHLSStreamingSessionURLCommandOutput) => void): void;
394
395
  getHLSStreamingSessionURL(args: GetHLSStreamingSessionURLCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetHLSStreamingSessionURLCommandOutput) => void): void;
396
+ /**
397
+ * <p>Retrieves a list of Images corresponding to each timestamp for a given time range, sampling interval, and image format configuration.</p>
398
+ */
399
+ getImages(args: GetImagesCommandInput, options?: __HttpHandlerOptions): Promise<GetImagesCommandOutput>;
400
+ getImages(args: GetImagesCommandInput, cb: (err: any, data?: GetImagesCommandOutput) => void): void;
401
+ getImages(args: GetImagesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetImagesCommandOutput) => void): void;
395
402
  /**
396
403
  * <p>Gets media for a list of fragments (specified by fragment number) from the archived
397
404
  * data in an Amazon Kinesis video stream.</p>
@@ -9,10 +9,11 @@ import { BodyLengthCalculator as __BodyLengthCalculator, Credentials as __Creden
9
9
  import { GetClipCommandInput, GetClipCommandOutput } from "./commands/GetClipCommand";
10
10
  import { GetDASHStreamingSessionURLCommandInput, GetDASHStreamingSessionURLCommandOutput } from "./commands/GetDASHStreamingSessionURLCommand";
11
11
  import { GetHLSStreamingSessionURLCommandInput, GetHLSStreamingSessionURLCommandOutput } from "./commands/GetHLSStreamingSessionURLCommand";
12
+ import { GetImagesCommandInput, GetImagesCommandOutput } from "./commands/GetImagesCommand";
12
13
  import { GetMediaForFragmentListCommandInput, GetMediaForFragmentListCommandOutput } from "./commands/GetMediaForFragmentListCommand";
13
14
  import { ListFragmentsCommandInput, ListFragmentsCommandOutput } from "./commands/ListFragmentsCommand";
14
- export declare type ServiceInputTypes = GetClipCommandInput | GetDASHStreamingSessionURLCommandInput | GetHLSStreamingSessionURLCommandInput | GetMediaForFragmentListCommandInput | ListFragmentsCommandInput;
15
- export declare type ServiceOutputTypes = GetClipCommandOutput | GetDASHStreamingSessionURLCommandOutput | GetHLSStreamingSessionURLCommandOutput | GetMediaForFragmentListCommandOutput | ListFragmentsCommandOutput;
15
+ export declare type ServiceInputTypes = GetClipCommandInput | GetDASHStreamingSessionURLCommandInput | GetHLSStreamingSessionURLCommandInput | GetImagesCommandInput | GetMediaForFragmentListCommandInput | ListFragmentsCommandInput;
16
+ export declare type ServiceOutputTypes = GetClipCommandOutput | GetDASHStreamingSessionURLCommandOutput | GetHLSStreamingSessionURLCommandOutput | GetImagesCommandOutput | GetMediaForFragmentListCommandOutput | ListFragmentsCommandOutput;
16
17
  export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
17
18
  /**
18
19
  * The HTTP handler to use. Fetch in browser and Https in Nodejs.
@@ -0,0 +1,35 @@
1
+ import { Command as $Command } from "@aws-sdk/smithy-client";
2
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
+ import { KinesisVideoArchivedMediaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KinesisVideoArchivedMediaClient";
4
+ import { GetImagesInput, GetImagesOutput } from "../models/models_0";
5
+ export interface GetImagesCommandInput extends GetImagesInput {
6
+ }
7
+ export interface GetImagesCommandOutput extends GetImagesOutput, __MetadataBearer {
8
+ }
9
+ /**
10
+ * <p>Retrieves a list of Images corresponding to each timestamp for a given time range, sampling interval, and image format configuration.</p>
11
+ * @example
12
+ * Use a bare-bones client and the command you need to make an API call.
13
+ * ```javascript
14
+ * import { KinesisVideoArchivedMediaClient, GetImagesCommand } from "@aws-sdk/client-kinesis-video-archived-media"; // ES Modules import
15
+ * // const { KinesisVideoArchivedMediaClient, GetImagesCommand } = require("@aws-sdk/client-kinesis-video-archived-media"); // CommonJS import
16
+ * const client = new KinesisVideoArchivedMediaClient(config);
17
+ * const command = new GetImagesCommand(input);
18
+ * const response = await client.send(command);
19
+ * ```
20
+ *
21
+ * @see {@link GetImagesCommandInput} for command's `input` shape.
22
+ * @see {@link GetImagesCommandOutput} for command's `response` shape.
23
+ * @see {@link KinesisVideoArchivedMediaClientResolvedConfig | config} for KinesisVideoArchivedMediaClient's `config` shape.
24
+ *
25
+ */
26
+ export declare class GetImagesCommand extends $Command<GetImagesCommandInput, GetImagesCommandOutput, KinesisVideoArchivedMediaClientResolvedConfig> {
27
+ readonly input: GetImagesCommandInput;
28
+ constructor(input: GetImagesCommandInput);
29
+ /**
30
+ * @internal
31
+ */
32
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: KinesisVideoArchivedMediaClientResolvedConfig, options?: __HttpHandlerOptions): Handler<GetImagesCommandInput, GetImagesCommandOutput>;
33
+ private serialize;
34
+ private deserialize;
35
+ }
@@ -1,5 +1,6 @@
1
1
  export * from "./GetClipCommand";
2
2
  export * from "./GetDASHStreamingSessionURLCommand";
3
3
  export * from "./GetHLSStreamingSessionURLCommand";
4
+ export * from "./GetImagesCommand";
4
5
  export * from "./GetMediaForFragmentListCommand";
5
6
  export * from "./ListFragmentsCommand";
@@ -805,6 +805,144 @@ export declare namespace GetHLSStreamingSessionURLOutput {
805
805
  */
806
806
  const filterSensitiveLog: (obj: GetHLSStreamingSessionURLOutput) => any;
807
807
  }
808
+ export declare enum Format {
809
+ JPEG = "JPEG",
810
+ PNG = "PNG"
811
+ }
812
+ export declare enum FormatConfigKey {
813
+ JPEGQuality = "JPEGQuality"
814
+ }
815
+ export declare enum ImageSelectorType {
816
+ PRODUCER_TIMESTAMP = "PRODUCER_TIMESTAMP",
817
+ SERVER_TIMESTAMP = "SERVER_TIMESTAMP"
818
+ }
819
+ export interface GetImagesInput {
820
+ /**
821
+ * <p>The name of the stream from which to retrieve the images. You must specify either the <code>StreamName</code> or the <code>StreamARN</code>.</p>
822
+ */
823
+ StreamName?: string;
824
+ /**
825
+ * <p>The Amazon Resource Name (ARN) of the stream from which to retrieve the images. You must specify either the <code>StreamName</code> or the <code>StreamARN</code>.</p>
826
+ */
827
+ StreamARN?: string;
828
+ /**
829
+ * <p>The origin of the Server or Producer timestamps to use to generate the images.</p>
830
+ */
831
+ ImageSelectorType: ImageSelectorType | string | undefined;
832
+ /**
833
+ * <p>The starting point from which the images should be generated. This <code>StartTimestamp</code> must be within an inclusive range of timestamps for an image to be returned.</p>
834
+ */
835
+ StartTimestamp: Date | undefined;
836
+ /**
837
+ * <p>The end timestamp for the range of images to be generated.</p>
838
+ */
839
+ EndTimestamp: Date | undefined;
840
+ /**
841
+ * <p>The time interval in milliseconds (ms) at which the images need to be generated from the stream. The minimum value that can be provided is 3000 ms. If the timestamp range is less than the sampling interval, the Image from the <code>startTimestamp</code> will be returned if available.
842
+ * </p>
843
+ * <note>
844
+ * <p>The minimum value of 3000 ms is a soft limit. If needed, a lower sampling frequency can be requested.</p>
845
+ * </note>
846
+ */
847
+ SamplingInterval: number | undefined;
848
+ /**
849
+ * <p>The format that will be used to encode the image.</p>
850
+ */
851
+ Format: Format | string | undefined;
852
+ /**
853
+ * <p>The list of a key-value pair structure that contains extra parameters that can be applied when the image is generated. The <code>FormatConfig</code> key is the <code>JPEGQuality</code>, which indicates the JPEG quality key to be used to generate the image.
854
+ * The <code>FormatConfig</code> value accepts ints from 1 to 100. If the value is 1, the image will be generated with less quality and the best compression.
855
+ * If the value is 100, the image will be generated with the best quality and less compression. If no value is provided, the default value of the <code>JPEGQuality</code> key will be set to 80.</p>
856
+ */
857
+ FormatConfig?: {
858
+ [key: string]: string;
859
+ };
860
+ /**
861
+ * <p>The width of the output image that is used in conjunction with the <code>HeightPixels</code> parameter. When both <code>WidthPixels</code> and <code>HeightPixels</code> parameters are provided,
862
+ * the image will be stretched to fit the specified aspect ratio. If only the <code>WidthPixels</code> parameter is provided or if only the <code>HeightPixels</code> is provided, a <code>ValidationException</code> will be thrown.
863
+ * If neither parameter is provided, the original image size from the stream will be returned.</p>
864
+ */
865
+ WidthPixels?: number;
866
+ /**
867
+ * <p>The height of the output image that is used in conjunction with the <code>WidthPixels</code> parameter. When both <code>HeightPixels</code> and <code>WidthPixels</code> parameters are provided, the image will be stretched to fit the
868
+ * specified aspect ratio. If only the <code>HeightPixels</code> parameter is provided, its original aspect ratio will be used to calculate the <code>WidthPixels</code> ratio. If neither parameter is provided,
869
+ * the original image size will be returned.</p>
870
+ */
871
+ HeightPixels?: number;
872
+ /**
873
+ * <p>The maximum number of images to be returned by the API. </p>
874
+ * <note>
875
+ * <p>The default limit is 100 images per API response. The additional results will be paginated. </p>
876
+ * </note>
877
+ */
878
+ MaxResults?: number;
879
+ /**
880
+ * <p>A token that specifies where to start paginating the next set of Images. This is the <code>GetImages:NextToken</code> from a previously truncated response.</p>
881
+ */
882
+ NextToken?: string;
883
+ }
884
+ export declare namespace GetImagesInput {
885
+ /**
886
+ * @internal
887
+ */
888
+ const filterSensitiveLog: (obj: GetImagesInput) => any;
889
+ }
890
+ export declare enum ImageError {
891
+ MEDIA_ERROR = "MEDIA_ERROR",
892
+ NO_MEDIA = "NO_MEDIA"
893
+ }
894
+ /**
895
+ * <p>A structure that contains the <code>Timestamp</code>, <code>Error</code>, and <code>ImageContent</code>.</p>
896
+ */
897
+ export interface Image {
898
+ /**
899
+ * <p>An attribute of the <code>Image</code> object that is used to extract an image from the video stream. This field is used to manage gaps on images or to better understand the pagination
900
+ * window.</p>
901
+ */
902
+ TimeStamp?: Date;
903
+ /**
904
+ * <p>The error message shown when the image for the provided timestamp was not extracted due to a non-tryable error. An error will be returned if: </p>
905
+ * <ul>
906
+ * <li>
907
+ * <p>There is no media that exists for the specified <code>Timestamp</code>.</p>
908
+ * </li>
909
+ * </ul>
910
+ * <ul>
911
+ * <li>
912
+ * <p>The media for the specified time does not allow an image to be extracted. In this case the media is audio only, or the incorrect
913
+ * media has been ingested.</p>
914
+ * </li>
915
+ * </ul>
916
+ */
917
+ Error?: ImageError | string;
918
+ /**
919
+ * <p>An attribute of the <code>Image</code> object that is Base64 encoded.</p>
920
+ */
921
+ ImageContent?: string;
922
+ }
923
+ export declare namespace Image {
924
+ /**
925
+ * @internal
926
+ */
927
+ const filterSensitiveLog: (obj: Image) => any;
928
+ }
929
+ export interface GetImagesOutput {
930
+ /**
931
+ * <p>The list of images generated from the video stream. If there is no media available for the given timestamp, the <code>NO_MEDIA</code> error will be listed in the output.
932
+ * If an error occurs while the image is being generated, the <code>MEDIA_ERROR</code> will be listed in the output as the cause of the missing image. </p>
933
+ */
934
+ Images?: Image[];
935
+ /**
936
+ * <p>The encrypted token that was used in the request to get more images.</p>
937
+ */
938
+ NextToken?: string;
939
+ }
940
+ export declare namespace GetImagesOutput {
941
+ /**
942
+ * @internal
943
+ */
944
+ const filterSensitiveLog: (obj: GetImagesOutput) => any;
945
+ }
808
946
  export interface GetMediaForFragmentListInput {
809
947
  /**
810
948
  * <p>The name of the stream from which to retrieve fragment media. Specify either this parameter or the <code>StreamARN</code> parameter.</p>
@@ -3,15 +3,18 @@ import { SerdeContext as __SerdeContext } from "@aws-sdk/types";
3
3
  import { GetClipCommandInput, GetClipCommandOutput } from "../commands/GetClipCommand";
4
4
  import { GetDASHStreamingSessionURLCommandInput, GetDASHStreamingSessionURLCommandOutput } from "../commands/GetDASHStreamingSessionURLCommand";
5
5
  import { GetHLSStreamingSessionURLCommandInput, GetHLSStreamingSessionURLCommandOutput } from "../commands/GetHLSStreamingSessionURLCommand";
6
+ import { GetImagesCommandInput, GetImagesCommandOutput } from "../commands/GetImagesCommand";
6
7
  import { GetMediaForFragmentListCommandInput, GetMediaForFragmentListCommandOutput } from "../commands/GetMediaForFragmentListCommand";
7
8
  import { ListFragmentsCommandInput, ListFragmentsCommandOutput } from "../commands/ListFragmentsCommand";
8
9
  export declare const serializeAws_restJson1GetClipCommand: (input: GetClipCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
9
10
  export declare const serializeAws_restJson1GetDASHStreamingSessionURLCommand: (input: GetDASHStreamingSessionURLCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
10
11
  export declare const serializeAws_restJson1GetHLSStreamingSessionURLCommand: (input: GetHLSStreamingSessionURLCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
12
+ export declare const serializeAws_restJson1GetImagesCommand: (input: GetImagesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
11
13
  export declare const serializeAws_restJson1GetMediaForFragmentListCommand: (input: GetMediaForFragmentListCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
12
14
  export declare const serializeAws_restJson1ListFragmentsCommand: (input: ListFragmentsCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
13
15
  export declare const deserializeAws_restJson1GetClipCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetClipCommandOutput>;
14
16
  export declare const deserializeAws_restJson1GetDASHStreamingSessionURLCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetDASHStreamingSessionURLCommandOutput>;
15
17
  export declare const deserializeAws_restJson1GetHLSStreamingSessionURLCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetHLSStreamingSessionURLCommandOutput>;
18
+ export declare const deserializeAws_restJson1GetImagesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetImagesCommandOutput>;
16
19
  export declare const deserializeAws_restJson1GetMediaForFragmentListCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetMediaForFragmentListCommandOutput>;
17
20
  export declare const deserializeAws_restJson1ListFragmentsCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<ListFragmentsCommandOutput>;
@@ -2,6 +2,7 @@ import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
2
2
  import { GetClipCommandInput, GetClipCommandOutput } from "./commands/GetClipCommand";
3
3
  import { GetDASHStreamingSessionURLCommandInput, GetDASHStreamingSessionURLCommandOutput } from "./commands/GetDASHStreamingSessionURLCommand";
4
4
  import { GetHLSStreamingSessionURLCommandInput, GetHLSStreamingSessionURLCommandOutput } from "./commands/GetHLSStreamingSessionURLCommand";
5
+ import { GetImagesCommandInput, GetImagesCommandOutput } from "./commands/GetImagesCommand";
5
6
  import { GetMediaForFragmentListCommandInput, GetMediaForFragmentListCommandOutput } from "./commands/GetMediaForFragmentListCommand";
6
7
  import { ListFragmentsCommandInput, ListFragmentsCommandOutput } from "./commands/ListFragmentsCommand";
7
8
  import { KinesisVideoArchivedMediaClient } from "./KinesisVideoArchivedMediaClient";
@@ -20,6 +21,10 @@ export declare class KinesisVideoArchivedMedia extends KinesisVideoArchivedMedia
20
21
  getHLSStreamingSessionURL(args: GetHLSStreamingSessionURLCommandInput, cb: (err: any, data?: GetHLSStreamingSessionURLCommandOutput) => void): void;
21
22
  getHLSStreamingSessionURL(args: GetHLSStreamingSessionURLCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetHLSStreamingSessionURLCommandOutput) => void): void;
22
23
 
24
+ getImages(args: GetImagesCommandInput, options?: __HttpHandlerOptions): Promise<GetImagesCommandOutput>;
25
+ getImages(args: GetImagesCommandInput, cb: (err: any, data?: GetImagesCommandOutput) => void): void;
26
+ getImages(args: GetImagesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetImagesCommandOutput) => void): void;
27
+
23
28
  getMediaForFragmentList(args: GetMediaForFragmentListCommandInput, options?: __HttpHandlerOptions): Promise<GetMediaForFragmentListCommandOutput>;
24
29
  getMediaForFragmentList(args: GetMediaForFragmentListCommandInput, cb: (err: any, data?: GetMediaForFragmentListCommandOutput) => void): void;
25
30
  getMediaForFragmentList(args: GetMediaForFragmentListCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetMediaForFragmentListCommandOutput) => void): void;
@@ -9,10 +9,11 @@ import { BodyLengthCalculator as __BodyLengthCalculator, Credentials as __Creden
9
9
  import { GetClipCommandInput, GetClipCommandOutput } from "./commands/GetClipCommand";
10
10
  import { GetDASHStreamingSessionURLCommandInput, GetDASHStreamingSessionURLCommandOutput } from "./commands/GetDASHStreamingSessionURLCommand";
11
11
  import { GetHLSStreamingSessionURLCommandInput, GetHLSStreamingSessionURLCommandOutput } from "./commands/GetHLSStreamingSessionURLCommand";
12
+ import { GetImagesCommandInput, GetImagesCommandOutput } from "./commands/GetImagesCommand";
12
13
  import { GetMediaForFragmentListCommandInput, GetMediaForFragmentListCommandOutput } from "./commands/GetMediaForFragmentListCommand";
13
14
  import { ListFragmentsCommandInput, ListFragmentsCommandOutput } from "./commands/ListFragmentsCommand";
14
- export declare type ServiceInputTypes = GetClipCommandInput | GetDASHStreamingSessionURLCommandInput | GetHLSStreamingSessionURLCommandInput | GetMediaForFragmentListCommandInput | ListFragmentsCommandInput;
15
- export declare type ServiceOutputTypes = GetClipCommandOutput | GetDASHStreamingSessionURLCommandOutput | GetHLSStreamingSessionURLCommandOutput | GetMediaForFragmentListCommandOutput | ListFragmentsCommandOutput;
15
+ export declare type ServiceInputTypes = GetClipCommandInput | GetDASHStreamingSessionURLCommandInput | GetHLSStreamingSessionURLCommandInput | GetImagesCommandInput | GetMediaForFragmentListCommandInput | ListFragmentsCommandInput;
16
+ export declare type ServiceOutputTypes = GetClipCommandOutput | GetDASHStreamingSessionURLCommandOutput | GetHLSStreamingSessionURLCommandOutput | GetImagesCommandOutput | GetMediaForFragmentListCommandOutput | ListFragmentsCommandOutput;
16
17
  export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
17
18
 
18
19
  requestHandler?: __HttpHandler;
@@ -0,0 +1,17 @@
1
+ import { Command as $Command } from "@aws-sdk/smithy-client";
2
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
+ import { KinesisVideoArchivedMediaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KinesisVideoArchivedMediaClient";
4
+ import { GetImagesInput, GetImagesOutput } from "../models/models_0";
5
+ export interface GetImagesCommandInput extends GetImagesInput {
6
+ }
7
+ export interface GetImagesCommandOutput extends GetImagesOutput, __MetadataBearer {
8
+ }
9
+
10
+ export declare class GetImagesCommand extends $Command<GetImagesCommandInput, GetImagesCommandOutput, KinesisVideoArchivedMediaClientResolvedConfig> {
11
+ readonly input: GetImagesCommandInput;
12
+ constructor(input: GetImagesCommandInput);
13
+
14
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: KinesisVideoArchivedMediaClientResolvedConfig, options?: __HttpHandlerOptions): Handler<GetImagesCommandInput, GetImagesCommandOutput>;
15
+ private serialize;
16
+ private deserialize;
17
+ }
@@ -1,5 +1,6 @@
1
1
  export * from "./GetClipCommand";
2
2
  export * from "./GetDASHStreamingSessionURLCommand";
3
3
  export * from "./GetHLSStreamingSessionURLCommand";
4
+ export * from "./GetImagesCommand";
4
5
  export * from "./GetMediaForFragmentListCommand";
5
6
  export * from "./ListFragmentsCommand";
@@ -267,6 +267,76 @@ export declare namespace GetHLSStreamingSessionURLOutput {
267
267
 
268
268
  const filterSensitiveLog: (obj: GetHLSStreamingSessionURLOutput) => any;
269
269
  }
270
+ export declare enum Format {
271
+ JPEG = "JPEG",
272
+ PNG = "PNG"
273
+ }
274
+ export declare enum FormatConfigKey {
275
+ JPEGQuality = "JPEGQuality"
276
+ }
277
+ export declare enum ImageSelectorType {
278
+ PRODUCER_TIMESTAMP = "PRODUCER_TIMESTAMP",
279
+ SERVER_TIMESTAMP = "SERVER_TIMESTAMP"
280
+ }
281
+ export interface GetImagesInput {
282
+
283
+ StreamName?: string;
284
+
285
+ StreamARN?: string;
286
+
287
+ ImageSelectorType: ImageSelectorType | string | undefined;
288
+
289
+ StartTimestamp: Date | undefined;
290
+
291
+ EndTimestamp: Date | undefined;
292
+
293
+ SamplingInterval: number | undefined;
294
+
295
+ Format: Format | string | undefined;
296
+
297
+ FormatConfig?: {
298
+ [key: string]: string;
299
+ };
300
+
301
+ WidthPixels?: number;
302
+
303
+ HeightPixels?: number;
304
+
305
+ MaxResults?: number;
306
+
307
+ NextToken?: string;
308
+ }
309
+ export declare namespace GetImagesInput {
310
+
311
+ const filterSensitiveLog: (obj: GetImagesInput) => any;
312
+ }
313
+ export declare enum ImageError {
314
+ MEDIA_ERROR = "MEDIA_ERROR",
315
+ NO_MEDIA = "NO_MEDIA"
316
+ }
317
+
318
+ export interface Image {
319
+
320
+ TimeStamp?: Date;
321
+
322
+ Error?: ImageError | string;
323
+
324
+ ImageContent?: string;
325
+ }
326
+ export declare namespace Image {
327
+
328
+ const filterSensitiveLog: (obj: Image) => any;
329
+ }
330
+ export interface GetImagesOutput {
331
+
332
+ Images?: Image[];
333
+
334
+ NextToken?: string;
335
+ }
336
+ export declare namespace GetImagesOutput {
337
+
338
+ const filterSensitiveLog: (obj: GetImagesOutput) => any;
339
+ }
270
340
  export interface GetMediaForFragmentListInput {
271
341
 
272
342
  StreamName?: string;
@@ -3,15 +3,18 @@ import { SerdeContext as __SerdeContext } from "@aws-sdk/types";
3
3
  import { GetClipCommandInput, GetClipCommandOutput } from "../commands/GetClipCommand";
4
4
  import { GetDASHStreamingSessionURLCommandInput, GetDASHStreamingSessionURLCommandOutput } from "../commands/GetDASHStreamingSessionURLCommand";
5
5
  import { GetHLSStreamingSessionURLCommandInput, GetHLSStreamingSessionURLCommandOutput } from "../commands/GetHLSStreamingSessionURLCommand";
6
+ import { GetImagesCommandInput, GetImagesCommandOutput } from "../commands/GetImagesCommand";
6
7
  import { GetMediaForFragmentListCommandInput, GetMediaForFragmentListCommandOutput } from "../commands/GetMediaForFragmentListCommand";
7
8
  import { ListFragmentsCommandInput, ListFragmentsCommandOutput } from "../commands/ListFragmentsCommand";
8
9
  export declare const serializeAws_restJson1GetClipCommand: (input: GetClipCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
9
10
  export declare const serializeAws_restJson1GetDASHStreamingSessionURLCommand: (input: GetDASHStreamingSessionURLCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
10
11
  export declare const serializeAws_restJson1GetHLSStreamingSessionURLCommand: (input: GetHLSStreamingSessionURLCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
12
+ export declare const serializeAws_restJson1GetImagesCommand: (input: GetImagesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
11
13
  export declare const serializeAws_restJson1GetMediaForFragmentListCommand: (input: GetMediaForFragmentListCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
12
14
  export declare const serializeAws_restJson1ListFragmentsCommand: (input: ListFragmentsCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
13
15
  export declare const deserializeAws_restJson1GetClipCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetClipCommandOutput>;
14
16
  export declare const deserializeAws_restJson1GetDASHStreamingSessionURLCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetDASHStreamingSessionURLCommandOutput>;
15
17
  export declare const deserializeAws_restJson1GetHLSStreamingSessionURLCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetHLSStreamingSessionURLCommandOutput>;
18
+ export declare const deserializeAws_restJson1GetImagesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetImagesCommandOutput>;
16
19
  export declare const deserializeAws_restJson1GetMediaForFragmentListCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetMediaForFragmentListCommandOutput>;
17
20
  export declare const deserializeAws_restJson1ListFragmentsCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<ListFragmentsCommandOutput>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kinesis-video-archived-media",
3
3
  "description": "AWS SDK for JavaScript Kinesis Video Archived Media Client for Node.js, Browser and React Native",
4
- "version": "3.82.0",
4
+ "version": "3.87.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.82.0",
21
+ "@aws-sdk/client-sts": "3.87.0",
22
22
  "@aws-sdk/config-resolver": "3.80.0",
23
- "@aws-sdk/credential-provider-node": "3.82.0",
23
+ "@aws-sdk/credential-provider-node": "3.87.0",
24
24
  "@aws-sdk/fetch-http-handler": "3.78.0",
25
25
  "@aws-sdk/hash-node": "3.78.0",
26
26
  "@aws-sdk/invalid-dependency": "3.78.0",
@@ -35,15 +35,15 @@
35
35
  "@aws-sdk/node-config-provider": "3.80.0",
36
36
  "@aws-sdk/node-http-handler": "3.82.0",
37
37
  "@aws-sdk/protocol-http": "3.78.0",
38
- "@aws-sdk/smithy-client": "3.78.0",
38
+ "@aws-sdk/smithy-client": "3.85.0",
39
39
  "@aws-sdk/types": "3.78.0",
40
40
  "@aws-sdk/url-parser": "3.78.0",
41
41
  "@aws-sdk/util-base64-browser": "3.58.0",
42
42
  "@aws-sdk/util-base64-node": "3.55.0",
43
43
  "@aws-sdk/util-body-length-browser": "3.55.0",
44
44
  "@aws-sdk/util-body-length-node": "3.55.0",
45
- "@aws-sdk/util-defaults-mode-browser": "3.78.0",
46
- "@aws-sdk/util-defaults-mode-node": "3.81.0",
45
+ "@aws-sdk/util-defaults-mode-browser": "3.85.0",
46
+ "@aws-sdk/util-defaults-mode-node": "3.85.0",
47
47
  "@aws-sdk/util-user-agent-browser": "3.78.0",
48
48
  "@aws-sdk/util-user-agent-node": "3.80.0",
49
49
  "@aws-sdk/util-utf8-browser": "3.55.0",