cdk-amazon-chime-resources
Version:

908 lines • 150 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deserializeAws_restJson1UpdateMediaInsightsPipelineStatusCommand = exports.deserializeAws_restJson1UpdateMediaInsightsPipelineConfigurationCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListMediaPipelinesCommand = exports.deserializeAws_restJson1ListMediaInsightsPipelineConfigurationsCommand = exports.deserializeAws_restJson1ListMediaCapturePipelinesCommand = exports.deserializeAws_restJson1GetMediaPipelineCommand = exports.deserializeAws_restJson1GetMediaInsightsPipelineConfigurationCommand = exports.deserializeAws_restJson1GetMediaCapturePipelineCommand = exports.deserializeAws_restJson1DeleteMediaPipelineCommand = exports.deserializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommand = exports.deserializeAws_restJson1DeleteMediaCapturePipelineCommand = exports.deserializeAws_restJson1CreateMediaLiveConnectorPipelineCommand = exports.deserializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommand = exports.deserializeAws_restJson1CreateMediaInsightsPipelineCommand = exports.deserializeAws_restJson1CreateMediaConcatenationPipelineCommand = exports.deserializeAws_restJson1CreateMediaCapturePipelineCommand = exports.serializeAws_restJson1UpdateMediaInsightsPipelineStatusCommand = exports.serializeAws_restJson1UpdateMediaInsightsPipelineConfigurationCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListMediaPipelinesCommand = exports.serializeAws_restJson1ListMediaInsightsPipelineConfigurationsCommand = exports.serializeAws_restJson1ListMediaCapturePipelinesCommand = exports.serializeAws_restJson1GetMediaPipelineCommand = exports.serializeAws_restJson1GetMediaInsightsPipelineConfigurationCommand = exports.serializeAws_restJson1GetMediaCapturePipelineCommand = exports.serializeAws_restJson1DeleteMediaPipelineCommand = exports.serializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommand = exports.serializeAws_restJson1DeleteMediaCapturePipelineCommand = exports.serializeAws_restJson1CreateMediaLiveConnectorPipelineCommand = exports.serializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommand = exports.serializeAws_restJson1CreateMediaInsightsPipelineCommand = exports.serializeAws_restJson1CreateMediaConcatenationPipelineCommand = exports.serializeAws_restJson1CreateMediaCapturePipelineCommand = void 0;
const protocol_http_1 = require("@aws-sdk/protocol-http");
const smithy_client_1 = require("@aws-sdk/smithy-client");
const uuid_1 = require("uuid");
const ChimeSDKMediaPipelinesServiceException_1 = require("../models/ChimeSDKMediaPipelinesServiceException");
const models_0_1 = require("../models/models_0");
const serializeAws_restJson1CreateMediaCapturePipelineCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sdk-media-capture-pipelines";
let body;
body = JSON.stringify({
...(input.ChimeSdkMeetingConfiguration != null && {
ChimeSdkMeetingConfiguration: serializeAws_restJson1ChimeSdkMeetingConfiguration(input.ChimeSdkMeetingConfiguration, context),
}),
ClientRequestToken: input.ClientRequestToken ?? (0, uuid_1.v4)(),
...(input.SinkArn != null && { SinkArn: input.SinkArn }),
...(input.SinkType != null && { SinkType: input.SinkType }),
...(input.SourceArn != null && { SourceArn: input.SourceArn }),
...(input.SourceType != null && { SourceType: input.SourceType }),
...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1CreateMediaCapturePipelineCommand = serializeAws_restJson1CreateMediaCapturePipelineCommand;
const serializeAws_restJson1CreateMediaConcatenationPipelineCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sdk-media-concatenation-pipelines";
let body;
body = JSON.stringify({
ClientRequestToken: input.ClientRequestToken ?? (0, uuid_1.v4)(),
...(input.Sinks != null && { Sinks: serializeAws_restJson1ConcatenationSinkList(input.Sinks, context) }),
...(input.Sources != null && { Sources: serializeAws_restJson1ConcatenationSourceList(input.Sources, context) }),
...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1CreateMediaConcatenationPipelineCommand = serializeAws_restJson1CreateMediaConcatenationPipelineCommand;
const serializeAws_restJson1CreateMediaInsightsPipelineCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/media-insights-pipelines";
let body;
body = JSON.stringify({
ClientRequestToken: input.ClientRequestToken ?? (0, uuid_1.v4)(),
...(input.KinesisVideoStreamRecordingSourceRuntimeConfiguration != null && {
KinesisVideoStreamRecordingSourceRuntimeConfiguration: serializeAws_restJson1KinesisVideoStreamRecordingSourceRuntimeConfiguration(input.KinesisVideoStreamRecordingSourceRuntimeConfiguration, context),
}),
...(input.KinesisVideoStreamSourceRuntimeConfiguration != null && {
KinesisVideoStreamSourceRuntimeConfiguration: serializeAws_restJson1KinesisVideoStreamSourceRuntimeConfiguration(input.KinesisVideoStreamSourceRuntimeConfiguration, context),
}),
...(input.MediaInsightsPipelineConfigurationArn != null && {
MediaInsightsPipelineConfigurationArn: input.MediaInsightsPipelineConfigurationArn,
}),
...(input.MediaInsightsRuntimeMetadata != null && {
MediaInsightsRuntimeMetadata: serializeAws_restJson1MediaInsightsRuntimeMetadata(input.MediaInsightsRuntimeMetadata, context),
}),
...(input.S3RecordingSinkRuntimeConfiguration != null && {
S3RecordingSinkRuntimeConfiguration: serializeAws_restJson1S3RecordingSinkRuntimeConfiguration(input.S3RecordingSinkRuntimeConfiguration, context),
}),
...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1CreateMediaInsightsPipelineCommand = serializeAws_restJson1CreateMediaInsightsPipelineCommand;
const serializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/media-insights-pipeline-configurations";
let body;
body = JSON.stringify({
ClientRequestToken: input.ClientRequestToken ?? (0, uuid_1.v4)(),
...(input.Elements != null && {
Elements: serializeAws_restJson1MediaInsightsPipelineConfigurationElements(input.Elements, context),
}),
...(input.MediaInsightsPipelineConfigurationName != null && {
MediaInsightsPipelineConfigurationName: input.MediaInsightsPipelineConfigurationName,
}),
...(input.RealTimeAlertConfiguration != null && {
RealTimeAlertConfiguration: serializeAws_restJson1RealTimeAlertConfiguration(input.RealTimeAlertConfiguration, context),
}),
...(input.ResourceAccessRoleArn != null && { ResourceAccessRoleArn: input.ResourceAccessRoleArn }),
...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommand = serializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommand;
const serializeAws_restJson1CreateMediaLiveConnectorPipelineCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sdk-media-live-connector-pipelines";
let body;
body = JSON.stringify({
ClientRequestToken: input.ClientRequestToken ?? (0, uuid_1.v4)(),
...(input.Sinks != null && { Sinks: serializeAws_restJson1LiveConnectorSinkList(input.Sinks, context) }),
...(input.Sources != null && { Sources: serializeAws_restJson1LiveConnectorSourceList(input.Sources, context) }),
...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1CreateMediaLiveConnectorPipelineCommand = serializeAws_restJson1CreateMediaLiveConnectorPipelineCommand;
const serializeAws_restJson1DeleteMediaCapturePipelineCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/sdk-media-capture-pipelines/{MediaPipelineId}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MediaPipelineId", () => input.MediaPipelineId, "{MediaPipelineId}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DeleteMediaCapturePipelineCommand = serializeAws_restJson1DeleteMediaCapturePipelineCommand;
const serializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/media-insights-pipeline-configurations/{Identifier}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommand = serializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommand;
const serializeAws_restJson1DeleteMediaPipelineCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sdk-media-pipelines/{MediaPipelineId}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MediaPipelineId", () => input.MediaPipelineId, "{MediaPipelineId}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DeleteMediaPipelineCommand = serializeAws_restJson1DeleteMediaPipelineCommand;
const serializeAws_restJson1GetMediaCapturePipelineCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/sdk-media-capture-pipelines/{MediaPipelineId}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MediaPipelineId", () => input.MediaPipelineId, "{MediaPipelineId}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1GetMediaCapturePipelineCommand = serializeAws_restJson1GetMediaCapturePipelineCommand;
const serializeAws_restJson1GetMediaInsightsPipelineConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/media-insights-pipeline-configurations/{Identifier}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1GetMediaInsightsPipelineConfigurationCommand = serializeAws_restJson1GetMediaInsightsPipelineConfigurationCommand;
const serializeAws_restJson1GetMediaPipelineCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sdk-media-pipelines/{MediaPipelineId}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MediaPipelineId", () => input.MediaPipelineId, "{MediaPipelineId}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1GetMediaPipelineCommand = serializeAws_restJson1GetMediaPipelineCommand;
const serializeAws_restJson1ListMediaCapturePipelinesCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sdk-media-capture-pipelines";
const query = map({
"next-token": [, input.NextToken],
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListMediaCapturePipelinesCommand = serializeAws_restJson1ListMediaCapturePipelinesCommand;
const serializeAws_restJson1ListMediaInsightsPipelineConfigurationsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/media-insights-pipeline-configurations";
const query = map({
"next-token": [, input.NextToken],
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListMediaInsightsPipelineConfigurationsCommand = serializeAws_restJson1ListMediaInsightsPipelineConfigurationsCommand;
const serializeAws_restJson1ListMediaPipelinesCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/sdk-media-pipelines";
const query = map({
"next-token": [, input.NextToken],
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListMediaPipelinesCommand = serializeAws_restJson1ListMediaPipelinesCommand;
const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
const query = map({
arn: [, (0, smithy_client_1.expectNonNull)(input.ResourceARN, `ResourceARN`)],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListTagsForResourceCommand = serializeAws_restJson1ListTagsForResourceCommand;
const serializeAws_restJson1TagResourceCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
const query = map({
operation: [, "tag-resource"],
});
let body;
body = JSON.stringify({
...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1TagResourceCommand = serializeAws_restJson1TagResourceCommand;
const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
const query = map({
operation: [, "untag-resource"],
});
let body;
body = JSON.stringify({
...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
...(input.TagKeys != null && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
const serializeAws_restJson1UpdateMediaInsightsPipelineConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {
"content-type": "application/json",
};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/media-insights-pipeline-configurations/{Identifier}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
let body;
body = JSON.stringify({
...(input.Elements != null && {
Elements: serializeAws_restJson1MediaInsightsPipelineConfigurationElements(input.Elements, context),
}),
...(input.RealTimeAlertConfiguration != null && {
RealTimeAlertConfiguration: serializeAws_restJson1RealTimeAlertConfiguration(input.RealTimeAlertConfiguration, context),
}),
...(input.ResourceAccessRoleArn != null && { ResourceAccessRoleArn: input.ResourceAccessRoleArn }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "PUT",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1UpdateMediaInsightsPipelineConfigurationCommand = serializeAws_restJson1UpdateMediaInsightsPipelineConfigurationCommand;
const serializeAws_restJson1UpdateMediaInsightsPipelineStatusCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {
"content-type": "application/json",
};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/media-insights-pipeline-status/{Identifier}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
let body;
body = JSON.stringify({
...(input.UpdateStatus != null && { UpdateStatus: input.UpdateStatus }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "PUT",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1UpdateMediaInsightsPipelineStatusCommand = serializeAws_restJson1UpdateMediaInsightsPipelineStatusCommand;
const deserializeAws_restJson1CreateMediaCapturePipelineCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return deserializeAws_restJson1CreateMediaCapturePipelineCommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
if (data.MediaCapturePipeline != null) {
contents.MediaCapturePipeline = deserializeAws_restJson1MediaCapturePipeline(data.MediaCapturePipeline, context);
}
return contents;
};
exports.deserializeAws_restJson1CreateMediaCapturePipelineCommand = deserializeAws_restJson1CreateMediaCapturePipelineCommand;
const deserializeAws_restJson1CreateMediaCapturePipelineCommandError = async (output, context) => {
const parsedOutput = {
...output,
body: await parseErrorBody(output.body, context),
};
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
switch (errorCode) {
case "BadRequestException":
case "com.amazonaws.chimesdkmediapipelines#BadRequestException":
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
case "ForbiddenException":
case "com.amazonaws.chimesdkmediapipelines#ForbiddenException":
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
case "ResourceLimitExceededException":
case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException":
throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
case "ServiceFailureException":
case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException":
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
case "ServiceUnavailableException":
case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException":
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
case "ThrottledClientException":
case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException":
throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
case "UnauthorizedClientException":
case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException":
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
(0, smithy_client_1.throwDefaultError)({
output,
parsedBody,
exceptionCtor: ChimeSDKMediaPipelinesServiceException_1.ChimeSDKMediaPipelinesServiceException,
errorCode,
});
}
};
const deserializeAws_restJson1CreateMediaConcatenationPipelineCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return deserializeAws_restJson1CreateMediaConcatenationPipelineCommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
if (data.MediaConcatenationPipeline != null) {
contents.MediaConcatenationPipeline = deserializeAws_restJson1MediaConcatenationPipeline(data.MediaConcatenationPipeline, context);
}
return contents;
};
exports.deserializeAws_restJson1CreateMediaConcatenationPipelineCommand = deserializeAws_restJson1CreateMediaConcatenationPipelineCommand;
const deserializeAws_restJson1CreateMediaConcatenationPipelineCommandError = async (output, context) => {
const parsedOutput = {
...output,
body: await parseErrorBody(output.body, context),
};
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
switch (errorCode) {
case "BadRequestException":
case "com.amazonaws.chimesdkmediapipelines#BadRequestException":
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
case "ForbiddenException":
case "com.amazonaws.chimesdkmediapipelines#ForbiddenException":
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
case "ResourceLimitExceededException":
case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException":
throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
case "ServiceFailureException":
case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException":
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
case "ServiceUnavailableException":
case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException":
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
case "ThrottledClientException":
case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException":
throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
case "UnauthorizedClientException":
case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException":
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
(0, smithy_client_1.throwDefaultError)({
output,
parsedBody,
exceptionCtor: ChimeSDKMediaPipelinesServiceException_1.ChimeSDKMediaPipelinesServiceException,
errorCode,
});
}
};
const deserializeAws_restJson1CreateMediaInsightsPipelineCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return deserializeAws_restJson1CreateMediaInsightsPipelineCommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
if (data.MediaInsightsPipeline != null) {
contents.MediaInsightsPipeline = deserializeAws_restJson1MediaInsightsPipeline(data.MediaInsightsPipeline, context);
}
return contents;
};
exports.deserializeAws_restJson1CreateMediaInsightsPipelineCommand = deserializeAws_restJson1CreateMediaInsightsPipelineCommand;
const deserializeAws_restJson1CreateMediaInsightsPipelineCommandError = async (output, context) => {
const parsedOutput = {
...output,
body: await parseErrorBody(output.body, context),
};
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
switch (errorCode) {
case "BadRequestException":
case "com.amazonaws.chimesdkmediapipelines#BadRequestException":
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
case "ForbiddenException":
case "com.amazonaws.chimesdkmediapipelines#ForbiddenException":
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
case "NotFoundException":
case "com.amazonaws.chimesdkmediapipelines#NotFoundException":
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
case "ResourceLimitExceededException":
case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException":
throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
case "ServiceFailureException":
case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException":
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
case "ServiceUnavailableException":
case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException":
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
case "ThrottledClientException":
case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException":
throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
case "UnauthorizedClientException":
case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException":
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
(0, smithy_client_1.throwDefaultError)({
output,
parsedBody,
exceptionCtor: ChimeSDKMediaPipelinesServiceException_1.ChimeSDKMediaPipelinesServiceException,
errorCode,
});
}
};
const deserializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return deserializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
if (data.MediaInsightsPipelineConfiguration != null) {
contents.MediaInsightsPipelineConfiguration = deserializeAws_restJson1MediaInsightsPipelineConfiguration(data.MediaInsightsPipelineConfiguration, context);
}
return contents;
};
exports.deserializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommand = deserializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommand;
const deserializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommandError = async (output, context) => {
const parsedOutput = {
...output,
body: await parseErrorBody(output.body, context),
};
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
switch (errorCode) {
case "BadRequestException":
case "com.amazonaws.chimesdkmediapipelines#BadRequestException":
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
case "ForbiddenException":
case "com.amazonaws.chimesdkmediapipelines#ForbiddenException":
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
case "NotFoundException":
case "com.amazonaws.chimesdkmediapipelines#NotFoundException":
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
case "ResourceLimitExceededException":
case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException":
throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
case "ServiceFailureException":
case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException":
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
case "ServiceUnavailableException":
case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException":
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
case "ThrottledClientException":
case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException":
throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
case "UnauthorizedClientException":
case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException":
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
(0, smithy_client_1.throwDefaultError)({
output,
parsedBody,
exceptionCtor: ChimeSDKMediaPipelinesServiceException_1.ChimeSDKMediaPipelinesServiceException,
errorCode,
});
}
};
const deserializeAws_restJson1CreateMediaLiveConnectorPipelineCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return deserializeAws_restJson1CreateMediaLiveConnectorPipelineCommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
if (data.MediaLiveConnectorPipeline != null) {
contents.MediaLiveConnectorPipeline = deserializeAws_restJson1MediaLiveConnectorPipeline(data.MediaLiveConnectorPipeline, context);
}
return contents;
};
exports.deserializeAws_restJson1CreateMediaLiveConnectorPipelineCommand = deserializeAws_restJson1CreateMediaLiveConnectorPipelineCommand;
const deserializeAws_restJson1CreateMediaLiveConnectorPipelineCommandError = async (output, context) => {
const parsedOutput = {
...output,
body: await parseErrorBody(output.body, context),
};
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
switch (errorCode) {
case "BadRequestException":
case "com.amazonaws.chimesdkmediapipelines#BadRequestException":
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
case "ForbiddenException":
case "com.amazonaws.chimesdkmediapipelines#ForbiddenException":
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
case "ResourceLimitExceededException":
case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException":
throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
case "ServiceFailureException":
case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException":
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
case "ServiceUnavailableException":
case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException":
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
case "ThrottledClientException":
case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException":
throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
case "UnauthorizedClientException":
case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException":
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
(0, smithy_client_1.throwDefaultError)({
output,
parsedBody,
exceptionCtor: ChimeSDKMediaPipelinesServiceException_1.ChimeSDKMediaPipelinesServiceException,
errorCode,
});
}
};
const deserializeAws_restJson1DeleteMediaCapturePipelineCommand = async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return deserializeAws_restJson1DeleteMediaCapturePipelineCommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
await collectBody(output.body, context);
return contents;
};
exports.deserializeAws_restJson1DeleteMediaCapturePipelineCommand = deserializeAws_restJson1DeleteMediaCapturePipelineCommand;
const deserializeAws_restJson1DeleteMediaCapturePipelineCommandError = async (output, context) => {
const parsedOutput = {
...output,
body: await parseErrorBody(output.body, context),
};
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
switch (errorCode) {
case "BadRequestException":
case "com.amazonaws.chimesdkmediapipelines#BadRequestException":
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
case "ForbiddenException":
case "com.amazonaws.chimesdkmediapipelines#ForbiddenException":
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
case "NotFoundException":
case "com.amazonaws.chimesdkmediapipelines#NotFoundException":
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
case "ServiceFailureException":
case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException":
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
case "ServiceUnavailableException":
case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException":
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
case "ThrottledClientException":
case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException":
throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
case "UnauthorizedClientException":
case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException":
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
(0, smithy_client_1.throwDefaultError)({
output,
parsedBody,
exceptionCtor: ChimeSDKMediaPipelinesServiceException_1.ChimeSDKMediaPipelinesServiceException,
errorCode,
});
}
};
const deserializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommand = async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return deserializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
await collectBody(output.body, context);
return contents;
};
exports.deserializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommand = deserializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommand;
const deserializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommandError = async (output, context) => {
const parsedOutput = {
...output,
body: await parseErrorBody(output.body, context),
};
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
switch (errorCode) {
case "BadRequestException":
case "com.amazonaws.chimesdkmediapipelines#BadRequestException":
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
case "ConflictException":
case "com.amazonaws.chimesdkmediapipelines#ConflictException":
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
case "ForbiddenException":
case "com.amazonaws.chimesdkmediapipelines#ForbiddenException":
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
case "NotFoundException":
case "com.amazonaws.chimesdkmediapipelines#NotFoundException":
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
case "ServiceFailureException":
case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException":
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
case "ServiceUnavailableException":
case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException":
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
case "ThrottledClientException":
case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException":
throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
case "UnauthorizedClientException":
case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException":
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
(0, smithy_client_1.throwDefaultError)({
output,
parsedBody,
exceptionCtor: ChimeSDKMediaPipelinesServiceException_1.ChimeSDKMediaPipelinesServiceException,
errorCode,
});
}
};
const deserializeAws_restJson1DeleteMediaPipelineCommand = async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return deserializeAws_restJson1DeleteMediaPipelineCommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
await collectBody(output.body, context);
return contents;
};
exports.deserializeAws_restJson1DeleteMediaPipelineCommand = deserializeAws_restJson1DeleteMediaPipelineCommand;
const deserializeAws_restJson1DeleteMediaPipelineCommandError = async (output, context) => {
const parsedOutput = {
...output,
body: await parseErrorBody(output.body, context),
};
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
switch (errorCode) {
case "BadRequestException":
case "com.amazonaws.chimesdkmediapipelines#BadRequestException":
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
case "ForbiddenException":
case "com.amazonaws.chimesdkmediapipelines#ForbiddenException":
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
case "NotFoundException":
case "com.amazonaws.chimesdkmediapipelines#NotFoundException":
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
case "ServiceFailureException":
case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException":
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
case "ServiceUnavailableException":
case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException":
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
case "ThrottledClientException":
case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException":
throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
case "UnauthorizedClientException":
case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException":
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
(0, smithy_client_1.throwDefaultError)({
output,
parsedBody,
exceptionCtor: ChimeSDKMediaPipelinesServiceException_1.ChimeSDKMediaPipelinesServiceException,
errorCode,
});
}
};
const deserializeAws_restJson1GetMediaCapturePipelineCommand = async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1GetMediaCapturePipelineCommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
if (data.MediaCapturePipeline != null) {
contents.MediaCapturePipeline = deserializeAws_restJson1MediaCapturePipeline(data.MediaCapturePipeline, context);
}
return contents;
};
exports.deserializeAws_restJson1GetMediaCapturePipelineCommand = deserializeAws_restJson1GetMediaCapturePipelineCommand;
const deserializeAws_restJson1GetMediaCapturePipelineCommandError = async (output, context) => {
const parsedOutput = {
...output,
body: await parseErrorBody(output.body, context),
};
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
switch (errorCode) {
case "BadRequestException":
case "com.amazonaws.chimesdkmediapipelines#BadRequestException":
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
case "ForbiddenException":
case "com.amazonaws.chimesdkmediapipelines#ForbiddenException":
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
case "NotFoundException":
case "com.amazonaws.chimesdkmediapipelines#NotFoundException":
throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
case "ServiceFailureException":
case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException":
throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
case "ServiceUnavailableException":
case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException":
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
case "ThrottledClientException":
case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException":
throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
case "UnauthorizedClientException":
case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException":
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
(0, smi