cdk-amazon-chime-resources
Version:

1,212 lines • 698 kB
JavaScript
import { HttpRequest as __HttpRequest, isValidHostname as __isValidHostname, } from "@aws-sdk/protocol-http";
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
import { v4 as generateIdempotencyToken } from "uuid";
import { ChimeServiceException as __BaseException } from "../models/ChimeServiceException";
import { AccessDeniedException, BadRequestException, ConflictException, ForbiddenException, NotFoundException, ResourceLimitExceededException, ServiceFailureException, ServiceUnavailableException, ThrottledClientException, UnauthorizedClientException, UnprocessableEntityException, } from "../models/models_0";
export const se_AssociatePhoneNumbersWithVoiceConnectorCommand = 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 || ""}` + "/voice-connectors/{VoiceConnectorId}";
resolvedPath = __resolvedPath(resolvedPath, input, "VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
const query = map({
operation: [, "associate-phone-numbers"],
});
let body;
body = JSON.stringify({
...(input.E164PhoneNumbers != null && {
E164PhoneNumbers: se_E164PhoneNumberList(input.E164PhoneNumbers, context),
}),
...(input.ForceAssociate != null && { ForceAssociate: input.ForceAssociate }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_AssociatePhoneNumbersWithVoiceConnectorGroupCommand = 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 || ""}` +
"/voice-connector-groups/{VoiceConnectorGroupId}";
resolvedPath = __resolvedPath(resolvedPath, input, "VoiceConnectorGroupId", () => input.VoiceConnectorGroupId, "{VoiceConnectorGroupId}", false);
const query = map({
operation: [, "associate-phone-numbers"],
});
let body;
body = JSON.stringify({
...(input.E164PhoneNumbers != null && {
E164PhoneNumbers: se_E164PhoneNumberList(input.E164PhoneNumbers, context),
}),
...(input.ForceAssociate != null && { ForceAssociate: input.ForceAssociate }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_AssociatePhoneNumberWithUserCommand = 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 || ""}` + "/accounts/{AccountId}/users/{UserId}";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "UserId", () => input.UserId, "{UserId}", false);
const query = map({
operation: [, "associate-phone-number"],
});
let body;
body = JSON.stringify({
...(input.E164PhoneNumber != null && { E164PhoneNumber: input.E164PhoneNumber }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_AssociateSigninDelegateGroupsWithAccountCommand = 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 || ""}` + "/accounts/{AccountId}";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
const query = map({
operation: [, "associate-signin-delegate-groups"],
});
let body;
body = JSON.stringify({
...(input.SigninDelegateGroups != null && {
SigninDelegateGroups: se_SigninDelegateGroupList(input.SigninDelegateGroups, context),
}),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_BatchCreateAttendeeCommand = 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 || ""}` + "/meetings/{MeetingId}/attendees";
resolvedPath = __resolvedPath(resolvedPath, input, "MeetingId", () => input.MeetingId, "{MeetingId}", false);
const query = map({
operation: [, "batch-create"],
});
let body;
body = JSON.stringify({
...(input.Attendees != null && { Attendees: se_CreateAttendeeRequestItemList(input.Attendees, context) }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_BatchCreateChannelMembershipCommand = 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 = __resolvedPath(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
const query = map({
operation: [, "batch-create"],
});
let body;
body = JSON.stringify({
...(input.MemberArns != null && { MemberArns: se_MemberArns(input.MemberArns, context) }),
...(input.Type != null && { Type: input.Type }),
});
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "messaging-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_BatchCreateRoomMembershipCommand = 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 || ""}` +
"/accounts/{AccountId}/rooms/{RoomId}/memberships";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "RoomId", () => input.RoomId, "{RoomId}", false);
const query = map({
operation: [, "batch-create"],
});
let body;
body = JSON.stringify({
...(input.MembershipItemList != null && {
MembershipItemList: se_MembershipItemList(input.MembershipItemList, context),
}),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_BatchDeletePhoneNumberCommand = 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 || ""}` + "/phone-numbers";
const query = map({
operation: [, "batch-delete"],
});
let body;
body = JSON.stringify({
...(input.PhoneNumberIds != null && { PhoneNumberIds: se_NonEmptyStringList(input.PhoneNumberIds, context) }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_BatchSuspendUserCommand = 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 || ""}` + "/accounts/{AccountId}/users";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
const query = map({
operation: [, "suspend"],
});
let body;
body = JSON.stringify({
...(input.UserIdList != null && { UserIdList: se_UserIdList(input.UserIdList, context) }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_BatchUnsuspendUserCommand = 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 || ""}` + "/accounts/{AccountId}/users";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
const query = map({
operation: [, "unsuspend"],
});
let body;
body = JSON.stringify({
...(input.UserIdList != null && { UserIdList: se_UserIdList(input.UserIdList, context) }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_BatchUpdatePhoneNumberCommand = 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 || ""}` + "/phone-numbers";
const query = map({
operation: [, "batch-update"],
});
let body;
body = JSON.stringify({
...(input.UpdatePhoneNumberRequestItems != null && {
UpdatePhoneNumberRequestItems: se_UpdatePhoneNumberRequestItemList(input.UpdatePhoneNumberRequestItems, context),
}),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_BatchUpdateUserCommand = 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 || ""}` + "/accounts/{AccountId}/users";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
let body;
body = JSON.stringify({
...(input.UpdateUserRequestItems != null && {
UpdateUserRequestItems: se_UpdateUserRequestItemList(input.UpdateUserRequestItems, context),
}),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateAccountCommand = 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 || ""}` + "/accounts";
let body;
body = JSON.stringify({
...(input.Name != null && { Name: input.Name }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateAppInstanceCommand = 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 || ""}` + "/app-instances";
let body;
body = JSON.stringify({
ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
...(input.Metadata != null && { Metadata: input.Metadata }),
...(input.Name != null && { Name: input.Name }),
...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
});
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "identity-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateAppInstanceAdminCommand = 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 || ""}` + "/app-instances/{AppInstanceArn}/admins";
resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
let body;
body = JSON.stringify({
...(input.AppInstanceAdminArn != null && { AppInstanceAdminArn: input.AppInstanceAdminArn }),
});
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "identity-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateAppInstanceUserCommand = 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 || ""}` + "/app-instance-users";
let body;
body = JSON.stringify({
...(input.AppInstanceArn != null && { AppInstanceArn: input.AppInstanceArn }),
...(input.AppInstanceUserId != null && { AppInstanceUserId: input.AppInstanceUserId }),
ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
...(input.Metadata != null && { Metadata: input.Metadata }),
...(input.Name != null && { Name: input.Name }),
...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
});
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "identity-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateAttendeeCommand = 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 || ""}` + "/meetings/{MeetingId}/attendees";
resolvedPath = __resolvedPath(resolvedPath, input, "MeetingId", () => input.MeetingId, "{MeetingId}", false);
let body;
body = JSON.stringify({
...(input.ExternalUserId != null && { ExternalUserId: input.ExternalUserId }),
...(input.Tags != null && { Tags: se_AttendeeTagList(input.Tags, context) }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateBotCommand = 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 || ""}` + "/accounts/{AccountId}/bots";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
let body;
body = JSON.stringify({
...(input.DisplayName != null && { DisplayName: input.DisplayName }),
...(input.Domain != null && { Domain: input.Domain }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateChannelCommand = 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 }),
ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
...(input.Metadata != null && { Metadata: input.Metadata }),
...(input.Mode != null && { Mode: input.Mode }),
...(input.Name != null && { Name: input.Name }),
...(input.Privacy != null && { Privacy: input.Privacy }),
...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
});
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "messaging-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateChannelBanCommand = 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 = __resolvedPath(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
let body;
body = JSON.stringify({
...(input.MemberArn != null && { MemberArn: input.MemberArn }),
});
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "messaging-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateChannelMembershipCommand = 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 = __resolvedPath(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
let body;
body = JSON.stringify({
...(input.MemberArn != null && { MemberArn: input.MemberArn }),
...(input.Type != null && { Type: input.Type }),
});
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "messaging-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateChannelModeratorCommand = 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 = __resolvedPath(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
let body;
body = JSON.stringify({
...(input.ChannelModeratorArn != null && { ChannelModeratorArn: input.ChannelModeratorArn }),
});
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "messaging-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateMediaCapturePipelineCommand = 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-capture-pipelines";
let body;
body = JSON.stringify({
...(input.ChimeSdkMeetingConfiguration != null && {
ChimeSdkMeetingConfiguration: se_ChimeSdkMeetingConfiguration(input.ChimeSdkMeetingConfiguration, context),
}),
ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
...(input.SinkArn != null && { SinkArn: input.SinkArn }),
...(input.SinkType != null && { SinkType: input.SinkType }),
...(input.SourceArn != null && { SourceArn: input.SourceArn }),
...(input.SourceType != null && { SourceType: input.SourceType }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateMeetingCommand = 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 || ""}` + "/meetings";
let body;
body = JSON.stringify({
ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
...(input.ExternalMeetingId != null && { ExternalMeetingId: input.ExternalMeetingId }),
...(input.MediaRegion != null && { MediaRegion: input.MediaRegion }),
...(input.MeetingHostId != null && { MeetingHostId: input.MeetingHostId }),
...(input.NotificationsConfiguration != null && {
NotificationsConfiguration: se_MeetingNotificationConfiguration(input.NotificationsConfiguration, context),
}),
...(input.Tags != null && { Tags: se_MeetingTagList(input.Tags, context) }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateMeetingDialOutCommand = 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 || ""}` + "/meetings/{MeetingId}/dial-outs";
resolvedPath = __resolvedPath(resolvedPath, input, "MeetingId", () => input.MeetingId, "{MeetingId}", false);
let body;
body = JSON.stringify({
...(input.FromPhoneNumber != null && { FromPhoneNumber: input.FromPhoneNumber }),
...(input.JoinToken != null && { JoinToken: input.JoinToken }),
...(input.ToPhoneNumber != null && { ToPhoneNumber: input.ToPhoneNumber }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateMeetingWithAttendeesCommand = 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 || ""}` + "/meetings";
const query = map({
operation: [, "create-attendees"],
});
let body;
body = JSON.stringify({
...(input.Attendees != null && {
Attendees: se_CreateMeetingWithAttendeesRequestItemList(input.Attendees, context),
}),
ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
...(input.ExternalMeetingId != null && { ExternalMeetingId: input.ExternalMeetingId }),
...(input.MediaRegion != null && { MediaRegion: input.MediaRegion }),
...(input.MeetingHostId != null && { MeetingHostId: input.MeetingHostId }),
...(input.NotificationsConfiguration != null && {
NotificationsConfiguration: se_MeetingNotificationConfiguration(input.NotificationsConfiguration, context),
}),
...(input.Tags != null && { Tags: se_MeetingTagList(input.Tags, context) }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_CreatePhoneNumberOrderCommand = 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 || ""}` + "/phone-number-orders";
let body;
body = JSON.stringify({
...(input.E164PhoneNumbers != null && {
E164PhoneNumbers: se_E164PhoneNumberList(input.E164PhoneNumbers, context),
}),
...(input.ProductType != null && { ProductType: input.ProductType }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateProxySessionCommand = 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 || ""}` +
"/voice-connectors/{VoiceConnectorId}/proxy-sessions";
resolvedPath = __resolvedPath(resolvedPath, input, "VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify({
...(input.Capabilities != null && { Capabilities: se_CapabilityList(input.Capabilities, context) }),
...(input.ExpiryMinutes != null && { ExpiryMinutes: input.ExpiryMinutes }),
...(input.GeoMatchLevel != null && { GeoMatchLevel: input.GeoMatchLevel }),
...(input.GeoMatchParams != null && { GeoMatchParams: se_GeoMatchParams(input.GeoMatchParams, context) }),
...(input.Name != null && { Name: input.Name }),
...(input.NumberSelectionBehavior != null && { NumberSelectionBehavior: input.NumberSelectionBehavior }),
...(input.ParticipantPhoneNumbers != null && {
ParticipantPhoneNumbers: se_ParticipantPhoneNumberList(input.ParticipantPhoneNumbers, context),
}),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateRoomCommand = 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 || ""}` + "/accounts/{AccountId}/rooms";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
let body;
body = JSON.stringify({
ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
...(input.Name != null && { Name: input.Name }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateRoomMembershipCommand = 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 || ""}` +
"/accounts/{AccountId}/rooms/{RoomId}/memberships";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "RoomId", () => input.RoomId, "{RoomId}", false);
let body;
body = JSON.stringify({
...(input.MemberId != null && { MemberId: input.MemberId }),
...(input.Role != null && { Role: input.Role }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateSipMediaApplicationCommand = 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 || ""}` + "/sip-media-applications";
let body;
body = JSON.stringify({
...(input.AwsRegion != null && { AwsRegion: input.AwsRegion }),
...(input.Endpoints != null && { Endpoints: se_SipMediaApplicationEndpointList(input.Endpoints, context) }),
...(input.Name != null && { Name: input.Name }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateSipMediaApplicationCallCommand = 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 || ""}` +
"/sip-media-applications/{SipMediaApplicationId}/calls";
resolvedPath = __resolvedPath(resolvedPath, input, "SipMediaApplicationId", () => input.SipMediaApplicationId, "{SipMediaApplicationId}", false);
let body;
body = JSON.stringify({
...(input.FromPhoneNumber != null && { FromPhoneNumber: input.FromPhoneNumber }),
...(input.SipHeaders != null && { SipHeaders: se_SipHeadersMap(input.SipHeaders, context) }),
...(input.ToPhoneNumber != null && { ToPhoneNumber: input.ToPhoneNumber }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateSipRuleCommand = 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 || ""}` + "/sip-rules";
let body;
body = JSON.stringify({
...(input.Disabled != null && { Disabled: input.Disabled }),
...(input.Name != null && { Name: input.Name }),
...(input.TargetApplications != null && {
TargetApplications: se_SipRuleTargetApplicationList(input.TargetApplications, context),
}),
...(input.TriggerType != null && { TriggerType: input.TriggerType }),
...(input.TriggerValue != null && { TriggerValue: input.TriggerValue }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateUserCommand = 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 || ""}` + "/accounts/{AccountId}/users";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
const query = map({
operation: [, "create"],
});
let body;
body = JSON.stringify({
...(input.Email != null && { Email: input.Email }),
...(input.UserType != null && { UserType: input.UserType }),
...(input.Username != null && { Username: input.Username }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
query,
body,
});
};
export const se_CreateVoiceConnectorCommand = 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 || ""}` + "/voice-connectors";
let body;
body = JSON.stringify({
...(input.AwsRegion != null && { AwsRegion: input.AwsRegion }),
...(input.Name != null && { Name: input.Name }),
...(input.RequireEncryption != null && { RequireEncryption: input.RequireEncryption }),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_CreateVoiceConnectorGroupCommand = 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 || ""}` + "/voice-connector-groups";
let body;
body = JSON.stringify({
...(input.Name != null && { Name: input.Name }),
...(input.VoiceConnectorItems != null && {
VoiceConnectorItems: se_VoiceConnectorItemList(input.VoiceConnectorItems, context),
}),
});
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteAccountCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/accounts/{AccountId}";
resolvedPath = __resolvedPath(resolvedPath, input, "AccountId", () => input.AccountId, "{AccountId}", false);
let body;
return new __HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteAppInstanceCommand = 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}";
resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
let body;
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "identity-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteAppInstanceAdminCommand = 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}/admins/{AppInstanceAdminArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceAdminArn", () => input.AppInstanceAdminArn, "{AppInstanceAdminArn}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
let body;
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "identity-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteAppInstanceStreamingConfigurationsCommand = 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 = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
let body;
return new __HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteAppInstanceUserCommand = 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-instance-users/{AppInstanceUserArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
let body;
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "identity-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteAttendeeCommand = async (input, context) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const headers = {};
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
"/meetings/{MeetingId}/attendees/{AttendeeId}";
resolvedPath = __resolvedPath(resolvedPath, input, "MeetingId", () => input.MeetingId, "{MeetingId}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "AttendeeId", () => input.AttendeeId, "{AttendeeId}", false);
let body;
return new __HttpRequest({
protocol,
hostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteChannelCommand = 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 = __resolvedPath(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
let body;
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "messaging-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteChannelBanCommand = 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 = __resolvedPath(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "MemberArn", () => input.MemberArn, "{MemberArn}", false);
let body;
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "messaging-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteChannelMembershipCommand = 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 = __resolvedPath(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "MemberArn", () => input.MemberArn, "{MemberArn}", false);
let body;
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "messaging-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteChannelMessageCommand = 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 = __resolvedPath(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "MessageId", () => input.MessageId, "{MessageId}", false);
let body;
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "messaging-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteChannelModeratorCommand = 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 = __resolvedPath(resolvedPath, input, "ChannelArn", () => input.ChannelArn, "{ChannelArn}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "ChannelModeratorArn", () => input.ChannelModeratorArn, "{ChannelModeratorArn}", false);
let body;
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
resolvedHostname = "messaging-" + resolvedHostname;
if (!__isValidHostname(resolvedHostname)) {
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
}
}
return new __HttpRequest({
protocol,
hostname: resolvedHostname,
port,
method: "DELETE",
headers,
path: resolvedPath,
body,
});
};
export const se_DeleteEventsConfigurationCommand = async (input, context) => {
const { hostname, protocol = "https", port,