/clients/client-api-gateway/protocols/Aws_restJson1.ts
https://github.com/aws/aws-sdk-js-v3 · TypeScript · 18708 lines · 18236 code · 467 blank · 5 comment · 7969 complexity · ad9dc544741b25018143ae03da46eb9b MD5 · raw file
Large files are truncated click here to view the full file
- import { CreateApiKeyCommandInput, CreateApiKeyCommandOutput } from "../commands/CreateApiKeyCommand";
- import { CreateAuthorizerCommandInput, CreateAuthorizerCommandOutput } from "../commands/CreateAuthorizerCommand";
- import {
- CreateBasePathMappingCommandInput,
- CreateBasePathMappingCommandOutput,
- } from "../commands/CreateBasePathMappingCommand";
- import { CreateDeploymentCommandInput, CreateDeploymentCommandOutput } from "../commands/CreateDeploymentCommand";
- import {
- CreateDocumentationPartCommandInput,
- CreateDocumentationPartCommandOutput,
- } from "../commands/CreateDocumentationPartCommand";
- import {
- CreateDocumentationVersionCommandInput,
- CreateDocumentationVersionCommandOutput,
- } from "../commands/CreateDocumentationVersionCommand";
- import { CreateDomainNameCommandInput, CreateDomainNameCommandOutput } from "../commands/CreateDomainNameCommand";
- import { CreateModelCommandInput, CreateModelCommandOutput } from "../commands/CreateModelCommand";
- import {
- CreateRequestValidatorCommandInput,
- CreateRequestValidatorCommandOutput,
- } from "../commands/CreateRequestValidatorCommand";
- import { CreateResourceCommandInput, CreateResourceCommandOutput } from "../commands/CreateResourceCommand";
- import { CreateRestApiCommandInput, CreateRestApiCommandOutput } from "../commands/CreateRestApiCommand";
- import { CreateStageCommandInput, CreateStageCommandOutput } from "../commands/CreateStageCommand";
- import { CreateUsagePlanCommandInput, CreateUsagePlanCommandOutput } from "../commands/CreateUsagePlanCommand";
- import { CreateUsagePlanKeyCommandInput, CreateUsagePlanKeyCommandOutput } from "../commands/CreateUsagePlanKeyCommand";
- import { CreateVpcLinkCommandInput, CreateVpcLinkCommandOutput } from "../commands/CreateVpcLinkCommand";
- import { DeleteApiKeyCommandInput, DeleteApiKeyCommandOutput } from "../commands/DeleteApiKeyCommand";
- import { DeleteAuthorizerCommandInput, DeleteAuthorizerCommandOutput } from "../commands/DeleteAuthorizerCommand";
- import {
- DeleteBasePathMappingCommandInput,
- DeleteBasePathMappingCommandOutput,
- } from "../commands/DeleteBasePathMappingCommand";
- import {
- DeleteClientCertificateCommandInput,
- DeleteClientCertificateCommandOutput,
- } from "../commands/DeleteClientCertificateCommand";
- import { DeleteDeploymentCommandInput, DeleteDeploymentCommandOutput } from "../commands/DeleteDeploymentCommand";
- import {
- DeleteDocumentationPartCommandInput,
- DeleteDocumentationPartCommandOutput,
- } from "../commands/DeleteDocumentationPartCommand";
- import {
- DeleteDocumentationVersionCommandInput,
- DeleteDocumentationVersionCommandOutput,
- } from "../commands/DeleteDocumentationVersionCommand";
- import { DeleteDomainNameCommandInput, DeleteDomainNameCommandOutput } from "../commands/DeleteDomainNameCommand";
- import {
- DeleteGatewayResponseCommandInput,
- DeleteGatewayResponseCommandOutput,
- } from "../commands/DeleteGatewayResponseCommand";
- import { DeleteIntegrationCommandInput, DeleteIntegrationCommandOutput } from "../commands/DeleteIntegrationCommand";
- import {
- DeleteIntegrationResponseCommandInput,
- DeleteIntegrationResponseCommandOutput,
- } from "../commands/DeleteIntegrationResponseCommand";
- import { DeleteMethodCommandInput, DeleteMethodCommandOutput } from "../commands/DeleteMethodCommand";
- import {
- DeleteMethodResponseCommandInput,
- DeleteMethodResponseCommandOutput,
- } from "../commands/DeleteMethodResponseCommand";
- import { DeleteModelCommandInput, DeleteModelCommandOutput } from "../commands/DeleteModelCommand";
- import {
- DeleteRequestValidatorCommandInput,
- DeleteRequestValidatorCommandOutput,
- } from "../commands/DeleteRequestValidatorCommand";
- import { DeleteResourceCommandInput, DeleteResourceCommandOutput } from "../commands/DeleteResourceCommand";
- import { DeleteRestApiCommandInput, DeleteRestApiCommandOutput } from "../commands/DeleteRestApiCommand";
- import { DeleteStageCommandInput, DeleteStageCommandOutput } from "../commands/DeleteStageCommand";
- import { DeleteUsagePlanCommandInput, DeleteUsagePlanCommandOutput } from "../commands/DeleteUsagePlanCommand";
- import { DeleteUsagePlanKeyCommandInput, DeleteUsagePlanKeyCommandOutput } from "../commands/DeleteUsagePlanKeyCommand";
- import { DeleteVpcLinkCommandInput, DeleteVpcLinkCommandOutput } from "../commands/DeleteVpcLinkCommand";
- import {
- FlushStageAuthorizersCacheCommandInput,
- FlushStageAuthorizersCacheCommandOutput,
- } from "../commands/FlushStageAuthorizersCacheCommand";
- import { FlushStageCacheCommandInput, FlushStageCacheCommandOutput } from "../commands/FlushStageCacheCommand";
- import {
- GenerateClientCertificateCommandInput,
- GenerateClientCertificateCommandOutput,
- } from "../commands/GenerateClientCertificateCommand";
- import { GetAccountCommandInput, GetAccountCommandOutput } from "../commands/GetAccountCommand";
- import { GetApiKeyCommandInput, GetApiKeyCommandOutput } from "../commands/GetApiKeyCommand";
- import { GetApiKeysCommandInput, GetApiKeysCommandOutput } from "../commands/GetApiKeysCommand";
- import { GetAuthorizerCommandInput, GetAuthorizerCommandOutput } from "../commands/GetAuthorizerCommand";
- import { GetAuthorizersCommandInput, GetAuthorizersCommandOutput } from "../commands/GetAuthorizersCommand";
- import { GetBasePathMappingCommandInput, GetBasePathMappingCommandOutput } from "../commands/GetBasePathMappingCommand";
- import {
- GetBasePathMappingsCommandInput,
- GetBasePathMappingsCommandOutput,
- } from "../commands/GetBasePathMappingsCommand";
- import {
- GetClientCertificateCommandInput,
- GetClientCertificateCommandOutput,
- } from "../commands/GetClientCertificateCommand";
- import {
- GetClientCertificatesCommandInput,
- GetClientCertificatesCommandOutput,
- } from "../commands/GetClientCertificatesCommand";
- import { GetDeploymentCommandInput, GetDeploymentCommandOutput } from "../commands/GetDeploymentCommand";
- import { GetDeploymentsCommandInput, GetDeploymentsCommandOutput } from "../commands/GetDeploymentsCommand";
- import {
- GetDocumentationPartCommandInput,
- GetDocumentationPartCommandOutput,
- } from "../commands/GetDocumentationPartCommand";
- import {
- GetDocumentationPartsCommandInput,
- GetDocumentationPartsCommandOutput,
- } from "../commands/GetDocumentationPartsCommand";
- import {
- GetDocumentationVersionCommandInput,
- GetDocumentationVersionCommandOutput,
- } from "../commands/GetDocumentationVersionCommand";
- import {
- GetDocumentationVersionsCommandInput,
- GetDocumentationVersionsCommandOutput,
- } from "../commands/GetDocumentationVersionsCommand";
- import { GetDomainNameCommandInput, GetDomainNameCommandOutput } from "../commands/GetDomainNameCommand";
- import { GetDomainNamesCommandInput, GetDomainNamesCommandOutput } from "../commands/GetDomainNamesCommand";
- import { GetExportCommandInput, GetExportCommandOutput } from "../commands/GetExportCommand";
- import { GetGatewayResponseCommandInput, GetGatewayResponseCommandOutput } from "../commands/GetGatewayResponseCommand";
- import {
- GetGatewayResponsesCommandInput,
- GetGatewayResponsesCommandOutput,
- } from "../commands/GetGatewayResponsesCommand";
- import { GetIntegrationCommandInput, GetIntegrationCommandOutput } from "../commands/GetIntegrationCommand";
- import {
- GetIntegrationResponseCommandInput,
- GetIntegrationResponseCommandOutput,
- } from "../commands/GetIntegrationResponseCommand";
- import { GetMethodCommandInput, GetMethodCommandOutput } from "../commands/GetMethodCommand";
- import { GetMethodResponseCommandInput, GetMethodResponseCommandOutput } from "../commands/GetMethodResponseCommand";
- import { GetModelCommandInput, GetModelCommandOutput } from "../commands/GetModelCommand";
- import { GetModelTemplateCommandInput, GetModelTemplateCommandOutput } from "../commands/GetModelTemplateCommand";
- import { GetModelsCommandInput, GetModelsCommandOutput } from "../commands/GetModelsCommand";
- import {
- GetRequestValidatorCommandInput,
- GetRequestValidatorCommandOutput,
- } from "../commands/GetRequestValidatorCommand";
- import {
- GetRequestValidatorsCommandInput,
- GetRequestValidatorsCommandOutput,
- } from "../commands/GetRequestValidatorsCommand";
- import { GetResourceCommandInput, GetResourceCommandOutput } from "../commands/GetResourceCommand";
- import { GetResourcesCommandInput, GetResourcesCommandOutput } from "../commands/GetResourcesCommand";
- import { GetRestApiCommandInput, GetRestApiCommandOutput } from "../commands/GetRestApiCommand";
- import { GetRestApisCommandInput, GetRestApisCommandOutput } from "../commands/GetRestApisCommand";
- import { GetSdkCommandInput, GetSdkCommandOutput } from "../commands/GetSdkCommand";
- import { GetSdkTypeCommandInput, GetSdkTypeCommandOutput } from "../commands/GetSdkTypeCommand";
- import { GetSdkTypesCommandInput, GetSdkTypesCommandOutput } from "../commands/GetSdkTypesCommand";
- import { GetStageCommandInput, GetStageCommandOutput } from "../commands/GetStageCommand";
- import { GetStagesCommandInput, GetStagesCommandOutput } from "../commands/GetStagesCommand";
- import { GetTagsCommandInput, GetTagsCommandOutput } from "../commands/GetTagsCommand";
- import { GetUsageCommandInput, GetUsageCommandOutput } from "../commands/GetUsageCommand";
- import { GetUsagePlanCommandInput, GetUsagePlanCommandOutput } from "../commands/GetUsagePlanCommand";
- import { GetUsagePlanKeyCommandInput, GetUsagePlanKeyCommandOutput } from "../commands/GetUsagePlanKeyCommand";
- import { GetUsagePlanKeysCommandInput, GetUsagePlanKeysCommandOutput } from "../commands/GetUsagePlanKeysCommand";
- import { GetUsagePlansCommandInput, GetUsagePlansCommandOutput } from "../commands/GetUsagePlansCommand";
- import { GetVpcLinkCommandInput, GetVpcLinkCommandOutput } from "../commands/GetVpcLinkCommand";
- import { GetVpcLinksCommandInput, GetVpcLinksCommandOutput } from "../commands/GetVpcLinksCommand";
- import { ImportApiKeysCommandInput, ImportApiKeysCommandOutput } from "../commands/ImportApiKeysCommand";
- import {
- ImportDocumentationPartsCommandInput,
- ImportDocumentationPartsCommandOutput,
- } from "../commands/ImportDocumentationPartsCommand";
- import { ImportRestApiCommandInput, ImportRestApiCommandOutput } from "../commands/ImportRestApiCommand";
- import { PutGatewayResponseCommandInput, PutGatewayResponseCommandOutput } from "../commands/PutGatewayResponseCommand";
- import { PutIntegrationCommandInput, PutIntegrationCommandOutput } from "../commands/PutIntegrationCommand";
- import {
- PutIntegrationResponseCommandInput,
- PutIntegrationResponseCommandOutput,
- } from "../commands/PutIntegrationResponseCommand";
- import { PutMethodCommandInput, PutMethodCommandOutput } from "../commands/PutMethodCommand";
- import { PutMethodResponseCommandInput, PutMethodResponseCommandOutput } from "../commands/PutMethodResponseCommand";
- import { PutRestApiCommandInput, PutRestApiCommandOutput } from "../commands/PutRestApiCommand";
- import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
- import {
- TestInvokeAuthorizerCommandInput,
- TestInvokeAuthorizerCommandOutput,
- } from "../commands/TestInvokeAuthorizerCommand";
- import { TestInvokeMethodCommandInput, TestInvokeMethodCommandOutput } from "../commands/TestInvokeMethodCommand";
- import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
- import { UpdateAccountCommandInput, UpdateAccountCommandOutput } from "../commands/UpdateAccountCommand";
- import { UpdateApiKeyCommandInput, UpdateApiKeyCommandOutput } from "../commands/UpdateApiKeyCommand";
- import { UpdateAuthorizerCommandInput, UpdateAuthorizerCommandOutput } from "../commands/UpdateAuthorizerCommand";
- import {
- UpdateBasePathMappingCommandInput,
- UpdateBasePathMappingCommandOutput,
- } from "../commands/UpdateBasePathMappingCommand";
- import {
- UpdateClientCertificateCommandInput,
- UpdateClientCertificateCommandOutput,
- } from "../commands/UpdateClientCertificateCommand";
- import { UpdateDeploymentCommandInput, UpdateDeploymentCommandOutput } from "../commands/UpdateDeploymentCommand";
- import {
- UpdateDocumentationPartCommandInput,
- UpdateDocumentationPartCommandOutput,
- } from "../commands/UpdateDocumentationPartCommand";
- import {
- UpdateDocumentationVersionCommandInput,
- UpdateDocumentationVersionCommandOutput,
- } from "../commands/UpdateDocumentationVersionCommand";
- import { UpdateDomainNameCommandInput, UpdateDomainNameCommandOutput } from "../commands/UpdateDomainNameCommand";
- import {
- UpdateGatewayResponseCommandInput,
- UpdateGatewayResponseCommandOutput,
- } from "../commands/UpdateGatewayResponseCommand";
- import { UpdateIntegrationCommandInput, UpdateIntegrationCommandOutput } from "../commands/UpdateIntegrationCommand";
- import {
- UpdateIntegrationResponseCommandInput,
- UpdateIntegrationResponseCommandOutput,
- } from "../commands/UpdateIntegrationResponseCommand";
- import { UpdateMethodCommandInput, UpdateMethodCommandOutput } from "../commands/UpdateMethodCommand";
- import {
- UpdateMethodResponseCommandInput,
- UpdateMethodResponseCommandOutput,
- } from "../commands/UpdateMethodResponseCommand";
- import { UpdateModelCommandInput, UpdateModelCommandOutput } from "../commands/UpdateModelCommand";
- import {
- UpdateRequestValidatorCommandInput,
- UpdateRequestValidatorCommandOutput,
- } from "../commands/UpdateRequestValidatorCommand";
- import { UpdateResourceCommandInput, UpdateResourceCommandOutput } from "../commands/UpdateResourceCommand";
- import { UpdateRestApiCommandInput, UpdateRestApiCommandOutput } from "../commands/UpdateRestApiCommand";
- import { UpdateStageCommandInput, UpdateStageCommandOutput } from "../commands/UpdateStageCommand";
- import { UpdateUsageCommandInput, UpdateUsageCommandOutput } from "../commands/UpdateUsageCommand";
- import { UpdateUsagePlanCommandInput, UpdateUsagePlanCommandOutput } from "../commands/UpdateUsagePlanCommand";
- import { UpdateVpcLinkCommandInput, UpdateVpcLinkCommandOutput } from "../commands/UpdateVpcLinkCommand";
- import {
- AccessLogSettings,
- ApiKey,
- ApiStage,
- Authorizer,
- BadRequestException,
- BasePathMapping,
- CanarySettings,
- ClientCertificate,
- ConflictException,
- Deployment,
- DeploymentCanarySettings,
- DocumentationPart,
- DocumentationPartLocation,
- DocumentationVersion,
- DomainName,
- EndpointConfiguration,
- EndpointType,
- GatewayResponse,
- Integration,
- IntegrationResponse,
- LimitExceededException,
- Method,
- MethodResponse,
- MethodSetting,
- MethodSnapshot,
- Model,
- NotFoundException,
- PatchOperation,
- QuotaSettings,
- RequestValidator,
- Resource,
- RestApi,
- SdkConfigurationProperty,
- SdkType,
- ServiceUnavailableException,
- Stage,
- StageKey,
- ThrottleSettings,
- TlsConfig,
- TooManyRequestsException,
- UnauthorizedException,
- UsagePlan,
- UsagePlanKey,
- VpcLink,
- } from "../models/models_0";
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
- import {
- SmithyException as __SmithyException,
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
- } from "@aws-sdk/smithy-client";
- import {
- Endpoint as __Endpoint,
- MetadataBearer as __MetadataBearer,
- ResponseMetadata as __ResponseMetadata,
- SerdeContext as __SerdeContext,
- } from "@aws-sdk/types";
- export const serializeAws_restJson1CreateApiKeyCommand = async (
- input: CreateApiKeyCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/apikeys";
- let body: any;
- body = JSON.stringify({
- ...(input.customerId !== undefined && { customerId: input.customerId }),
- ...(input.description !== undefined && { description: input.description }),
- ...(input.enabled !== undefined && { enabled: input.enabled }),
- ...(input.generateDistinctId !== undefined && { generateDistinctId: input.generateDistinctId }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.stageKeys !== undefined && {
- stageKeys: serializeAws_restJson1ListOfStageKeys(input.stageKeys, context),
- }),
- ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- ...(input.value !== undefined && { value: input.value }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateAuthorizerCommand = async (
- input: CreateAuthorizerCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/authorizers";
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.authType !== undefined && { authType: input.authType }),
- ...(input.authorizerCredentials !== undefined && { authorizerCredentials: input.authorizerCredentials }),
- ...(input.authorizerResultTtlInSeconds !== undefined && {
- authorizerResultTtlInSeconds: input.authorizerResultTtlInSeconds,
- }),
- ...(input.authorizerUri !== undefined && { authorizerUri: input.authorizerUri }),
- ...(input.identitySource !== undefined && { identitySource: input.identitySource }),
- ...(input.identityValidationExpression !== undefined && {
- identityValidationExpression: input.identityValidationExpression,
- }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.providerARNs !== undefined && {
- providerARNs: serializeAws_restJson1ListOfARNs(input.providerARNs, context),
- }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- ...(input.type !== undefined && { type: input.type }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateBasePathMappingCommand = async (
- input: CreateBasePathMappingCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/domainnames/{domainName}/basepathmappings";
- if (input.domainName !== undefined) {
- const labelValue: string = input.domainName;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: domainName.");
- }
- resolvedPath = resolvedPath.replace("{domainName}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: domainName.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.basePath !== undefined && { basePath: input.basePath }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.restApiId !== undefined && { restApiId: input.restApiId }),
- ...(input.stage !== undefined && { stage: input.stage }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateDeploymentCommand = async (
- input: CreateDeploymentCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/deployments";
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.cacheClusterEnabled !== undefined && { cacheClusterEnabled: input.cacheClusterEnabled }),
- ...(input.cacheClusterSize !== undefined && { cacheClusterSize: input.cacheClusterSize }),
- ...(input.canarySettings !== undefined && {
- canarySettings: serializeAws_restJson1DeploymentCanarySettings(input.canarySettings, context),
- }),
- ...(input.description !== undefined && { description: input.description }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.stageDescription !== undefined && { stageDescription: input.stageDescription }),
- ...(input.stageName !== undefined && { stageName: input.stageName }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- ...(input.tracingEnabled !== undefined && { tracingEnabled: input.tracingEnabled }),
- ...(input.variables !== undefined && {
- variables: serializeAws_restJson1MapOfStringToString(input.variables, context),
- }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateDocumentationPartCommand = async (
- input: CreateDocumentationPartCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/documentation/parts";
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.location !== undefined && {
- location: serializeAws_restJson1DocumentationPartLocation(input.location, context),
- }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.properties !== undefined && { properties: input.properties }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateDocumentationVersionCommand = async (
- input: CreateDocumentationVersionCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/documentation/versions";
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.description !== undefined && { description: input.description }),
- ...(input.documentationVersion !== undefined && { documentationVersion: input.documentationVersion }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.stageName !== undefined && { stageName: input.stageName }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateDomainNameCommand = async (
- input: CreateDomainNameCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/domainnames";
- let body: any;
- body = JSON.stringify({
- ...(input.certificateArn !== undefined && { certificateArn: input.certificateArn }),
- ...(input.certificateBody !== undefined && { certificateBody: input.certificateBody }),
- ...(input.certificateChain !== undefined && { certificateChain: input.certificateChain }),
- ...(input.certificateName !== undefined && { certificateName: input.certificateName }),
- ...(input.certificatePrivateKey !== undefined && { certificatePrivateKey: input.certificatePrivateKey }),
- ...(input.domainName !== undefined && { domainName: input.domainName }),
- ...(input.endpointConfiguration !== undefined && {
- endpointConfiguration: serializeAws_restJson1EndpointConfiguration(input.endpointConfiguration, context),
- }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.regionalCertificateArn !== undefined && { regionalCertificateArn: input.regionalCertificateArn }),
- ...(input.regionalCertificateName !== undefined && { regionalCertificateName: input.regionalCertificateName }),
- ...(input.securityPolicy !== undefined && { securityPolicy: input.securityPolicy }),
- ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateModelCommand = async (
- input: CreateModelCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/models";
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.contentType !== undefined && { contentType: input.contentType }),
- ...(input.description !== undefined && { description: input.description }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.schema !== undefined && { schema: input.schema }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateRequestValidatorCommand = async (
- input: CreateRequestValidatorCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/requestvalidators";
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.name !== undefined && { name: input.name }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- ...(input.validateRequestBody !== undefined && { validateRequestBody: input.validateRequestBody }),
- ...(input.validateRequestParameters !== undefined && {
- validateRequestParameters: input.validateRequestParameters,
- }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateResourceCommand = async (
- input: CreateResourceCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/resources/{parentId}";
- if (input.parentId !== undefined) {
- const labelValue: string = input.parentId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: parentId.");
- }
- resolvedPath = resolvedPath.replace("{parentId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: parentId.");
- }
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.name !== undefined && { name: input.name }),
- ...(input.pathPart !== undefined && { pathPart: input.pathPart }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateRestApiCommand = async (
- input: CreateRestApiCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis";
- let body: any;
- body = JSON.stringify({
- ...(input.apiKeySource !== undefined && { apiKeySource: input.apiKeySource }),
- ...(input.binaryMediaTypes !== undefined && {
- binaryMediaTypes: serializeAws_restJson1ListOfString(input.binaryMediaTypes, context),
- }),
- ...(input.cloneFrom !== undefined && { cloneFrom: input.cloneFrom }),
- ...(input.description !== undefined && { description: input.description }),
- ...(input.endpointConfiguration !== undefined && {
- endpointConfiguration: serializeAws_restJson1EndpointConfiguration(input.endpointConfiguration, context),
- }),
- ...(input.minimumCompressionSize !== undefined && { minimumCompressionSize: input.minimumCompressionSize }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.policy !== undefined && { policy: input.policy }),
- ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- ...(input.version !== undefined && { version: input.version }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateStageCommand = async (
- input: CreateStageCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/stages";
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.cacheClusterEnabled !== undefined && { cacheClusterEnabled: input.cacheClusterEnabled }),
- ...(input.cacheClusterSize !== undefined && { cacheClusterSize: input.cacheClusterSize }),
- ...(input.canarySettings !== undefined && {
- canarySettings: serializeAws_restJson1CanarySettings(input.canarySettings, context),
- }),
- ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }),
- ...(input.description !== undefined && { description: input.description }),
- ...(input.documentationVersion !== undefined && { documentationVersion: input.documentationVersion }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.stageName !== undefined && { stageName: input.stageName }),
- ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- ...(input.tracingEnabled !== undefined && { tracingEnabled: input.tracingEnabled }),
- ...(input.variables !== undefined && {
- variables: serializeAws_restJson1MapOfStringToString(input.variables, context),
- }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateUsagePlanCommand = async (
- input: CreateUsagePlanCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/usageplans";
- let body: any;
- body = JSON.stringify({
- ...(input.apiStages !== undefined && { apiStages: serializeAws_restJson1ListOfApiStage(input.apiStages, context) }),
- ...(input.description !== undefined && { description: input.description }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.quota !== undefined && { quota: serializeAws_restJson1QuotaSettings(input.quota, context) }),
- ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.throttle !== undefined && { throttle: serializeAws_restJson1ThrottleSettings(input.throttle, context) }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateUsagePlanKeyCommand = async (
- input: CreateUsagePlanKeyCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/usageplans/{usagePlanId}/keys";
- if (input.usagePlanId !== undefined) {
- const labelValue: string = input.usagePlanId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: usagePlanId.");
- }
- resolvedPath = resolvedPath.replace("{usagePlanId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: usagePlanId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.keyId !== undefined && { keyId: input.keyId }),
- ...(input.keyType !== undefined && { keyType: input.keyType }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1CreateVpcLinkCommand = async (
- input: CreateVpcLinkCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/vpclinks";
- let body: any;
- body = JSON.stringify({
- ...(input.description !== undefined && { description: input.description }),
- ...(input.name !== undefined && { name: input.name }),
- ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }),
- ...(input.targetArns !== undefined && {
- targetArns: serializeAws_restJson1ListOfString(input.targetArns, context),
- }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "POST",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1DeleteApiKeyCommand = async (
- input: DeleteApiKeyCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/apikeys/{apiKey}";
- if (input.apiKey !== undefined) {
- const labelValue: string = input.apiKey;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: apiKey.");
- }
- resolvedPath = resolvedPath.replace("{apiKey}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: apiKey.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.name !== undefined && { name: input.name }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "DELETE",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1DeleteAuthorizerCommand = async (
- input: DeleteAuthorizerCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/authorizers/{authorizerId}";
- if (input.authorizerId !== undefined) {
- const labelValue: string = input.authorizerId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: authorizerId.");
- }
- resolvedPath = resolvedPath.replace("{authorizerId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: authorizerId.");
- }
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.name !== undefined && { name: input.name }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "DELETE",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1DeleteBasePathMappingCommand = async (
- input: DeleteBasePathMappingCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/domainnames/{domainName}/basepathmappings/{basePath}";
- if (input.domainName !== undefined) {
- const labelValue: string = input.domainName;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: domainName.");
- }
- resolvedPath = resolvedPath.replace("{domainName}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: domainName.");
- }
- if (input.basePath !== undefined) {
- const labelValue: string = input.basePath;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: basePath.");
- }
- resolvedPath = resolvedPath.replace("{basePath}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: basePath.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.name !== undefined && { name: input.name }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "DELETE",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1DeleteClientCertificateCommand = async (
- input: DeleteClientCertificateCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/clientcertificates/{clientCertificateId}";
- if (input.clientCertificateId !== undefined) {
- const labelValue: string = input.clientCertificateId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: clientCertificateId.");
- }
- resolvedPath = resolvedPath.replace("{clientCertificateId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: clientCertificateId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.name !== undefined && { name: input.name }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "DELETE",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1DeleteDeploymentCommand = async (
- input: DeleteDeploymentCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/deployments/{deploymentId}";
- if (input.deploymentId !== undefined) {
- const labelValue: string = input.deploymentId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: deploymentId.");
- }
- resolvedPath = resolvedPath.replace("{deploymentId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: deploymentId.");
- }
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.name !== undefined && { name: input.name }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, protocol = "https", port } = await context.endpoint();
- return new __HttpRequest({
- protocol,
- hostname,
- port,
- method: "DELETE",
- headers,
- path: resolvedPath,
- body,
- });
- };
- export const serializeAws_restJson1DeleteDocumentationPartCommand = async (
- input: DeleteDocumentationPartCommandInput,
- context: __SerdeContext
- ): Promise<__HttpRequest> => {
- const headers: any = {
- "Content-Type": "application/json",
- };
- let resolvedPath = "/restapis/{restApiId}/documentation/parts/{documentationPartId}";
- if (input.restApiId !== undefined) {
- const labelValue: string = input.restApiId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: restApiId.");
- }
- resolvedPath = resolvedPath.replace("{restApiId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: restApiId.");
- }
- if (input.documentationPartId !== undefined) {
- const labelValue: string = input.documentationPartId;
- if (labelValue.length <= 0) {
- throw new Error("Empty value provided for input HTTP label: documentationPartId.");
- }
- resolvedPath = resolvedPath.replace("{documentationPartId}", __extendedEncodeURIComponent(labelValue));
- } else {
- throw new Error("No value provided for input HTTP label: documentationPartId.");
- }
- let body: any;
- body = JSON.stringify({
- ...(input.name !== undefined && { name: input.name }),
- ...(input.template !== undefined && { template: input.template }),
- ...(input.templateSkipList !== undefined && {
- templateSkipList: serializeAws_restJson1ListOfString(input.templateSkipList, context),
- }),
- ...(input.title !== undefined && { title: input.title }),
- });
- const { hostname, pr…