cdk-amazon-chime-resources
Version:

1,370 lines • 109 kB
JavaScript
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
import { requestBuilder as rb } from "@smithy/core";
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, take, withBaseException, } from "@smithy/smithy-client";
import { ChimeSDKVoiceServiceException as __BaseException } from "../models/ChimeSDKVoiceServiceException";
import { AccessDeniedException, BadRequestException, ConflictException, ForbiddenException, GoneException, NotFoundException, ResourceLimitExceededException, ServiceFailureException, ServiceUnavailableException, ThrottledClientException, UnauthorizedClientException, UnprocessableEntityException, } from "../models/models_0";
export const se_AssociatePhoneNumbersWithVoiceConnectorCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
const query = map({
[_o]: [, "associate-phone-numbers"],
});
let body;
body = JSON.stringify(take(input, {
E164PhoneNumbers: (_) => _json(_),
ForceAssociate: [],
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_AssociatePhoneNumbersWithVoiceConnectorGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connector-groups/{VoiceConnectorGroupId}");
b.p("VoiceConnectorGroupId", () => input.VoiceConnectorGroupId, "{VoiceConnectorGroupId}", false);
const query = map({
[_o]: [, "associate-phone-numbers"],
});
let body;
body = JSON.stringify(take(input, {
E164PhoneNumbers: (_) => _json(_),
ForceAssociate: [],
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_BatchDeletePhoneNumberCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/phone-numbers");
const query = map({
[_o]: [, "batch-delete"],
});
let body;
body = JSON.stringify(take(input, {
PhoneNumberIds: (_) => _json(_),
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_BatchUpdatePhoneNumberCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/phone-numbers");
const query = map({
[_o]: [, "batch-update"],
});
let body;
body = JSON.stringify(take(input, {
UpdatePhoneNumberRequestItems: (_) => _json(_),
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_CreatePhoneNumberOrderCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/phone-number-orders");
let body;
body = JSON.stringify(take(input, {
E164PhoneNumbers: (_) => _json(_),
Name: [],
ProductType: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateProxySessionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/proxy-sessions");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify(take(input, {
Capabilities: (_) => _json(_),
ExpiryMinutes: [],
GeoMatchLevel: [],
GeoMatchParams: (_) => _json(_),
Name: [],
NumberSelectionBehavior: [],
ParticipantPhoneNumbers: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateSipMediaApplicationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/sip-media-applications");
let body;
body = JSON.stringify(take(input, {
AwsRegion: [],
Endpoints: (_) => _json(_),
Name: [],
Tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateSipMediaApplicationCallCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/sip-media-applications/{SipMediaApplicationId}/calls");
b.p("SipMediaApplicationId", () => input.SipMediaApplicationId, "{SipMediaApplicationId}", false);
let body;
body = JSON.stringify(take(input, {
ArgumentsMap: (_) => _json(_),
FromPhoneNumber: [],
SipHeaders: (_) => _json(_),
ToPhoneNumber: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateSipRuleCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/sip-rules");
let body;
body = JSON.stringify(take(input, {
Disabled: [],
Name: [],
TargetApplications: (_) => _json(_),
TriggerType: [],
TriggerValue: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateVoiceConnectorCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors");
let body;
body = JSON.stringify(take(input, {
AwsRegion: [],
Name: [],
RequireEncryption: [],
Tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateVoiceConnectorGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connector-groups");
let body;
body = JSON.stringify(take(input, {
Name: [],
VoiceConnectorItems: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateVoiceProfileCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-profiles");
let body;
body = JSON.stringify(take(input, {
SpeakerSearchTaskId: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_CreateVoiceProfileDomainCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-profile-domains");
let body;
body = JSON.stringify(take(input, {
ClientRequestToken: [],
Description: [],
Name: [],
ServerSideEncryptionConfiguration: (_) => _json(_),
Tags: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_DeletePhoneNumberCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/phone-numbers/{PhoneNumberId}");
b.p("PhoneNumberId", () => input.PhoneNumberId, "{PhoneNumberId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteProxySessionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/proxy-sessions/{ProxySessionId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
b.p("ProxySessionId", () => input.ProxySessionId, "{ProxySessionId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteSipMediaApplicationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/sip-media-applications/{SipMediaApplicationId}");
b.p("SipMediaApplicationId", () => input.SipMediaApplicationId, "{SipMediaApplicationId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteSipRuleCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/sip-rules/{SipRuleId}");
b.p("SipRuleId", () => input.SipRuleId, "{SipRuleId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteVoiceConnectorCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteVoiceConnectorEmergencyCallingConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/emergency-calling-configuration");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteVoiceConnectorGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connector-groups/{VoiceConnectorGroupId}");
b.p("VoiceConnectorGroupId", () => input.VoiceConnectorGroupId, "{VoiceConnectorGroupId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteVoiceConnectorOriginationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/origination");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteVoiceConnectorProxyCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/programmable-numbers/proxy");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteVoiceConnectorStreamingConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/streaming-configuration");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteVoiceConnectorTerminationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/termination");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteVoiceConnectorTerminationCredentialsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/termination/credentials");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
const query = map({
[_o]: [, "delete"],
});
let body;
body = JSON.stringify(take(input, {
Usernames: (_) => _json(_),
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_DeleteVoiceProfileCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-profiles/{VoiceProfileId}");
b.p("VoiceProfileId", () => input.VoiceProfileId, "{VoiceProfileId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DeleteVoiceProfileDomainCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-profile-domains/{VoiceProfileDomainId}");
b.p("VoiceProfileDomainId", () => input.VoiceProfileDomainId, "{VoiceProfileDomainId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
};
export const se_DisassociatePhoneNumbersFromVoiceConnectorCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
const query = map({
[_o]: [, "disassociate-phone-numbers"],
});
let body;
body = JSON.stringify(take(input, {
E164PhoneNumbers: (_) => _json(_),
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_DisassociatePhoneNumbersFromVoiceConnectorGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connector-groups/{VoiceConnectorGroupId}");
b.p("VoiceConnectorGroupId", () => input.VoiceConnectorGroupId, "{VoiceConnectorGroupId}", false);
const query = map({
[_o]: [, "disassociate-phone-numbers"],
});
let body;
body = JSON.stringify(take(input, {
E164PhoneNumbers: (_) => _json(_),
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_GetGlobalSettingsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/settings");
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetPhoneNumberCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/phone-numbers/{PhoneNumberId}");
b.p("PhoneNumberId", () => input.PhoneNumberId, "{PhoneNumberId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetPhoneNumberOrderCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/phone-number-orders/{PhoneNumberOrderId}");
b.p("PhoneNumberOrderId", () => input.PhoneNumberOrderId, "{PhoneNumberOrderId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetPhoneNumberSettingsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/settings/phone-number");
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetProxySessionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/proxy-sessions/{ProxySessionId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
b.p("ProxySessionId", () => input.ProxySessionId, "{ProxySessionId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetSipMediaApplicationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/sip-media-applications/{SipMediaApplicationId}");
b.p("SipMediaApplicationId", () => input.SipMediaApplicationId, "{SipMediaApplicationId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetSipMediaApplicationAlexaSkillConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/sip-media-applications/{SipMediaApplicationId}/alexa-skill-configuration");
b.p("SipMediaApplicationId", () => input.SipMediaApplicationId, "{SipMediaApplicationId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetSipMediaApplicationLoggingConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/sip-media-applications/{SipMediaApplicationId}/logging-configuration");
b.p("SipMediaApplicationId", () => input.SipMediaApplicationId, "{SipMediaApplicationId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetSipRuleCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/sip-rules/{SipRuleId}");
b.p("SipRuleId", () => input.SipRuleId, "{SipRuleId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetSpeakerSearchTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/speaker-search-tasks/{SpeakerSearchTaskId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
b.p("SpeakerSearchTaskId", () => input.SpeakerSearchTaskId, "{SpeakerSearchTaskId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceConnectorCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceConnectorEmergencyCallingConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/emergency-calling-configuration");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceConnectorGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connector-groups/{VoiceConnectorGroupId}");
b.p("VoiceConnectorGroupId", () => input.VoiceConnectorGroupId, "{VoiceConnectorGroupId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceConnectorLoggingConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/logging-configuration");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceConnectorOriginationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/origination");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceConnectorProxyCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/programmable-numbers/proxy");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceConnectorStreamingConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/streaming-configuration");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceConnectorTerminationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/termination");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceConnectorTerminationHealthCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/termination/health");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceProfileCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-profiles/{VoiceProfileId}");
b.p("VoiceProfileId", () => input.VoiceProfileId, "{VoiceProfileId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceProfileDomainCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-profile-domains/{VoiceProfileDomainId}");
b.p("VoiceProfileDomainId", () => input.VoiceProfileDomainId, "{VoiceProfileDomainId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_GetVoiceToneAnalysisTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/voice-tone-analysis-tasks/{VoiceToneAnalysisTaskId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
b.p("VoiceToneAnalysisTaskId", () => input.VoiceToneAnalysisTaskId, "{VoiceToneAnalysisTaskId}", false);
const query = map({
[_iC]: [__expectNonNull(input.IsCaller, `IsCaller`) != null, () => input[_IC].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListAvailableVoiceConnectorRegionsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connector-regions");
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_ListPhoneNumberOrdersCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/phone-number-orders");
const query = map({
[_nt]: [, input[_NT]],
[_mr]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListPhoneNumbersCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/phone-numbers");
const query = map({
[_s]: [, input[_S]],
[_pt]: [, input[_PT]],
[_fn]: [, input[_FN]],
[_fv]: [, input[_FV]],
[_mr]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nt]: [, input[_NT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListProxySessionsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/proxy-sessions");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
const query = map({
[_s]: [, input[_S]],
[_nt]: [, input[_NT]],
[_mr]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListSipMediaApplicationsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/sip-media-applications");
const query = map({
[_mr]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nt]: [, input[_NT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListSipRulesCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/sip-rules");
const query = map({
[_sma]: [, input[_SMAI]],
[_mr]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nt]: [, input[_NT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListSupportedPhoneNumberCountriesCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/phone-number-countries");
const query = map({
[_pt]: [, __expectNonNull(input[_PT], `ProductType`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListTagsForResourceCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/tags");
const query = map({
[_a]: [, __expectNonNull(input[_RARN], `ResourceARN`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListVoiceConnectorGroupsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connector-groups");
const query = map({
[_nt]: [, input[_NT]],
[_mr]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListVoiceConnectorsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors");
const query = map({
[_nt]: [, input[_NT]],
[_mr]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListVoiceConnectorTerminationCredentialsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/termination/credentials");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
};
export const se_ListVoiceProfileDomainsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-profile-domains");
const query = map({
[_nt]: [, input[_NT]],
[_mr]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_ListVoiceProfilesCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-profiles");
const query = map({
[_vpdi]: [, __expectNonNull(input[_VPDI], `VoiceProfileDomainId`)],
[_nt]: [, input[_NT]],
[_mr]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_PutSipMediaApplicationAlexaSkillConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/sip-media-applications/{SipMediaApplicationId}/alexa-skill-configuration");
b.p("SipMediaApplicationId", () => input.SipMediaApplicationId, "{SipMediaApplicationId}", false);
let body;
body = JSON.stringify(take(input, {
SipMediaApplicationAlexaSkillConfiguration: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_PutSipMediaApplicationLoggingConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/sip-media-applications/{SipMediaApplicationId}/logging-configuration");
b.p("SipMediaApplicationId", () => input.SipMediaApplicationId, "{SipMediaApplicationId}", false);
let body;
body = JSON.stringify(take(input, {
SipMediaApplicationLoggingConfiguration: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_PutVoiceConnectorEmergencyCallingConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/emergency-calling-configuration");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify(take(input, {
EmergencyCallingConfiguration: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_PutVoiceConnectorLoggingConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/logging-configuration");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify(take(input, {
LoggingConfiguration: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_PutVoiceConnectorOriginationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/origination");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify(take(input, {
Origination: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_PutVoiceConnectorProxyCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/programmable-numbers/proxy");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify(take(input, {
DefaultSessionExpiryMinutes: [],
Disabled: [],
FallBackPhoneNumber: [],
PhoneNumberPoolCountries: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_PutVoiceConnectorStreamingConfigurationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/streaming-configuration");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify(take(input, {
StreamingConfiguration: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_PutVoiceConnectorTerminationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/termination");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify(take(input, {
Termination: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_PutVoiceConnectorTerminationCredentialsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/termination/credentials");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
const query = map({
[_o]: [, "put"],
});
let body;
body = JSON.stringify(take(input, {
Credentials: (_) => _json(_),
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_RestorePhoneNumberCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/phone-numbers/{PhoneNumberId}");
b.p("PhoneNumberId", () => input.PhoneNumberId, "{PhoneNumberId}", false);
const query = map({
[_o]: [, "restore"],
});
let body;
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_SearchAvailablePhoneNumbersCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/search");
const query = map({
[_t]: [, "phone-numbers"],
[_ac]: [, input[_AC]],
[_c]: [, input[_C]],
[_co]: [, input[_Co]],
[_st]: [, input[_St]],
[_tfp]: [, input[_TFP]],
[_pnt]: [, input[_PNT]],
[_mr]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nt]: [, input[_NT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};
export const se_StartSpeakerSearchTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/speaker-search-tasks");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify(take(input, {
CallLeg: [],
ClientRequestToken: [],
TransactionId: [],
VoiceProfileDomainId: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_StartVoiceToneAnalysisTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/voice-tone-analysis-tasks");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify(take(input, {
ClientRequestToken: [],
LanguageCode: [],
TransactionId: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_StopSpeakerSearchTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/speaker-search-tasks/{SpeakerSearchTaskId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
b.p("SpeakerSearchTaskId", () => input.SpeakerSearchTaskId, "{SpeakerSearchTaskId}", false);
const query = map({
[_o]: [, "stop"],
});
let body;
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_StopVoiceToneAnalysisTaskCommand = async (input, context) => {
const b = rb(input, context);
const headers = {};
b.bp("/voice-connectors/{VoiceConnectorId}/voice-tone-analysis-tasks/{VoiceToneAnalysisTaskId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
b.p("VoiceToneAnalysisTaskId", () => input.VoiceToneAnalysisTaskId, "{VoiceToneAnalysisTaskId}", false);
const query = map({
[_o]: [, "stop"],
});
let body;
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_TagResourceCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/tags");
const query = map({
[_o]: [, "tag-resource"],
});
let body;
body = JSON.stringify(take(input, {
ResourceARN: [],
Tags: (_) => _json(_),
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_UntagResourceCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/tags");
const query = map({
[_o]: [, "untag-resource"],
});
let body;
body = JSON.stringify(take(input, {
ResourceARN: [],
TagKeys: (_) => _json(_),
}));
b.m("POST").h(headers).q(query).b(body);
return b.build();
};
export const se_UpdateGlobalSettingsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/settings");
let body;
body = JSON.stringify(take(input, {
VoiceConnector: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_UpdatePhoneNumberCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/phone-numbers/{PhoneNumberId}");
b.p("PhoneNumberId", () => input.PhoneNumberId, "{PhoneNumberId}", false);
let body;
body = JSON.stringify(take(input, {
CallingName: [],
Name: [],
ProductType: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_UpdatePhoneNumberSettingsCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/settings/phone-number");
let body;
body = JSON.stringify(take(input, {
CallingName: [],
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_UpdateProxySessionCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}/proxy-sessions/{ProxySessionId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
b.p("ProxySessionId", () => input.ProxySessionId, "{ProxySessionId}", false);
let body;
body = JSON.stringify(take(input, {
Capabilities: (_) => _json(_),
ExpiryMinutes: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_UpdateSipMediaApplicationCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/sip-media-applications/{SipMediaApplicationId}");
b.p("SipMediaApplicationId", () => input.SipMediaApplicationId, "{SipMediaApplicationId}", false);
let body;
body = JSON.stringify(take(input, {
Endpoints: (_) => _json(_),
Name: [],
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_UpdateSipMediaApplicationCallCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/sip-media-applications/{SipMediaApplicationId}/calls/{TransactionId}");
b.p("SipMediaApplicationId", () => input.SipMediaApplicationId, "{SipMediaApplicationId}", false);
b.p("TransactionId", () => input.TransactionId, "{TransactionId}", false);
let body;
body = JSON.stringify(take(input, {
Arguments: (_) => _json(_),
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const se_UpdateSipRuleCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/sip-rules/{SipRuleId}");
b.p("SipRuleId", () => input.SipRuleId, "{SipRuleId}", false);
let body;
body = JSON.stringify(take(input, {
Disabled: [],
Name: [],
TargetApplications: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_UpdateVoiceConnectorCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connectors/{VoiceConnectorId}");
b.p("VoiceConnectorId", () => input.VoiceConnectorId, "{VoiceConnectorId}", false);
let body;
body = JSON.stringify(take(input, {
Name: [],
RequireEncryption: [],
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_UpdateVoiceConnectorGroupCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-connector-groups/{VoiceConnectorGroupId}");
b.p("VoiceConnectorGroupId", () => input.VoiceConnectorGroupId, "{VoiceConnectorGroupId}", false);
let body;
body = JSON.stringify(take(input, {
Name: [],
VoiceConnectorItems: (_) => _json(_),
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_UpdateVoiceProfileCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-profiles/{VoiceProfileId}");
b.p("VoiceProfileId", () => input.VoiceProfileId, "{VoiceProfileId}", false);
let body;
body = JSON.stringify(take(input, {
SpeakerSearchTaskId: [],
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_UpdateVoiceProfileDomainCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/voice-profile-domains/{VoiceProfileDomainId}");
b.p("VoiceProfileDomainId", () => input.VoiceProfileDomainId, "{VoiceProfileDomainId}", false);
let body;
body = JSON.stringify(take(input, {
Description: [],
Name: [],
}));
b.m("PUT").h(headers).b(body);
return b.build();
};
export const se_ValidateE911AddressCommand = async (input, context) => {
const b = rb(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/emergency-calling/address");
let body;
body = JSON.stringify(take(input, {
AwsAccountId: [],
City: [],
Country: [],
PostalCode: [],
State: [],
StreetInfo: [],
StreetNumber: [],
}));
b.m("POST").h(headers).b(body);
return b.build();
};
export const de_AssociatePhoneNumbersWithVoiceConnectorCommand = async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
PhoneNumberErrors: _json,
});
Object.assign(contents, doc);
return contents;
};
export const de_AssociatePhoneNumbersWithVoiceConnectorGroupCommand = async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
PhoneNumberErrors: _json,
});
Object.assign(contents, doc);
return contents;
};
export const de_BatchDeletePhoneNumberCommand = async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
PhoneNumberErrors: _json,
});
Object.assign(contents, doc);
return contents;
};
export const de_BatchUpdatePhoneNumberCommand = async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
PhoneNumberErrors: _json,
});
Object.assign(contents, doc);
return contents;
};
export const de_CreatePhoneNumberOrderCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
PhoneNumberOrder: (_) => de_PhoneNumberOrder(_, context),
});
Object.assign(contents, doc);
return contents;
};
export const de_CreateProxySessionCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
ProxySession: (_) => de_ProxySession(_, context),
});
Object.assign(contents, doc);
return contents;
};
export const de_CreateSipMediaApplicationCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
SipMediaApplication: (_) => de_SipMediaApplication(_, context),
});
Object.assign(contents, doc);
return contents;
};
export const de_CreateSipMediaApplicationCallCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
SipMediaApplicationCall: _json,
});
Object.assign(contents, doc);
return contents;
};
export const de_CreateSipRuleCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
SipRule: (_) => de_SipRule(_, context),
});
Object.assign(contents, doc);
return contents;
};
export const de_CreateVoiceConnectorCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
VoiceConnector: (_) => de_VoiceConnector(_, context),
});
Object.assign(contents, doc);
return contents;
};
export const de_CreateVoiceConnectorGroupCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
VoiceConnectorGroup: (_) => de_VoiceConnectorGroup(_, context),
});
Object.assign(contents, doc);
return contents;
};
export const de_CreateVoiceProfileCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
VoiceProfile: (_) => de_VoiceProfile(_, context),
});
Object.assign(contents, doc);
return contents;
};
export const de_CreateVoiceProfileDomainCommand = async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metadata: deserializeMetadata(output),
});
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
VoiceProfileDomain: (_) => de_VoiceProfileDomain(_, context),
});
Object.assign(contents, doc);
return contents;
};
export const de_DeletePhoneNumberCommand = async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = map({
$metad