cdk-amazon-chime-resources
Version:

956 lines • 246 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeAws_restJson1UpdateChannelMessageCommand = exports.serializeAws_restJson1UpdateChannelFlowCommand = exports.serializeAws_restJson1UpdateChannelCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1SendChannelMessageCommand = exports.serializeAws_restJson1SearchChannelsCommand = exports.serializeAws_restJson1RedactChannelMessageCommand = exports.serializeAws_restJson1PutMessagingStreamingConfigurationsCommand = exports.serializeAws_restJson1PutChannelMembershipPreferencesCommand = exports.serializeAws_restJson1PutChannelExpirationSettingsCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListSubChannelsCommand = exports.serializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommand = exports.serializeAws_restJson1ListChannelsAssociatedWithChannelFlowCommand = exports.serializeAws_restJson1ListChannelsCommand = exports.serializeAws_restJson1ListChannelModeratorsCommand = exports.serializeAws_restJson1ListChannelMessagesCommand = exports.serializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommand = exports.serializeAws_restJson1ListChannelMembershipsCommand = exports.serializeAws_restJson1ListChannelFlowsCommand = exports.serializeAws_restJson1ListChannelBansCommand = exports.serializeAws_restJson1GetMessagingStreamingConfigurationsCommand = exports.serializeAws_restJson1GetMessagingSessionEndpointCommand = exports.serializeAws_restJson1GetChannelMessageStatusCommand = exports.serializeAws_restJson1GetChannelMessageCommand = exports.serializeAws_restJson1GetChannelMembershipPreferencesCommand = exports.serializeAws_restJson1DisassociateChannelFlowCommand = exports.serializeAws_restJson1DescribeChannelModeratorCommand = exports.serializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommand = exports.serializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand = exports.serializeAws_restJson1DescribeChannelMembershipCommand = exports.serializeAws_restJson1DescribeChannelFlowCommand = exports.serializeAws_restJson1DescribeChannelBanCommand = exports.serializeAws_restJson1DescribeChannelCommand = exports.serializeAws_restJson1DeleteMessagingStreamingConfigurationsCommand = exports.serializeAws_restJson1DeleteChannelModeratorCommand = exports.serializeAws_restJson1DeleteChannelMessageCommand = exports.serializeAws_restJson1DeleteChannelMembershipCommand = exports.serializeAws_restJson1DeleteChannelFlowCommand = exports.serializeAws_restJson1DeleteChannelBanCommand = exports.serializeAws_restJson1DeleteChannelCommand = exports.serializeAws_restJson1CreateChannelModeratorCommand = exports.serializeAws_restJson1CreateChannelMembershipCommand = exports.serializeAws_restJson1CreateChannelFlowCommand = exports.serializeAws_restJson1CreateChannelBanCommand = exports.serializeAws_restJson1CreateChannelCommand = exports.serializeAws_restJson1ChannelFlowCallbackCommand = exports.serializeAws_restJson1BatchCreateChannelMembershipCommand = exports.serializeAws_restJson1AssociateChannelFlowCommand = void 0;
exports.deserializeAws_restJson1UpdateChannelFlowCommand = exports.deserializeAws_restJson1UpdateChannelCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1SendChannelMessageCommand = exports.deserializeAws_restJson1SearchChannelsCommand = exports.deserializeAws_restJson1RedactChannelMessageCommand = exports.deserializeAws_restJson1PutMessagingStreamingConfigurationsCommand = exports.deserializeAws_restJson1PutChannelMembershipPreferencesCommand = exports.deserializeAws_restJson1PutChannelExpirationSettingsCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListSubChannelsCommand = exports.deserializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommand = exports.deserializeAws_restJson1ListChannelsAssociatedWithChannelFlowCommand = exports.deserializeAws_restJson1ListChannelsCommand = exports.deserializeAws_restJson1ListChannelModeratorsCommand = exports.deserializeAws_restJson1ListChannelMessagesCommand = exports.deserializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommand = exports.deserializeAws_restJson1ListChannelMembershipsCommand = exports.deserializeAws_restJson1ListChannelFlowsCommand = exports.deserializeAws_restJson1ListChannelBansCommand = exports.deserializeAws_restJson1GetMessagingStreamingConfigurationsCommand = exports.deserializeAws_restJson1GetMessagingSessionEndpointCommand = exports.deserializeAws_restJson1GetChannelMessageStatusCommand = exports.deserializeAws_restJson1GetChannelMessageCommand = exports.deserializeAws_restJson1GetChannelMembershipPreferencesCommand = exports.deserializeAws_restJson1DisassociateChannelFlowCommand = exports.deserializeAws_restJson1DescribeChannelModeratorCommand = exports.deserializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommand = exports.deserializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand = exports.deserializeAws_restJson1DescribeChannelMembershipCommand = exports.deserializeAws_restJson1DescribeChannelFlowCommand = exports.deserializeAws_restJson1DescribeChannelBanCommand = exports.deserializeAws_restJson1DescribeChannelCommand = exports.deserializeAws_restJson1DeleteMessagingStreamingConfigurationsCommand = exports.deserializeAws_restJson1DeleteChannelModeratorCommand = exports.deserializeAws_restJson1DeleteChannelMessageCommand = exports.deserializeAws_restJson1DeleteChannelMembershipCommand = exports.deserializeAws_restJson1DeleteChannelFlowCommand = exports.deserializeAws_restJson1DeleteChannelBanCommand = exports.deserializeAws_restJson1DeleteChannelCommand = exports.deserializeAws_restJson1CreateChannelModeratorCommand = exports.deserializeAws_restJson1CreateChannelMembershipCommand = exports.deserializeAws_restJson1CreateChannelFlowCommand = exports.deserializeAws_restJson1CreateChannelBanCommand = exports.deserializeAws_restJson1CreateChannelCommand = exports.deserializeAws_restJson1ChannelFlowCallbackCommand = exports.deserializeAws_restJson1BatchCreateChannelMembershipCommand = exports.deserializeAws_restJson1AssociateChannelFlowCommand = exports.serializeAws_restJson1UpdateChannelReadMarkerCommand = void 0;
exports.deserializeAws_restJson1UpdateChannelReadMarkerCommand = exports.deserializeAws_restJson1UpdateChannelMessageCommand = 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 ChimeSDKMessagingServiceException_1 = require("../models/ChimeSDKMessagingServiceException");
const models_0_1 = require("../models/models_0");
const serializeAws_restJson1AssociateChannelFlowCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/channel-flow";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
let body;
body = JSON.stringify({
...(input.ChannelFlowArn != null && { ChannelFlowArn: input.ChannelFlowArn }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "PUT",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1AssociateChannelFlowCommand = serializeAws_restJson1AssociateChannelFlowCommand;
const serializeAws_restJson1BatchCreateChannelMembershipCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/memberships";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
operation: [, "batch-create"],
});
let body;
body = JSON.stringify({
...(input.MemberArns != null && { MemberArns: serializeAws_restJson1MemberArns(input.MemberArns, context) }),
...(input.SubChannelId != null && { SubChannelId: input.SubChannelId }),
...(input.Type != null && { Type: input.Type }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1BatchCreateChannelMembershipCommand = serializeAws_restJson1BatchCreateChannelMembershipCommand;
const serializeAws_restJson1ChannelFlowCallbackCommand = 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 || ""}` + "/channels/{ChannelArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
operation: [, "channel-flow-callback"],
});
let body;
body = JSON.stringify({
CallbackId: input.CallbackId ?? (0, uuid_1.v4)(),
...(input.ChannelMessage != null && {
ChannelMessage: serializeAws_restJson1ChannelMessageCallback(input.ChannelMessage, context),
}),
...(input.DeleteResource != null && { DeleteResource: input.DeleteResource }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ChannelFlowCallbackCommand = serializeAws_restJson1ChannelFlowCallbackCommand;
const serializeAws_restJson1CreateChannelCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
"x-amz-chime-bearer": input.ChimeBearer,
});
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels";
let body;
body = JSON.stringify({
...(input.AppInstanceArn != null && { AppInstanceArn: input.AppInstanceArn }),
...(input.ChannelId != null && { ChannelId: input.ChannelId }),
ClientRequestToken: input.ClientRequestToken ?? (0, uuid_1.v4)(),
...(input.ElasticChannelConfiguration != null && {
ElasticChannelConfiguration: serializeAws_restJson1ElasticChannelConfiguration(input.ElasticChannelConfiguration, context),
}),
...(input.ExpirationSettings != null && {
ExpirationSettings: serializeAws_restJson1ExpirationSettings(input.ExpirationSettings, context),
}),
...(input.MemberArns != null && { MemberArns: serializeAws_restJson1ChannelMemberArns(input.MemberArns, context) }),
...(input.Metadata != null && { Metadata: input.Metadata }),
...(input.Mode != null && { Mode: input.Mode }),
...(input.ModeratorArns != null && {
ModeratorArns: serializeAws_restJson1ChannelModeratorArns(input.ModeratorArns, context),
}),
...(input.Name != null && { Name: input.Name }),
...(input.Privacy != null && { Privacy: input.Privacy }),
...(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_restJson1CreateChannelCommand = serializeAws_restJson1CreateChannelCommand;
const serializeAws_restJson1CreateChannelBanCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/bans";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
let body;
body = JSON.stringify({
...(input.MemberArn != null && { MemberArn: input.MemberArn }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1CreateChannelBanCommand = serializeAws_restJson1CreateChannelBanCommand;
const serializeAws_restJson1CreateChannelFlowCommand = 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 || ""}` + "/channel-flows";
let body;
body = JSON.stringify({
...(input.AppInstanceArn != null && { AppInstanceArn: input.AppInstanceArn }),
...(input.ClientRequestToken != null && { ClientRequestToken: input.ClientRequestToken }),
...(input.Name != null && { Name: input.Name }),
...(input.Processors != null && { Processors: serializeAws_restJson1ProcessorList(input.Processors, 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_restJson1CreateChannelFlowCommand = serializeAws_restJson1CreateChannelFlowCommand;
const serializeAws_restJson1CreateChannelMembershipCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/memberships";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
let body;
body = JSON.stringify({
...(input.MemberArn != null && { MemberArn: input.MemberArn }),
...(input.SubChannelId != null && { SubChannelId: input.SubChannelId }),
...(input.Type != null && { Type: input.Type }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1CreateChannelMembershipCommand = serializeAws_restJson1CreateChannelMembershipCommand;
const serializeAws_restJson1CreateChannelModeratorCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/moderators";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
let body;
body = JSON.stringify({
...(input.ChannelModeratorArn != null && { ChannelModeratorArn: input.ChannelModeratorArn }),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1CreateChannelModeratorCommand = serializeAws_restJson1CreateChannelModeratorCommand;
const serializeAws_restJson1DeleteChannelCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
"sub-channel-id": [, input.SubChannelId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1DeleteChannelCommand = serializeAws_restJson1DeleteChannelCommand;
const serializeAws_restJson1DeleteChannelBanCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/bans/{MemberArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MemberArn", () => input.MemberArn, "{MemberArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DeleteChannelBanCommand = serializeAws_restJson1DeleteChannelBanCommand;
const serializeAws_restJson1DeleteChannelFlowCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channel-flows/{ChannelFlowArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelFlowArn", () => input.ChannelFlowArn, "{ChannelFlowArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DeleteChannelFlowCommand = serializeAws_restJson1DeleteChannelFlowCommand;
const serializeAws_restJson1DeleteChannelMembershipCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/channels/{ChannelArn}/memberships/{MemberArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MemberArn", () => input.MemberArn, "{MemberArn}", false);
const query = map({
"sub-channel-id": [, input.SubChannelId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1DeleteChannelMembershipCommand = serializeAws_restJson1DeleteChannelMembershipCommand;
const serializeAws_restJson1DeleteChannelMessageCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/channels/{ChannelArn}/messages/{MessageId}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MessageId", () => input.MessageId, "{MessageId}", false);
const query = map({
"sub-channel-id": [, input.SubChannelId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1DeleteChannelMessageCommand = serializeAws_restJson1DeleteChannelMessageCommand;
const serializeAws_restJson1DeleteChannelModeratorCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/channels/{ChannelArn}/moderators/{ChannelModeratorArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelModeratorArn", () => input.ChannelModeratorArn, "{ChannelModeratorArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DeleteChannelModeratorCommand = serializeAws_restJson1DeleteChannelModeratorCommand;
const serializeAws_restJson1DeleteMessagingStreamingConfigurationsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/app-instances/{AppInstanceArn}/streaming-configurations";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DeleteMessagingStreamingConfigurationsCommand = serializeAws_restJson1DeleteMessagingStreamingConfigurationsCommand;
const serializeAws_restJson1DescribeChannelCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DescribeChannelCommand = serializeAws_restJson1DescribeChannelCommand;
const serializeAws_restJson1DescribeChannelBanCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/bans/{MemberArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MemberArn", () => input.MemberArn, "{MemberArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DescribeChannelBanCommand = serializeAws_restJson1DescribeChannelBanCommand;
const serializeAws_restJson1DescribeChannelFlowCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channel-flows/{ChannelFlowArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelFlowArn", () => input.ChannelFlowArn, "{ChannelFlowArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DescribeChannelFlowCommand = serializeAws_restJson1DescribeChannelFlowCommand;
const serializeAws_restJson1DescribeChannelMembershipCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/channels/{ChannelArn}/memberships/{MemberArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MemberArn", () => input.MemberArn, "{MemberArn}", false);
const query = map({
"sub-channel-id": [, input.SubChannelId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1DescribeChannelMembershipCommand = serializeAws_restJson1DescribeChannelMembershipCommand;
const serializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
scope: [, "app-instance-user-membership"],
"app-instance-user-arn": [, (0, smithy_client_1.expectNonNull)(input.AppInstanceUserArn, `AppInstanceUserArn`)],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand = serializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand;
const serializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
scope: [, "app-instance-user-moderated-channel"],
"app-instance-user-arn": [, (0, smithy_client_1.expectNonNull)(input.AppInstanceUserArn, `AppInstanceUserArn`)],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommand = serializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommand;
const serializeAws_restJson1DescribeChannelModeratorCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/channels/{ChannelArn}/moderators/{ChannelModeratorArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelModeratorArn", () => input.ChannelModeratorArn, "{ChannelModeratorArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DescribeChannelModeratorCommand = serializeAws_restJson1DescribeChannelModeratorCommand;
const serializeAws_restJson1DisassociateChannelFlowCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/channels/{ChannelArn}/channel-flow/{ChannelFlowArn}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelFlowArn", () => input.ChannelFlowArn, "{ChannelFlowArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1DisassociateChannelFlowCommand = serializeAws_restJson1DisassociateChannelFlowCommand;
const serializeAws_restJson1GetChannelMembershipPreferencesCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/channels/{ChannelArn}/memberships/{MemberArn}/preferences";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MemberArn", () => input.MemberArn, "{MemberArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1GetChannelMembershipPreferencesCommand = serializeAws_restJson1GetChannelMembershipPreferencesCommand;
const serializeAws_restJson1GetChannelMessageCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/channels/{ChannelArn}/messages/{MessageId}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MessageId", () => input.MessageId, "{MessageId}", false);
const query = map({
"sub-channel-id": [, input.SubChannelId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1GetChannelMessageCommand = serializeAws_restJson1GetChannelMessageCommand;
const serializeAws_restJson1GetChannelMessageStatusCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/channels/{ChannelArn}/messages/{MessageId}";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MessageId", () => input.MessageId, "{MessageId}", false);
const query = map({
scope: [, "message-status"],
"sub-channel-id": [, input.SubChannelId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1GetChannelMessageStatusCommand = serializeAws_restJson1GetChannelMessageStatusCommand;
const serializeAws_restJson1GetMessagingSessionEndpointCommand = 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 || ""}` + "/endpoints/messaging-session";
let body;
body = "";
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1GetMessagingSessionEndpointCommand = serializeAws_restJson1GetMessagingSessionEndpointCommand;
const serializeAws_restJson1GetMessagingStreamingConfigurationsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/app-instances/{AppInstanceArn}/streaming-configurations";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1GetMessagingStreamingConfigurationsCommand = serializeAws_restJson1GetMessagingStreamingConfigurationsCommand;
const serializeAws_restJson1ListChannelBansCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/bans";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
"next-token": [, input.NextToken],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListChannelBansCommand = serializeAws_restJson1ListChannelBansCommand;
const serializeAws_restJson1ListChannelFlowsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channel-flows";
const query = map({
"app-instance-arn": [, (0, smithy_client_1.expectNonNull)(input.AppInstanceArn, `AppInstanceArn`)],
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
"next-token": [, input.NextToken],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListChannelFlowsCommand = serializeAws_restJson1ListChannelFlowsCommand;
const serializeAws_restJson1ListChannelMembershipsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/memberships";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
type: [, input.Type],
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
"next-token": [, input.NextToken],
"sub-channel-id": [, input.SubChannelId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListChannelMembershipsCommand = serializeAws_restJson1ListChannelMembershipsCommand;
const serializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels";
const query = map({
scope: [, "app-instance-user-memberships"],
"app-instance-user-arn": [, input.AppInstanceUserArn],
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
"next-token": [, input.NextToken],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommand = serializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommand;
const serializeAws_restJson1ListChannelMessagesCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/messages";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
"sort-order": [, input.SortOrder],
"not-before": [
() => input.NotBefore !== void 0,
() => (input.NotBefore.toISOString().split(".")[0] + "Z").toString(),
],
"not-after": [
() => input.NotAfter !== void 0,
() => (input.NotAfter.toISOString().split(".")[0] + "Z").toString(),
],
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
"next-token": [, input.NextToken],
"sub-channel-id": [, input.SubChannelId],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListChannelMessagesCommand = serializeAws_restJson1ListChannelMessagesCommand;
const serializeAws_restJson1ListChannelModeratorsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/moderators";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
"next-token": [, input.NextToken],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListChannelModeratorsCommand = serializeAws_restJson1ListChannelModeratorsCommand;
const serializeAws_restJson1ListChannelsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels";
const query = map({
"app-instance-arn": [, (0, smithy_client_1.expectNonNull)(input.AppInstanceArn, `AppInstanceArn`)],
privacy: [, input.Privacy],
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
"next-token": [, input.NextToken],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListChannelsCommand = serializeAws_restJson1ListChannelsCommand;
const serializeAws_restJson1ListChannelsAssociatedWithChannelFlowCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels";
const query = map({
scope: [, "channel-flow-associations"],
"channel-flow-arn": [, (0, smithy_client_1.expectNonNull)(input.ChannelFlowArn, `ChannelFlowArn`)],
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
"next-token": [, input.NextToken],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListChannelsAssociatedWithChannelFlowCommand = serializeAws_restJson1ListChannelsAssociatedWithChannelFlowCommand;
const serializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels";
const query = map({
scope: [, "app-instance-user-moderated-channels"],
"app-instance-user-arn": [, input.AppInstanceUserArn],
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
"next-token": [, input.NextToken],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommand = serializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommand;
const serializeAws_restJson1ListSubChannelsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{ChannelArn}/subchannels";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
"max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
"next-token": [, input.NextToken],
});
let body;
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
exports.serializeAws_restJson1ListSubChannelsCommand = serializeAws_restJson1ListSubChannelsCommand;
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_restJson1PutChannelExpirationSettingsCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
"x-amz-chime-bearer": input.ChimeBearer,
});
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/channels/{ChannelArn}/expiration-settings";
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
let body;
body = JSON.stringify({
...(input.ExpirationSettings != null && {
ExpirationSettings: serializeAws_restJson1ExpirationSettings(input.ExpirationSettings, context),
}),
});
return new protocol_http_1.HttpRequest({
protocol,
hostname,
port,
method: "PUT",
headers,
path: resolvedPath,
body,
});
};
exports.serializeAws_restJson1PutChannelExpirationSettingsCommand = serializeAws_restJson1PutChannelExpirationSettingsCommand;
const serializeAws_restJson1PutChannelMembershipPreferencesCommand = async (input, context) => {
const { hostname, protocol = "https", port, p