Skip to content

Commit

Permalink
feat(client-kinesis-video): Amazon Kinesis Video Streams offers capab…
Browse files Browse the repository at this point in the history
…ilities to stream video and audio in real-time via WebRTC to the cloud for storage, playback, and analytical processing. Customers can use our enhanced WebRTC SDK and cloud APIs to enable real-time streaming, as well as media ingestion to the cloud.
  • Loading branch information
awstools committed Dec 19, 2022
1 parent 59c84e0 commit cbb5b21
Show file tree
Hide file tree
Showing 12 changed files with 1,601 additions and 326 deletions.
149 changes: 136 additions & 13 deletions clients/client-kinesis-video/src/KinesisVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ import {
DescribeImageGenerationConfigurationCommandInput,
DescribeImageGenerationConfigurationCommandOutput,
} from "./commands/DescribeImageGenerationConfigurationCommand";
import {
DescribeMappedResourceConfigurationCommand,
DescribeMappedResourceConfigurationCommandInput,
DescribeMappedResourceConfigurationCommandOutput,
} from "./commands/DescribeMappedResourceConfigurationCommand";
import {
DescribeMediaStorageConfigurationCommand,
DescribeMediaStorageConfigurationCommandInput,
DescribeMediaStorageConfigurationCommandOutput,
} from "./commands/DescribeMediaStorageConfigurationCommand";
import {
DescribeNotificationConfigurationCommand,
DescribeNotificationConfigurationCommandInput,
Expand Down Expand Up @@ -95,6 +105,11 @@ import {
UpdateImageGenerationConfigurationCommandInput,
UpdateImageGenerationConfigurationCommandOutput,
} from "./commands/UpdateImageGenerationConfigurationCommand";
import {
UpdateMediaStorageConfigurationCommand,
UpdateMediaStorageConfigurationCommandInput,
UpdateMediaStorageConfigurationCommandOutput,
} from "./commands/UpdateMediaStorageConfigurationCommand";
import {
UpdateNotificationConfigurationCommand,
UpdateNotificationConfigurationCommandInput,
Expand Down Expand Up @@ -324,6 +339,73 @@ export class KinesisVideo extends KinesisVideoClient {
}
}

/**
* <p>Returns the most current information about the stream. Either streamName or streamARN should be provided in the input.</p>
* <p>Returns the most current information about the stream. The <code>streamName</code>
* or <code>streamARN</code> should be provided in the input.</p>
*/
public describeMappedResourceConfiguration(
args: DescribeMappedResourceConfigurationCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeMappedResourceConfigurationCommandOutput>;
public describeMappedResourceConfiguration(
args: DescribeMappedResourceConfigurationCommandInput,
cb: (err: any, data?: DescribeMappedResourceConfigurationCommandOutput) => void
): void;
public describeMappedResourceConfiguration(
args: DescribeMappedResourceConfigurationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeMappedResourceConfigurationCommandOutput) => void
): void;
public describeMappedResourceConfiguration(
args: DescribeMappedResourceConfigurationCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeMappedResourceConfigurationCommandOutput) => void),
cb?: (err: any, data?: DescribeMappedResourceConfigurationCommandOutput) => void
): Promise<DescribeMappedResourceConfigurationCommandOutput> | void {
const command = new DescribeMappedResourceConfigurationCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Returns the most current information about the channel. Specify the <code>ChannelName</code>
* or <code>ChannelARN</code> in the input.</p>
*/
public describeMediaStorageConfiguration(
args: DescribeMediaStorageConfigurationCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeMediaStorageConfigurationCommandOutput>;
public describeMediaStorageConfiguration(
args: DescribeMediaStorageConfigurationCommandInput,
cb: (err: any, data?: DescribeMediaStorageConfigurationCommandOutput) => void
): void;
public describeMediaStorageConfiguration(
args: DescribeMediaStorageConfigurationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeMediaStorageConfigurationCommandOutput) => void
): void;
public describeMediaStorageConfiguration(
args: DescribeMediaStorageConfigurationCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeMediaStorageConfigurationCommandOutput) => void),
cb?: (err: any, data?: DescribeMediaStorageConfigurationCommandOutput) => void
): Promise<DescribeMediaStorageConfigurationCommandOutput> | void {
const command = new DescribeMediaStorageConfigurationCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Gets the <code>NotificationConfiguration</code> for a given Kinesis video stream.</p>
*/
Expand Down Expand Up @@ -639,20 +721,18 @@ export class KinesisVideo extends KinesisVideoClient {
}

/**
* <p>An asynchronous API that updates a stream’s existing edge configuration. If this API is invoked for the
* first time, a new edge configuration will be created for the stream, and the sync status will be set to
* <code>SYNCING</code>. </p>
* <p>The Kinesis Video Stream will sync the stream’s edge configuration with the Edge Agent
* IoT Greengrass component that runs on an IoT Hub Device setup at your premise.
* The time to sync can vary and depends on the connectivity of the Hub Device.
* <p>An asynchronous API that updates a stream’s existing edge configuration.
* The Kinesis Video Stream will sync the stream’s edge configuration with the Edge Agent IoT Greengrass
* component that runs on an IoT Hub Device, setup at your premise. The time to sync can vary
* and depends on the connectivity of the Hub Device.
* The <code>SyncStatus</code> will be updated as the edge configuration is acknowledged,
* and synced with the Edge Agent. You will have to wait for the sync status to reach a terminal state such as:
* <code>IN_SYNC</code> and <code>SYNC_FAILED</code>, before using this API again.</p>
* <p>If you invoke this API during the syncing process,
* a <code>ResourceInUseException</code> will be thrown. The connectivity of the stream's edge configuration
* and the Edge Agent will be retried
* for 15 minutes. After 15 minutes, the status will transition into the <code>SYNC_FAILED</code> state.
* </p>
* and synced with the Edge Agent. </p>
* <p>If this API is invoked for the first time, a new edge configuration will be created for the stream,
* and the sync status will be set to <code>SYNCING</code>. You will have to wait for the sync status
* to reach a terminal state such as: <code>IN_SYNC</code>, or <code>SYNC_FAILED</code>, before using this API again.
* If you invoke this API during the syncing process, a <code>ResourceInUseException</code> will be thrown.
* The connectivity of the stream’s edge configuration and the Edge Agent will be retried for 15 minutes. After 15 minutes,
* the status will transition into the <code>SYNC_FAILED</code> state.</p>
*/
public startEdgeConfigurationUpdate(
args: StartEdgeConfigurationUpdateCommandInput,
Expand Down Expand Up @@ -901,6 +981,49 @@ export class KinesisVideo extends KinesisVideoClient {
}
}

/**
* <p>Associates a <code>SignalingChannel</code> to a stream to store the media. There are two signaling modes that
* can specified :</p>
* <ul>
* <li>
* <p>If the <code>StorageStatus</code> is disabled, no data will be stored,
* and the <code>StreamARN</code> parameter will not be needed. </p>
* </li>
* <li>
* <p>If the <code>StorageStatus</code> is enabled, the data will be stored in the
* <code>StreamARN</code> provided. </p>
* </li>
* </ul>
*/
public updateMediaStorageConfiguration(
args: UpdateMediaStorageConfigurationCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateMediaStorageConfigurationCommandOutput>;
public updateMediaStorageConfiguration(
args: UpdateMediaStorageConfigurationCommandInput,
cb: (err: any, data?: UpdateMediaStorageConfigurationCommandOutput) => void
): void;
public updateMediaStorageConfiguration(
args: UpdateMediaStorageConfigurationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateMediaStorageConfigurationCommandOutput) => void
): void;
public updateMediaStorageConfiguration(
args: UpdateMediaStorageConfigurationCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateMediaStorageConfigurationCommandOutput) => void),
cb?: (err: any, data?: UpdateMediaStorageConfigurationCommandOutput) => void
): Promise<UpdateMediaStorageConfigurationCommandOutput> | void {
const command = new UpdateMediaStorageConfigurationCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Updates the notification information for a stream.</p>
*/
Expand Down
18 changes: 18 additions & 0 deletions clients/client-kinesis-video/src/KinesisVideoClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ import {
DescribeImageGenerationConfigurationCommandInput,
DescribeImageGenerationConfigurationCommandOutput,
} from "./commands/DescribeImageGenerationConfigurationCommand";
import {
DescribeMappedResourceConfigurationCommandInput,
DescribeMappedResourceConfigurationCommandOutput,
} from "./commands/DescribeMappedResourceConfigurationCommand";
import {
DescribeMediaStorageConfigurationCommandInput,
DescribeMediaStorageConfigurationCommandOutput,
} from "./commands/DescribeMediaStorageConfigurationCommand";
import {
DescribeNotificationConfigurationCommandInput,
DescribeNotificationConfigurationCommandOutput,
Expand Down Expand Up @@ -105,6 +113,10 @@ import {
UpdateImageGenerationConfigurationCommandInput,
UpdateImageGenerationConfigurationCommandOutput,
} from "./commands/UpdateImageGenerationConfigurationCommand";
import {
UpdateMediaStorageConfigurationCommandInput,
UpdateMediaStorageConfigurationCommandOutput,
} from "./commands/UpdateMediaStorageConfigurationCommand";
import {
UpdateNotificationConfigurationCommandInput,
UpdateNotificationConfigurationCommandOutput,
Expand All @@ -129,6 +141,8 @@ export type ServiceInputTypes =
| DeleteStreamCommandInput
| DescribeEdgeConfigurationCommandInput
| DescribeImageGenerationConfigurationCommandInput
| DescribeMappedResourceConfigurationCommandInput
| DescribeMediaStorageConfigurationCommandInput
| DescribeNotificationConfigurationCommandInput
| DescribeSignalingChannelCommandInput
| DescribeStreamCommandInput
Expand All @@ -145,6 +159,7 @@ export type ServiceInputTypes =
| UntagStreamCommandInput
| UpdateDataRetentionCommandInput
| UpdateImageGenerationConfigurationCommandInput
| UpdateMediaStorageConfigurationCommandInput
| UpdateNotificationConfigurationCommandInput
| UpdateSignalingChannelCommandInput
| UpdateStreamCommandInput;
Expand All @@ -156,6 +171,8 @@ export type ServiceOutputTypes =
| DeleteStreamCommandOutput
| DescribeEdgeConfigurationCommandOutput
| DescribeImageGenerationConfigurationCommandOutput
| DescribeMappedResourceConfigurationCommandOutput
| DescribeMediaStorageConfigurationCommandOutput
| DescribeNotificationConfigurationCommandOutput
| DescribeSignalingChannelCommandOutput
| DescribeStreamCommandOutput
Expand All @@ -172,6 +189,7 @@ export type ServiceOutputTypes =
| UntagStreamCommandOutput
| UpdateDataRetentionCommandOutput
| UpdateImageGenerationConfigurationCommandOutput
| UpdateMediaStorageConfigurationCommandOutput
| UpdateNotificationConfigurationCommandOutput
| UpdateSignalingChannelCommandOutput
| UpdateStreamCommandOutput;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { KinesisVideoClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KinesisVideoClient";
import {
DescribeMappedResourceConfigurationInput,
DescribeMappedResourceConfigurationInputFilterSensitiveLog,
DescribeMappedResourceConfigurationOutput,
DescribeMappedResourceConfigurationOutputFilterSensitiveLog,
} from "../models/models_0";
import {
deserializeAws_restJson1DescribeMappedResourceConfigurationCommand,
serializeAws_restJson1DescribeMappedResourceConfigurationCommand,
} from "../protocols/Aws_restJson1";

export interface DescribeMappedResourceConfigurationCommandInput extends DescribeMappedResourceConfigurationInput {}
export interface DescribeMappedResourceConfigurationCommandOutput
extends DescribeMappedResourceConfigurationOutput,
__MetadataBearer {}

/**
* <p>Returns the most current information about the stream. Either streamName or streamARN should be provided in the input.</p>
* <p>Returns the most current information about the stream. The <code>streamName</code>
* or <code>streamARN</code> should be provided in the input.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { KinesisVideoClient, DescribeMappedResourceConfigurationCommand } from "@aws-sdk/client-kinesis-video"; // ES Modules import
* // const { KinesisVideoClient, DescribeMappedResourceConfigurationCommand } = require("@aws-sdk/client-kinesis-video"); // CommonJS import
* const client = new KinesisVideoClient(config);
* const command = new DescribeMappedResourceConfigurationCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link DescribeMappedResourceConfigurationCommandInput} for command's `input` shape.
* @see {@link DescribeMappedResourceConfigurationCommandOutput} for command's `response` shape.
* @see {@link KinesisVideoClientResolvedConfig | config} for KinesisVideoClient's `config` shape.
*
*/
export class DescribeMappedResourceConfigurationCommand extends $Command<
DescribeMappedResourceConfigurationCommandInput,
DescribeMappedResourceConfigurationCommandOutput,
KinesisVideoClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

constructor(readonly input: DescribeMappedResourceConfigurationCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: KinesisVideoClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<DescribeMappedResourceConfigurationCommandInput, DescribeMappedResourceConfigurationCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, DescribeMappedResourceConfigurationCommand.getEndpointParameterInstructions())
);

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "KinesisVideoClient";
const commandName = "DescribeMappedResourceConfigurationCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: DescribeMappedResourceConfigurationInputFilterSensitiveLog,
outputFilterSensitiveLog: DescribeMappedResourceConfigurationOutputFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(
input: DescribeMappedResourceConfigurationCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> {
return serializeAws_restJson1DescribeMappedResourceConfigurationCommand(input, context);
}

private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<DescribeMappedResourceConfigurationCommandOutput> {
return deserializeAws_restJson1DescribeMappedResourceConfigurationCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}

0 comments on commit cbb5b21

Please sign in to comment.