diff --git a/clients/client-acm-pca/src/protocols/Aws_json1_1.ts b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts index 6ed0a39296202..09e25de97883f 100644 --- a/clients/client-acm-pca/src/protocols/Aws_json1_1.ts +++ b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts @@ -166,10 +166,7 @@ export const serializeAws_json1_1CreateCertificateAuthorityCommand = async ( input: CreateCertificateAuthorityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.CreateCertificateAuthority", - }; + const headers: __HeaderBag = sharedHeaders("CreateCertificateAuthority"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCertificateAuthorityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -179,10 +176,7 @@ export const serializeAws_json1_1CreateCertificateAuthorityAuditReportCommand = input: CreateCertificateAuthorityAuditReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.CreateCertificateAuthorityAuditReport", - }; + const headers: __HeaderBag = sharedHeaders("CreateCertificateAuthorityAuditReport"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCertificateAuthorityAuditReportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -192,10 +186,7 @@ export const serializeAws_json1_1CreatePermissionCommand = async ( input: CreatePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.CreatePermission", - }; + const headers: __HeaderBag = sharedHeaders("CreatePermission"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -205,10 +196,7 @@ export const serializeAws_json1_1DeleteCertificateAuthorityCommand = async ( input: DeleteCertificateAuthorityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.DeleteCertificateAuthority", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCertificateAuthority"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCertificateAuthorityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -218,10 +206,7 @@ export const serializeAws_json1_1DeletePermissionCommand = async ( input: DeletePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.DeletePermission", - }; + const headers: __HeaderBag = sharedHeaders("DeletePermission"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -231,10 +216,7 @@ export const serializeAws_json1_1DeletePolicyCommand = async ( input: DeletePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.DeletePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeletePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -244,10 +226,7 @@ export const serializeAws_json1_1DescribeCertificateAuthorityCommand = async ( input: DescribeCertificateAuthorityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.DescribeCertificateAuthority", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCertificateAuthority"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCertificateAuthorityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -257,10 +236,7 @@ export const serializeAws_json1_1DescribeCertificateAuthorityAuditReportCommand input: DescribeCertificateAuthorityAuditReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.DescribeCertificateAuthorityAuditReport", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCertificateAuthorityAuditReport"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCertificateAuthorityAuditReportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -270,10 +246,7 @@ export const serializeAws_json1_1GetCertificateCommand = async ( input: GetCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.GetCertificate", - }; + const headers: __HeaderBag = sharedHeaders("GetCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -283,10 +256,7 @@ export const serializeAws_json1_1GetCertificateAuthorityCertificateCommand = asy input: GetCertificateAuthorityCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.GetCertificateAuthorityCertificate", - }; + const headers: __HeaderBag = sharedHeaders("GetCertificateAuthorityCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCertificateAuthorityCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -296,10 +266,7 @@ export const serializeAws_json1_1GetCertificateAuthorityCsrCommand = async ( input: GetCertificateAuthorityCsrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.GetCertificateAuthorityCsr", - }; + const headers: __HeaderBag = sharedHeaders("GetCertificateAuthorityCsr"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCertificateAuthorityCsrRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -309,10 +276,7 @@ export const serializeAws_json1_1GetPolicyCommand = async ( input: GetPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.GetPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -322,10 +286,7 @@ export const serializeAws_json1_1ImportCertificateAuthorityCertificateCommand = input: ImportCertificateAuthorityCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.ImportCertificateAuthorityCertificate", - }; + const headers: __HeaderBag = sharedHeaders("ImportCertificateAuthorityCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportCertificateAuthorityCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -335,10 +296,7 @@ export const serializeAws_json1_1IssueCertificateCommand = async ( input: IssueCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.IssueCertificate", - }; + const headers: __HeaderBag = sharedHeaders("IssueCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1IssueCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -348,10 +306,7 @@ export const serializeAws_json1_1ListCertificateAuthoritiesCommand = async ( input: ListCertificateAuthoritiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.ListCertificateAuthorities", - }; + const headers: __HeaderBag = sharedHeaders("ListCertificateAuthorities"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCertificateAuthoritiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -361,10 +316,7 @@ export const serializeAws_json1_1ListPermissionsCommand = async ( input: ListPermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.ListPermissions", - }; + const headers: __HeaderBag = sharedHeaders("ListPermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -374,10 +326,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.ListTags", - }; + const headers: __HeaderBag = sharedHeaders("ListTags"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -387,10 +336,7 @@ export const serializeAws_json1_1PutPolicyCommand = async ( input: PutPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.PutPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -400,10 +346,7 @@ export const serializeAws_json1_1RestoreCertificateAuthorityCommand = async ( input: RestoreCertificateAuthorityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.RestoreCertificateAuthority", - }; + const headers: __HeaderBag = sharedHeaders("RestoreCertificateAuthority"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreCertificateAuthorityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -413,10 +356,7 @@ export const serializeAws_json1_1RevokeCertificateCommand = async ( input: RevokeCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.RevokeCertificate", - }; + const headers: __HeaderBag = sharedHeaders("RevokeCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1RevokeCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -426,10 +366,7 @@ export const serializeAws_json1_1TagCertificateAuthorityCommand = async ( input: TagCertificateAuthorityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.TagCertificateAuthority", - }; + const headers: __HeaderBag = sharedHeaders("TagCertificateAuthority"); let body: any; body = JSON.stringify(serializeAws_json1_1TagCertificateAuthorityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -439,10 +376,7 @@ export const serializeAws_json1_1UntagCertificateAuthorityCommand = async ( input: UntagCertificateAuthorityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.UntagCertificateAuthority", - }; + const headers: __HeaderBag = sharedHeaders("UntagCertificateAuthority"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagCertificateAuthorityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -452,10 +386,7 @@ export const serializeAws_json1_1UpdateCertificateAuthorityCommand = async ( input: UpdateCertificateAuthorityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ACMPrivateCA.UpdateCertificateAuthority", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCertificateAuthority"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCertificateAuthorityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2976,6 +2907,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `ACMPrivateCA.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-acm/src/protocols/Aws_json1_1.ts b/clients/client-acm/src/protocols/Aws_json1_1.ts index abc09380e81de..d1be5216ab913 100644 --- a/clients/client-acm/src/protocols/Aws_json1_1.ts +++ b/clients/client-acm/src/protocols/Aws_json1_1.ts @@ -118,10 +118,7 @@ export const serializeAws_json1_1AddTagsToCertificateCommand = async ( input: AddTagsToCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.AddTagsToCertificate", - }; + const headers: __HeaderBag = sharedHeaders("AddTagsToCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsToCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -131,10 +128,7 @@ export const serializeAws_json1_1DeleteCertificateCommand = async ( input: DeleteCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.DeleteCertificate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -144,10 +138,7 @@ export const serializeAws_json1_1DescribeCertificateCommand = async ( input: DescribeCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.DescribeCertificate", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -157,10 +148,7 @@ export const serializeAws_json1_1ExportCertificateCommand = async ( input: ExportCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.ExportCertificate", - }; + const headers: __HeaderBag = sharedHeaders("ExportCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1ExportCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -170,10 +158,7 @@ export const serializeAws_json1_1GetAccountConfigurationCommand = async ( input: GetAccountConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.GetAccountConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetAccountConfiguration"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -182,10 +167,7 @@ export const serializeAws_json1_1GetCertificateCommand = async ( input: GetCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.GetCertificate", - }; + const headers: __HeaderBag = sharedHeaders("GetCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -195,10 +177,7 @@ export const serializeAws_json1_1ImportCertificateCommand = async ( input: ImportCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.ImportCertificate", - }; + const headers: __HeaderBag = sharedHeaders("ImportCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -208,10 +187,7 @@ export const serializeAws_json1_1ListCertificatesCommand = async ( input: ListCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.ListCertificates", - }; + const headers: __HeaderBag = sharedHeaders("ListCertificates"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCertificatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -221,10 +197,7 @@ export const serializeAws_json1_1ListTagsForCertificateCommand = async ( input: ListTagsForCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.ListTagsForCertificate", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -234,10 +207,7 @@ export const serializeAws_json1_1PutAccountConfigurationCommand = async ( input: PutAccountConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.PutAccountConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutAccountConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAccountConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -247,10 +217,7 @@ export const serializeAws_json1_1RemoveTagsFromCertificateCommand = async ( input: RemoveTagsFromCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.RemoveTagsFromCertificate", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTagsFromCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsFromCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -260,10 +227,7 @@ export const serializeAws_json1_1RenewCertificateCommand = async ( input: RenewCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.RenewCertificate", - }; + const headers: __HeaderBag = sharedHeaders("RenewCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1RenewCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -273,10 +237,7 @@ export const serializeAws_json1_1RequestCertificateCommand = async ( input: RequestCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.RequestCertificate", - }; + const headers: __HeaderBag = sharedHeaders("RequestCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1RequestCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -286,10 +247,7 @@ export const serializeAws_json1_1ResendValidationEmailCommand = async ( input: ResendValidationEmailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.ResendValidationEmail", - }; + const headers: __HeaderBag = sharedHeaders("ResendValidationEmail"); let body: any; body = JSON.stringify(serializeAws_json1_1ResendValidationEmailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -299,10 +257,7 @@ export const serializeAws_json1_1UpdateCertificateOptionsCommand = async ( input: UpdateCertificateOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CertificateManager.UpdateCertificateOptions", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCertificateOptions"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCertificateOptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2011,6 +1966,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `CertificateManager.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts index 62869fa0dbcab..7a338ecefb137 100644 --- a/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts +++ b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts @@ -500,10 +500,7 @@ export const serializeAws_json1_1ApproveSkillCommand = async ( input: ApproveSkillCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ApproveSkill", - }; + const headers: __HeaderBag = sharedHeaders("ApproveSkill"); let body: any; body = JSON.stringify(serializeAws_json1_1ApproveSkillRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -513,10 +510,7 @@ export const serializeAws_json1_1AssociateContactWithAddressBookCommand = async input: AssociateContactWithAddressBookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.AssociateContactWithAddressBook", - }; + const headers: __HeaderBag = sharedHeaders("AssociateContactWithAddressBook"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateContactWithAddressBookRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -526,10 +520,7 @@ export const serializeAws_json1_1AssociateDeviceWithNetworkProfileCommand = asyn input: AssociateDeviceWithNetworkProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.AssociateDeviceWithNetworkProfile", - }; + const headers: __HeaderBag = sharedHeaders("AssociateDeviceWithNetworkProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateDeviceWithNetworkProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -539,10 +530,7 @@ export const serializeAws_json1_1AssociateDeviceWithRoomCommand = async ( input: AssociateDeviceWithRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.AssociateDeviceWithRoom", - }; + const headers: __HeaderBag = sharedHeaders("AssociateDeviceWithRoom"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateDeviceWithRoomRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -552,10 +540,7 @@ export const serializeAws_json1_1AssociateSkillGroupWithRoomCommand = async ( input: AssociateSkillGroupWithRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.AssociateSkillGroupWithRoom", - }; + const headers: __HeaderBag = sharedHeaders("AssociateSkillGroupWithRoom"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateSkillGroupWithRoomRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -565,10 +550,7 @@ export const serializeAws_json1_1AssociateSkillWithSkillGroupCommand = async ( input: AssociateSkillWithSkillGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.AssociateSkillWithSkillGroup", - }; + const headers: __HeaderBag = sharedHeaders("AssociateSkillWithSkillGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateSkillWithSkillGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -578,10 +560,7 @@ export const serializeAws_json1_1AssociateSkillWithUsersCommand = async ( input: AssociateSkillWithUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.AssociateSkillWithUsers", - }; + const headers: __HeaderBag = sharedHeaders("AssociateSkillWithUsers"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateSkillWithUsersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -591,10 +570,7 @@ export const serializeAws_json1_1CreateAddressBookCommand = async ( input: CreateAddressBookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.CreateAddressBook", - }; + const headers: __HeaderBag = sharedHeaders("CreateAddressBook"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAddressBookRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -604,10 +580,7 @@ export const serializeAws_json1_1CreateBusinessReportScheduleCommand = async ( input: CreateBusinessReportScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.CreateBusinessReportSchedule", - }; + const headers: __HeaderBag = sharedHeaders("CreateBusinessReportSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBusinessReportScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -617,10 +590,7 @@ export const serializeAws_json1_1CreateConferenceProviderCommand = async ( input: CreateConferenceProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.CreateConferenceProvider", - }; + const headers: __HeaderBag = sharedHeaders("CreateConferenceProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateConferenceProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -630,10 +600,7 @@ export const serializeAws_json1_1CreateContactCommand = async ( input: CreateContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.CreateContact", - }; + const headers: __HeaderBag = sharedHeaders("CreateContact"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateContactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -643,10 +610,7 @@ export const serializeAws_json1_1CreateGatewayGroupCommand = async ( input: CreateGatewayGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.CreateGatewayGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateGatewayGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGatewayGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -656,10 +620,7 @@ export const serializeAws_json1_1CreateNetworkProfileCommand = async ( input: CreateNetworkProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.CreateNetworkProfile", - }; + const headers: __HeaderBag = sharedHeaders("CreateNetworkProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateNetworkProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -669,10 +630,7 @@ export const serializeAws_json1_1CreateProfileCommand = async ( input: CreateProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.CreateProfile", - }; + const headers: __HeaderBag = sharedHeaders("CreateProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -682,10 +640,7 @@ export const serializeAws_json1_1CreateRoomCommand = async ( input: CreateRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.CreateRoom", - }; + const headers: __HeaderBag = sharedHeaders("CreateRoom"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRoomRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -695,10 +650,7 @@ export const serializeAws_json1_1CreateSkillGroupCommand = async ( input: CreateSkillGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.CreateSkillGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateSkillGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSkillGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -708,10 +660,7 @@ export const serializeAws_json1_1CreateUserCommand = async ( input: CreateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.CreateUser", - }; + const headers: __HeaderBag = sharedHeaders("CreateUser"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -721,10 +670,7 @@ export const serializeAws_json1_1DeleteAddressBookCommand = async ( input: DeleteAddressBookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteAddressBook", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAddressBook"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAddressBookRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -734,10 +680,7 @@ export const serializeAws_json1_1DeleteBusinessReportScheduleCommand = async ( input: DeleteBusinessReportScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteBusinessReportSchedule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBusinessReportSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBusinessReportScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -747,10 +690,7 @@ export const serializeAws_json1_1DeleteConferenceProviderCommand = async ( input: DeleteConferenceProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteConferenceProvider", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConferenceProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConferenceProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -760,10 +700,7 @@ export const serializeAws_json1_1DeleteContactCommand = async ( input: DeleteContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteContact", - }; + const headers: __HeaderBag = sharedHeaders("DeleteContact"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteContactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -773,10 +710,7 @@ export const serializeAws_json1_1DeleteDeviceCommand = async ( input: DeleteDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteDevice", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -786,10 +720,7 @@ export const serializeAws_json1_1DeleteDeviceUsageDataCommand = async ( input: DeleteDeviceUsageDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteDeviceUsageData", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDeviceUsageData"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDeviceUsageDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -799,10 +730,7 @@ export const serializeAws_json1_1DeleteGatewayGroupCommand = async ( input: DeleteGatewayGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteGatewayGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGatewayGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGatewayGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -812,10 +740,7 @@ export const serializeAws_json1_1DeleteNetworkProfileCommand = async ( input: DeleteNetworkProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteNetworkProfile", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNetworkProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNetworkProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -825,10 +750,7 @@ export const serializeAws_json1_1DeleteProfileCommand = async ( input: DeleteProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteProfile", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -838,10 +760,7 @@ export const serializeAws_json1_1DeleteRoomCommand = async ( input: DeleteRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteRoom", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRoom"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRoomRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -851,10 +770,7 @@ export const serializeAws_json1_1DeleteRoomSkillParameterCommand = async ( input: DeleteRoomSkillParameterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteRoomSkillParameter", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRoomSkillParameter"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRoomSkillParameterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -864,10 +780,7 @@ export const serializeAws_json1_1DeleteSkillAuthorizationCommand = async ( input: DeleteSkillAuthorizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteSkillAuthorization", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSkillAuthorization"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSkillAuthorizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -877,10 +790,7 @@ export const serializeAws_json1_1DeleteSkillGroupCommand = async ( input: DeleteSkillGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteSkillGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSkillGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSkillGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -890,10 +800,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DeleteUser", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -903,10 +810,7 @@ export const serializeAws_json1_1DisassociateContactFromAddressBookCommand = asy input: DisassociateContactFromAddressBookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DisassociateContactFromAddressBook", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateContactFromAddressBook"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateContactFromAddressBookRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -916,10 +820,7 @@ export const serializeAws_json1_1DisassociateDeviceFromRoomCommand = async ( input: DisassociateDeviceFromRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DisassociateDeviceFromRoom", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateDeviceFromRoom"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateDeviceFromRoomRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -929,10 +830,7 @@ export const serializeAws_json1_1DisassociateSkillFromSkillGroupCommand = async input: DisassociateSkillFromSkillGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DisassociateSkillFromSkillGroup", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateSkillFromSkillGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateSkillFromSkillGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -942,10 +840,7 @@ export const serializeAws_json1_1DisassociateSkillFromUsersCommand = async ( input: DisassociateSkillFromUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DisassociateSkillFromUsers", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateSkillFromUsers"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateSkillFromUsersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -955,10 +850,7 @@ export const serializeAws_json1_1DisassociateSkillGroupFromRoomCommand = async ( input: DisassociateSkillGroupFromRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.DisassociateSkillGroupFromRoom", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateSkillGroupFromRoom"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateSkillGroupFromRoomRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -968,10 +860,7 @@ export const serializeAws_json1_1ForgetSmartHomeAppliancesCommand = async ( input: ForgetSmartHomeAppliancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ForgetSmartHomeAppliances", - }; + const headers: __HeaderBag = sharedHeaders("ForgetSmartHomeAppliances"); let body: any; body = JSON.stringify(serializeAws_json1_1ForgetSmartHomeAppliancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -981,10 +870,7 @@ export const serializeAws_json1_1GetAddressBookCommand = async ( input: GetAddressBookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetAddressBook", - }; + const headers: __HeaderBag = sharedHeaders("GetAddressBook"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAddressBookRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -994,10 +880,7 @@ export const serializeAws_json1_1GetConferencePreferenceCommand = async ( input: GetConferencePreferenceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetConferencePreference", - }; + const headers: __HeaderBag = sharedHeaders("GetConferencePreference"); let body: any; body = JSON.stringify(serializeAws_json1_1GetConferencePreferenceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1007,10 +890,7 @@ export const serializeAws_json1_1GetConferenceProviderCommand = async ( input: GetConferenceProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetConferenceProvider", - }; + const headers: __HeaderBag = sharedHeaders("GetConferenceProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1GetConferenceProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1020,10 +900,7 @@ export const serializeAws_json1_1GetContactCommand = async ( input: GetContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetContact", - }; + const headers: __HeaderBag = sharedHeaders("GetContact"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1033,10 +910,7 @@ export const serializeAws_json1_1GetDeviceCommand = async ( input: GetDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetDevice", - }; + const headers: __HeaderBag = sharedHeaders("GetDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1046,10 +920,7 @@ export const serializeAws_json1_1GetGatewayCommand = async ( input: GetGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetGateway", - }; + const headers: __HeaderBag = sharedHeaders("GetGateway"); let body: any; body = JSON.stringify(serializeAws_json1_1GetGatewayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1059,10 +930,7 @@ export const serializeAws_json1_1GetGatewayGroupCommand = async ( input: GetGatewayGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetGatewayGroup", - }; + const headers: __HeaderBag = sharedHeaders("GetGatewayGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetGatewayGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1072,10 +940,7 @@ export const serializeAws_json1_1GetInvitationConfigurationCommand = async ( input: GetInvitationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetInvitationConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetInvitationConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInvitationConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1085,10 +950,7 @@ export const serializeAws_json1_1GetNetworkProfileCommand = async ( input: GetNetworkProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetNetworkProfile", - }; + const headers: __HeaderBag = sharedHeaders("GetNetworkProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1GetNetworkProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1098,10 +960,7 @@ export const serializeAws_json1_1GetProfileCommand = async ( input: GetProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetProfile", - }; + const headers: __HeaderBag = sharedHeaders("GetProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1GetProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1111,10 +970,7 @@ export const serializeAws_json1_1GetRoomCommand = async ( input: GetRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetRoom", - }; + const headers: __HeaderBag = sharedHeaders("GetRoom"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRoomRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1124,10 +980,7 @@ export const serializeAws_json1_1GetRoomSkillParameterCommand = async ( input: GetRoomSkillParameterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetRoomSkillParameter", - }; + const headers: __HeaderBag = sharedHeaders("GetRoomSkillParameter"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRoomSkillParameterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1137,10 +990,7 @@ export const serializeAws_json1_1GetSkillGroupCommand = async ( input: GetSkillGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.GetSkillGroup", - }; + const headers: __HeaderBag = sharedHeaders("GetSkillGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSkillGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1150,10 +1000,7 @@ export const serializeAws_json1_1ListBusinessReportSchedulesCommand = async ( input: ListBusinessReportSchedulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ListBusinessReportSchedules", - }; + const headers: __HeaderBag = sharedHeaders("ListBusinessReportSchedules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBusinessReportSchedulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1163,10 +1010,7 @@ export const serializeAws_json1_1ListConferenceProvidersCommand = async ( input: ListConferenceProvidersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ListConferenceProviders", - }; + const headers: __HeaderBag = sharedHeaders("ListConferenceProviders"); let body: any; body = JSON.stringify(serializeAws_json1_1ListConferenceProvidersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1176,10 +1020,7 @@ export const serializeAws_json1_1ListDeviceEventsCommand = async ( input: ListDeviceEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ListDeviceEvents", - }; + const headers: __HeaderBag = sharedHeaders("ListDeviceEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDeviceEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1189,10 +1030,7 @@ export const serializeAws_json1_1ListGatewayGroupsCommand = async ( input: ListGatewayGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ListGatewayGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListGatewayGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGatewayGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1202,10 +1040,7 @@ export const serializeAws_json1_1ListGatewaysCommand = async ( input: ListGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ListGateways", - }; + const headers: __HeaderBag = sharedHeaders("ListGateways"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGatewaysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1215,10 +1050,7 @@ export const serializeAws_json1_1ListSkillsCommand = async ( input: ListSkillsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ListSkills", - }; + const headers: __HeaderBag = sharedHeaders("ListSkills"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSkillsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1228,10 +1060,7 @@ export const serializeAws_json1_1ListSkillsStoreCategoriesCommand = async ( input: ListSkillsStoreCategoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ListSkillsStoreCategories", - }; + const headers: __HeaderBag = sharedHeaders("ListSkillsStoreCategories"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSkillsStoreCategoriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1241,10 +1070,7 @@ export const serializeAws_json1_1ListSkillsStoreSkillsByCategoryCommand = async input: ListSkillsStoreSkillsByCategoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ListSkillsStoreSkillsByCategory", - }; + const headers: __HeaderBag = sharedHeaders("ListSkillsStoreSkillsByCategory"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSkillsStoreSkillsByCategoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1254,10 +1080,7 @@ export const serializeAws_json1_1ListSmartHomeAppliancesCommand = async ( input: ListSmartHomeAppliancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ListSmartHomeAppliances", - }; + const headers: __HeaderBag = sharedHeaders("ListSmartHomeAppliances"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSmartHomeAppliancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1267,10 +1090,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ListTags", - }; + const headers: __HeaderBag = sharedHeaders("ListTags"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1280,10 +1100,7 @@ export const serializeAws_json1_1PutConferencePreferenceCommand = async ( input: PutConferencePreferenceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.PutConferencePreference", - }; + const headers: __HeaderBag = sharedHeaders("PutConferencePreference"); let body: any; body = JSON.stringify(serializeAws_json1_1PutConferencePreferenceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1293,10 +1110,7 @@ export const serializeAws_json1_1PutInvitationConfigurationCommand = async ( input: PutInvitationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.PutInvitationConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutInvitationConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutInvitationConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1306,10 +1120,7 @@ export const serializeAws_json1_1PutRoomSkillParameterCommand = async ( input: PutRoomSkillParameterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.PutRoomSkillParameter", - }; + const headers: __HeaderBag = sharedHeaders("PutRoomSkillParameter"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRoomSkillParameterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1319,10 +1130,7 @@ export const serializeAws_json1_1PutSkillAuthorizationCommand = async ( input: PutSkillAuthorizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.PutSkillAuthorization", - }; + const headers: __HeaderBag = sharedHeaders("PutSkillAuthorization"); let body: any; body = JSON.stringify(serializeAws_json1_1PutSkillAuthorizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1332,10 +1140,7 @@ export const serializeAws_json1_1RegisterAVSDeviceCommand = async ( input: RegisterAVSDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.RegisterAVSDevice", - }; + const headers: __HeaderBag = sharedHeaders("RegisterAVSDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterAVSDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1345,10 +1150,7 @@ export const serializeAws_json1_1RejectSkillCommand = async ( input: RejectSkillCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.RejectSkill", - }; + const headers: __HeaderBag = sharedHeaders("RejectSkill"); let body: any; body = JSON.stringify(serializeAws_json1_1RejectSkillRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1358,10 +1160,7 @@ export const serializeAws_json1_1ResolveRoomCommand = async ( input: ResolveRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.ResolveRoom", - }; + const headers: __HeaderBag = sharedHeaders("ResolveRoom"); let body: any; body = JSON.stringify(serializeAws_json1_1ResolveRoomRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1371,10 +1170,7 @@ export const serializeAws_json1_1RevokeInvitationCommand = async ( input: RevokeInvitationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.RevokeInvitation", - }; + const headers: __HeaderBag = sharedHeaders("RevokeInvitation"); let body: any; body = JSON.stringify(serializeAws_json1_1RevokeInvitationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1384,10 +1180,7 @@ export const serializeAws_json1_1SearchAddressBooksCommand = async ( input: SearchAddressBooksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.SearchAddressBooks", - }; + const headers: __HeaderBag = sharedHeaders("SearchAddressBooks"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchAddressBooksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1397,10 +1190,7 @@ export const serializeAws_json1_1SearchContactsCommand = async ( input: SearchContactsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.SearchContacts", - }; + const headers: __HeaderBag = sharedHeaders("SearchContacts"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchContactsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1410,10 +1200,7 @@ export const serializeAws_json1_1SearchDevicesCommand = async ( input: SearchDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.SearchDevices", - }; + const headers: __HeaderBag = sharedHeaders("SearchDevices"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchDevicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1423,10 +1210,7 @@ export const serializeAws_json1_1SearchNetworkProfilesCommand = async ( input: SearchNetworkProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.SearchNetworkProfiles", - }; + const headers: __HeaderBag = sharedHeaders("SearchNetworkProfiles"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchNetworkProfilesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1436,10 +1220,7 @@ export const serializeAws_json1_1SearchProfilesCommand = async ( input: SearchProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.SearchProfiles", - }; + const headers: __HeaderBag = sharedHeaders("SearchProfiles"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchProfilesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1449,10 +1230,7 @@ export const serializeAws_json1_1SearchRoomsCommand = async ( input: SearchRoomsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.SearchRooms", - }; + const headers: __HeaderBag = sharedHeaders("SearchRooms"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchRoomsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1462,10 +1240,7 @@ export const serializeAws_json1_1SearchSkillGroupsCommand = async ( input: SearchSkillGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.SearchSkillGroups", - }; + const headers: __HeaderBag = sharedHeaders("SearchSkillGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchSkillGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1475,10 +1250,7 @@ export const serializeAws_json1_1SearchUsersCommand = async ( input: SearchUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.SearchUsers", - }; + const headers: __HeaderBag = sharedHeaders("SearchUsers"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchUsersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1488,10 +1260,7 @@ export const serializeAws_json1_1SendAnnouncementCommand = async ( input: SendAnnouncementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.SendAnnouncement", - }; + const headers: __HeaderBag = sharedHeaders("SendAnnouncement"); let body: any; body = JSON.stringify(serializeAws_json1_1SendAnnouncementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1501,10 +1270,7 @@ export const serializeAws_json1_1SendInvitationCommand = async ( input: SendInvitationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.SendInvitation", - }; + const headers: __HeaderBag = sharedHeaders("SendInvitation"); let body: any; body = JSON.stringify(serializeAws_json1_1SendInvitationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1514,10 +1280,7 @@ export const serializeAws_json1_1StartDeviceSyncCommand = async ( input: StartDeviceSyncCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.StartDeviceSync", - }; + const headers: __HeaderBag = sharedHeaders("StartDeviceSync"); let body: any; body = JSON.stringify(serializeAws_json1_1StartDeviceSyncRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1527,10 +1290,7 @@ export const serializeAws_json1_1StartSmartHomeApplianceDiscoveryCommand = async input: StartSmartHomeApplianceDiscoveryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.StartSmartHomeApplianceDiscovery", - }; + const headers: __HeaderBag = sharedHeaders("StartSmartHomeApplianceDiscovery"); let body: any; body = JSON.stringify(serializeAws_json1_1StartSmartHomeApplianceDiscoveryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1540,10 +1300,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1553,10 +1310,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1566,10 +1320,7 @@ export const serializeAws_json1_1UpdateAddressBookCommand = async ( input: UpdateAddressBookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateAddressBook", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAddressBook"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAddressBookRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1579,10 +1330,7 @@ export const serializeAws_json1_1UpdateBusinessReportScheduleCommand = async ( input: UpdateBusinessReportScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateBusinessReportSchedule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateBusinessReportSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateBusinessReportScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1592,10 +1340,7 @@ export const serializeAws_json1_1UpdateConferenceProviderCommand = async ( input: UpdateConferenceProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateConferenceProvider", - }; + const headers: __HeaderBag = sharedHeaders("UpdateConferenceProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateConferenceProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1605,10 +1350,7 @@ export const serializeAws_json1_1UpdateContactCommand = async ( input: UpdateContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateContact", - }; + const headers: __HeaderBag = sharedHeaders("UpdateContact"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateContactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1618,10 +1360,7 @@ export const serializeAws_json1_1UpdateDeviceCommand = async ( input: UpdateDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateDevice", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1631,10 +1370,7 @@ export const serializeAws_json1_1UpdateGatewayCommand = async ( input: UpdateGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateGateway", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGateway"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGatewayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1644,10 +1380,7 @@ export const serializeAws_json1_1UpdateGatewayGroupCommand = async ( input: UpdateGatewayGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateGatewayGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGatewayGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGatewayGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1657,10 +1390,7 @@ export const serializeAws_json1_1UpdateNetworkProfileCommand = async ( input: UpdateNetworkProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateNetworkProfile", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNetworkProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNetworkProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1670,10 +1400,7 @@ export const serializeAws_json1_1UpdateProfileCommand = async ( input: UpdateProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateProfile", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1683,10 +1410,7 @@ export const serializeAws_json1_1UpdateRoomCommand = async ( input: UpdateRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateRoom", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRoom"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRoomRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1696,10 +1420,7 @@ export const serializeAws_json1_1UpdateSkillGroupCommand = async ( input: UpdateSkillGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AlexaForBusiness.UpdateSkillGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSkillGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSkillGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -8857,6 +8578,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AlexaForBusiness.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts index 6bbfdddfd6516..9011ba8c1caf5 100644 --- a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts @@ -120,10 +120,7 @@ export const serializeAws_json1_1DeleteScalingPolicyCommand = async ( input: DeleteScalingPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.DeleteScalingPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteScalingPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteScalingPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -133,10 +130,7 @@ export const serializeAws_json1_1DeleteScheduledActionCommand = async ( input: DeleteScheduledActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.DeleteScheduledAction", - }; + const headers: __HeaderBag = sharedHeaders("DeleteScheduledAction"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteScheduledActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -146,10 +140,7 @@ export const serializeAws_json1_1DeregisterScalableTargetCommand = async ( input: DeregisterScalableTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.DeregisterScalableTarget", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterScalableTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterScalableTargetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -159,10 +150,7 @@ export const serializeAws_json1_1DescribeScalableTargetsCommand = async ( input: DescribeScalableTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.DescribeScalableTargets", - }; + const headers: __HeaderBag = sharedHeaders("DescribeScalableTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeScalableTargetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -172,10 +160,7 @@ export const serializeAws_json1_1DescribeScalingActivitiesCommand = async ( input: DescribeScalingActivitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.DescribeScalingActivities", - }; + const headers: __HeaderBag = sharedHeaders("DescribeScalingActivities"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeScalingActivitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -185,10 +170,7 @@ export const serializeAws_json1_1DescribeScalingPoliciesCommand = async ( input: DescribeScalingPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.DescribeScalingPolicies", - }; + const headers: __HeaderBag = sharedHeaders("DescribeScalingPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeScalingPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -198,10 +180,7 @@ export const serializeAws_json1_1DescribeScheduledActionsCommand = async ( input: DescribeScheduledActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.DescribeScheduledActions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeScheduledActions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeScheduledActionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -211,10 +190,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -224,10 +200,7 @@ export const serializeAws_json1_1PutScalingPolicyCommand = async ( input: PutScalingPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.PutScalingPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutScalingPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutScalingPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -237,10 +210,7 @@ export const serializeAws_json1_1PutScheduledActionCommand = async ( input: PutScheduledActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.PutScheduledAction", - }; + const headers: __HeaderBag = sharedHeaders("PutScheduledAction"); let body: any; body = JSON.stringify(serializeAws_json1_1PutScheduledActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -250,10 +220,7 @@ export const serializeAws_json1_1RegisterScalableTargetCommand = async ( input: RegisterScalableTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.RegisterScalableTarget", - }; + const headers: __HeaderBag = sharedHeaders("RegisterScalableTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterScalableTargetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -263,10 +230,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -276,10 +240,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleFrontendService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2052,6 +2013,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AnyScaleFrontendService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts index f5544b8013788..bbb39b7fdbe66 100644 --- a/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts @@ -175,10 +175,7 @@ export const serializeAws_json1_1AssociateConfigurationItemsToApplicationCommand input: AssociateConfigurationItemsToApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.AssociateConfigurationItemsToApplication", - }; + const headers: __HeaderBag = sharedHeaders("AssociateConfigurationItemsToApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateConfigurationItemsToApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -188,10 +185,7 @@ export const serializeAws_json1_1BatchDeleteImportDataCommand = async ( input: BatchDeleteImportDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.BatchDeleteImportData", - }; + const headers: __HeaderBag = sharedHeaders("BatchDeleteImportData"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDeleteImportDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -201,10 +195,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( input: CreateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.CreateApplication", - }; + const headers: __HeaderBag = sharedHeaders("CreateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -214,10 +205,7 @@ export const serializeAws_json1_1CreateTagsCommand = async ( input: CreateTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.CreateTags", - }; + const headers: __HeaderBag = sharedHeaders("CreateTags"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -227,10 +215,7 @@ export const serializeAws_json1_1DeleteApplicationsCommand = async ( input: DeleteApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.DeleteApplications", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplications"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -240,10 +225,7 @@ export const serializeAws_json1_1DeleteTagsCommand = async ( input: DeleteTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.DeleteTags", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTags"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -253,10 +235,7 @@ export const serializeAws_json1_1DescribeAgentsCommand = async ( input: DescribeAgentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.DescribeAgents", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAgents"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAgentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -266,10 +245,7 @@ export const serializeAws_json1_1DescribeConfigurationsCommand = async ( input: DescribeConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.DescribeConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -279,10 +255,7 @@ export const serializeAws_json1_1DescribeContinuousExportsCommand = async ( input: DescribeContinuousExportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.DescribeContinuousExports", - }; + const headers: __HeaderBag = sharedHeaders("DescribeContinuousExports"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeContinuousExportsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -292,10 +265,7 @@ export const serializeAws_json1_1DescribeExportConfigurationsCommand = async ( input: DescribeExportConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.DescribeExportConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExportConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeExportConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -305,10 +275,7 @@ export const serializeAws_json1_1DescribeExportTasksCommand = async ( input: DescribeExportTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.DescribeExportTasks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExportTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeExportTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -318,10 +285,7 @@ export const serializeAws_json1_1DescribeImportTasksCommand = async ( input: DescribeImportTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.DescribeImportTasks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImportTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImportTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -331,10 +295,7 @@ export const serializeAws_json1_1DescribeTagsCommand = async ( input: DescribeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.DescribeTags", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTags"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -344,10 +305,7 @@ export const serializeAws_json1_1DisassociateConfigurationItemsFromApplicationCo input: DisassociateConfigurationItemsFromApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.DisassociateConfigurationItemsFromApplication", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateConfigurationItemsFromApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateConfigurationItemsFromApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -357,10 +315,7 @@ export const serializeAws_json1_1ExportConfigurationsCommand = async ( input: ExportConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.ExportConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ExportConfigurations"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -369,10 +324,7 @@ export const serializeAws_json1_1GetDiscoverySummaryCommand = async ( input: GetDiscoverySummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.GetDiscoverySummary", - }; + const headers: __HeaderBag = sharedHeaders("GetDiscoverySummary"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDiscoverySummaryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -382,10 +334,7 @@ export const serializeAws_json1_1ListConfigurationsCommand = async ( input: ListConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.ListConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -395,10 +344,7 @@ export const serializeAws_json1_1ListServerNeighborsCommand = async ( input: ListServerNeighborsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.ListServerNeighbors", - }; + const headers: __HeaderBag = sharedHeaders("ListServerNeighbors"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServerNeighborsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -408,10 +354,7 @@ export const serializeAws_json1_1StartContinuousExportCommand = async ( input: StartContinuousExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.StartContinuousExport", - }; + const headers: __HeaderBag = sharedHeaders("StartContinuousExport"); let body: any; body = JSON.stringify(serializeAws_json1_1StartContinuousExportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -421,10 +364,7 @@ export const serializeAws_json1_1StartDataCollectionByAgentIdsCommand = async ( input: StartDataCollectionByAgentIdsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.StartDataCollectionByAgentIds", - }; + const headers: __HeaderBag = sharedHeaders("StartDataCollectionByAgentIds"); let body: any; body = JSON.stringify(serializeAws_json1_1StartDataCollectionByAgentIdsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -434,10 +374,7 @@ export const serializeAws_json1_1StartExportTaskCommand = async ( input: StartExportTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.StartExportTask", - }; + const headers: __HeaderBag = sharedHeaders("StartExportTask"); let body: any; body = JSON.stringify(serializeAws_json1_1StartExportTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -447,10 +384,7 @@ export const serializeAws_json1_1StartImportTaskCommand = async ( input: StartImportTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.StartImportTask", - }; + const headers: __HeaderBag = sharedHeaders("StartImportTask"); let body: any; body = JSON.stringify(serializeAws_json1_1StartImportTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -460,10 +394,7 @@ export const serializeAws_json1_1StopContinuousExportCommand = async ( input: StopContinuousExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.StopContinuousExport", - }; + const headers: __HeaderBag = sharedHeaders("StopContinuousExport"); let body: any; body = JSON.stringify(serializeAws_json1_1StopContinuousExportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -473,10 +404,7 @@ export const serializeAws_json1_1StopDataCollectionByAgentIdsCommand = async ( input: StopDataCollectionByAgentIdsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.StopDataCollectionByAgentIds", - }; + const headers: __HeaderBag = sharedHeaders("StopDataCollectionByAgentIds"); let body: any; body = JSON.stringify(serializeAws_json1_1StopDataCollectionByAgentIdsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -486,10 +414,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( input: UpdateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPoseidonService_V2015_11_01.UpdateApplication", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3148,6 +3073,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSPoseidonService_V2015_11_01.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-application-insights/src/protocols/Aws_json1_1.ts b/clients/client-application-insights/src/protocols/Aws_json1_1.ts index 186d18334c4e9..baf7bf117316a 100644 --- a/clients/client-application-insights/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-insights/src/protocols/Aws_json1_1.ts @@ -151,10 +151,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( input: CreateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.CreateApplication", - }; + const headers: __HeaderBag = sharedHeaders("CreateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -164,10 +161,7 @@ export const serializeAws_json1_1CreateComponentCommand = async ( input: CreateComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.CreateComponent", - }; + const headers: __HeaderBag = sharedHeaders("CreateComponent"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateComponentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -177,10 +171,7 @@ export const serializeAws_json1_1CreateLogPatternCommand = async ( input: CreateLogPatternCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.CreateLogPattern", - }; + const headers: __HeaderBag = sharedHeaders("CreateLogPattern"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLogPatternRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -190,10 +181,7 @@ export const serializeAws_json1_1DeleteApplicationCommand = async ( input: DeleteApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DeleteApplication", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -203,10 +191,7 @@ export const serializeAws_json1_1DeleteComponentCommand = async ( input: DeleteComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DeleteComponent", - }; + const headers: __HeaderBag = sharedHeaders("DeleteComponent"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteComponentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -216,10 +201,7 @@ export const serializeAws_json1_1DeleteLogPatternCommand = async ( input: DeleteLogPatternCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DeleteLogPattern", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLogPattern"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLogPatternRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -229,10 +211,7 @@ export const serializeAws_json1_1DescribeApplicationCommand = async ( input: DescribeApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DescribeApplication", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -242,10 +221,7 @@ export const serializeAws_json1_1DescribeComponentCommand = async ( input: DescribeComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DescribeComponent", - }; + const headers: __HeaderBag = sharedHeaders("DescribeComponent"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeComponentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -255,10 +231,7 @@ export const serializeAws_json1_1DescribeComponentConfigurationCommand = async ( input: DescribeComponentConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DescribeComponentConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeComponentConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeComponentConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -268,10 +241,7 @@ export const serializeAws_json1_1DescribeComponentConfigurationRecommendationCom input: DescribeComponentConfigurationRecommendationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DescribeComponentConfigurationRecommendation", - }; + const headers: __HeaderBag = sharedHeaders("DescribeComponentConfigurationRecommendation"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeComponentConfigurationRecommendationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -281,10 +251,7 @@ export const serializeAws_json1_1DescribeLogPatternCommand = async ( input: DescribeLogPatternCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DescribeLogPattern", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLogPattern"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLogPatternRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -294,10 +261,7 @@ export const serializeAws_json1_1DescribeObservationCommand = async ( input: DescribeObservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DescribeObservation", - }; + const headers: __HeaderBag = sharedHeaders("DescribeObservation"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeObservationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -307,10 +271,7 @@ export const serializeAws_json1_1DescribeProblemCommand = async ( input: DescribeProblemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DescribeProblem", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProblem"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProblemRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -320,10 +281,7 @@ export const serializeAws_json1_1DescribeProblemObservationsCommand = async ( input: DescribeProblemObservationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.DescribeProblemObservations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProblemObservations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProblemObservationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -333,10 +291,7 @@ export const serializeAws_json1_1ListApplicationsCommand = async ( input: ListApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.ListApplications", - }; + const headers: __HeaderBag = sharedHeaders("ListApplications"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApplicationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -346,10 +301,7 @@ export const serializeAws_json1_1ListComponentsCommand = async ( input: ListComponentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.ListComponents", - }; + const headers: __HeaderBag = sharedHeaders("ListComponents"); let body: any; body = JSON.stringify(serializeAws_json1_1ListComponentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -359,10 +311,7 @@ export const serializeAws_json1_1ListConfigurationHistoryCommand = async ( input: ListConfigurationHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.ListConfigurationHistory", - }; + const headers: __HeaderBag = sharedHeaders("ListConfigurationHistory"); let body: any; body = JSON.stringify(serializeAws_json1_1ListConfigurationHistoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -372,10 +321,7 @@ export const serializeAws_json1_1ListLogPatternsCommand = async ( input: ListLogPatternsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.ListLogPatterns", - }; + const headers: __HeaderBag = sharedHeaders("ListLogPatterns"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLogPatternsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -385,10 +331,7 @@ export const serializeAws_json1_1ListLogPatternSetsCommand = async ( input: ListLogPatternSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.ListLogPatternSets", - }; + const headers: __HeaderBag = sharedHeaders("ListLogPatternSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLogPatternSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -398,10 +341,7 @@ export const serializeAws_json1_1ListProblemsCommand = async ( input: ListProblemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.ListProblems", - }; + const headers: __HeaderBag = sharedHeaders("ListProblems"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProblemsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -411,10 +351,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -424,10 +361,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -437,10 +371,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -450,10 +381,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( input: UpdateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.UpdateApplication", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -463,10 +391,7 @@ export const serializeAws_json1_1UpdateComponentCommand = async ( input: UpdateComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.UpdateComponent", - }; + const headers: __HeaderBag = sharedHeaders("UpdateComponent"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateComponentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -476,10 +401,7 @@ export const serializeAws_json1_1UpdateComponentConfigurationCommand = async ( input: UpdateComponentConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.UpdateComponentConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateComponentConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateComponentConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -489,10 +411,7 @@ export const serializeAws_json1_1UpdateLogPatternCommand = async ( input: UpdateLogPatternCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "EC2WindowsBarleyService.UpdateLogPattern", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLogPattern"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLogPatternRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2837,6 +2756,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `EC2WindowsBarleyService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-apprunner/src/protocols/Aws_json1_0.ts b/clients/client-apprunner/src/protocols/Aws_json1_0.ts index fa24ebe40bd53..afba83cb63bbe 100644 --- a/clients/client-apprunner/src/protocols/Aws_json1_0.ts +++ b/clients/client-apprunner/src/protocols/Aws_json1_0.ts @@ -223,10 +223,7 @@ export const serializeAws_json1_0AssociateCustomDomainCommand = async ( input: AssociateCustomDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.AssociateCustomDomain", - }; + const headers: __HeaderBag = sharedHeaders("AssociateCustomDomain"); let body: any; body = JSON.stringify(serializeAws_json1_0AssociateCustomDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -236,10 +233,7 @@ export const serializeAws_json1_0CreateAutoScalingConfigurationCommand = async ( input: CreateAutoScalingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.CreateAutoScalingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("CreateAutoScalingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateAutoScalingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -249,10 +243,7 @@ export const serializeAws_json1_0CreateConnectionCommand = async ( input: CreateConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.CreateConnection", - }; + const headers: __HeaderBag = sharedHeaders("CreateConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -262,10 +253,7 @@ export const serializeAws_json1_0CreateObservabilityConfigurationCommand = async input: CreateObservabilityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.CreateObservabilityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("CreateObservabilityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateObservabilityConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -275,10 +263,7 @@ export const serializeAws_json1_0CreateServiceCommand = async ( input: CreateServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.CreateService", - }; + const headers: __HeaderBag = sharedHeaders("CreateService"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -288,10 +273,7 @@ export const serializeAws_json1_0CreateVpcConnectorCommand = async ( input: CreateVpcConnectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.CreateVpcConnector", - }; + const headers: __HeaderBag = sharedHeaders("CreateVpcConnector"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateVpcConnectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -301,10 +283,7 @@ export const serializeAws_json1_0CreateVpcIngressConnectionCommand = async ( input: CreateVpcIngressConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.CreateVpcIngressConnection", - }; + const headers: __HeaderBag = sharedHeaders("CreateVpcIngressConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateVpcIngressConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -314,10 +293,7 @@ export const serializeAws_json1_0DeleteAutoScalingConfigurationCommand = async ( input: DeleteAutoScalingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DeleteAutoScalingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAutoScalingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteAutoScalingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -327,10 +303,7 @@ export const serializeAws_json1_0DeleteConnectionCommand = async ( input: DeleteConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DeleteConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -340,10 +313,7 @@ export const serializeAws_json1_0DeleteObservabilityConfigurationCommand = async input: DeleteObservabilityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DeleteObservabilityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteObservabilityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteObservabilityConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -353,10 +323,7 @@ export const serializeAws_json1_0DeleteServiceCommand = async ( input: DeleteServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DeleteService", - }; + const headers: __HeaderBag = sharedHeaders("DeleteService"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -366,10 +333,7 @@ export const serializeAws_json1_0DeleteVpcConnectorCommand = async ( input: DeleteVpcConnectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DeleteVpcConnector", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVpcConnector"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteVpcConnectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -379,10 +343,7 @@ export const serializeAws_json1_0DeleteVpcIngressConnectionCommand = async ( input: DeleteVpcIngressConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DeleteVpcIngressConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVpcIngressConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteVpcIngressConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -392,10 +353,7 @@ export const serializeAws_json1_0DescribeAutoScalingConfigurationCommand = async input: DescribeAutoScalingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DescribeAutoScalingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAutoScalingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeAutoScalingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -405,10 +363,7 @@ export const serializeAws_json1_0DescribeCustomDomainsCommand = async ( input: DescribeCustomDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DescribeCustomDomains", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCustomDomains"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeCustomDomainsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -418,10 +373,7 @@ export const serializeAws_json1_0DescribeObservabilityConfigurationCommand = asy input: DescribeObservabilityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DescribeObservabilityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeObservabilityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeObservabilityConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -431,10 +383,7 @@ export const serializeAws_json1_0DescribeServiceCommand = async ( input: DescribeServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DescribeService", - }; + const headers: __HeaderBag = sharedHeaders("DescribeService"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -444,10 +393,7 @@ export const serializeAws_json1_0DescribeVpcConnectorCommand = async ( input: DescribeVpcConnectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DescribeVpcConnector", - }; + const headers: __HeaderBag = sharedHeaders("DescribeVpcConnector"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeVpcConnectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -457,10 +403,7 @@ export const serializeAws_json1_0DescribeVpcIngressConnectionCommand = async ( input: DescribeVpcIngressConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DescribeVpcIngressConnection", - }; + const headers: __HeaderBag = sharedHeaders("DescribeVpcIngressConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeVpcIngressConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -470,10 +413,7 @@ export const serializeAws_json1_0DisassociateCustomDomainCommand = async ( input: DisassociateCustomDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.DisassociateCustomDomain", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateCustomDomain"); let body: any; body = JSON.stringify(serializeAws_json1_0DisassociateCustomDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -483,10 +423,7 @@ export const serializeAws_json1_0ListAutoScalingConfigurationsCommand = async ( input: ListAutoScalingConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.ListAutoScalingConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListAutoScalingConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_0ListAutoScalingConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -496,10 +433,7 @@ export const serializeAws_json1_0ListConnectionsCommand = async ( input: ListConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.ListConnections", - }; + const headers: __HeaderBag = sharedHeaders("ListConnections"); let body: any; body = JSON.stringify(serializeAws_json1_0ListConnectionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -509,10 +443,7 @@ export const serializeAws_json1_0ListObservabilityConfigurationsCommand = async input: ListObservabilityConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.ListObservabilityConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListObservabilityConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_0ListObservabilityConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -522,10 +453,7 @@ export const serializeAws_json1_0ListOperationsCommand = async ( input: ListOperationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.ListOperations", - }; + const headers: __HeaderBag = sharedHeaders("ListOperations"); let body: any; body = JSON.stringify(serializeAws_json1_0ListOperationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -535,10 +463,7 @@ export const serializeAws_json1_0ListServicesCommand = async ( input: ListServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.ListServices", - }; + const headers: __HeaderBag = sharedHeaders("ListServices"); let body: any; body = JSON.stringify(serializeAws_json1_0ListServicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -548,10 +473,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -561,10 +483,7 @@ export const serializeAws_json1_0ListVpcConnectorsCommand = async ( input: ListVpcConnectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.ListVpcConnectors", - }; + const headers: __HeaderBag = sharedHeaders("ListVpcConnectors"); let body: any; body = JSON.stringify(serializeAws_json1_0ListVpcConnectorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -574,10 +493,7 @@ export const serializeAws_json1_0ListVpcIngressConnectionsCommand = async ( input: ListVpcIngressConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.ListVpcIngressConnections", - }; + const headers: __HeaderBag = sharedHeaders("ListVpcIngressConnections"); let body: any; body = JSON.stringify(serializeAws_json1_0ListVpcIngressConnectionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -587,10 +503,7 @@ export const serializeAws_json1_0PauseServiceCommand = async ( input: PauseServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.PauseService", - }; + const headers: __HeaderBag = sharedHeaders("PauseService"); let body: any; body = JSON.stringify(serializeAws_json1_0PauseServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -600,10 +513,7 @@ export const serializeAws_json1_0ResumeServiceCommand = async ( input: ResumeServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.ResumeService", - }; + const headers: __HeaderBag = sharedHeaders("ResumeService"); let body: any; body = JSON.stringify(serializeAws_json1_0ResumeServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -613,10 +523,7 @@ export const serializeAws_json1_0StartDeploymentCommand = async ( input: StartDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.StartDeployment", - }; + const headers: __HeaderBag = sharedHeaders("StartDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_0StartDeploymentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -626,10 +533,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -639,10 +543,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -652,10 +553,7 @@ export const serializeAws_json1_0UpdateServiceCommand = async ( input: UpdateServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.UpdateService", - }; + const headers: __HeaderBag = sharedHeaders("UpdateService"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -665,10 +563,7 @@ export const serializeAws_json1_0UpdateVpcIngressConnectionCommand = async ( input: UpdateVpcIngressConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AppRunner.UpdateVpcIngressConnection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVpcIngressConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateVpcIngressConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4088,6 +3983,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `AppRunner.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-appstream/src/protocols/Aws_json1_1.ts b/clients/client-appstream/src/protocols/Aws_json1_1.ts index 25160fc6780e4..bef0dabe810d7 100644 --- a/clients/client-appstream/src/protocols/Aws_json1_1.ts +++ b/clients/client-appstream/src/protocols/Aws_json1_1.ts @@ -355,10 +355,7 @@ export const serializeAws_json1_1AssociateApplicationFleetCommand = async ( input: AssociateApplicationFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.AssociateApplicationFleet", - }; + const headers: __HeaderBag = sharedHeaders("AssociateApplicationFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateApplicationFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -368,10 +365,7 @@ export const serializeAws_json1_1AssociateApplicationToEntitlementCommand = asyn input: AssociateApplicationToEntitlementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.AssociateApplicationToEntitlement", - }; + const headers: __HeaderBag = sharedHeaders("AssociateApplicationToEntitlement"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateApplicationToEntitlementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -381,10 +375,7 @@ export const serializeAws_json1_1AssociateFleetCommand = async ( input: AssociateFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.AssociateFleet", - }; + const headers: __HeaderBag = sharedHeaders("AssociateFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -394,10 +385,7 @@ export const serializeAws_json1_1BatchAssociateUserStackCommand = async ( input: BatchAssociateUserStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.BatchAssociateUserStack", - }; + const headers: __HeaderBag = sharedHeaders("BatchAssociateUserStack"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchAssociateUserStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -407,10 +395,7 @@ export const serializeAws_json1_1BatchDisassociateUserStackCommand = async ( input: BatchDisassociateUserStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.BatchDisassociateUserStack", - }; + const headers: __HeaderBag = sharedHeaders("BatchDisassociateUserStack"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDisassociateUserStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -420,10 +405,7 @@ export const serializeAws_json1_1CopyImageCommand = async ( input: CopyImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CopyImage", - }; + const headers: __HeaderBag = sharedHeaders("CopyImage"); let body: any; body = JSON.stringify(serializeAws_json1_1CopyImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -433,10 +415,7 @@ export const serializeAws_json1_1CreateAppBlockCommand = async ( input: CreateAppBlockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateAppBlock", - }; + const headers: __HeaderBag = sharedHeaders("CreateAppBlock"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAppBlockRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -446,10 +425,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( input: CreateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateApplication", - }; + const headers: __HeaderBag = sharedHeaders("CreateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -459,10 +435,7 @@ export const serializeAws_json1_1CreateDirectoryConfigCommand = async ( input: CreateDirectoryConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateDirectoryConfig", - }; + const headers: __HeaderBag = sharedHeaders("CreateDirectoryConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDirectoryConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -472,10 +445,7 @@ export const serializeAws_json1_1CreateEntitlementCommand = async ( input: CreateEntitlementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateEntitlement", - }; + const headers: __HeaderBag = sharedHeaders("CreateEntitlement"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEntitlementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -485,10 +455,7 @@ export const serializeAws_json1_1CreateFleetCommand = async ( input: CreateFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateFleet", - }; + const headers: __HeaderBag = sharedHeaders("CreateFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -498,10 +465,7 @@ export const serializeAws_json1_1CreateImageBuilderCommand = async ( input: CreateImageBuilderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateImageBuilder", - }; + const headers: __HeaderBag = sharedHeaders("CreateImageBuilder"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateImageBuilderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -511,10 +475,7 @@ export const serializeAws_json1_1CreateImageBuilderStreamingURLCommand = async ( input: CreateImageBuilderStreamingURLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateImageBuilderStreamingURL", - }; + const headers: __HeaderBag = sharedHeaders("CreateImageBuilderStreamingURL"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateImageBuilderStreamingURLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -524,10 +485,7 @@ export const serializeAws_json1_1CreateStackCommand = async ( input: CreateStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateStack", - }; + const headers: __HeaderBag = sharedHeaders("CreateStack"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -537,10 +495,7 @@ export const serializeAws_json1_1CreateStreamingURLCommand = async ( input: CreateStreamingURLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateStreamingURL", - }; + const headers: __HeaderBag = sharedHeaders("CreateStreamingURL"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStreamingURLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -550,10 +505,7 @@ export const serializeAws_json1_1CreateUpdatedImageCommand = async ( input: CreateUpdatedImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateUpdatedImage", - }; + const headers: __HeaderBag = sharedHeaders("CreateUpdatedImage"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUpdatedImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -563,10 +515,7 @@ export const serializeAws_json1_1CreateUsageReportSubscriptionCommand = async ( input: CreateUsageReportSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateUsageReportSubscription", - }; + const headers: __HeaderBag = sharedHeaders("CreateUsageReportSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUsageReportSubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -576,10 +525,7 @@ export const serializeAws_json1_1CreateUserCommand = async ( input: CreateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.CreateUser", - }; + const headers: __HeaderBag = sharedHeaders("CreateUser"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -589,10 +535,7 @@ export const serializeAws_json1_1DeleteAppBlockCommand = async ( input: DeleteAppBlockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteAppBlock", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAppBlock"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAppBlockRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -602,10 +545,7 @@ export const serializeAws_json1_1DeleteApplicationCommand = async ( input: DeleteApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteApplication", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -615,10 +555,7 @@ export const serializeAws_json1_1DeleteDirectoryConfigCommand = async ( input: DeleteDirectoryConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteDirectoryConfig", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDirectoryConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDirectoryConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -628,10 +565,7 @@ export const serializeAws_json1_1DeleteEntitlementCommand = async ( input: DeleteEntitlementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteEntitlement", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEntitlement"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEntitlementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -641,10 +575,7 @@ export const serializeAws_json1_1DeleteFleetCommand = async ( input: DeleteFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteFleet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -654,10 +585,7 @@ export const serializeAws_json1_1DeleteImageCommand = async ( input: DeleteImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteImage", - }; + const headers: __HeaderBag = sharedHeaders("DeleteImage"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -667,10 +595,7 @@ export const serializeAws_json1_1DeleteImageBuilderCommand = async ( input: DeleteImageBuilderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteImageBuilder", - }; + const headers: __HeaderBag = sharedHeaders("DeleteImageBuilder"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteImageBuilderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -680,10 +605,7 @@ export const serializeAws_json1_1DeleteImagePermissionsCommand = async ( input: DeleteImagePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteImagePermissions", - }; + const headers: __HeaderBag = sharedHeaders("DeleteImagePermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteImagePermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -693,10 +615,7 @@ export const serializeAws_json1_1DeleteStackCommand = async ( input: DeleteStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteStack", - }; + const headers: __HeaderBag = sharedHeaders("DeleteStack"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -706,10 +625,7 @@ export const serializeAws_json1_1DeleteUsageReportSubscriptionCommand = async ( input: DeleteUsageReportSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteUsageReportSubscription", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUsageReportSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUsageReportSubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -719,10 +635,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DeleteUser", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -732,10 +645,7 @@ export const serializeAws_json1_1DescribeAppBlocksCommand = async ( input: DescribeAppBlocksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeAppBlocks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAppBlocks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAppBlocksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -745,10 +655,7 @@ export const serializeAws_json1_1DescribeApplicationFleetAssociationsCommand = a input: DescribeApplicationFleetAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeApplicationFleetAssociations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApplicationFleetAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApplicationFleetAssociationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -758,10 +665,7 @@ export const serializeAws_json1_1DescribeApplicationsCommand = async ( input: DescribeApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeApplications", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApplications"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApplicationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -771,10 +675,7 @@ export const serializeAws_json1_1DescribeDirectoryConfigsCommand = async ( input: DescribeDirectoryConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeDirectoryConfigs", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDirectoryConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDirectoryConfigsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -784,10 +685,7 @@ export const serializeAws_json1_1DescribeEntitlementsCommand = async ( input: DescribeEntitlementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeEntitlements", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEntitlements"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEntitlementsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -797,10 +695,7 @@ export const serializeAws_json1_1DescribeFleetsCommand = async ( input: DescribeFleetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeFleets", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleets"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -810,10 +705,7 @@ export const serializeAws_json1_1DescribeImageBuildersCommand = async ( input: DescribeImageBuildersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeImageBuilders", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImageBuilders"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImageBuildersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -823,10 +715,7 @@ export const serializeAws_json1_1DescribeImagePermissionsCommand = async ( input: DescribeImagePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeImagePermissions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImagePermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImagePermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -836,10 +725,7 @@ export const serializeAws_json1_1DescribeImagesCommand = async ( input: DescribeImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeImages", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImages"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -849,10 +735,7 @@ export const serializeAws_json1_1DescribeSessionsCommand = async ( input: DescribeSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeSessions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSessionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -862,10 +745,7 @@ export const serializeAws_json1_1DescribeStacksCommand = async ( input: DescribeStacksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeStacks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStacks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStacksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -875,10 +755,7 @@ export const serializeAws_json1_1DescribeUsageReportSubscriptionsCommand = async input: DescribeUsageReportSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeUsageReportSubscriptions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUsageReportSubscriptions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUsageReportSubscriptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -888,10 +765,7 @@ export const serializeAws_json1_1DescribeUsersCommand = async ( input: DescribeUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeUsers", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUsers"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUsersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -901,10 +775,7 @@ export const serializeAws_json1_1DescribeUserStackAssociationsCommand = async ( input: DescribeUserStackAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DescribeUserStackAssociations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUserStackAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserStackAssociationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -914,10 +785,7 @@ export const serializeAws_json1_1DisableUserCommand = async ( input: DisableUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DisableUser", - }; + const headers: __HeaderBag = sharedHeaders("DisableUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -927,10 +795,7 @@ export const serializeAws_json1_1DisassociateApplicationFleetCommand = async ( input: DisassociateApplicationFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DisassociateApplicationFleet", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateApplicationFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateApplicationFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -940,10 +805,7 @@ export const serializeAws_json1_1DisassociateApplicationFromEntitlementCommand = input: DisassociateApplicationFromEntitlementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DisassociateApplicationFromEntitlement", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateApplicationFromEntitlement"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateApplicationFromEntitlementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -953,10 +815,7 @@ export const serializeAws_json1_1DisassociateFleetCommand = async ( input: DisassociateFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.DisassociateFleet", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -966,10 +825,7 @@ export const serializeAws_json1_1EnableUserCommand = async ( input: EnableUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.EnableUser", - }; + const headers: __HeaderBag = sharedHeaders("EnableUser"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -979,10 +835,7 @@ export const serializeAws_json1_1ExpireSessionCommand = async ( input: ExpireSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.ExpireSession", - }; + const headers: __HeaderBag = sharedHeaders("ExpireSession"); let body: any; body = JSON.stringify(serializeAws_json1_1ExpireSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -992,10 +845,7 @@ export const serializeAws_json1_1ListAssociatedFleetsCommand = async ( input: ListAssociatedFleetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.ListAssociatedFleets", - }; + const headers: __HeaderBag = sharedHeaders("ListAssociatedFleets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssociatedFleetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1005,10 +855,7 @@ export const serializeAws_json1_1ListAssociatedStacksCommand = async ( input: ListAssociatedStacksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.ListAssociatedStacks", - }; + const headers: __HeaderBag = sharedHeaders("ListAssociatedStacks"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssociatedStacksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1018,10 +865,7 @@ export const serializeAws_json1_1ListEntitledApplicationsCommand = async ( input: ListEntitledApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.ListEntitledApplications", - }; + const headers: __HeaderBag = sharedHeaders("ListEntitledApplications"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEntitledApplicationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1031,10 +875,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1044,10 +885,7 @@ export const serializeAws_json1_1StartFleetCommand = async ( input: StartFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.StartFleet", - }; + const headers: __HeaderBag = sharedHeaders("StartFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1StartFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1057,10 +895,7 @@ export const serializeAws_json1_1StartImageBuilderCommand = async ( input: StartImageBuilderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.StartImageBuilder", - }; + const headers: __HeaderBag = sharedHeaders("StartImageBuilder"); let body: any; body = JSON.stringify(serializeAws_json1_1StartImageBuilderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1070,10 +905,7 @@ export const serializeAws_json1_1StopFleetCommand = async ( input: StopFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.StopFleet", - }; + const headers: __HeaderBag = sharedHeaders("StopFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1StopFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1083,10 +915,7 @@ export const serializeAws_json1_1StopImageBuilderCommand = async ( input: StopImageBuilderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.StopImageBuilder", - }; + const headers: __HeaderBag = sharedHeaders("StopImageBuilder"); let body: any; body = JSON.stringify(serializeAws_json1_1StopImageBuilderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1096,10 +925,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1109,10 +935,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1122,10 +945,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( input: UpdateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.UpdateApplication", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1135,10 +955,7 @@ export const serializeAws_json1_1UpdateDirectoryConfigCommand = async ( input: UpdateDirectoryConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.UpdateDirectoryConfig", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDirectoryConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDirectoryConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1148,10 +965,7 @@ export const serializeAws_json1_1UpdateEntitlementCommand = async ( input: UpdateEntitlementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.UpdateEntitlement", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEntitlement"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEntitlementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1161,10 +975,7 @@ export const serializeAws_json1_1UpdateFleetCommand = async ( input: UpdateFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.UpdateFleet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1174,10 +985,7 @@ export const serializeAws_json1_1UpdateImagePermissionsCommand = async ( input: UpdateImagePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.UpdateImagePermissions", - }; + const headers: __HeaderBag = sharedHeaders("UpdateImagePermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateImagePermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1187,10 +995,7 @@ export const serializeAws_json1_1UpdateStackCommand = async ( input: UpdateStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PhotonAdminProxyService.UpdateStack", - }; + const headers: __HeaderBag = sharedHeaders("UpdateStack"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -7270,6 +7075,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `PhotonAdminProxyService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-athena/src/protocols/Aws_json1_1.ts b/clients/client-athena/src/protocols/Aws_json1_1.ts index 98d6bb46786e4..b7939e53aab60 100644 --- a/clients/client-athena/src/protocols/Aws_json1_1.ts +++ b/clients/client-athena/src/protocols/Aws_json1_1.ts @@ -337,10 +337,7 @@ export const serializeAws_json1_1BatchGetNamedQueryCommand = async ( input: BatchGetNamedQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.BatchGetNamedQuery", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetNamedQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetNamedQueryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -350,10 +347,7 @@ export const serializeAws_json1_1BatchGetPreparedStatementCommand = async ( input: BatchGetPreparedStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.BatchGetPreparedStatement", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetPreparedStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetPreparedStatementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -363,10 +357,7 @@ export const serializeAws_json1_1BatchGetQueryExecutionCommand = async ( input: BatchGetQueryExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.BatchGetQueryExecution", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetQueryExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetQueryExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -376,10 +367,7 @@ export const serializeAws_json1_1CreateDataCatalogCommand = async ( input: CreateDataCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.CreateDataCatalog", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDataCatalogInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -389,10 +377,7 @@ export const serializeAws_json1_1CreateNamedQueryCommand = async ( input: CreateNamedQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.CreateNamedQuery", - }; + const headers: __HeaderBag = sharedHeaders("CreateNamedQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateNamedQueryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -402,10 +387,7 @@ export const serializeAws_json1_1CreateNotebookCommand = async ( input: CreateNotebookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.CreateNotebook", - }; + const headers: __HeaderBag = sharedHeaders("CreateNotebook"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateNotebookInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -415,10 +397,7 @@ export const serializeAws_json1_1CreatePreparedStatementCommand = async ( input: CreatePreparedStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.CreatePreparedStatement", - }; + const headers: __HeaderBag = sharedHeaders("CreatePreparedStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePreparedStatementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -428,10 +407,7 @@ export const serializeAws_json1_1CreatePresignedNotebookUrlCommand = async ( input: CreatePresignedNotebookUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.CreatePresignedNotebookUrl", - }; + const headers: __HeaderBag = sharedHeaders("CreatePresignedNotebookUrl"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePresignedNotebookUrlRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -441,10 +417,7 @@ export const serializeAws_json1_1CreateWorkGroupCommand = async ( input: CreateWorkGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.CreateWorkGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateWorkGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWorkGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -454,10 +427,7 @@ export const serializeAws_json1_1DeleteDataCatalogCommand = async ( input: DeleteDataCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.DeleteDataCatalog", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDataCatalogInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -467,10 +437,7 @@ export const serializeAws_json1_1DeleteNamedQueryCommand = async ( input: DeleteNamedQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.DeleteNamedQuery", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNamedQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNamedQueryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -480,10 +447,7 @@ export const serializeAws_json1_1DeleteNotebookCommand = async ( input: DeleteNotebookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.DeleteNotebook", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNotebook"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNotebookInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -493,10 +457,7 @@ export const serializeAws_json1_1DeletePreparedStatementCommand = async ( input: DeletePreparedStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.DeletePreparedStatement", - }; + const headers: __HeaderBag = sharedHeaders("DeletePreparedStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePreparedStatementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -506,10 +467,7 @@ export const serializeAws_json1_1DeleteWorkGroupCommand = async ( input: DeleteWorkGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.DeleteWorkGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWorkGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWorkGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -519,10 +477,7 @@ export const serializeAws_json1_1ExportNotebookCommand = async ( input: ExportNotebookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ExportNotebook", - }; + const headers: __HeaderBag = sharedHeaders("ExportNotebook"); let body: any; body = JSON.stringify(serializeAws_json1_1ExportNotebookInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -532,10 +487,7 @@ export const serializeAws_json1_1GetCalculationExecutionCommand = async ( input: GetCalculationExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetCalculationExecution", - }; + const headers: __HeaderBag = sharedHeaders("GetCalculationExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCalculationExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -545,10 +497,7 @@ export const serializeAws_json1_1GetCalculationExecutionCodeCommand = async ( input: GetCalculationExecutionCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetCalculationExecutionCode", - }; + const headers: __HeaderBag = sharedHeaders("GetCalculationExecutionCode"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCalculationExecutionCodeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -558,10 +507,7 @@ export const serializeAws_json1_1GetCalculationExecutionStatusCommand = async ( input: GetCalculationExecutionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetCalculationExecutionStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetCalculationExecutionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCalculationExecutionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -571,10 +517,7 @@ export const serializeAws_json1_1GetDatabaseCommand = async ( input: GetDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetDatabase", - }; + const headers: __HeaderBag = sharedHeaders("GetDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDatabaseInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -584,10 +527,7 @@ export const serializeAws_json1_1GetDataCatalogCommand = async ( input: GetDataCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetDataCatalog", - }; + const headers: __HeaderBag = sharedHeaders("GetDataCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDataCatalogInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -597,10 +537,7 @@ export const serializeAws_json1_1GetNamedQueryCommand = async ( input: GetNamedQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetNamedQuery", - }; + const headers: __HeaderBag = sharedHeaders("GetNamedQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1GetNamedQueryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -610,10 +547,7 @@ export const serializeAws_json1_1GetNotebookMetadataCommand = async ( input: GetNotebookMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetNotebookMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetNotebookMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetNotebookMetadataInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -623,10 +557,7 @@ export const serializeAws_json1_1GetPreparedStatementCommand = async ( input: GetPreparedStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetPreparedStatement", - }; + const headers: __HeaderBag = sharedHeaders("GetPreparedStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPreparedStatementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -636,10 +567,7 @@ export const serializeAws_json1_1GetQueryExecutionCommand = async ( input: GetQueryExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetQueryExecution", - }; + const headers: __HeaderBag = sharedHeaders("GetQueryExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1GetQueryExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -649,10 +577,7 @@ export const serializeAws_json1_1GetQueryResultsCommand = async ( input: GetQueryResultsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetQueryResults", - }; + const headers: __HeaderBag = sharedHeaders("GetQueryResults"); let body: any; body = JSON.stringify(serializeAws_json1_1GetQueryResultsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -662,10 +587,7 @@ export const serializeAws_json1_1GetQueryRuntimeStatisticsCommand = async ( input: GetQueryRuntimeStatisticsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetQueryRuntimeStatistics", - }; + const headers: __HeaderBag = sharedHeaders("GetQueryRuntimeStatistics"); let body: any; body = JSON.stringify(serializeAws_json1_1GetQueryRuntimeStatisticsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -675,10 +597,7 @@ export const serializeAws_json1_1GetSessionCommand = async ( input: GetSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetSession", - }; + const headers: __HeaderBag = sharedHeaders("GetSession"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -688,10 +607,7 @@ export const serializeAws_json1_1GetSessionStatusCommand = async ( input: GetSessionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetSessionStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetSessionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSessionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -701,10 +617,7 @@ export const serializeAws_json1_1GetTableMetadataCommand = async ( input: GetTableMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetTableMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetTableMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTableMetadataInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -714,10 +627,7 @@ export const serializeAws_json1_1GetWorkGroupCommand = async ( input: GetWorkGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.GetWorkGroup", - }; + const headers: __HeaderBag = sharedHeaders("GetWorkGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWorkGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -727,10 +637,7 @@ export const serializeAws_json1_1ImportNotebookCommand = async ( input: ImportNotebookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ImportNotebook", - }; + const headers: __HeaderBag = sharedHeaders("ImportNotebook"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportNotebookInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -740,10 +647,7 @@ export const serializeAws_json1_1ListApplicationDPUSizesCommand = async ( input: ListApplicationDPUSizesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListApplicationDPUSizes", - }; + const headers: __HeaderBag = sharedHeaders("ListApplicationDPUSizes"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApplicationDPUSizesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -753,10 +657,7 @@ export const serializeAws_json1_1ListCalculationExecutionsCommand = async ( input: ListCalculationExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListCalculationExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListCalculationExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCalculationExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -766,10 +667,7 @@ export const serializeAws_json1_1ListDatabasesCommand = async ( input: ListDatabasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListDatabases", - }; + const headers: __HeaderBag = sharedHeaders("ListDatabases"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatabasesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -779,10 +677,7 @@ export const serializeAws_json1_1ListDataCatalogsCommand = async ( input: ListDataCatalogsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListDataCatalogs", - }; + const headers: __HeaderBag = sharedHeaders("ListDataCatalogs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDataCatalogsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -792,10 +687,7 @@ export const serializeAws_json1_1ListEngineVersionsCommand = async ( input: ListEngineVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListEngineVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListEngineVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEngineVersionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -805,10 +697,7 @@ export const serializeAws_json1_1ListExecutorsCommand = async ( input: ListExecutorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListExecutors", - }; + const headers: __HeaderBag = sharedHeaders("ListExecutors"); let body: any; body = JSON.stringify(serializeAws_json1_1ListExecutorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -818,10 +707,7 @@ export const serializeAws_json1_1ListNamedQueriesCommand = async ( input: ListNamedQueriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListNamedQueries", - }; + const headers: __HeaderBag = sharedHeaders("ListNamedQueries"); let body: any; body = JSON.stringify(serializeAws_json1_1ListNamedQueriesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -831,10 +717,7 @@ export const serializeAws_json1_1ListNotebookMetadataCommand = async ( input: ListNotebookMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListNotebookMetadata", - }; + const headers: __HeaderBag = sharedHeaders("ListNotebookMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1ListNotebookMetadataInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -844,10 +727,7 @@ export const serializeAws_json1_1ListNotebookSessionsCommand = async ( input: ListNotebookSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListNotebookSessions", - }; + const headers: __HeaderBag = sharedHeaders("ListNotebookSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListNotebookSessionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -857,10 +737,7 @@ export const serializeAws_json1_1ListPreparedStatementsCommand = async ( input: ListPreparedStatementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListPreparedStatements", - }; + const headers: __HeaderBag = sharedHeaders("ListPreparedStatements"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPreparedStatementsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -870,10 +747,7 @@ export const serializeAws_json1_1ListQueryExecutionsCommand = async ( input: ListQueryExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListQueryExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListQueryExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListQueryExecutionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -883,10 +757,7 @@ export const serializeAws_json1_1ListSessionsCommand = async ( input: ListSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListSessions", - }; + const headers: __HeaderBag = sharedHeaders("ListSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSessionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -896,10 +767,7 @@ export const serializeAws_json1_1ListTableMetadataCommand = async ( input: ListTableMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListTableMetadata", - }; + const headers: __HeaderBag = sharedHeaders("ListTableMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTableMetadataInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -909,10 +777,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -922,10 +787,7 @@ export const serializeAws_json1_1ListWorkGroupsCommand = async ( input: ListWorkGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.ListWorkGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListWorkGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWorkGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -935,10 +797,7 @@ export const serializeAws_json1_1StartCalculationExecutionCommand = async ( input: StartCalculationExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.StartCalculationExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartCalculationExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StartCalculationExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -948,10 +807,7 @@ export const serializeAws_json1_1StartQueryExecutionCommand = async ( input: StartQueryExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.StartQueryExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartQueryExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StartQueryExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -961,10 +817,7 @@ export const serializeAws_json1_1StartSessionCommand = async ( input: StartSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.StartSession", - }; + const headers: __HeaderBag = sharedHeaders("StartSession"); let body: any; body = JSON.stringify(serializeAws_json1_1StartSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -974,10 +827,7 @@ export const serializeAws_json1_1StopCalculationExecutionCommand = async ( input: StopCalculationExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.StopCalculationExecution", - }; + const headers: __HeaderBag = sharedHeaders("StopCalculationExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StopCalculationExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -987,10 +837,7 @@ export const serializeAws_json1_1StopQueryExecutionCommand = async ( input: StopQueryExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.StopQueryExecution", - }; + const headers: __HeaderBag = sharedHeaders("StopQueryExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StopQueryExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1000,10 +847,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1013,10 +857,7 @@ export const serializeAws_json1_1TerminateSessionCommand = async ( input: TerminateSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.TerminateSession", - }; + const headers: __HeaderBag = sharedHeaders("TerminateSession"); let body: any; body = JSON.stringify(serializeAws_json1_1TerminateSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1026,10 +867,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1039,10 +877,7 @@ export const serializeAws_json1_1UpdateDataCatalogCommand = async ( input: UpdateDataCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.UpdateDataCatalog", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDataCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDataCatalogInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1052,10 +887,7 @@ export const serializeAws_json1_1UpdateNamedQueryCommand = async ( input: UpdateNamedQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.UpdateNamedQuery", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNamedQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNamedQueryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1065,10 +897,7 @@ export const serializeAws_json1_1UpdateNotebookCommand = async ( input: UpdateNotebookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.UpdateNotebook", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNotebook"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNotebookInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1078,10 +907,7 @@ export const serializeAws_json1_1UpdateNotebookMetadataCommand = async ( input: UpdateNotebookMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.UpdateNotebookMetadata", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNotebookMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNotebookMetadataInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1091,10 +917,7 @@ export const serializeAws_json1_1UpdatePreparedStatementCommand = async ( input: UpdatePreparedStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.UpdatePreparedStatement", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePreparedStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePreparedStatementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1104,10 +927,7 @@ export const serializeAws_json1_1UpdateWorkGroupCommand = async ( input: UpdateWorkGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonAthena.UpdateWorkGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWorkGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWorkGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6370,6 +6190,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonAthena.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts index 24ae6b9f19e0f..1f6386de3dac6 100644 --- a/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts +++ b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts @@ -74,10 +74,7 @@ export const serializeAws_json1_1CreateScalingPlanCommand = async ( input: CreateScalingPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleScalingPlannerFrontendService.CreateScalingPlan", - }; + const headers: __HeaderBag = sharedHeaders("CreateScalingPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateScalingPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -87,10 +84,7 @@ export const serializeAws_json1_1DeleteScalingPlanCommand = async ( input: DeleteScalingPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleScalingPlannerFrontendService.DeleteScalingPlan", - }; + const headers: __HeaderBag = sharedHeaders("DeleteScalingPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteScalingPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -100,10 +94,7 @@ export const serializeAws_json1_1DescribeScalingPlanResourcesCommand = async ( input: DescribeScalingPlanResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleScalingPlannerFrontendService.DescribeScalingPlanResources", - }; + const headers: __HeaderBag = sharedHeaders("DescribeScalingPlanResources"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeScalingPlanResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -113,10 +104,7 @@ export const serializeAws_json1_1DescribeScalingPlansCommand = async ( input: DescribeScalingPlansCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleScalingPlannerFrontendService.DescribeScalingPlans", - }; + const headers: __HeaderBag = sharedHeaders("DescribeScalingPlans"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeScalingPlansRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -126,10 +114,7 @@ export const serializeAws_json1_1GetScalingPlanResourceForecastDataCommand = asy input: GetScalingPlanResourceForecastDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleScalingPlannerFrontendService.GetScalingPlanResourceForecastData", - }; + const headers: __HeaderBag = sharedHeaders("GetScalingPlanResourceForecastData"); let body: any; body = JSON.stringify(serializeAws_json1_1GetScalingPlanResourceForecastDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -139,10 +124,7 @@ export const serializeAws_json1_1UpdateScalingPlanCommand = async ( input: UpdateScalingPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AnyScaleScalingPlannerFrontendService.UpdateScalingPlan", - }; + const headers: __HeaderBag = sharedHeaders("UpdateScalingPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateScalingPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1242,6 +1224,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AnyScaleScalingPlannerFrontendService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-auto-scaling/src/protocols/Aws_query.ts b/clients/client-auto-scaling/src/protocols/Aws_query.ts index 45d127cf7d7df..7872b2a7e380f 100644 --- a/clients/client-auto-scaling/src/protocols/Aws_query.ts +++ b/clients/client-auto-scaling/src/protocols/Aws_query.ts @@ -425,9 +425,7 @@ export const serializeAws_queryAttachInstancesCommand = async ( input: AttachInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAttachInstancesQuery(input, context), @@ -441,9 +439,7 @@ export const serializeAws_queryAttachLoadBalancersCommand = async ( input: AttachLoadBalancersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAttachLoadBalancersType(input, context), @@ -457,9 +453,7 @@ export const serializeAws_queryAttachLoadBalancerTargetGroupsCommand = async ( input: AttachLoadBalancerTargetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAttachLoadBalancerTargetGroupsType(input, context), @@ -473,9 +467,7 @@ export const serializeAws_queryAttachTrafficSourcesCommand = async ( input: AttachTrafficSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAttachTrafficSourcesType(input, context), @@ -489,9 +481,7 @@ export const serializeAws_queryBatchDeleteScheduledActionCommand = async ( input: BatchDeleteScheduledActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryBatchDeleteScheduledActionType(input, context), @@ -505,9 +495,7 @@ export const serializeAws_queryBatchPutScheduledUpdateGroupActionCommand = async input: BatchPutScheduledUpdateGroupActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryBatchPutScheduledUpdateGroupActionType(input, context), @@ -521,9 +509,7 @@ export const serializeAws_queryCancelInstanceRefreshCommand = async ( input: CancelInstanceRefreshCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCancelInstanceRefreshType(input, context), @@ -537,9 +523,7 @@ export const serializeAws_queryCompleteLifecycleActionCommand = async ( input: CompleteLifecycleActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCompleteLifecycleActionType(input, context), @@ -553,9 +537,7 @@ export const serializeAws_queryCreateAutoScalingGroupCommand = async ( input: CreateAutoScalingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateAutoScalingGroupType(input, context), @@ -569,9 +551,7 @@ export const serializeAws_queryCreateLaunchConfigurationCommand = async ( input: CreateLaunchConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateLaunchConfigurationType(input, context), @@ -585,9 +565,7 @@ export const serializeAws_queryCreateOrUpdateTagsCommand = async ( input: CreateOrUpdateTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateOrUpdateTagsType(input, context), @@ -601,9 +579,7 @@ export const serializeAws_queryDeleteAutoScalingGroupCommand = async ( input: DeleteAutoScalingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteAutoScalingGroupType(input, context), @@ -617,9 +593,7 @@ export const serializeAws_queryDeleteLaunchConfigurationCommand = async ( input: DeleteLaunchConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryLaunchConfigurationNameType(input, context), @@ -633,9 +607,7 @@ export const serializeAws_queryDeleteLifecycleHookCommand = async ( input: DeleteLifecycleHookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteLifecycleHookType(input, context), @@ -649,9 +621,7 @@ export const serializeAws_queryDeleteNotificationConfigurationCommand = async ( input: DeleteNotificationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteNotificationConfigurationType(input, context), @@ -665,9 +635,7 @@ export const serializeAws_queryDeletePolicyCommand = async ( input: DeletePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeletePolicyType(input, context), @@ -681,9 +649,7 @@ export const serializeAws_queryDeleteScheduledActionCommand = async ( input: DeleteScheduledActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteScheduledActionType(input, context), @@ -697,9 +663,7 @@ export const serializeAws_queryDeleteTagsCommand = async ( input: DeleteTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteTagsType(input, context), @@ -713,9 +677,7 @@ export const serializeAws_queryDeleteWarmPoolCommand = async ( input: DeleteWarmPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteWarmPoolType(input, context), @@ -729,9 +691,7 @@ export const serializeAws_queryDescribeAccountLimitsCommand = async ( input: DescribeAccountLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DescribeAccountLimits", Version: "2011-01-01", @@ -743,9 +703,7 @@ export const serializeAws_queryDescribeAdjustmentTypesCommand = async ( input: DescribeAdjustmentTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DescribeAdjustmentTypes", Version: "2011-01-01", @@ -757,9 +715,7 @@ export const serializeAws_queryDescribeAutoScalingGroupsCommand = async ( input: DescribeAutoScalingGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAutoScalingGroupNamesType(input, context), @@ -773,9 +729,7 @@ export const serializeAws_queryDescribeAutoScalingInstancesCommand = async ( input: DescribeAutoScalingInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAutoScalingInstancesType(input, context), @@ -789,9 +743,7 @@ export const serializeAws_queryDescribeAutoScalingNotificationTypesCommand = asy input: DescribeAutoScalingNotificationTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DescribeAutoScalingNotificationTypes", Version: "2011-01-01", @@ -803,9 +755,7 @@ export const serializeAws_queryDescribeInstanceRefreshesCommand = async ( input: DescribeInstanceRefreshesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeInstanceRefreshesType(input, context), @@ -819,9 +769,7 @@ export const serializeAws_queryDescribeLaunchConfigurationsCommand = async ( input: DescribeLaunchConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryLaunchConfigurationNamesType(input, context), @@ -835,9 +783,7 @@ export const serializeAws_queryDescribeLifecycleHooksCommand = async ( input: DescribeLifecycleHooksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeLifecycleHooksType(input, context), @@ -851,9 +797,7 @@ export const serializeAws_queryDescribeLifecycleHookTypesCommand = async ( input: DescribeLifecycleHookTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DescribeLifecycleHookTypes", Version: "2011-01-01", @@ -865,9 +809,7 @@ export const serializeAws_queryDescribeLoadBalancersCommand = async ( input: DescribeLoadBalancersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeLoadBalancersRequest(input, context), @@ -881,9 +823,7 @@ export const serializeAws_queryDescribeLoadBalancerTargetGroupsCommand = async ( input: DescribeLoadBalancerTargetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeLoadBalancerTargetGroupsRequest(input, context), @@ -897,9 +837,7 @@ export const serializeAws_queryDescribeMetricCollectionTypesCommand = async ( input: DescribeMetricCollectionTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DescribeMetricCollectionTypes", Version: "2011-01-01", @@ -911,9 +849,7 @@ export const serializeAws_queryDescribeNotificationConfigurationsCommand = async input: DescribeNotificationConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeNotificationConfigurationsType(input, context), @@ -927,9 +863,7 @@ export const serializeAws_queryDescribePoliciesCommand = async ( input: DescribePoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribePoliciesType(input, context), @@ -943,9 +877,7 @@ export const serializeAws_queryDescribeScalingActivitiesCommand = async ( input: DescribeScalingActivitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeScalingActivitiesType(input, context), @@ -959,9 +891,7 @@ export const serializeAws_queryDescribeScalingProcessTypesCommand = async ( input: DescribeScalingProcessTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DescribeScalingProcessTypes", Version: "2011-01-01", @@ -973,9 +903,7 @@ export const serializeAws_queryDescribeScheduledActionsCommand = async ( input: DescribeScheduledActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeScheduledActionsType(input, context), @@ -989,9 +917,7 @@ export const serializeAws_queryDescribeTagsCommand = async ( input: DescribeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTagsType(input, context), @@ -1005,9 +931,7 @@ export const serializeAws_queryDescribeTerminationPolicyTypesCommand = async ( input: DescribeTerminationPolicyTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DescribeTerminationPolicyTypes", Version: "2011-01-01", @@ -1019,9 +943,7 @@ export const serializeAws_queryDescribeTrafficSourcesCommand = async ( input: DescribeTrafficSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTrafficSourcesRequest(input, context), @@ -1035,9 +957,7 @@ export const serializeAws_queryDescribeWarmPoolCommand = async ( input: DescribeWarmPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeWarmPoolType(input, context), @@ -1051,9 +971,7 @@ export const serializeAws_queryDetachInstancesCommand = async ( input: DetachInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetachInstancesQuery(input, context), @@ -1067,9 +985,7 @@ export const serializeAws_queryDetachLoadBalancersCommand = async ( input: DetachLoadBalancersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetachLoadBalancersType(input, context), @@ -1083,9 +999,7 @@ export const serializeAws_queryDetachLoadBalancerTargetGroupsCommand = async ( input: DetachLoadBalancerTargetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetachLoadBalancerTargetGroupsType(input, context), @@ -1099,9 +1013,7 @@ export const serializeAws_queryDetachTrafficSourcesCommand = async ( input: DetachTrafficSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetachTrafficSourcesType(input, context), @@ -1115,9 +1027,7 @@ export const serializeAws_queryDisableMetricsCollectionCommand = async ( input: DisableMetricsCollectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDisableMetricsCollectionQuery(input, context), @@ -1131,9 +1041,7 @@ export const serializeAws_queryEnableMetricsCollectionCommand = async ( input: EnableMetricsCollectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryEnableMetricsCollectionQuery(input, context), @@ -1147,9 +1055,7 @@ export const serializeAws_queryEnterStandbyCommand = async ( input: EnterStandbyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryEnterStandbyQuery(input, context), @@ -1163,9 +1069,7 @@ export const serializeAws_queryExecutePolicyCommand = async ( input: ExecutePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryExecutePolicyType(input, context), @@ -1179,9 +1083,7 @@ export const serializeAws_queryExitStandbyCommand = async ( input: ExitStandbyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryExitStandbyQuery(input, context), @@ -1195,9 +1097,7 @@ export const serializeAws_queryGetPredictiveScalingForecastCommand = async ( input: GetPredictiveScalingForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetPredictiveScalingForecastType(input, context), @@ -1211,9 +1111,7 @@ export const serializeAws_queryPutLifecycleHookCommand = async ( input: PutLifecycleHookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutLifecycleHookType(input, context), @@ -1227,9 +1125,7 @@ export const serializeAws_queryPutNotificationConfigurationCommand = async ( input: PutNotificationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutNotificationConfigurationType(input, context), @@ -1243,9 +1139,7 @@ export const serializeAws_queryPutScalingPolicyCommand = async ( input: PutScalingPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutScalingPolicyType(input, context), @@ -1259,9 +1153,7 @@ export const serializeAws_queryPutScheduledUpdateGroupActionCommand = async ( input: PutScheduledUpdateGroupActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutScheduledUpdateGroupActionType(input, context), @@ -1275,9 +1167,7 @@ export const serializeAws_queryPutWarmPoolCommand = async ( input: PutWarmPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutWarmPoolType(input, context), @@ -1291,9 +1181,7 @@ export const serializeAws_queryRecordLifecycleActionHeartbeatCommand = async ( input: RecordLifecycleActionHeartbeatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRecordLifecycleActionHeartbeatType(input, context), @@ -1307,9 +1195,7 @@ export const serializeAws_queryResumeProcessesCommand = async ( input: ResumeProcessesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryScalingProcessQuery(input, context), @@ -1323,9 +1209,7 @@ export const serializeAws_queryRollbackInstanceRefreshCommand = async ( input: RollbackInstanceRefreshCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRollbackInstanceRefreshType(input, context), @@ -1339,9 +1223,7 @@ export const serializeAws_querySetDesiredCapacityCommand = async ( input: SetDesiredCapacityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetDesiredCapacityType(input, context), @@ -1355,9 +1237,7 @@ export const serializeAws_querySetInstanceHealthCommand = async ( input: SetInstanceHealthCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetInstanceHealthQuery(input, context), @@ -1371,9 +1251,7 @@ export const serializeAws_querySetInstanceProtectionCommand = async ( input: SetInstanceProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetInstanceProtectionQuery(input, context), @@ -1387,9 +1265,7 @@ export const serializeAws_queryStartInstanceRefreshCommand = async ( input: StartInstanceRefreshCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStartInstanceRefreshType(input, context), @@ -1403,9 +1279,7 @@ export const serializeAws_querySuspendProcessesCommand = async ( input: SuspendProcessesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryScalingProcessQuery(input, context), @@ -1419,9 +1293,7 @@ export const serializeAws_queryTerminateInstanceInAutoScalingGroupCommand = asyn input: TerminateInstanceInAutoScalingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTerminateInstanceInAutoScalingGroupType(input, context), @@ -1435,9 +1307,7 @@ export const serializeAws_queryUpdateAutoScalingGroupCommand = async ( input: UpdateAutoScalingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateAutoScalingGroupType(input, context), @@ -10290,6 +10160,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts b/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts index 595250e421281..978c8bf38d6ea 100644 --- a/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts +++ b/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts @@ -159,10 +159,7 @@ export const serializeAws_json1_0AssociateGatewayToServerCommand = async ( input: AssociateGatewayToServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.AssociateGatewayToServer", - }; + const headers: __HeaderBag = sharedHeaders("AssociateGatewayToServer"); let body: any; body = JSON.stringify(serializeAws_json1_0AssociateGatewayToServerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -172,10 +169,7 @@ export const serializeAws_json1_0CreateGatewayCommand = async ( input: CreateGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.CreateGateway", - }; + const headers: __HeaderBag = sharedHeaders("CreateGateway"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateGatewayInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -185,10 +179,7 @@ export const serializeAws_json1_0DeleteGatewayCommand = async ( input: DeleteGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.DeleteGateway", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGateway"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteGatewayInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -198,10 +189,7 @@ export const serializeAws_json1_0DeleteHypervisorCommand = async ( input: DeleteHypervisorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.DeleteHypervisor", - }; + const headers: __HeaderBag = sharedHeaders("DeleteHypervisor"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteHypervisorInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -211,10 +199,7 @@ export const serializeAws_json1_0DisassociateGatewayFromServerCommand = async ( input: DisassociateGatewayFromServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.DisassociateGatewayFromServer", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateGatewayFromServer"); let body: any; body = JSON.stringify(serializeAws_json1_0DisassociateGatewayFromServerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -224,10 +209,7 @@ export const serializeAws_json1_0GetBandwidthRateLimitScheduleCommand = async ( input: GetBandwidthRateLimitScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.GetBandwidthRateLimitSchedule", - }; + const headers: __HeaderBag = sharedHeaders("GetBandwidthRateLimitSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_0GetBandwidthRateLimitScheduleInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -237,10 +219,7 @@ export const serializeAws_json1_0GetGatewayCommand = async ( input: GetGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.GetGateway", - }; + const headers: __HeaderBag = sharedHeaders("GetGateway"); let body: any; body = JSON.stringify(serializeAws_json1_0GetGatewayInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -250,10 +229,7 @@ export const serializeAws_json1_0GetHypervisorCommand = async ( input: GetHypervisorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.GetHypervisor", - }; + const headers: __HeaderBag = sharedHeaders("GetHypervisor"); let body: any; body = JSON.stringify(serializeAws_json1_0GetHypervisorInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -263,10 +239,7 @@ export const serializeAws_json1_0GetHypervisorPropertyMappingsCommand = async ( input: GetHypervisorPropertyMappingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.GetHypervisorPropertyMappings", - }; + const headers: __HeaderBag = sharedHeaders("GetHypervisorPropertyMappings"); let body: any; body = JSON.stringify(serializeAws_json1_0GetHypervisorPropertyMappingsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -276,10 +249,7 @@ export const serializeAws_json1_0GetVirtualMachineCommand = async ( input: GetVirtualMachineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.GetVirtualMachine", - }; + const headers: __HeaderBag = sharedHeaders("GetVirtualMachine"); let body: any; body = JSON.stringify(serializeAws_json1_0GetVirtualMachineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -289,10 +259,7 @@ export const serializeAws_json1_0ImportHypervisorConfigurationCommand = async ( input: ImportHypervisorConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.ImportHypervisorConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("ImportHypervisorConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0ImportHypervisorConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -302,10 +269,7 @@ export const serializeAws_json1_0ListGatewaysCommand = async ( input: ListGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.ListGateways", - }; + const headers: __HeaderBag = sharedHeaders("ListGateways"); let body: any; body = JSON.stringify(serializeAws_json1_0ListGatewaysInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -315,10 +279,7 @@ export const serializeAws_json1_0ListHypervisorsCommand = async ( input: ListHypervisorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.ListHypervisors", - }; + const headers: __HeaderBag = sharedHeaders("ListHypervisors"); let body: any; body = JSON.stringify(serializeAws_json1_0ListHypervisorsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -328,10 +289,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -341,10 +299,7 @@ export const serializeAws_json1_0ListVirtualMachinesCommand = async ( input: ListVirtualMachinesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.ListVirtualMachines", - }; + const headers: __HeaderBag = sharedHeaders("ListVirtualMachines"); let body: any; body = JSON.stringify(serializeAws_json1_0ListVirtualMachinesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -354,10 +309,7 @@ export const serializeAws_json1_0PutBandwidthRateLimitScheduleCommand = async ( input: PutBandwidthRateLimitScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.PutBandwidthRateLimitSchedule", - }; + const headers: __HeaderBag = sharedHeaders("PutBandwidthRateLimitSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_0PutBandwidthRateLimitScheduleInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -367,10 +319,7 @@ export const serializeAws_json1_0PutHypervisorPropertyMappingsCommand = async ( input: PutHypervisorPropertyMappingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.PutHypervisorPropertyMappings", - }; + const headers: __HeaderBag = sharedHeaders("PutHypervisorPropertyMappings"); let body: any; body = JSON.stringify(serializeAws_json1_0PutHypervisorPropertyMappingsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -380,10 +329,7 @@ export const serializeAws_json1_0PutMaintenanceStartTimeCommand = async ( input: PutMaintenanceStartTimeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.PutMaintenanceStartTime", - }; + const headers: __HeaderBag = sharedHeaders("PutMaintenanceStartTime"); let body: any; body = JSON.stringify(serializeAws_json1_0PutMaintenanceStartTimeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -393,10 +339,7 @@ export const serializeAws_json1_0StartVirtualMachinesMetadataSyncCommand = async input: StartVirtualMachinesMetadataSyncCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.StartVirtualMachinesMetadataSync", - }; + const headers: __HeaderBag = sharedHeaders("StartVirtualMachinesMetadataSync"); let body: any; body = JSON.stringify(serializeAws_json1_0StartVirtualMachinesMetadataSyncInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -406,10 +349,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -419,10 +359,7 @@ export const serializeAws_json1_0TestHypervisorConfigurationCommand = async ( input: TestHypervisorConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.TestHypervisorConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("TestHypervisorConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0TestHypervisorConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -432,10 +369,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -445,10 +379,7 @@ export const serializeAws_json1_0UpdateGatewayInformationCommand = async ( input: UpdateGatewayInformationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.UpdateGatewayInformation", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGatewayInformation"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateGatewayInformationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -458,10 +389,7 @@ export const serializeAws_json1_0UpdateGatewaySoftwareNowCommand = async ( input: UpdateGatewaySoftwareNowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.UpdateGatewaySoftwareNow", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGatewaySoftwareNow"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateGatewaySoftwareNowInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -471,10 +399,7 @@ export const serializeAws_json1_0UpdateHypervisorCommand = async ( input: UpdateHypervisorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "BackupOnPremises_v20210101.UpdateHypervisor", - }; + const headers: __HeaderBag = sharedHeaders("UpdateHypervisor"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateHypervisorInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2683,6 +2608,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `BackupOnPremises_v20210101.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-budgets/src/protocols/Aws_json1_1.ts b/clients/client-budgets/src/protocols/Aws_json1_1.ts index a28409cd5343a..8fc32583f096e 100644 --- a/clients/client-budgets/src/protocols/Aws_json1_1.ts +++ b/clients/client-budgets/src/protocols/Aws_json1_1.ts @@ -154,10 +154,7 @@ export const serializeAws_json1_1CreateBudgetCommand = async ( input: CreateBudgetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.CreateBudget", - }; + const headers: __HeaderBag = sharedHeaders("CreateBudget"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBudgetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -167,10 +164,7 @@ export const serializeAws_json1_1CreateBudgetActionCommand = async ( input: CreateBudgetActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.CreateBudgetAction", - }; + const headers: __HeaderBag = sharedHeaders("CreateBudgetAction"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBudgetActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -180,10 +174,7 @@ export const serializeAws_json1_1CreateNotificationCommand = async ( input: CreateNotificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.CreateNotification", - }; + const headers: __HeaderBag = sharedHeaders("CreateNotification"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateNotificationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -193,10 +184,7 @@ export const serializeAws_json1_1CreateSubscriberCommand = async ( input: CreateSubscriberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.CreateSubscriber", - }; + const headers: __HeaderBag = sharedHeaders("CreateSubscriber"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSubscriberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -206,10 +194,7 @@ export const serializeAws_json1_1DeleteBudgetCommand = async ( input: DeleteBudgetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DeleteBudget", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBudget"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBudgetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -219,10 +204,7 @@ export const serializeAws_json1_1DeleteBudgetActionCommand = async ( input: DeleteBudgetActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DeleteBudgetAction", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBudgetAction"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBudgetActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -232,10 +214,7 @@ export const serializeAws_json1_1DeleteNotificationCommand = async ( input: DeleteNotificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DeleteNotification", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNotification"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNotificationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -245,10 +224,7 @@ export const serializeAws_json1_1DeleteSubscriberCommand = async ( input: DeleteSubscriberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DeleteSubscriber", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSubscriber"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSubscriberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -258,10 +234,7 @@ export const serializeAws_json1_1DescribeBudgetCommand = async ( input: DescribeBudgetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DescribeBudget", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBudget"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBudgetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -271,10 +244,7 @@ export const serializeAws_json1_1DescribeBudgetActionCommand = async ( input: DescribeBudgetActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DescribeBudgetAction", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBudgetAction"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBudgetActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -284,10 +254,7 @@ export const serializeAws_json1_1DescribeBudgetActionHistoriesCommand = async ( input: DescribeBudgetActionHistoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DescribeBudgetActionHistories", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBudgetActionHistories"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBudgetActionHistoriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -297,10 +264,7 @@ export const serializeAws_json1_1DescribeBudgetActionsForAccountCommand = async input: DescribeBudgetActionsForAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DescribeBudgetActionsForAccount", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBudgetActionsForAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBudgetActionsForAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -310,10 +274,7 @@ export const serializeAws_json1_1DescribeBudgetActionsForBudgetCommand = async ( input: DescribeBudgetActionsForBudgetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DescribeBudgetActionsForBudget", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBudgetActionsForBudget"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBudgetActionsForBudgetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -323,10 +284,7 @@ export const serializeAws_json1_1DescribeBudgetNotificationsForAccountCommand = input: DescribeBudgetNotificationsForAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DescribeBudgetNotificationsForAccount", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBudgetNotificationsForAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBudgetNotificationsForAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -336,10 +294,7 @@ export const serializeAws_json1_1DescribeBudgetPerformanceHistoryCommand = async input: DescribeBudgetPerformanceHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DescribeBudgetPerformanceHistory", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBudgetPerformanceHistory"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBudgetPerformanceHistoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -349,10 +304,7 @@ export const serializeAws_json1_1DescribeBudgetsCommand = async ( input: DescribeBudgetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DescribeBudgets", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBudgets"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBudgetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -362,10 +314,7 @@ export const serializeAws_json1_1DescribeNotificationsForBudgetCommand = async ( input: DescribeNotificationsForBudgetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DescribeNotificationsForBudget", - }; + const headers: __HeaderBag = sharedHeaders("DescribeNotificationsForBudget"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeNotificationsForBudgetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -375,10 +324,7 @@ export const serializeAws_json1_1DescribeSubscribersForNotificationCommand = asy input: DescribeSubscribersForNotificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.DescribeSubscribersForNotification", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSubscribersForNotification"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSubscribersForNotificationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -388,10 +334,7 @@ export const serializeAws_json1_1ExecuteBudgetActionCommand = async ( input: ExecuteBudgetActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.ExecuteBudgetAction", - }; + const headers: __HeaderBag = sharedHeaders("ExecuteBudgetAction"); let body: any; body = JSON.stringify(serializeAws_json1_1ExecuteBudgetActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -401,10 +344,7 @@ export const serializeAws_json1_1UpdateBudgetCommand = async ( input: UpdateBudgetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.UpdateBudget", - }; + const headers: __HeaderBag = sharedHeaders("UpdateBudget"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateBudgetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -414,10 +354,7 @@ export const serializeAws_json1_1UpdateBudgetActionCommand = async ( input: UpdateBudgetActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.UpdateBudgetAction", - }; + const headers: __HeaderBag = sharedHeaders("UpdateBudgetAction"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateBudgetActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -427,10 +364,7 @@ export const serializeAws_json1_1UpdateNotificationCommand = async ( input: UpdateNotificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.UpdateNotification", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNotification"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNotificationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -440,10 +374,7 @@ export const serializeAws_json1_1UpdateSubscriberCommand = async ( input: UpdateSubscriberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSBudgetServiceGateway.UpdateSubscriber", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSubscriber"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSubscriberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3120,6 +3051,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSBudgetServiceGateway.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cloud9/src/protocols/Aws_json1_1.ts b/clients/client-cloud9/src/protocols/Aws_json1_1.ts index 6f07ac7ca93e5..fb862e19955e2 100644 --- a/clients/client-cloud9/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloud9/src/protocols/Aws_json1_1.ts @@ -100,10 +100,7 @@ export const serializeAws_json1_1CreateEnvironmentEC2Command = async ( input: CreateEnvironmentEC2CommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.CreateEnvironmentEC2", - }; + const headers: __HeaderBag = sharedHeaders("CreateEnvironmentEC2"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEnvironmentEC2Request(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -113,10 +110,7 @@ export const serializeAws_json1_1CreateEnvironmentMembershipCommand = async ( input: CreateEnvironmentMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.CreateEnvironmentMembership", - }; + const headers: __HeaderBag = sharedHeaders("CreateEnvironmentMembership"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEnvironmentMembershipRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -126,10 +120,7 @@ export const serializeAws_json1_1DeleteEnvironmentCommand = async ( input: DeleteEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.DeleteEnvironment", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEnvironment"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEnvironmentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -139,10 +130,7 @@ export const serializeAws_json1_1DeleteEnvironmentMembershipCommand = async ( input: DeleteEnvironmentMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.DeleteEnvironmentMembership", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEnvironmentMembership"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEnvironmentMembershipRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -152,10 +140,7 @@ export const serializeAws_json1_1DescribeEnvironmentMembershipsCommand = async ( input: DescribeEnvironmentMembershipsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.DescribeEnvironmentMemberships", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEnvironmentMemberships"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEnvironmentMembershipsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -165,10 +150,7 @@ export const serializeAws_json1_1DescribeEnvironmentsCommand = async ( input: DescribeEnvironmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.DescribeEnvironments", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEnvironments"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEnvironmentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -178,10 +160,7 @@ export const serializeAws_json1_1DescribeEnvironmentStatusCommand = async ( input: DescribeEnvironmentStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.DescribeEnvironmentStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEnvironmentStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEnvironmentStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -191,10 +170,7 @@ export const serializeAws_json1_1ListEnvironmentsCommand = async ( input: ListEnvironmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.ListEnvironments", - }; + const headers: __HeaderBag = sharedHeaders("ListEnvironments"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEnvironmentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -204,10 +180,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -217,10 +190,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -230,10 +200,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -243,10 +210,7 @@ export const serializeAws_json1_1UpdateEnvironmentCommand = async ( input: UpdateEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.UpdateEnvironment", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEnvironment"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEnvironmentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -256,10 +220,7 @@ export const serializeAws_json1_1UpdateEnvironmentMembershipCommand = async ( input: UpdateEnvironmentMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCloud9WorkspaceManagementService.UpdateEnvironmentMembership", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEnvironmentMembership"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEnvironmentMembershipRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1596,6 +1557,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSCloud9WorkspaceManagementService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts b/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts index e036069398859..e5ed2d1513f40 100644 --- a/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts +++ b/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts @@ -83,10 +83,7 @@ export const serializeAws_json1_0CancelResourceRequestCommand = async ( input: CancelResourceRequestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CloudApiService.CancelResourceRequest", - }; + const headers: __HeaderBag = sharedHeaders("CancelResourceRequest"); let body: any; body = JSON.stringify(serializeAws_json1_0CancelResourceRequestInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -96,10 +93,7 @@ export const serializeAws_json1_0CreateResourceCommand = async ( input: CreateResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CloudApiService.CreateResource", - }; + const headers: __HeaderBag = sharedHeaders("CreateResource"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -109,10 +103,7 @@ export const serializeAws_json1_0DeleteResourceCommand = async ( input: DeleteResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CloudApiService.DeleteResource", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResource"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -122,10 +113,7 @@ export const serializeAws_json1_0GetResourceCommand = async ( input: GetResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CloudApiService.GetResource", - }; + const headers: __HeaderBag = sharedHeaders("GetResource"); let body: any; body = JSON.stringify(serializeAws_json1_0GetResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -135,10 +123,7 @@ export const serializeAws_json1_0GetResourceRequestStatusCommand = async ( input: GetResourceRequestStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CloudApiService.GetResourceRequestStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetResourceRequestStatus"); let body: any; body = JSON.stringify(serializeAws_json1_0GetResourceRequestStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -148,10 +133,7 @@ export const serializeAws_json1_0ListResourceRequestsCommand = async ( input: ListResourceRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CloudApiService.ListResourceRequests", - }; + const headers: __HeaderBag = sharedHeaders("ListResourceRequests"); let body: any; body = JSON.stringify(serializeAws_json1_0ListResourceRequestsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -161,10 +143,7 @@ export const serializeAws_json1_0ListResourcesCommand = async ( input: ListResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CloudApiService.ListResources", - }; + const headers: __HeaderBag = sharedHeaders("ListResources"); let body: any; body = JSON.stringify(serializeAws_json1_0ListResourcesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -174,10 +153,7 @@ export const serializeAws_json1_0UpdateResourceCommand = async ( input: UpdateResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CloudApiService.UpdateResource", - }; + const headers: __HeaderBag = sharedHeaders("UpdateResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1493,6 +1469,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `CloudApiService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cloudformation/src/protocols/Aws_query.ts b/clients/client-cloudformation/src/protocols/Aws_query.ts index b4cf6ba46175f..4528811fbb13c 100644 --- a/clients/client-cloudformation/src/protocols/Aws_query.ts +++ b/clients/client-cloudformation/src/protocols/Aws_query.ts @@ -390,9 +390,7 @@ export const serializeAws_queryActivateTypeCommand = async ( input: ActivateTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryActivateTypeInput(input, context), @@ -406,9 +404,7 @@ export const serializeAws_queryBatchDescribeTypeConfigurationsCommand = async ( input: BatchDescribeTypeConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryBatchDescribeTypeConfigurationsInput(input, context), @@ -422,9 +418,7 @@ export const serializeAws_queryCancelUpdateStackCommand = async ( input: CancelUpdateStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCancelUpdateStackInput(input, context), @@ -438,9 +432,7 @@ export const serializeAws_queryContinueUpdateRollbackCommand = async ( input: ContinueUpdateRollbackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryContinueUpdateRollbackInput(input, context), @@ -454,9 +446,7 @@ export const serializeAws_queryCreateChangeSetCommand = async ( input: CreateChangeSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateChangeSetInput(input, context), @@ -470,9 +460,7 @@ export const serializeAws_queryCreateStackCommand = async ( input: CreateStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateStackInput(input, context), @@ -486,9 +474,7 @@ export const serializeAws_queryCreateStackInstancesCommand = async ( input: CreateStackInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateStackInstancesInput(input, context), @@ -502,9 +488,7 @@ export const serializeAws_queryCreateStackSetCommand = async ( input: CreateStackSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateStackSetInput(input, context), @@ -518,9 +502,7 @@ export const serializeAws_queryDeactivateTypeCommand = async ( input: DeactivateTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeactivateTypeInput(input, context), @@ -534,9 +516,7 @@ export const serializeAws_queryDeleteChangeSetCommand = async ( input: DeleteChangeSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteChangeSetInput(input, context), @@ -550,9 +530,7 @@ export const serializeAws_queryDeleteStackCommand = async ( input: DeleteStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteStackInput(input, context), @@ -566,9 +544,7 @@ export const serializeAws_queryDeleteStackInstancesCommand = async ( input: DeleteStackInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteStackInstancesInput(input, context), @@ -582,9 +558,7 @@ export const serializeAws_queryDeleteStackSetCommand = async ( input: DeleteStackSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteStackSetInput(input, context), @@ -598,9 +572,7 @@ export const serializeAws_queryDeregisterTypeCommand = async ( input: DeregisterTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeregisterTypeInput(input, context), @@ -614,9 +586,7 @@ export const serializeAws_queryDescribeAccountLimitsCommand = async ( input: DescribeAccountLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAccountLimitsInput(input, context), @@ -630,9 +600,7 @@ export const serializeAws_queryDescribeChangeSetCommand = async ( input: DescribeChangeSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeChangeSetInput(input, context), @@ -646,9 +614,7 @@ export const serializeAws_queryDescribeChangeSetHooksCommand = async ( input: DescribeChangeSetHooksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeChangeSetHooksInput(input, context), @@ -662,9 +628,7 @@ export const serializeAws_queryDescribePublisherCommand = async ( input: DescribePublisherCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribePublisherInput(input, context), @@ -678,9 +642,7 @@ export const serializeAws_queryDescribeStackDriftDetectionStatusCommand = async input: DescribeStackDriftDetectionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeStackDriftDetectionStatusInput(input, context), @@ -694,9 +656,7 @@ export const serializeAws_queryDescribeStackEventsCommand = async ( input: DescribeStackEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeStackEventsInput(input, context), @@ -710,9 +670,7 @@ export const serializeAws_queryDescribeStackInstanceCommand = async ( input: DescribeStackInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeStackInstanceInput(input, context), @@ -726,9 +684,7 @@ export const serializeAws_queryDescribeStackResourceCommand = async ( input: DescribeStackResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeStackResourceInput(input, context), @@ -742,9 +698,7 @@ export const serializeAws_queryDescribeStackResourceDriftsCommand = async ( input: DescribeStackResourceDriftsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeStackResourceDriftsInput(input, context), @@ -758,9 +712,7 @@ export const serializeAws_queryDescribeStackResourcesCommand = async ( input: DescribeStackResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeStackResourcesInput(input, context), @@ -774,9 +726,7 @@ export const serializeAws_queryDescribeStacksCommand = async ( input: DescribeStacksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeStacksInput(input, context), @@ -790,9 +740,7 @@ export const serializeAws_queryDescribeStackSetCommand = async ( input: DescribeStackSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeStackSetInput(input, context), @@ -806,9 +754,7 @@ export const serializeAws_queryDescribeStackSetOperationCommand = async ( input: DescribeStackSetOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeStackSetOperationInput(input, context), @@ -822,9 +768,7 @@ export const serializeAws_queryDescribeTypeCommand = async ( input: DescribeTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTypeInput(input, context), @@ -838,9 +782,7 @@ export const serializeAws_queryDescribeTypeRegistrationCommand = async ( input: DescribeTypeRegistrationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTypeRegistrationInput(input, context), @@ -854,9 +796,7 @@ export const serializeAws_queryDetectStackDriftCommand = async ( input: DetectStackDriftCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetectStackDriftInput(input, context), @@ -870,9 +810,7 @@ export const serializeAws_queryDetectStackResourceDriftCommand = async ( input: DetectStackResourceDriftCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetectStackResourceDriftInput(input, context), @@ -886,9 +824,7 @@ export const serializeAws_queryDetectStackSetDriftCommand = async ( input: DetectStackSetDriftCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetectStackSetDriftInput(input, context), @@ -902,9 +838,7 @@ export const serializeAws_queryEstimateTemplateCostCommand = async ( input: EstimateTemplateCostCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryEstimateTemplateCostInput(input, context), @@ -918,9 +852,7 @@ export const serializeAws_queryExecuteChangeSetCommand = async ( input: ExecuteChangeSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryExecuteChangeSetInput(input, context), @@ -934,9 +866,7 @@ export const serializeAws_queryGetStackPolicyCommand = async ( input: GetStackPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetStackPolicyInput(input, context), @@ -950,9 +880,7 @@ export const serializeAws_queryGetTemplateCommand = async ( input: GetTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetTemplateInput(input, context), @@ -966,9 +894,7 @@ export const serializeAws_queryGetTemplateSummaryCommand = async ( input: GetTemplateSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetTemplateSummaryInput(input, context), @@ -982,9 +908,7 @@ export const serializeAws_queryImportStacksToStackSetCommand = async ( input: ImportStacksToStackSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryImportStacksToStackSetInput(input, context), @@ -998,9 +922,7 @@ export const serializeAws_queryListChangeSetsCommand = async ( input: ListChangeSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListChangeSetsInput(input, context), @@ -1014,9 +936,7 @@ export const serializeAws_queryListExportsCommand = async ( input: ListExportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListExportsInput(input, context), @@ -1030,9 +950,7 @@ export const serializeAws_queryListImportsCommand = async ( input: ListImportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListImportsInput(input, context), @@ -1046,9 +964,7 @@ export const serializeAws_queryListStackInstancesCommand = async ( input: ListStackInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListStackInstancesInput(input, context), @@ -1062,9 +978,7 @@ export const serializeAws_queryListStackResourcesCommand = async ( input: ListStackResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListStackResourcesInput(input, context), @@ -1078,9 +992,7 @@ export const serializeAws_queryListStacksCommand = async ( input: ListStacksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListStacksInput(input, context), @@ -1094,9 +1006,7 @@ export const serializeAws_queryListStackSetOperationResultsCommand = async ( input: ListStackSetOperationResultsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListStackSetOperationResultsInput(input, context), @@ -1110,9 +1020,7 @@ export const serializeAws_queryListStackSetOperationsCommand = async ( input: ListStackSetOperationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListStackSetOperationsInput(input, context), @@ -1126,9 +1034,7 @@ export const serializeAws_queryListStackSetsCommand = async ( input: ListStackSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListStackSetsInput(input, context), @@ -1142,9 +1048,7 @@ export const serializeAws_queryListTypeRegistrationsCommand = async ( input: ListTypeRegistrationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTypeRegistrationsInput(input, context), @@ -1158,9 +1062,7 @@ export const serializeAws_queryListTypesCommand = async ( input: ListTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTypesInput(input, context), @@ -1174,9 +1076,7 @@ export const serializeAws_queryListTypeVersionsCommand = async ( input: ListTypeVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTypeVersionsInput(input, context), @@ -1190,9 +1090,7 @@ export const serializeAws_queryPublishTypeCommand = async ( input: PublishTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPublishTypeInput(input, context), @@ -1206,9 +1104,7 @@ export const serializeAws_queryRecordHandlerProgressCommand = async ( input: RecordHandlerProgressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRecordHandlerProgressInput(input, context), @@ -1222,9 +1118,7 @@ export const serializeAws_queryRegisterPublisherCommand = async ( input: RegisterPublisherCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRegisterPublisherInput(input, context), @@ -1238,9 +1132,7 @@ export const serializeAws_queryRegisterTypeCommand = async ( input: RegisterTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRegisterTypeInput(input, context), @@ -1254,9 +1146,7 @@ export const serializeAws_queryRollbackStackCommand = async ( input: RollbackStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRollbackStackInput(input, context), @@ -1270,9 +1160,7 @@ export const serializeAws_querySetStackPolicyCommand = async ( input: SetStackPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetStackPolicyInput(input, context), @@ -1286,9 +1174,7 @@ export const serializeAws_querySetTypeConfigurationCommand = async ( input: SetTypeConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetTypeConfigurationInput(input, context), @@ -1302,9 +1188,7 @@ export const serializeAws_querySetTypeDefaultVersionCommand = async ( input: SetTypeDefaultVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetTypeDefaultVersionInput(input, context), @@ -1318,9 +1202,7 @@ export const serializeAws_querySignalResourceCommand = async ( input: SignalResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySignalResourceInput(input, context), @@ -1334,9 +1216,7 @@ export const serializeAws_queryStopStackSetOperationCommand = async ( input: StopStackSetOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStopStackSetOperationInput(input, context), @@ -1350,9 +1230,7 @@ export const serializeAws_queryTestTypeCommand = async ( input: TestTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTestTypeInput(input, context), @@ -1366,9 +1244,7 @@ export const serializeAws_queryUpdateStackCommand = async ( input: UpdateStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateStackInput(input, context), @@ -1382,9 +1258,7 @@ export const serializeAws_queryUpdateStackInstancesCommand = async ( input: UpdateStackInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateStackInstancesInput(input, context), @@ -1398,9 +1272,7 @@ export const serializeAws_queryUpdateStackSetCommand = async ( input: UpdateStackSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateStackSetInput(input, context), @@ -1414,9 +1286,7 @@ export const serializeAws_queryUpdateTerminationProtectionCommand = async ( input: UpdateTerminationProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateTerminationProtectionInput(input, context), @@ -1430,9 +1300,7 @@ export const serializeAws_queryValidateTemplateCommand = async ( input: ValidateTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryValidateTemplateInput(input, context), @@ -9845,6 +9713,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts index 42aace9e2e5b4..ff8da2c5ac5d3 100644 --- a/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts @@ -85,10 +85,7 @@ export const serializeAws_json1_1CopyBackupToRegionCommand = async ( input: CopyBackupToRegionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.CopyBackupToRegion", - }; + const headers: __HeaderBag = sharedHeaders("CopyBackupToRegion"); let body: any; body = JSON.stringify(serializeAws_json1_1CopyBackupToRegionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -98,10 +95,7 @@ export const serializeAws_json1_1CreateClusterCommand = async ( input: CreateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.CreateCluster", - }; + const headers: __HeaderBag = sharedHeaders("CreateCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -111,10 +105,7 @@ export const serializeAws_json1_1CreateHsmCommand = async ( input: CreateHsmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.CreateHsm", - }; + const headers: __HeaderBag = sharedHeaders("CreateHsm"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHsmRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -124,10 +115,7 @@ export const serializeAws_json1_1DeleteBackupCommand = async ( input: DeleteBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.DeleteBackup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBackup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBackupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -137,10 +125,7 @@ export const serializeAws_json1_1DeleteClusterCommand = async ( input: DeleteClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.DeleteCluster", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -150,10 +135,7 @@ export const serializeAws_json1_1DeleteHsmCommand = async ( input: DeleteHsmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.DeleteHsm", - }; + const headers: __HeaderBag = sharedHeaders("DeleteHsm"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteHsmRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -163,10 +145,7 @@ export const serializeAws_json1_1DescribeBackupsCommand = async ( input: DescribeBackupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.DescribeBackups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBackups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBackupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -176,10 +155,7 @@ export const serializeAws_json1_1DescribeClustersCommand = async ( input: DescribeClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.DescribeClusters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeClusters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeClustersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -189,10 +165,7 @@ export const serializeAws_json1_1InitializeClusterCommand = async ( input: InitializeClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.InitializeCluster", - }; + const headers: __HeaderBag = sharedHeaders("InitializeCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1InitializeClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -202,10 +175,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.ListTags", - }; + const headers: __HeaderBag = sharedHeaders("ListTags"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -215,10 +185,7 @@ export const serializeAws_json1_1ModifyBackupAttributesCommand = async ( input: ModifyBackupAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.ModifyBackupAttributes", - }; + const headers: __HeaderBag = sharedHeaders("ModifyBackupAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyBackupAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -228,10 +195,7 @@ export const serializeAws_json1_1ModifyClusterCommand = async ( input: ModifyClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.ModifyCluster", - }; + const headers: __HeaderBag = sharedHeaders("ModifyCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -241,10 +205,7 @@ export const serializeAws_json1_1RestoreBackupCommand = async ( input: RestoreBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.RestoreBackup", - }; + const headers: __HeaderBag = sharedHeaders("RestoreBackup"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreBackupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -254,10 +215,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -267,10 +225,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "BaldrApiService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1718,6 +1673,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `BaldrApiService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts index 5189e87270698..6d2a0eb4abe9c 100644 --- a/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts @@ -91,10 +91,7 @@ export const serializeAws_json1_1AddTagsToResourceCommand = async ( input: AddTagsToResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.AddTagsToResource", - }; + const headers: __HeaderBag = sharedHeaders("AddTagsToResource"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsToResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -104,10 +101,7 @@ export const serializeAws_json1_1CreateHapgCommand = async ( input: CreateHapgCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.CreateHapg", - }; + const headers: __HeaderBag = sharedHeaders("CreateHapg"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHapgRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -117,10 +111,7 @@ export const serializeAws_json1_1CreateHsmCommand = async ( input: CreateHsmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.CreateHsm", - }; + const headers: __HeaderBag = sharedHeaders("CreateHsm"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHsmRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -130,10 +121,7 @@ export const serializeAws_json1_1CreateLunaClientCommand = async ( input: CreateLunaClientCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.CreateLunaClient", - }; + const headers: __HeaderBag = sharedHeaders("CreateLunaClient"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLunaClientRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -143,10 +131,7 @@ export const serializeAws_json1_1DeleteHapgCommand = async ( input: DeleteHapgCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.DeleteHapg", - }; + const headers: __HeaderBag = sharedHeaders("DeleteHapg"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteHapgRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -156,10 +141,7 @@ export const serializeAws_json1_1DeleteHsmCommand = async ( input: DeleteHsmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.DeleteHsm", - }; + const headers: __HeaderBag = sharedHeaders("DeleteHsm"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteHsmRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -169,10 +151,7 @@ export const serializeAws_json1_1DeleteLunaClientCommand = async ( input: DeleteLunaClientCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.DeleteLunaClient", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLunaClient"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLunaClientRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -182,10 +161,7 @@ export const serializeAws_json1_1DescribeHapgCommand = async ( input: DescribeHapgCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.DescribeHapg", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHapg"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeHapgRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -195,10 +171,7 @@ export const serializeAws_json1_1DescribeHsmCommand = async ( input: DescribeHsmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.DescribeHsm", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHsm"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeHsmRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -208,10 +181,7 @@ export const serializeAws_json1_1DescribeLunaClientCommand = async ( input: DescribeLunaClientCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.DescribeLunaClient", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLunaClient"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLunaClientRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -221,10 +191,7 @@ export const serializeAws_json1_1GetConfigCommand = async ( input: GetConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.GetConfig", - }; + const headers: __HeaderBag = sharedHeaders("GetConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1GetConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -234,10 +201,7 @@ export const serializeAws_json1_1ListAvailableZonesCommand = async ( input: ListAvailableZonesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.ListAvailableZones", - }; + const headers: __HeaderBag = sharedHeaders("ListAvailableZones"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAvailableZonesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -247,10 +211,7 @@ export const serializeAws_json1_1ListHapgsCommand = async ( input: ListHapgsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.ListHapgs", - }; + const headers: __HeaderBag = sharedHeaders("ListHapgs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHapgsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -260,10 +221,7 @@ export const serializeAws_json1_1ListHsmsCommand = async ( input: ListHsmsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.ListHsms", - }; + const headers: __HeaderBag = sharedHeaders("ListHsms"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHsmsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -273,10 +231,7 @@ export const serializeAws_json1_1ListLunaClientsCommand = async ( input: ListLunaClientsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.ListLunaClients", - }; + const headers: __HeaderBag = sharedHeaders("ListLunaClients"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLunaClientsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -286,10 +241,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -299,10 +251,7 @@ export const serializeAws_json1_1ModifyHapgCommand = async ( input: ModifyHapgCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.ModifyHapg", - }; + const headers: __HeaderBag = sharedHeaders("ModifyHapg"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyHapgRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -312,10 +261,7 @@ export const serializeAws_json1_1ModifyHsmCommand = async ( input: ModifyHsmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.ModifyHsm", - }; + const headers: __HeaderBag = sharedHeaders("ModifyHsm"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyHsmRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -325,10 +271,7 @@ export const serializeAws_json1_1ModifyLunaClientCommand = async ( input: ModifyLunaClientCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.ModifyLunaClient", - }; + const headers: __HeaderBag = sharedHeaders("ModifyLunaClient"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyLunaClientRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -338,10 +281,7 @@ export const serializeAws_json1_1RemoveTagsFromResourceCommand = async ( input: RemoveTagsFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudHsmFrontendService.RemoveTagsFromResource", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTagsFromResource"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsFromResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1877,6 +1817,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `CloudHsmFrontendService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cloudsearch/src/protocols/Aws_query.ts b/clients/client-cloudsearch/src/protocols/Aws_query.ts index 9de8da91d8924..3131d7738d684 100644 --- a/clients/client-cloudsearch/src/protocols/Aws_query.ts +++ b/clients/client-cloudsearch/src/protocols/Aws_query.ts @@ -186,9 +186,7 @@ export const serializeAws_queryBuildSuggestersCommand = async ( input: BuildSuggestersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryBuildSuggestersRequest(input, context), @@ -202,9 +200,7 @@ export const serializeAws_queryCreateDomainCommand = async ( input: CreateDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDomainRequest(input, context), @@ -218,9 +214,7 @@ export const serializeAws_queryDefineAnalysisSchemeCommand = async ( input: DefineAnalysisSchemeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDefineAnalysisSchemeRequest(input, context), @@ -234,9 +228,7 @@ export const serializeAws_queryDefineExpressionCommand = async ( input: DefineExpressionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDefineExpressionRequest(input, context), @@ -250,9 +242,7 @@ export const serializeAws_queryDefineIndexFieldCommand = async ( input: DefineIndexFieldCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDefineIndexFieldRequest(input, context), @@ -266,9 +256,7 @@ export const serializeAws_queryDefineSuggesterCommand = async ( input: DefineSuggesterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDefineSuggesterRequest(input, context), @@ -282,9 +270,7 @@ export const serializeAws_queryDeleteAnalysisSchemeCommand = async ( input: DeleteAnalysisSchemeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteAnalysisSchemeRequest(input, context), @@ -298,9 +284,7 @@ export const serializeAws_queryDeleteDomainCommand = async ( input: DeleteDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDomainRequest(input, context), @@ -314,9 +298,7 @@ export const serializeAws_queryDeleteExpressionCommand = async ( input: DeleteExpressionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteExpressionRequest(input, context), @@ -330,9 +312,7 @@ export const serializeAws_queryDeleteIndexFieldCommand = async ( input: DeleteIndexFieldCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteIndexFieldRequest(input, context), @@ -346,9 +326,7 @@ export const serializeAws_queryDeleteSuggesterCommand = async ( input: DeleteSuggesterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteSuggesterRequest(input, context), @@ -362,9 +340,7 @@ export const serializeAws_queryDescribeAnalysisSchemesCommand = async ( input: DescribeAnalysisSchemesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAnalysisSchemesRequest(input, context), @@ -378,9 +354,7 @@ export const serializeAws_queryDescribeAvailabilityOptionsCommand = async ( input: DescribeAvailabilityOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAvailabilityOptionsRequest(input, context), @@ -394,9 +368,7 @@ export const serializeAws_queryDescribeDomainEndpointOptionsCommand = async ( input: DescribeDomainEndpointOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDomainEndpointOptionsRequest(input, context), @@ -410,9 +382,7 @@ export const serializeAws_queryDescribeDomainsCommand = async ( input: DescribeDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDomainsRequest(input, context), @@ -426,9 +396,7 @@ export const serializeAws_queryDescribeExpressionsCommand = async ( input: DescribeExpressionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeExpressionsRequest(input, context), @@ -442,9 +410,7 @@ export const serializeAws_queryDescribeIndexFieldsCommand = async ( input: DescribeIndexFieldsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeIndexFieldsRequest(input, context), @@ -458,9 +424,7 @@ export const serializeAws_queryDescribeScalingParametersCommand = async ( input: DescribeScalingParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeScalingParametersRequest(input, context), @@ -474,9 +438,7 @@ export const serializeAws_queryDescribeServiceAccessPoliciesCommand = async ( input: DescribeServiceAccessPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeServiceAccessPoliciesRequest(input, context), @@ -490,9 +452,7 @@ export const serializeAws_queryDescribeSuggestersCommand = async ( input: DescribeSuggestersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeSuggestersRequest(input, context), @@ -506,9 +466,7 @@ export const serializeAws_queryIndexDocumentsCommand = async ( input: IndexDocumentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryIndexDocumentsRequest(input, context), @@ -522,9 +480,7 @@ export const serializeAws_queryListDomainNamesCommand = async ( input: ListDomainNamesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "ListDomainNames", Version: "2013-01-01", @@ -536,9 +492,7 @@ export const serializeAws_queryUpdateAvailabilityOptionsCommand = async ( input: UpdateAvailabilityOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateAvailabilityOptionsRequest(input, context), @@ -552,9 +506,7 @@ export const serializeAws_queryUpdateDomainEndpointOptionsCommand = async ( input: UpdateDomainEndpointOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateDomainEndpointOptionsRequest(input, context), @@ -568,9 +520,7 @@ export const serializeAws_queryUpdateScalingParametersCommand = async ( input: UpdateScalingParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateScalingParametersRequest(input, context), @@ -584,9 +534,7 @@ export const serializeAws_queryUpdateServiceAccessPoliciesCommand = async ( input: UpdateServiceAccessPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateServiceAccessPoliciesRequest(input, context), @@ -3956,6 +3904,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts index f4e4fc095819e..0db0ca01e6c30 100644 --- a/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts @@ -293,10 +293,7 @@ export const serializeAws_json1_1AddTagsCommand = async ( input: AddTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.AddTags", - }; + const headers: __HeaderBag = sharedHeaders("AddTags"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -306,10 +303,7 @@ export const serializeAws_json1_1CancelQueryCommand = async ( input: CancelQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.CancelQuery", - }; + const headers: __HeaderBag = sharedHeaders("CancelQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -319,10 +313,7 @@ export const serializeAws_json1_1CreateChannelCommand = async ( input: CreateChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.CreateChannel", - }; + const headers: __HeaderBag = sharedHeaders("CreateChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -332,10 +323,7 @@ export const serializeAws_json1_1CreateEventDataStoreCommand = async ( input: CreateEventDataStoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.CreateEventDataStore", - }; + const headers: __HeaderBag = sharedHeaders("CreateEventDataStore"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEventDataStoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -345,10 +333,7 @@ export const serializeAws_json1_1CreateTrailCommand = async ( input: CreateTrailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.CreateTrail", - }; + const headers: __HeaderBag = sharedHeaders("CreateTrail"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTrailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -358,10 +343,7 @@ export const serializeAws_json1_1DeleteChannelCommand = async ( input: DeleteChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.DeleteChannel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -371,10 +353,7 @@ export const serializeAws_json1_1DeleteEventDataStoreCommand = async ( input: DeleteEventDataStoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.DeleteEventDataStore", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEventDataStore"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEventDataStoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -384,10 +363,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.DeleteResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -397,10 +373,7 @@ export const serializeAws_json1_1DeleteTrailCommand = async ( input: DeleteTrailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.DeleteTrail", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTrail"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTrailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -410,10 +383,7 @@ export const serializeAws_json1_1DeregisterOrganizationDelegatedAdminCommand = a input: DeregisterOrganizationDelegatedAdminCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.DeregisterOrganizationDelegatedAdmin", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterOrganizationDelegatedAdmin"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterOrganizationDelegatedAdminRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -423,10 +393,7 @@ export const serializeAws_json1_1DescribeQueryCommand = async ( input: DescribeQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.DescribeQuery", - }; + const headers: __HeaderBag = sharedHeaders("DescribeQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -436,10 +403,7 @@ export const serializeAws_json1_1DescribeTrailsCommand = async ( input: DescribeTrailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.DescribeTrails", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTrails"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTrailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -449,10 +413,7 @@ export const serializeAws_json1_1GetChannelCommand = async ( input: GetChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.GetChannel", - }; + const headers: __HeaderBag = sharedHeaders("GetChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1GetChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -462,10 +423,7 @@ export const serializeAws_json1_1GetEventDataStoreCommand = async ( input: GetEventDataStoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.GetEventDataStore", - }; + const headers: __HeaderBag = sharedHeaders("GetEventDataStore"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEventDataStoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -475,10 +433,7 @@ export const serializeAws_json1_1GetEventSelectorsCommand = async ( input: GetEventSelectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.GetEventSelectors", - }; + const headers: __HeaderBag = sharedHeaders("GetEventSelectors"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEventSelectorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -488,10 +443,7 @@ export const serializeAws_json1_1GetImportCommand = async ( input: GetImportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.GetImport", - }; + const headers: __HeaderBag = sharedHeaders("GetImport"); let body: any; body = JSON.stringify(serializeAws_json1_1GetImportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -501,10 +453,7 @@ export const serializeAws_json1_1GetInsightSelectorsCommand = async ( input: GetInsightSelectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.GetInsightSelectors", - }; + const headers: __HeaderBag = sharedHeaders("GetInsightSelectors"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInsightSelectorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -514,10 +463,7 @@ export const serializeAws_json1_1GetQueryResultsCommand = async ( input: GetQueryResultsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.GetQueryResults", - }; + const headers: __HeaderBag = sharedHeaders("GetQueryResults"); let body: any; body = JSON.stringify(serializeAws_json1_1GetQueryResultsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -527,10 +473,7 @@ export const serializeAws_json1_1GetResourcePolicyCommand = async ( input: GetResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.GetResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -540,10 +483,7 @@ export const serializeAws_json1_1GetTrailCommand = async ( input: GetTrailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.GetTrail", - }; + const headers: __HeaderBag = sharedHeaders("GetTrail"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTrailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -553,10 +493,7 @@ export const serializeAws_json1_1GetTrailStatusCommand = async ( input: GetTrailStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.GetTrailStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetTrailStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTrailStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -566,10 +503,7 @@ export const serializeAws_json1_1ListChannelsCommand = async ( input: ListChannelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.ListChannels", - }; + const headers: __HeaderBag = sharedHeaders("ListChannels"); let body: any; body = JSON.stringify(serializeAws_json1_1ListChannelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -579,10 +513,7 @@ export const serializeAws_json1_1ListEventDataStoresCommand = async ( input: ListEventDataStoresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.ListEventDataStores", - }; + const headers: __HeaderBag = sharedHeaders("ListEventDataStores"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEventDataStoresRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -592,10 +523,7 @@ export const serializeAws_json1_1ListImportFailuresCommand = async ( input: ListImportFailuresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.ListImportFailures", - }; + const headers: __HeaderBag = sharedHeaders("ListImportFailures"); let body: any; body = JSON.stringify(serializeAws_json1_1ListImportFailuresRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -605,10 +533,7 @@ export const serializeAws_json1_1ListImportsCommand = async ( input: ListImportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.ListImports", - }; + const headers: __HeaderBag = sharedHeaders("ListImports"); let body: any; body = JSON.stringify(serializeAws_json1_1ListImportsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -618,10 +543,7 @@ export const serializeAws_json1_1ListPublicKeysCommand = async ( input: ListPublicKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.ListPublicKeys", - }; + const headers: __HeaderBag = sharedHeaders("ListPublicKeys"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPublicKeysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -631,10 +553,7 @@ export const serializeAws_json1_1ListQueriesCommand = async ( input: ListQueriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.ListQueries", - }; + const headers: __HeaderBag = sharedHeaders("ListQueries"); let body: any; body = JSON.stringify(serializeAws_json1_1ListQueriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -644,10 +563,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.ListTags", - }; + const headers: __HeaderBag = sharedHeaders("ListTags"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -657,10 +573,7 @@ export const serializeAws_json1_1ListTrailsCommand = async ( input: ListTrailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.ListTrails", - }; + const headers: __HeaderBag = sharedHeaders("ListTrails"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTrailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -670,10 +583,7 @@ export const serializeAws_json1_1LookupEventsCommand = async ( input: LookupEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.LookupEvents", - }; + const headers: __HeaderBag = sharedHeaders("LookupEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1LookupEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -683,10 +593,7 @@ export const serializeAws_json1_1PutEventSelectorsCommand = async ( input: PutEventSelectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.PutEventSelectors", - }; + const headers: __HeaderBag = sharedHeaders("PutEventSelectors"); let body: any; body = JSON.stringify(serializeAws_json1_1PutEventSelectorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -696,10 +603,7 @@ export const serializeAws_json1_1PutInsightSelectorsCommand = async ( input: PutInsightSelectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.PutInsightSelectors", - }; + const headers: __HeaderBag = sharedHeaders("PutInsightSelectors"); let body: any; body = JSON.stringify(serializeAws_json1_1PutInsightSelectorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -709,10 +613,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( input: PutResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.PutResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -722,10 +623,7 @@ export const serializeAws_json1_1RegisterOrganizationDelegatedAdminCommand = asy input: RegisterOrganizationDelegatedAdminCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.RegisterOrganizationDelegatedAdmin", - }; + const headers: __HeaderBag = sharedHeaders("RegisterOrganizationDelegatedAdmin"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterOrganizationDelegatedAdminRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -735,10 +633,7 @@ export const serializeAws_json1_1RemoveTagsCommand = async ( input: RemoveTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.RemoveTags", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTags"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -748,10 +643,7 @@ export const serializeAws_json1_1RestoreEventDataStoreCommand = async ( input: RestoreEventDataStoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.RestoreEventDataStore", - }; + const headers: __HeaderBag = sharedHeaders("RestoreEventDataStore"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreEventDataStoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -761,10 +653,7 @@ export const serializeAws_json1_1StartImportCommand = async ( input: StartImportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.StartImport", - }; + const headers: __HeaderBag = sharedHeaders("StartImport"); let body: any; body = JSON.stringify(serializeAws_json1_1StartImportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -774,10 +663,7 @@ export const serializeAws_json1_1StartLoggingCommand = async ( input: StartLoggingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.StartLogging", - }; + const headers: __HeaderBag = sharedHeaders("StartLogging"); let body: any; body = JSON.stringify(serializeAws_json1_1StartLoggingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -787,10 +673,7 @@ export const serializeAws_json1_1StartQueryCommand = async ( input: StartQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.StartQuery", - }; + const headers: __HeaderBag = sharedHeaders("StartQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1StartQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -800,10 +683,7 @@ export const serializeAws_json1_1StopImportCommand = async ( input: StopImportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.StopImport", - }; + const headers: __HeaderBag = sharedHeaders("StopImport"); let body: any; body = JSON.stringify(serializeAws_json1_1StopImportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -813,10 +693,7 @@ export const serializeAws_json1_1StopLoggingCommand = async ( input: StopLoggingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.StopLogging", - }; + const headers: __HeaderBag = sharedHeaders("StopLogging"); let body: any; body = JSON.stringify(serializeAws_json1_1StopLoggingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -826,10 +703,7 @@ export const serializeAws_json1_1UpdateChannelCommand = async ( input: UpdateChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.UpdateChannel", - }; + const headers: __HeaderBag = sharedHeaders("UpdateChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -839,10 +713,7 @@ export const serializeAws_json1_1UpdateEventDataStoreCommand = async ( input: UpdateEventDataStoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.UpdateEventDataStore", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEventDataStore"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEventDataStoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -852,10 +723,7 @@ export const serializeAws_json1_1UpdateTrailCommand = async ( input: UpdateTrailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CloudTrail_20131101.UpdateTrail", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTrail"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTrailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -7368,6 +7236,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `CloudTrail_20131101.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts index b7c4d774bc8bb..7ba3e676ab188 100644 --- a/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts @@ -287,10 +287,7 @@ export const serializeAws_json1_1ActivateEventSourceCommand = async ( input: ActivateEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ActivateEventSource", - }; + const headers: __HeaderBag = sharedHeaders("ActivateEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1ActivateEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -300,10 +297,7 @@ export const serializeAws_json1_1CancelReplayCommand = async ( input: CancelReplayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CancelReplay", - }; + const headers: __HeaderBag = sharedHeaders("CancelReplay"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelReplayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -313,10 +307,7 @@ export const serializeAws_json1_1CreateApiDestinationCommand = async ( input: CreateApiDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreateApiDestination", - }; + const headers: __HeaderBag = sharedHeaders("CreateApiDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApiDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -326,10 +317,7 @@ export const serializeAws_json1_1CreateArchiveCommand = async ( input: CreateArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreateArchive", - }; + const headers: __HeaderBag = sharedHeaders("CreateArchive"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateArchiveRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -339,10 +327,7 @@ export const serializeAws_json1_1CreateConnectionCommand = async ( input: CreateConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreateConnection", - }; + const headers: __HeaderBag = sharedHeaders("CreateConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -352,10 +337,7 @@ export const serializeAws_json1_1CreateEventBusCommand = async ( input: CreateEventBusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreateEventBus", - }; + const headers: __HeaderBag = sharedHeaders("CreateEventBus"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEventBusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -365,10 +347,7 @@ export const serializeAws_json1_1CreatePartnerEventSourceCommand = async ( input: CreatePartnerEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreatePartnerEventSource", - }; + const headers: __HeaderBag = sharedHeaders("CreatePartnerEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePartnerEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -378,10 +357,7 @@ export const serializeAws_json1_1DeactivateEventSourceCommand = async ( input: DeactivateEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeactivateEventSource", - }; + const headers: __HeaderBag = sharedHeaders("DeactivateEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DeactivateEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -391,10 +367,7 @@ export const serializeAws_json1_1DeauthorizeConnectionCommand = async ( input: DeauthorizeConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeauthorizeConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeauthorizeConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1DeauthorizeConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -404,10 +377,7 @@ export const serializeAws_json1_1DeleteApiDestinationCommand = async ( input: DeleteApiDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteApiDestination", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApiDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApiDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -417,10 +387,7 @@ export const serializeAws_json1_1DeleteArchiveCommand = async ( input: DeleteArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteArchive", - }; + const headers: __HeaderBag = sharedHeaders("DeleteArchive"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteArchiveRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -430,10 +397,7 @@ export const serializeAws_json1_1DeleteConnectionCommand = async ( input: DeleteConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -443,10 +407,7 @@ export const serializeAws_json1_1DeleteEventBusCommand = async ( input: DeleteEventBusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteEventBus", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEventBus"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEventBusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -456,10 +417,7 @@ export const serializeAws_json1_1DeletePartnerEventSourceCommand = async ( input: DeletePartnerEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeletePartnerEventSource", - }; + const headers: __HeaderBag = sharedHeaders("DeletePartnerEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePartnerEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -469,10 +427,7 @@ export const serializeAws_json1_1DeleteRuleCommand = async ( input: DeleteRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -482,10 +437,7 @@ export const serializeAws_json1_1DescribeApiDestinationCommand = async ( input: DescribeApiDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeApiDestination", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApiDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApiDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -495,10 +447,7 @@ export const serializeAws_json1_1DescribeArchiveCommand = async ( input: DescribeArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeArchive", - }; + const headers: __HeaderBag = sharedHeaders("DescribeArchive"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeArchiveRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -508,10 +457,7 @@ export const serializeAws_json1_1DescribeConnectionCommand = async ( input: DescribeConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeConnection", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -521,10 +467,7 @@ export const serializeAws_json1_1DescribeEventBusCommand = async ( input: DescribeEventBusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeEventBus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventBus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventBusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -534,10 +477,7 @@ export const serializeAws_json1_1DescribeEventSourceCommand = async ( input: DescribeEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeEventSource", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -547,10 +487,7 @@ export const serializeAws_json1_1DescribePartnerEventSourceCommand = async ( input: DescribePartnerEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribePartnerEventSource", - }; + const headers: __HeaderBag = sharedHeaders("DescribePartnerEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePartnerEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -560,10 +497,7 @@ export const serializeAws_json1_1DescribeReplayCommand = async ( input: DescribeReplayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeReplay", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReplay"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReplayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -573,10 +507,7 @@ export const serializeAws_json1_1DescribeRuleCommand = async ( input: DescribeRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeRule", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -586,10 +517,7 @@ export const serializeAws_json1_1DisableRuleCommand = async ( input: DisableRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DisableRule", - }; + const headers: __HeaderBag = sharedHeaders("DisableRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -599,10 +527,7 @@ export const serializeAws_json1_1EnableRuleCommand = async ( input: EnableRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.EnableRule", - }; + const headers: __HeaderBag = sharedHeaders("EnableRule"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -612,10 +537,7 @@ export const serializeAws_json1_1ListApiDestinationsCommand = async ( input: ListApiDestinationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListApiDestinations", - }; + const headers: __HeaderBag = sharedHeaders("ListApiDestinations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApiDestinationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -625,10 +547,7 @@ export const serializeAws_json1_1ListArchivesCommand = async ( input: ListArchivesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListArchives", - }; + const headers: __HeaderBag = sharedHeaders("ListArchives"); let body: any; body = JSON.stringify(serializeAws_json1_1ListArchivesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -638,10 +557,7 @@ export const serializeAws_json1_1ListConnectionsCommand = async ( input: ListConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListConnections", - }; + const headers: __HeaderBag = sharedHeaders("ListConnections"); let body: any; body = JSON.stringify(serializeAws_json1_1ListConnectionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -651,10 +567,7 @@ export const serializeAws_json1_1ListEventBusesCommand = async ( input: ListEventBusesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListEventBuses", - }; + const headers: __HeaderBag = sharedHeaders("ListEventBuses"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEventBusesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -664,10 +577,7 @@ export const serializeAws_json1_1ListEventSourcesCommand = async ( input: ListEventSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListEventSources", - }; + const headers: __HeaderBag = sharedHeaders("ListEventSources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEventSourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -677,10 +587,7 @@ export const serializeAws_json1_1ListPartnerEventSourceAccountsCommand = async ( input: ListPartnerEventSourceAccountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListPartnerEventSourceAccounts", - }; + const headers: __HeaderBag = sharedHeaders("ListPartnerEventSourceAccounts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPartnerEventSourceAccountsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -690,10 +597,7 @@ export const serializeAws_json1_1ListPartnerEventSourcesCommand = async ( input: ListPartnerEventSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListPartnerEventSources", - }; + const headers: __HeaderBag = sharedHeaders("ListPartnerEventSources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPartnerEventSourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -703,10 +607,7 @@ export const serializeAws_json1_1ListReplaysCommand = async ( input: ListReplaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListReplays", - }; + const headers: __HeaderBag = sharedHeaders("ListReplays"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReplaysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -716,10 +617,7 @@ export const serializeAws_json1_1ListRuleNamesByTargetCommand = async ( input: ListRuleNamesByTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListRuleNamesByTarget", - }; + const headers: __HeaderBag = sharedHeaders("ListRuleNamesByTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRuleNamesByTargetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -729,10 +627,7 @@ export const serializeAws_json1_1ListRulesCommand = async ( input: ListRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListRules", - }; + const headers: __HeaderBag = sharedHeaders("ListRules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -742,10 +637,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -755,10 +647,7 @@ export const serializeAws_json1_1ListTargetsByRuleCommand = async ( input: ListTargetsByRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListTargetsByRule", - }; + const headers: __HeaderBag = sharedHeaders("ListTargetsByRule"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTargetsByRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -768,10 +657,7 @@ export const serializeAws_json1_1PutEventsCommand = async ( input: PutEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.PutEvents", - }; + const headers: __HeaderBag = sharedHeaders("PutEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1PutEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -781,10 +667,7 @@ export const serializeAws_json1_1PutPartnerEventsCommand = async ( input: PutPartnerEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.PutPartnerEvents", - }; + const headers: __HeaderBag = sharedHeaders("PutPartnerEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPartnerEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -794,10 +677,7 @@ export const serializeAws_json1_1PutPermissionCommand = async ( input: PutPermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.PutPermission", - }; + const headers: __HeaderBag = sharedHeaders("PutPermission"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -807,10 +687,7 @@ export const serializeAws_json1_1PutRuleCommand = async ( input: PutRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.PutRule", - }; + const headers: __HeaderBag = sharedHeaders("PutRule"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -820,10 +697,7 @@ export const serializeAws_json1_1PutTargetsCommand = async ( input: PutTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.PutTargets", - }; + const headers: __HeaderBag = sharedHeaders("PutTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1PutTargetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -833,10 +707,7 @@ export const serializeAws_json1_1RemovePermissionCommand = async ( input: RemovePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.RemovePermission", - }; + const headers: __HeaderBag = sharedHeaders("RemovePermission"); let body: any; body = JSON.stringify(serializeAws_json1_1RemovePermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -846,10 +717,7 @@ export const serializeAws_json1_1RemoveTargetsCommand = async ( input: RemoveTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.RemoveTargets", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTargetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -859,10 +727,7 @@ export const serializeAws_json1_1StartReplayCommand = async ( input: StartReplayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.StartReplay", - }; + const headers: __HeaderBag = sharedHeaders("StartReplay"); let body: any; body = JSON.stringify(serializeAws_json1_1StartReplayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -872,10 +737,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -885,10 +747,7 @@ export const serializeAws_json1_1TestEventPatternCommand = async ( input: TestEventPatternCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.TestEventPattern", - }; + const headers: __HeaderBag = sharedHeaders("TestEventPattern"); let body: any; body = JSON.stringify(serializeAws_json1_1TestEventPatternRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -898,10 +757,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -911,10 +767,7 @@ export const serializeAws_json1_1UpdateApiDestinationCommand = async ( input: UpdateApiDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.UpdateApiDestination", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApiDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApiDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -924,10 +777,7 @@ export const serializeAws_json1_1UpdateArchiveCommand = async ( input: UpdateArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.UpdateArchive", - }; + const headers: __HeaderBag = sharedHeaders("UpdateArchive"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateArchiveRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -937,10 +787,7 @@ export const serializeAws_json1_1UpdateConnectionCommand = async ( input: UpdateConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.UpdateConnection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6278,6 +6125,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSEvents.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts index a997c0b3f8b16..3802d63deeedb 100644 --- a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts @@ -231,10 +231,7 @@ export const serializeAws_json1_1AssociateKmsKeyCommand = async ( input: AssociateKmsKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.AssociateKmsKey", - }; + const headers: __HeaderBag = sharedHeaders("AssociateKmsKey"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateKmsKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -244,10 +241,7 @@ export const serializeAws_json1_1CancelExportTaskCommand = async ( input: CancelExportTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.CancelExportTask", - }; + const headers: __HeaderBag = sharedHeaders("CancelExportTask"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelExportTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -257,10 +251,7 @@ export const serializeAws_json1_1CreateExportTaskCommand = async ( input: CreateExportTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.CreateExportTask", - }; + const headers: __HeaderBag = sharedHeaders("CreateExportTask"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateExportTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -270,10 +261,7 @@ export const serializeAws_json1_1CreateLogGroupCommand = async ( input: CreateLogGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.CreateLogGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateLogGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLogGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -283,10 +271,7 @@ export const serializeAws_json1_1CreateLogStreamCommand = async ( input: CreateLogStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.CreateLogStream", - }; + const headers: __HeaderBag = sharedHeaders("CreateLogStream"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLogStreamRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -296,10 +281,7 @@ export const serializeAws_json1_1DeleteDataProtectionPolicyCommand = async ( input: DeleteDataProtectionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DeleteDataProtectionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataProtectionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDataProtectionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -309,10 +291,7 @@ export const serializeAws_json1_1DeleteDestinationCommand = async ( input: DeleteDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DeleteDestination", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -322,10 +301,7 @@ export const serializeAws_json1_1DeleteLogGroupCommand = async ( input: DeleteLogGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DeleteLogGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLogGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLogGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -335,10 +311,7 @@ export const serializeAws_json1_1DeleteLogStreamCommand = async ( input: DeleteLogStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DeleteLogStream", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLogStream"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLogStreamRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -348,10 +321,7 @@ export const serializeAws_json1_1DeleteMetricFilterCommand = async ( input: DeleteMetricFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DeleteMetricFilter", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMetricFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMetricFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -361,10 +331,7 @@ export const serializeAws_json1_1DeleteQueryDefinitionCommand = async ( input: DeleteQueryDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DeleteQueryDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DeleteQueryDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteQueryDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -374,10 +341,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DeleteResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -387,10 +351,7 @@ export const serializeAws_json1_1DeleteRetentionPolicyCommand = async ( input: DeleteRetentionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DeleteRetentionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRetentionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRetentionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -400,10 +361,7 @@ export const serializeAws_json1_1DeleteSubscriptionFilterCommand = async ( input: DeleteSubscriptionFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DeleteSubscriptionFilter", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSubscriptionFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSubscriptionFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -413,10 +371,7 @@ export const serializeAws_json1_1DescribeDestinationsCommand = async ( input: DescribeDestinationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DescribeDestinations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDestinations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDestinationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -426,10 +381,7 @@ export const serializeAws_json1_1DescribeExportTasksCommand = async ( input: DescribeExportTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DescribeExportTasks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExportTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeExportTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -439,10 +391,7 @@ export const serializeAws_json1_1DescribeLogGroupsCommand = async ( input: DescribeLogGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DescribeLogGroups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLogGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLogGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -452,10 +401,7 @@ export const serializeAws_json1_1DescribeLogStreamsCommand = async ( input: DescribeLogStreamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DescribeLogStreams", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLogStreams"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLogStreamsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -465,10 +411,7 @@ export const serializeAws_json1_1DescribeMetricFiltersCommand = async ( input: DescribeMetricFiltersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DescribeMetricFilters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMetricFilters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMetricFiltersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -478,10 +421,7 @@ export const serializeAws_json1_1DescribeQueriesCommand = async ( input: DescribeQueriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DescribeQueries", - }; + const headers: __HeaderBag = sharedHeaders("DescribeQueries"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeQueriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -491,10 +431,7 @@ export const serializeAws_json1_1DescribeQueryDefinitionsCommand = async ( input: DescribeQueryDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DescribeQueryDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeQueryDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeQueryDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -504,10 +441,7 @@ export const serializeAws_json1_1DescribeResourcePoliciesCommand = async ( input: DescribeResourcePoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DescribeResourcePolicies", - }; + const headers: __HeaderBag = sharedHeaders("DescribeResourcePolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeResourcePoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -517,10 +451,7 @@ export const serializeAws_json1_1DescribeSubscriptionFiltersCommand = async ( input: DescribeSubscriptionFiltersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DescribeSubscriptionFilters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSubscriptionFilters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSubscriptionFiltersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -530,10 +461,7 @@ export const serializeAws_json1_1DisassociateKmsKeyCommand = async ( input: DisassociateKmsKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.DisassociateKmsKey", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateKmsKey"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateKmsKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -543,10 +471,7 @@ export const serializeAws_json1_1FilterLogEventsCommand = async ( input: FilterLogEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.FilterLogEvents", - }; + const headers: __HeaderBag = sharedHeaders("FilterLogEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1FilterLogEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -556,10 +481,7 @@ export const serializeAws_json1_1GetDataProtectionPolicyCommand = async ( input: GetDataProtectionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.GetDataProtectionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetDataProtectionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDataProtectionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -569,10 +491,7 @@ export const serializeAws_json1_1GetLogEventsCommand = async ( input: GetLogEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.GetLogEvents", - }; + const headers: __HeaderBag = sharedHeaders("GetLogEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLogEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -582,10 +501,7 @@ export const serializeAws_json1_1GetLogGroupFieldsCommand = async ( input: GetLogGroupFieldsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.GetLogGroupFields", - }; + const headers: __HeaderBag = sharedHeaders("GetLogGroupFields"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLogGroupFieldsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -595,10 +511,7 @@ export const serializeAws_json1_1GetLogRecordCommand = async ( input: GetLogRecordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.GetLogRecord", - }; + const headers: __HeaderBag = sharedHeaders("GetLogRecord"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLogRecordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -608,10 +521,7 @@ export const serializeAws_json1_1GetQueryResultsCommand = async ( input: GetQueryResultsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.GetQueryResults", - }; + const headers: __HeaderBag = sharedHeaders("GetQueryResults"); let body: any; body = JSON.stringify(serializeAws_json1_1GetQueryResultsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -621,10 +531,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -634,10 +541,7 @@ export const serializeAws_json1_1ListTagsLogGroupCommand = async ( input: ListTagsLogGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.ListTagsLogGroup", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsLogGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsLogGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -647,10 +551,7 @@ export const serializeAws_json1_1PutDataProtectionPolicyCommand = async ( input: PutDataProtectionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.PutDataProtectionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutDataProtectionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutDataProtectionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -660,10 +561,7 @@ export const serializeAws_json1_1PutDestinationCommand = async ( input: PutDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.PutDestination", - }; + const headers: __HeaderBag = sharedHeaders("PutDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1PutDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -673,10 +571,7 @@ export const serializeAws_json1_1PutDestinationPolicyCommand = async ( input: PutDestinationPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.PutDestinationPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutDestinationPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutDestinationPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -686,10 +581,7 @@ export const serializeAws_json1_1PutLogEventsCommand = async ( input: PutLogEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.PutLogEvents", - }; + const headers: __HeaderBag = sharedHeaders("PutLogEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1PutLogEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -699,10 +591,7 @@ export const serializeAws_json1_1PutMetricFilterCommand = async ( input: PutMetricFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.PutMetricFilter", - }; + const headers: __HeaderBag = sharedHeaders("PutMetricFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1PutMetricFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -712,10 +601,7 @@ export const serializeAws_json1_1PutQueryDefinitionCommand = async ( input: PutQueryDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.PutQueryDefinition", - }; + const headers: __HeaderBag = sharedHeaders("PutQueryDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1PutQueryDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -725,10 +611,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( input: PutResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.PutResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -738,10 +621,7 @@ export const serializeAws_json1_1PutRetentionPolicyCommand = async ( input: PutRetentionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.PutRetentionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutRetentionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRetentionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -751,10 +631,7 @@ export const serializeAws_json1_1PutSubscriptionFilterCommand = async ( input: PutSubscriptionFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.PutSubscriptionFilter", - }; + const headers: __HeaderBag = sharedHeaders("PutSubscriptionFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1PutSubscriptionFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -764,10 +641,7 @@ export const serializeAws_json1_1StartQueryCommand = async ( input: StartQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.StartQuery", - }; + const headers: __HeaderBag = sharedHeaders("StartQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1StartQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -777,10 +651,7 @@ export const serializeAws_json1_1StopQueryCommand = async ( input: StopQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.StopQuery", - }; + const headers: __HeaderBag = sharedHeaders("StopQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1StopQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -790,10 +661,7 @@ export const serializeAws_json1_1TagLogGroupCommand = async ( input: TagLogGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.TagLogGroup", - }; + const headers: __HeaderBag = sharedHeaders("TagLogGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1TagLogGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -803,10 +671,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -816,10 +681,7 @@ export const serializeAws_json1_1TestMetricFilterCommand = async ( input: TestMetricFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.TestMetricFilter", - }; + const headers: __HeaderBag = sharedHeaders("TestMetricFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1TestMetricFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -829,10 +691,7 @@ export const serializeAws_json1_1UntagLogGroupCommand = async ( input: UntagLogGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.UntagLogGroup", - }; + const headers: __HeaderBag = sharedHeaders("UntagLogGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagLogGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -842,10 +701,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Logs_20140328.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4754,6 +4610,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `Logs_20140328.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cloudwatch/src/protocols/Aws_query.ts b/clients/client-cloudwatch/src/protocols/Aws_query.ts index 949759e2db36e..bbb3a18ddee1e 100644 --- a/clients/client-cloudwatch/src/protocols/Aws_query.ts +++ b/clients/client-cloudwatch/src/protocols/Aws_query.ts @@ -227,9 +227,7 @@ export const serializeAws_queryDeleteAlarmsCommand = async ( input: DeleteAlarmsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteAlarmsInput(input, context), @@ -243,9 +241,7 @@ export const serializeAws_queryDeleteAnomalyDetectorCommand = async ( input: DeleteAnomalyDetectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteAnomalyDetectorInput(input, context), @@ -259,9 +255,7 @@ export const serializeAws_queryDeleteDashboardsCommand = async ( input: DeleteDashboardsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDashboardsInput(input, context), @@ -275,9 +269,7 @@ export const serializeAws_queryDeleteInsightRulesCommand = async ( input: DeleteInsightRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteInsightRulesInput(input, context), @@ -291,9 +283,7 @@ export const serializeAws_queryDeleteMetricStreamCommand = async ( input: DeleteMetricStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteMetricStreamInput(input, context), @@ -307,9 +297,7 @@ export const serializeAws_queryDescribeAlarmHistoryCommand = async ( input: DescribeAlarmHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAlarmHistoryInput(input, context), @@ -323,9 +311,7 @@ export const serializeAws_queryDescribeAlarmsCommand = async ( input: DescribeAlarmsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAlarmsInput(input, context), @@ -339,9 +325,7 @@ export const serializeAws_queryDescribeAlarmsForMetricCommand = async ( input: DescribeAlarmsForMetricCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAlarmsForMetricInput(input, context), @@ -355,9 +339,7 @@ export const serializeAws_queryDescribeAnomalyDetectorsCommand = async ( input: DescribeAnomalyDetectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAnomalyDetectorsInput(input, context), @@ -371,9 +353,7 @@ export const serializeAws_queryDescribeInsightRulesCommand = async ( input: DescribeInsightRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeInsightRulesInput(input, context), @@ -387,9 +367,7 @@ export const serializeAws_queryDisableAlarmActionsCommand = async ( input: DisableAlarmActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDisableAlarmActionsInput(input, context), @@ -403,9 +381,7 @@ export const serializeAws_queryDisableInsightRulesCommand = async ( input: DisableInsightRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDisableInsightRulesInput(input, context), @@ -419,9 +395,7 @@ export const serializeAws_queryEnableAlarmActionsCommand = async ( input: EnableAlarmActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryEnableAlarmActionsInput(input, context), @@ -435,9 +409,7 @@ export const serializeAws_queryEnableInsightRulesCommand = async ( input: EnableInsightRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryEnableInsightRulesInput(input, context), @@ -451,9 +423,7 @@ export const serializeAws_queryGetDashboardCommand = async ( input: GetDashboardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetDashboardInput(input, context), @@ -467,9 +437,7 @@ export const serializeAws_queryGetInsightRuleReportCommand = async ( input: GetInsightRuleReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetInsightRuleReportInput(input, context), @@ -483,9 +451,7 @@ export const serializeAws_queryGetMetricDataCommand = async ( input: GetMetricDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetMetricDataInput(input, context), @@ -499,9 +465,7 @@ export const serializeAws_queryGetMetricStatisticsCommand = async ( input: GetMetricStatisticsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetMetricStatisticsInput(input, context), @@ -515,9 +479,7 @@ export const serializeAws_queryGetMetricStreamCommand = async ( input: GetMetricStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetMetricStreamInput(input, context), @@ -531,9 +493,7 @@ export const serializeAws_queryGetMetricWidgetImageCommand = async ( input: GetMetricWidgetImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetMetricWidgetImageInput(input, context), @@ -547,9 +507,7 @@ export const serializeAws_queryListDashboardsCommand = async ( input: ListDashboardsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListDashboardsInput(input, context), @@ -563,9 +521,7 @@ export const serializeAws_queryListManagedInsightRulesCommand = async ( input: ListManagedInsightRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListManagedInsightRulesInput(input, context), @@ -579,9 +535,7 @@ export const serializeAws_queryListMetricsCommand = async ( input: ListMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListMetricsInput(input, context), @@ -595,9 +549,7 @@ export const serializeAws_queryListMetricStreamsCommand = async ( input: ListMetricStreamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListMetricStreamsInput(input, context), @@ -611,9 +563,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTagsForResourceInput(input, context), @@ -627,9 +577,7 @@ export const serializeAws_queryPutAnomalyDetectorCommand = async ( input: PutAnomalyDetectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutAnomalyDetectorInput(input, context), @@ -643,9 +591,7 @@ export const serializeAws_queryPutCompositeAlarmCommand = async ( input: PutCompositeAlarmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutCompositeAlarmInput(input, context), @@ -659,9 +605,7 @@ export const serializeAws_queryPutDashboardCommand = async ( input: PutDashboardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutDashboardInput(input, context), @@ -675,9 +619,7 @@ export const serializeAws_queryPutInsightRuleCommand = async ( input: PutInsightRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutInsightRuleInput(input, context), @@ -691,9 +633,7 @@ export const serializeAws_queryPutManagedInsightRulesCommand = async ( input: PutManagedInsightRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutManagedInsightRulesInput(input, context), @@ -707,9 +647,7 @@ export const serializeAws_queryPutMetricAlarmCommand = async ( input: PutMetricAlarmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutMetricAlarmInput(input, context), @@ -723,9 +661,7 @@ export const serializeAws_queryPutMetricDataCommand = async ( input: PutMetricDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutMetricDataInput(input, context), @@ -739,9 +675,7 @@ export const serializeAws_queryPutMetricStreamCommand = async ( input: PutMetricStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutMetricStreamInput(input, context), @@ -755,9 +689,7 @@ export const serializeAws_querySetAlarmStateCommand = async ( input: SetAlarmStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetAlarmStateInput(input, context), @@ -771,9 +703,7 @@ export const serializeAws_queryStartMetricStreamsCommand = async ( input: StartMetricStreamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStartMetricStreamsInput(input, context), @@ -787,9 +717,7 @@ export const serializeAws_queryStopMetricStreamsCommand = async ( input: StopMetricStreamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStopMetricStreamsInput(input, context), @@ -803,9 +731,7 @@ export const serializeAws_queryTagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagResourceInput(input, context), @@ -819,9 +745,7 @@ export const serializeAws_queryUntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagResourceInput(input, context), @@ -6097,6 +6021,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-codebuild/src/protocols/Aws_json1_1.ts b/clients/client-codebuild/src/protocols/Aws_json1_1.ts index aab78a6b6200c..8196e57d32fce 100644 --- a/clients/client-codebuild/src/protocols/Aws_json1_1.ts +++ b/clients/client-codebuild/src/protocols/Aws_json1_1.ts @@ -267,10 +267,7 @@ export const serializeAws_json1_1BatchDeleteBuildsCommand = async ( input: BatchDeleteBuildsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.BatchDeleteBuilds", - }; + const headers: __HeaderBag = sharedHeaders("BatchDeleteBuilds"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDeleteBuildsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -280,10 +277,7 @@ export const serializeAws_json1_1BatchGetBuildBatchesCommand = async ( input: BatchGetBuildBatchesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.BatchGetBuildBatches", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetBuildBatches"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetBuildBatchesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -293,10 +287,7 @@ export const serializeAws_json1_1BatchGetBuildsCommand = async ( input: BatchGetBuildsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.BatchGetBuilds", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetBuilds"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetBuildsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -306,10 +297,7 @@ export const serializeAws_json1_1BatchGetProjectsCommand = async ( input: BatchGetProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.BatchGetProjects", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetProjects"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetProjectsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -319,10 +307,7 @@ export const serializeAws_json1_1BatchGetReportGroupsCommand = async ( input: BatchGetReportGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.BatchGetReportGroups", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetReportGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetReportGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -332,10 +317,7 @@ export const serializeAws_json1_1BatchGetReportsCommand = async ( input: BatchGetReportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.BatchGetReports", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetReports"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetReportsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -345,10 +327,7 @@ export const serializeAws_json1_1CreateProjectCommand = async ( input: CreateProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.CreateProject", - }; + const headers: __HeaderBag = sharedHeaders("CreateProject"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProjectInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -358,10 +337,7 @@ export const serializeAws_json1_1CreateReportGroupCommand = async ( input: CreateReportGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.CreateReportGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateReportGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateReportGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -371,10 +347,7 @@ export const serializeAws_json1_1CreateWebhookCommand = async ( input: CreateWebhookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.CreateWebhook", - }; + const headers: __HeaderBag = sharedHeaders("CreateWebhook"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWebhookInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -384,10 +357,7 @@ export const serializeAws_json1_1DeleteBuildBatchCommand = async ( input: DeleteBuildBatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.DeleteBuildBatch", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBuildBatch"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBuildBatchInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -397,10 +367,7 @@ export const serializeAws_json1_1DeleteProjectCommand = async ( input: DeleteProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.DeleteProject", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProject"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProjectInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -410,10 +377,7 @@ export const serializeAws_json1_1DeleteReportCommand = async ( input: DeleteReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.DeleteReport", - }; + const headers: __HeaderBag = sharedHeaders("DeleteReport"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteReportInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -423,10 +387,7 @@ export const serializeAws_json1_1DeleteReportGroupCommand = async ( input: DeleteReportGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.DeleteReportGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteReportGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteReportGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -436,10 +397,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.DeleteResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourcePolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -449,10 +407,7 @@ export const serializeAws_json1_1DeleteSourceCredentialsCommand = async ( input: DeleteSourceCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.DeleteSourceCredentials", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSourceCredentials"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSourceCredentialsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -462,10 +417,7 @@ export const serializeAws_json1_1DeleteWebhookCommand = async ( input: DeleteWebhookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.DeleteWebhook", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWebhook"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWebhookInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -475,10 +427,7 @@ export const serializeAws_json1_1DescribeCodeCoveragesCommand = async ( input: DescribeCodeCoveragesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.DescribeCodeCoverages", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCodeCoverages"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCodeCoveragesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -488,10 +437,7 @@ export const serializeAws_json1_1DescribeTestCasesCommand = async ( input: DescribeTestCasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.DescribeTestCases", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTestCases"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTestCasesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -501,10 +447,7 @@ export const serializeAws_json1_1GetReportGroupTrendCommand = async ( input: GetReportGroupTrendCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.GetReportGroupTrend", - }; + const headers: __HeaderBag = sharedHeaders("GetReportGroupTrend"); let body: any; body = JSON.stringify(serializeAws_json1_1GetReportGroupTrendInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -514,10 +457,7 @@ export const serializeAws_json1_1GetResourcePolicyCommand = async ( input: GetResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.GetResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourcePolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -527,10 +467,7 @@ export const serializeAws_json1_1ImportSourceCredentialsCommand = async ( input: ImportSourceCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ImportSourceCredentials", - }; + const headers: __HeaderBag = sharedHeaders("ImportSourceCredentials"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportSourceCredentialsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -540,10 +477,7 @@ export const serializeAws_json1_1InvalidateProjectCacheCommand = async ( input: InvalidateProjectCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.InvalidateProjectCache", - }; + const headers: __HeaderBag = sharedHeaders("InvalidateProjectCache"); let body: any; body = JSON.stringify(serializeAws_json1_1InvalidateProjectCacheInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -553,10 +487,7 @@ export const serializeAws_json1_1ListBuildBatchesCommand = async ( input: ListBuildBatchesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListBuildBatches", - }; + const headers: __HeaderBag = sharedHeaders("ListBuildBatches"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBuildBatchesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -566,10 +497,7 @@ export const serializeAws_json1_1ListBuildBatchesForProjectCommand = async ( input: ListBuildBatchesForProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListBuildBatchesForProject", - }; + const headers: __HeaderBag = sharedHeaders("ListBuildBatchesForProject"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBuildBatchesForProjectInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -579,10 +507,7 @@ export const serializeAws_json1_1ListBuildsCommand = async ( input: ListBuildsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListBuilds", - }; + const headers: __HeaderBag = sharedHeaders("ListBuilds"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBuildsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -592,10 +517,7 @@ export const serializeAws_json1_1ListBuildsForProjectCommand = async ( input: ListBuildsForProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListBuildsForProject", - }; + const headers: __HeaderBag = sharedHeaders("ListBuildsForProject"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBuildsForProjectInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -605,10 +527,7 @@ export const serializeAws_json1_1ListCuratedEnvironmentImagesCommand = async ( input: ListCuratedEnvironmentImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListCuratedEnvironmentImages", - }; + const headers: __HeaderBag = sharedHeaders("ListCuratedEnvironmentImages"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCuratedEnvironmentImagesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -618,10 +537,7 @@ export const serializeAws_json1_1ListProjectsCommand = async ( input: ListProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListProjects", - }; + const headers: __HeaderBag = sharedHeaders("ListProjects"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProjectsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -631,10 +547,7 @@ export const serializeAws_json1_1ListReportGroupsCommand = async ( input: ListReportGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListReportGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListReportGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReportGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -644,10 +557,7 @@ export const serializeAws_json1_1ListReportsCommand = async ( input: ListReportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListReports", - }; + const headers: __HeaderBag = sharedHeaders("ListReports"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReportsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -657,10 +567,7 @@ export const serializeAws_json1_1ListReportsForReportGroupCommand = async ( input: ListReportsForReportGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListReportsForReportGroup", - }; + const headers: __HeaderBag = sharedHeaders("ListReportsForReportGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReportsForReportGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -670,10 +577,7 @@ export const serializeAws_json1_1ListSharedProjectsCommand = async ( input: ListSharedProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListSharedProjects", - }; + const headers: __HeaderBag = sharedHeaders("ListSharedProjects"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSharedProjectsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -683,10 +587,7 @@ export const serializeAws_json1_1ListSharedReportGroupsCommand = async ( input: ListSharedReportGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListSharedReportGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListSharedReportGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSharedReportGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -696,10 +597,7 @@ export const serializeAws_json1_1ListSourceCredentialsCommand = async ( input: ListSourceCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.ListSourceCredentials", - }; + const headers: __HeaderBag = sharedHeaders("ListSourceCredentials"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSourceCredentialsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -709,10 +607,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( input: PutResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.PutResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourcePolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -722,10 +617,7 @@ export const serializeAws_json1_1RetryBuildCommand = async ( input: RetryBuildCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.RetryBuild", - }; + const headers: __HeaderBag = sharedHeaders("RetryBuild"); let body: any; body = JSON.stringify(serializeAws_json1_1RetryBuildInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -735,10 +627,7 @@ export const serializeAws_json1_1RetryBuildBatchCommand = async ( input: RetryBuildBatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.RetryBuildBatch", - }; + const headers: __HeaderBag = sharedHeaders("RetryBuildBatch"); let body: any; body = JSON.stringify(serializeAws_json1_1RetryBuildBatchInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -748,10 +637,7 @@ export const serializeAws_json1_1StartBuildCommand = async ( input: StartBuildCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.StartBuild", - }; + const headers: __HeaderBag = sharedHeaders("StartBuild"); let body: any; body = JSON.stringify(serializeAws_json1_1StartBuildInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -761,10 +647,7 @@ export const serializeAws_json1_1StartBuildBatchCommand = async ( input: StartBuildBatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.StartBuildBatch", - }; + const headers: __HeaderBag = sharedHeaders("StartBuildBatch"); let body: any; body = JSON.stringify(serializeAws_json1_1StartBuildBatchInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -774,10 +657,7 @@ export const serializeAws_json1_1StopBuildCommand = async ( input: StopBuildCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.StopBuild", - }; + const headers: __HeaderBag = sharedHeaders("StopBuild"); let body: any; body = JSON.stringify(serializeAws_json1_1StopBuildInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -787,10 +667,7 @@ export const serializeAws_json1_1StopBuildBatchCommand = async ( input: StopBuildBatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.StopBuildBatch", - }; + const headers: __HeaderBag = sharedHeaders("StopBuildBatch"); let body: any; body = JSON.stringify(serializeAws_json1_1StopBuildBatchInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -800,10 +677,7 @@ export const serializeAws_json1_1UpdateProjectCommand = async ( input: UpdateProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.UpdateProject", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProject"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProjectInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -813,10 +687,7 @@ export const serializeAws_json1_1UpdateProjectVisibilityCommand = async ( input: UpdateProjectVisibilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.UpdateProjectVisibility", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProjectVisibility"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProjectVisibilityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -826,10 +697,7 @@ export const serializeAws_json1_1UpdateReportGroupCommand = async ( input: UpdateReportGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.UpdateReportGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateReportGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateReportGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -839,10 +707,7 @@ export const serializeAws_json1_1UpdateWebhookCommand = async ( input: UpdateWebhookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeBuild_20161006.UpdateWebhook", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWebhook"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWebhookInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5474,6 +5339,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `CodeBuild_20161006.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-codecommit/src/protocols/Aws_json1_1.ts b/clients/client-codecommit/src/protocols/Aws_json1_1.ts index 72406995c7364..e459db20ec13e 100644 --- a/clients/client-codecommit/src/protocols/Aws_json1_1.ts +++ b/clients/client-codecommit/src/protocols/Aws_json1_1.ts @@ -636,10 +636,7 @@ export const serializeAws_json1_1AssociateApprovalRuleTemplateWithRepositoryComm input: AssociateApprovalRuleTemplateWithRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.AssociateApprovalRuleTemplateWithRepository", - }; + const headers: __HeaderBag = sharedHeaders("AssociateApprovalRuleTemplateWithRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateApprovalRuleTemplateWithRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -649,10 +646,7 @@ export const serializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositor input: BatchAssociateApprovalRuleTemplateWithRepositoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.BatchAssociateApprovalRuleTemplateWithRepositories", - }; + const headers: __HeaderBag = sharedHeaders("BatchAssociateApprovalRuleTemplateWithRepositories"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -662,10 +656,7 @@ export const serializeAws_json1_1BatchDescribeMergeConflictsCommand = async ( input: BatchDescribeMergeConflictsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.BatchDescribeMergeConflicts", - }; + const headers: __HeaderBag = sharedHeaders("BatchDescribeMergeConflicts"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDescribeMergeConflictsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -675,10 +666,7 @@ export const serializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromReposi input: BatchDisassociateApprovalRuleTemplateFromRepositoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.BatchDisassociateApprovalRuleTemplateFromRepositories", - }; + const headers: __HeaderBag = sharedHeaders("BatchDisassociateApprovalRuleTemplateFromRepositories"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositoriesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -688,10 +676,7 @@ export const serializeAws_json1_1BatchGetCommitsCommand = async ( input: BatchGetCommitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.BatchGetCommits", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetCommits"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetCommitsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -701,10 +686,7 @@ export const serializeAws_json1_1BatchGetRepositoriesCommand = async ( input: BatchGetRepositoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.BatchGetRepositories", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetRepositories"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetRepositoriesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -714,10 +696,7 @@ export const serializeAws_json1_1CreateApprovalRuleTemplateCommand = async ( input: CreateApprovalRuleTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.CreateApprovalRuleTemplate", - }; + const headers: __HeaderBag = sharedHeaders("CreateApprovalRuleTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApprovalRuleTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -727,10 +706,7 @@ export const serializeAws_json1_1CreateBranchCommand = async ( input: CreateBranchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.CreateBranch", - }; + const headers: __HeaderBag = sharedHeaders("CreateBranch"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBranchInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -740,10 +716,7 @@ export const serializeAws_json1_1CreateCommitCommand = async ( input: CreateCommitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.CreateCommit", - }; + const headers: __HeaderBag = sharedHeaders("CreateCommit"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCommitInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -753,10 +726,7 @@ export const serializeAws_json1_1CreatePullRequestCommand = async ( input: CreatePullRequestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.CreatePullRequest", - }; + const headers: __HeaderBag = sharedHeaders("CreatePullRequest"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePullRequestInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -766,10 +736,7 @@ export const serializeAws_json1_1CreatePullRequestApprovalRuleCommand = async ( input: CreatePullRequestApprovalRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.CreatePullRequestApprovalRule", - }; + const headers: __HeaderBag = sharedHeaders("CreatePullRequestApprovalRule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePullRequestApprovalRuleInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -779,10 +746,7 @@ export const serializeAws_json1_1CreateRepositoryCommand = async ( input: CreateRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.CreateRepository", - }; + const headers: __HeaderBag = sharedHeaders("CreateRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -792,10 +756,7 @@ export const serializeAws_json1_1CreateUnreferencedMergeCommitCommand = async ( input: CreateUnreferencedMergeCommitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.CreateUnreferencedMergeCommit", - }; + const headers: __HeaderBag = sharedHeaders("CreateUnreferencedMergeCommit"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUnreferencedMergeCommitInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -805,10 +766,7 @@ export const serializeAws_json1_1DeleteApprovalRuleTemplateCommand = async ( input: DeleteApprovalRuleTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.DeleteApprovalRuleTemplate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApprovalRuleTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApprovalRuleTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -818,10 +776,7 @@ export const serializeAws_json1_1DeleteBranchCommand = async ( input: DeleteBranchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.DeleteBranch", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBranch"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBranchInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -831,10 +786,7 @@ export const serializeAws_json1_1DeleteCommentContentCommand = async ( input: DeleteCommentContentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.DeleteCommentContent", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCommentContent"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCommentContentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -844,10 +796,7 @@ export const serializeAws_json1_1DeleteFileCommand = async ( input: DeleteFileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.DeleteFile", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFile"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFileInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -857,10 +806,7 @@ export const serializeAws_json1_1DeletePullRequestApprovalRuleCommand = async ( input: DeletePullRequestApprovalRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.DeletePullRequestApprovalRule", - }; + const headers: __HeaderBag = sharedHeaders("DeletePullRequestApprovalRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePullRequestApprovalRuleInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -870,10 +816,7 @@ export const serializeAws_json1_1DeleteRepositoryCommand = async ( input: DeleteRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.DeleteRepository", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -883,10 +826,7 @@ export const serializeAws_json1_1DescribeMergeConflictsCommand = async ( input: DescribeMergeConflictsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.DescribeMergeConflicts", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMergeConflicts"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMergeConflictsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -896,10 +836,7 @@ export const serializeAws_json1_1DescribePullRequestEventsCommand = async ( input: DescribePullRequestEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.DescribePullRequestEvents", - }; + const headers: __HeaderBag = sharedHeaders("DescribePullRequestEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePullRequestEventsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -909,10 +846,7 @@ export const serializeAws_json1_1DisassociateApprovalRuleTemplateFromRepositoryC input: DisassociateApprovalRuleTemplateFromRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.DisassociateApprovalRuleTemplateFromRepository", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateApprovalRuleTemplateFromRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateApprovalRuleTemplateFromRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -922,10 +856,7 @@ export const serializeAws_json1_1EvaluatePullRequestApprovalRulesCommand = async input: EvaluatePullRequestApprovalRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.EvaluatePullRequestApprovalRules", - }; + const headers: __HeaderBag = sharedHeaders("EvaluatePullRequestApprovalRules"); let body: any; body = JSON.stringify(serializeAws_json1_1EvaluatePullRequestApprovalRulesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -935,10 +866,7 @@ export const serializeAws_json1_1GetApprovalRuleTemplateCommand = async ( input: GetApprovalRuleTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetApprovalRuleTemplate", - }; + const headers: __HeaderBag = sharedHeaders("GetApprovalRuleTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1GetApprovalRuleTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -948,10 +876,7 @@ export const serializeAws_json1_1GetBlobCommand = async ( input: GetBlobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetBlob", - }; + const headers: __HeaderBag = sharedHeaders("GetBlob"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBlobInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -961,10 +886,7 @@ export const serializeAws_json1_1GetBranchCommand = async ( input: GetBranchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetBranch", - }; + const headers: __HeaderBag = sharedHeaders("GetBranch"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBranchInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -974,10 +896,7 @@ export const serializeAws_json1_1GetCommentCommand = async ( input: GetCommentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetComment", - }; + const headers: __HeaderBag = sharedHeaders("GetComment"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCommentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -987,10 +906,7 @@ export const serializeAws_json1_1GetCommentReactionsCommand = async ( input: GetCommentReactionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetCommentReactions", - }; + const headers: __HeaderBag = sharedHeaders("GetCommentReactions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCommentReactionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1000,10 +916,7 @@ export const serializeAws_json1_1GetCommentsForComparedCommitCommand = async ( input: GetCommentsForComparedCommitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetCommentsForComparedCommit", - }; + const headers: __HeaderBag = sharedHeaders("GetCommentsForComparedCommit"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCommentsForComparedCommitInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1013,10 +926,7 @@ export const serializeAws_json1_1GetCommentsForPullRequestCommand = async ( input: GetCommentsForPullRequestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetCommentsForPullRequest", - }; + const headers: __HeaderBag = sharedHeaders("GetCommentsForPullRequest"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCommentsForPullRequestInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1026,10 +936,7 @@ export const serializeAws_json1_1GetCommitCommand = async ( input: GetCommitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetCommit", - }; + const headers: __HeaderBag = sharedHeaders("GetCommit"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCommitInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1039,10 +946,7 @@ export const serializeAws_json1_1GetDifferencesCommand = async ( input: GetDifferencesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetDifferences", - }; + const headers: __HeaderBag = sharedHeaders("GetDifferences"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDifferencesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1052,10 +956,7 @@ export const serializeAws_json1_1GetFileCommand = async ( input: GetFileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetFile", - }; + const headers: __HeaderBag = sharedHeaders("GetFile"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFileInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1065,10 +966,7 @@ export const serializeAws_json1_1GetFolderCommand = async ( input: GetFolderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetFolder", - }; + const headers: __HeaderBag = sharedHeaders("GetFolder"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFolderInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1078,10 +976,7 @@ export const serializeAws_json1_1GetMergeCommitCommand = async ( input: GetMergeCommitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetMergeCommit", - }; + const headers: __HeaderBag = sharedHeaders("GetMergeCommit"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMergeCommitInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1091,10 +986,7 @@ export const serializeAws_json1_1GetMergeConflictsCommand = async ( input: GetMergeConflictsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetMergeConflicts", - }; + const headers: __HeaderBag = sharedHeaders("GetMergeConflicts"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMergeConflictsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1104,10 +996,7 @@ export const serializeAws_json1_1GetMergeOptionsCommand = async ( input: GetMergeOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetMergeOptions", - }; + const headers: __HeaderBag = sharedHeaders("GetMergeOptions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMergeOptionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1117,10 +1006,7 @@ export const serializeAws_json1_1GetPullRequestCommand = async ( input: GetPullRequestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetPullRequest", - }; + const headers: __HeaderBag = sharedHeaders("GetPullRequest"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPullRequestInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1130,10 +1016,7 @@ export const serializeAws_json1_1GetPullRequestApprovalStatesCommand = async ( input: GetPullRequestApprovalStatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetPullRequestApprovalStates", - }; + const headers: __HeaderBag = sharedHeaders("GetPullRequestApprovalStates"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPullRequestApprovalStatesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1143,10 +1026,7 @@ export const serializeAws_json1_1GetPullRequestOverrideStateCommand = async ( input: GetPullRequestOverrideStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetPullRequestOverrideState", - }; + const headers: __HeaderBag = sharedHeaders("GetPullRequestOverrideState"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPullRequestOverrideStateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1156,10 +1036,7 @@ export const serializeAws_json1_1GetRepositoryCommand = async ( input: GetRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetRepository", - }; + const headers: __HeaderBag = sharedHeaders("GetRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1169,10 +1046,7 @@ export const serializeAws_json1_1GetRepositoryTriggersCommand = async ( input: GetRepositoryTriggersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.GetRepositoryTriggers", - }; + const headers: __HeaderBag = sharedHeaders("GetRepositoryTriggers"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRepositoryTriggersInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1182,10 +1056,7 @@ export const serializeAws_json1_1ListApprovalRuleTemplatesCommand = async ( input: ListApprovalRuleTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.ListApprovalRuleTemplates", - }; + const headers: __HeaderBag = sharedHeaders("ListApprovalRuleTemplates"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApprovalRuleTemplatesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1195,10 +1066,7 @@ export const serializeAws_json1_1ListAssociatedApprovalRuleTemplatesForRepositor input: ListAssociatedApprovalRuleTemplatesForRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.ListAssociatedApprovalRuleTemplatesForRepository", - }; + const headers: __HeaderBag = sharedHeaders("ListAssociatedApprovalRuleTemplatesForRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssociatedApprovalRuleTemplatesForRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1208,10 +1076,7 @@ export const serializeAws_json1_1ListBranchesCommand = async ( input: ListBranchesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.ListBranches", - }; + const headers: __HeaderBag = sharedHeaders("ListBranches"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBranchesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1221,10 +1086,7 @@ export const serializeAws_json1_1ListPullRequestsCommand = async ( input: ListPullRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.ListPullRequests", - }; + const headers: __HeaderBag = sharedHeaders("ListPullRequests"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPullRequestsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1234,10 +1096,7 @@ export const serializeAws_json1_1ListRepositoriesCommand = async ( input: ListRepositoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.ListRepositories", - }; + const headers: __HeaderBag = sharedHeaders("ListRepositories"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRepositoriesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1247,10 +1106,7 @@ export const serializeAws_json1_1ListRepositoriesForApprovalRuleTemplateCommand input: ListRepositoriesForApprovalRuleTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.ListRepositoriesForApprovalRuleTemplate", - }; + const headers: __HeaderBag = sharedHeaders("ListRepositoriesForApprovalRuleTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRepositoriesForApprovalRuleTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1260,10 +1116,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1273,10 +1126,7 @@ export const serializeAws_json1_1MergeBranchesByFastForwardCommand = async ( input: MergeBranchesByFastForwardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.MergeBranchesByFastForward", - }; + const headers: __HeaderBag = sharedHeaders("MergeBranchesByFastForward"); let body: any; body = JSON.stringify(serializeAws_json1_1MergeBranchesByFastForwardInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1286,10 +1136,7 @@ export const serializeAws_json1_1MergeBranchesBySquashCommand = async ( input: MergeBranchesBySquashCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.MergeBranchesBySquash", - }; + const headers: __HeaderBag = sharedHeaders("MergeBranchesBySquash"); let body: any; body = JSON.stringify(serializeAws_json1_1MergeBranchesBySquashInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1299,10 +1146,7 @@ export const serializeAws_json1_1MergeBranchesByThreeWayCommand = async ( input: MergeBranchesByThreeWayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.MergeBranchesByThreeWay", - }; + const headers: __HeaderBag = sharedHeaders("MergeBranchesByThreeWay"); let body: any; body = JSON.stringify(serializeAws_json1_1MergeBranchesByThreeWayInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1312,10 +1156,7 @@ export const serializeAws_json1_1MergePullRequestByFastForwardCommand = async ( input: MergePullRequestByFastForwardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.MergePullRequestByFastForward", - }; + const headers: __HeaderBag = sharedHeaders("MergePullRequestByFastForward"); let body: any; body = JSON.stringify(serializeAws_json1_1MergePullRequestByFastForwardInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1325,10 +1166,7 @@ export const serializeAws_json1_1MergePullRequestBySquashCommand = async ( input: MergePullRequestBySquashCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.MergePullRequestBySquash", - }; + const headers: __HeaderBag = sharedHeaders("MergePullRequestBySquash"); let body: any; body = JSON.stringify(serializeAws_json1_1MergePullRequestBySquashInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1338,10 +1176,7 @@ export const serializeAws_json1_1MergePullRequestByThreeWayCommand = async ( input: MergePullRequestByThreeWayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.MergePullRequestByThreeWay", - }; + const headers: __HeaderBag = sharedHeaders("MergePullRequestByThreeWay"); let body: any; body = JSON.stringify(serializeAws_json1_1MergePullRequestByThreeWayInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1351,10 +1186,7 @@ export const serializeAws_json1_1OverridePullRequestApprovalRulesCommand = async input: OverridePullRequestApprovalRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.OverridePullRequestApprovalRules", - }; + const headers: __HeaderBag = sharedHeaders("OverridePullRequestApprovalRules"); let body: any; body = JSON.stringify(serializeAws_json1_1OverridePullRequestApprovalRulesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1364,10 +1196,7 @@ export const serializeAws_json1_1PostCommentForComparedCommitCommand = async ( input: PostCommentForComparedCommitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.PostCommentForComparedCommit", - }; + const headers: __HeaderBag = sharedHeaders("PostCommentForComparedCommit"); let body: any; body = JSON.stringify(serializeAws_json1_1PostCommentForComparedCommitInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1377,10 +1206,7 @@ export const serializeAws_json1_1PostCommentForPullRequestCommand = async ( input: PostCommentForPullRequestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.PostCommentForPullRequest", - }; + const headers: __HeaderBag = sharedHeaders("PostCommentForPullRequest"); let body: any; body = JSON.stringify(serializeAws_json1_1PostCommentForPullRequestInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1390,10 +1216,7 @@ export const serializeAws_json1_1PostCommentReplyCommand = async ( input: PostCommentReplyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.PostCommentReply", - }; + const headers: __HeaderBag = sharedHeaders("PostCommentReply"); let body: any; body = JSON.stringify(serializeAws_json1_1PostCommentReplyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1403,10 +1226,7 @@ export const serializeAws_json1_1PutCommentReactionCommand = async ( input: PutCommentReactionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.PutCommentReaction", - }; + const headers: __HeaderBag = sharedHeaders("PutCommentReaction"); let body: any; body = JSON.stringify(serializeAws_json1_1PutCommentReactionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1416,10 +1236,7 @@ export const serializeAws_json1_1PutFileCommand = async ( input: PutFileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.PutFile", - }; + const headers: __HeaderBag = sharedHeaders("PutFile"); let body: any; body = JSON.stringify(serializeAws_json1_1PutFileInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1429,10 +1246,7 @@ export const serializeAws_json1_1PutRepositoryTriggersCommand = async ( input: PutRepositoryTriggersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.PutRepositoryTriggers", - }; + const headers: __HeaderBag = sharedHeaders("PutRepositoryTriggers"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRepositoryTriggersInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1442,10 +1256,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1455,10 +1266,7 @@ export const serializeAws_json1_1TestRepositoryTriggersCommand = async ( input: TestRepositoryTriggersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.TestRepositoryTriggers", - }; + const headers: __HeaderBag = sharedHeaders("TestRepositoryTriggers"); let body: any; body = JSON.stringify(serializeAws_json1_1TestRepositoryTriggersInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1468,10 +1276,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1481,10 +1286,7 @@ export const serializeAws_json1_1UpdateApprovalRuleTemplateContentCommand = asyn input: UpdateApprovalRuleTemplateContentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdateApprovalRuleTemplateContent", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApprovalRuleTemplateContent"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApprovalRuleTemplateContentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1494,10 +1296,7 @@ export const serializeAws_json1_1UpdateApprovalRuleTemplateDescriptionCommand = input: UpdateApprovalRuleTemplateDescriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdateApprovalRuleTemplateDescription", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApprovalRuleTemplateDescription"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApprovalRuleTemplateDescriptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1507,10 +1306,7 @@ export const serializeAws_json1_1UpdateApprovalRuleTemplateNameCommand = async ( input: UpdateApprovalRuleTemplateNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdateApprovalRuleTemplateName", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApprovalRuleTemplateName"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApprovalRuleTemplateNameInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1520,10 +1316,7 @@ export const serializeAws_json1_1UpdateCommentCommand = async ( input: UpdateCommentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdateComment", - }; + const headers: __HeaderBag = sharedHeaders("UpdateComment"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCommentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1533,10 +1326,7 @@ export const serializeAws_json1_1UpdateDefaultBranchCommand = async ( input: UpdateDefaultBranchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdateDefaultBranch", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDefaultBranch"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDefaultBranchInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1546,10 +1336,7 @@ export const serializeAws_json1_1UpdatePullRequestApprovalRuleContentCommand = a input: UpdatePullRequestApprovalRuleContentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdatePullRequestApprovalRuleContent", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePullRequestApprovalRuleContent"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePullRequestApprovalRuleContentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1559,10 +1346,7 @@ export const serializeAws_json1_1UpdatePullRequestApprovalStateCommand = async ( input: UpdatePullRequestApprovalStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdatePullRequestApprovalState", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePullRequestApprovalState"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePullRequestApprovalStateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1572,10 +1356,7 @@ export const serializeAws_json1_1UpdatePullRequestDescriptionCommand = async ( input: UpdatePullRequestDescriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdatePullRequestDescription", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePullRequestDescription"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePullRequestDescriptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1585,10 +1366,7 @@ export const serializeAws_json1_1UpdatePullRequestStatusCommand = async ( input: UpdatePullRequestStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdatePullRequestStatus", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePullRequestStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePullRequestStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1598,10 +1376,7 @@ export const serializeAws_json1_1UpdatePullRequestTitleCommand = async ( input: UpdatePullRequestTitleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdatePullRequestTitle", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePullRequestTitle"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePullRequestTitleInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1611,10 +1386,7 @@ export const serializeAws_json1_1UpdateRepositoryDescriptionCommand = async ( input: UpdateRepositoryDescriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdateRepositoryDescription", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRepositoryDescription"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRepositoryDescriptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1624,10 +1396,7 @@ export const serializeAws_json1_1UpdateRepositoryNameCommand = async ( input: UpdateRepositoryNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeCommit_20150413.UpdateRepositoryName", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRepositoryName"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRepositoryNameInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -14659,6 +14428,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `CodeCommit_20150413.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-codedeploy/src/protocols/Aws_json1_1.ts b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts index 9f622f932244c..e99dcfee7b8c4 100644 --- a/clients/client-codedeploy/src/protocols/Aws_json1_1.ts +++ b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts @@ -429,10 +429,7 @@ export const serializeAws_json1_1AddTagsToOnPremisesInstancesCommand = async ( input: AddTagsToOnPremisesInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.AddTagsToOnPremisesInstances", - }; + const headers: __HeaderBag = sharedHeaders("AddTagsToOnPremisesInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsToOnPremisesInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -442,10 +439,7 @@ export const serializeAws_json1_1BatchGetApplicationRevisionsCommand = async ( input: BatchGetApplicationRevisionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.BatchGetApplicationRevisions", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetApplicationRevisions"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetApplicationRevisionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -455,10 +449,7 @@ export const serializeAws_json1_1BatchGetApplicationsCommand = async ( input: BatchGetApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.BatchGetApplications", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetApplications"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetApplicationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -468,10 +459,7 @@ export const serializeAws_json1_1BatchGetDeploymentGroupsCommand = async ( input: BatchGetDeploymentGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.BatchGetDeploymentGroups", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetDeploymentGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetDeploymentGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -481,10 +469,7 @@ export const serializeAws_json1_1BatchGetDeploymentInstancesCommand = async ( input: BatchGetDeploymentInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.BatchGetDeploymentInstances", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetDeploymentInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetDeploymentInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -494,10 +479,7 @@ export const serializeAws_json1_1BatchGetDeploymentsCommand = async ( input: BatchGetDeploymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.BatchGetDeployments", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetDeployments"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetDeploymentsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -507,10 +489,7 @@ export const serializeAws_json1_1BatchGetDeploymentTargetsCommand = async ( input: BatchGetDeploymentTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.BatchGetDeploymentTargets", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetDeploymentTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetDeploymentTargetsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -520,10 +499,7 @@ export const serializeAws_json1_1BatchGetOnPremisesInstancesCommand = async ( input: BatchGetOnPremisesInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.BatchGetOnPremisesInstances", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetOnPremisesInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetOnPremisesInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -533,10 +509,7 @@ export const serializeAws_json1_1ContinueDeploymentCommand = async ( input: ContinueDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ContinueDeployment", - }; + const headers: __HeaderBag = sharedHeaders("ContinueDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_1ContinueDeploymentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -546,10 +519,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( input: CreateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.CreateApplication", - }; + const headers: __HeaderBag = sharedHeaders("CreateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApplicationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -559,10 +529,7 @@ export const serializeAws_json1_1CreateDeploymentCommand = async ( input: CreateDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.CreateDeployment", - }; + const headers: __HeaderBag = sharedHeaders("CreateDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDeploymentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -572,10 +539,7 @@ export const serializeAws_json1_1CreateDeploymentConfigCommand = async ( input: CreateDeploymentConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.CreateDeploymentConfig", - }; + const headers: __HeaderBag = sharedHeaders("CreateDeploymentConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDeploymentConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -585,10 +549,7 @@ export const serializeAws_json1_1CreateDeploymentGroupCommand = async ( input: CreateDeploymentGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.CreateDeploymentGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateDeploymentGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDeploymentGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -598,10 +559,7 @@ export const serializeAws_json1_1DeleteApplicationCommand = async ( input: DeleteApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.DeleteApplication", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -611,10 +569,7 @@ export const serializeAws_json1_1DeleteDeploymentConfigCommand = async ( input: DeleteDeploymentConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.DeleteDeploymentConfig", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDeploymentConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDeploymentConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -624,10 +579,7 @@ export const serializeAws_json1_1DeleteDeploymentGroupCommand = async ( input: DeleteDeploymentGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.DeleteDeploymentGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDeploymentGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDeploymentGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -637,10 +589,7 @@ export const serializeAws_json1_1DeleteGitHubAccountTokenCommand = async ( input: DeleteGitHubAccountTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.DeleteGitHubAccountToken", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGitHubAccountToken"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGitHubAccountTokenInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -650,10 +599,7 @@ export const serializeAws_json1_1DeleteResourcesByExternalIdCommand = async ( input: DeleteResourcesByExternalIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.DeleteResourcesByExternalId", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcesByExternalId"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourcesByExternalIdInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -663,10 +609,7 @@ export const serializeAws_json1_1DeregisterOnPremisesInstanceCommand = async ( input: DeregisterOnPremisesInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.DeregisterOnPremisesInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterOnPremisesInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterOnPremisesInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -676,10 +619,7 @@ export const serializeAws_json1_1GetApplicationCommand = async ( input: GetApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.GetApplication", - }; + const headers: __HeaderBag = sharedHeaders("GetApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1GetApplicationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -689,10 +629,7 @@ export const serializeAws_json1_1GetApplicationRevisionCommand = async ( input: GetApplicationRevisionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.GetApplicationRevision", - }; + const headers: __HeaderBag = sharedHeaders("GetApplicationRevision"); let body: any; body = JSON.stringify(serializeAws_json1_1GetApplicationRevisionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -702,10 +639,7 @@ export const serializeAws_json1_1GetDeploymentCommand = async ( input: GetDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.GetDeployment", - }; + const headers: __HeaderBag = sharedHeaders("GetDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeploymentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -715,10 +649,7 @@ export const serializeAws_json1_1GetDeploymentConfigCommand = async ( input: GetDeploymentConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.GetDeploymentConfig", - }; + const headers: __HeaderBag = sharedHeaders("GetDeploymentConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeploymentConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -728,10 +659,7 @@ export const serializeAws_json1_1GetDeploymentGroupCommand = async ( input: GetDeploymentGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.GetDeploymentGroup", - }; + const headers: __HeaderBag = sharedHeaders("GetDeploymentGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeploymentGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -741,10 +669,7 @@ export const serializeAws_json1_1GetDeploymentInstanceCommand = async ( input: GetDeploymentInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.GetDeploymentInstance", - }; + const headers: __HeaderBag = sharedHeaders("GetDeploymentInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeploymentInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -754,10 +679,7 @@ export const serializeAws_json1_1GetDeploymentTargetCommand = async ( input: GetDeploymentTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.GetDeploymentTarget", - }; + const headers: __HeaderBag = sharedHeaders("GetDeploymentTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeploymentTargetInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -767,10 +689,7 @@ export const serializeAws_json1_1GetOnPremisesInstanceCommand = async ( input: GetOnPremisesInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.GetOnPremisesInstance", - }; + const headers: __HeaderBag = sharedHeaders("GetOnPremisesInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOnPremisesInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -780,10 +699,7 @@ export const serializeAws_json1_1ListApplicationRevisionsCommand = async ( input: ListApplicationRevisionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ListApplicationRevisions", - }; + const headers: __HeaderBag = sharedHeaders("ListApplicationRevisions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApplicationRevisionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -793,10 +709,7 @@ export const serializeAws_json1_1ListApplicationsCommand = async ( input: ListApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ListApplications", - }; + const headers: __HeaderBag = sharedHeaders("ListApplications"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApplicationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -806,10 +719,7 @@ export const serializeAws_json1_1ListDeploymentConfigsCommand = async ( input: ListDeploymentConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ListDeploymentConfigs", - }; + const headers: __HeaderBag = sharedHeaders("ListDeploymentConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDeploymentConfigsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -819,10 +729,7 @@ export const serializeAws_json1_1ListDeploymentGroupsCommand = async ( input: ListDeploymentGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ListDeploymentGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListDeploymentGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDeploymentGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -832,10 +739,7 @@ export const serializeAws_json1_1ListDeploymentInstancesCommand = async ( input: ListDeploymentInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ListDeploymentInstances", - }; + const headers: __HeaderBag = sharedHeaders("ListDeploymentInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDeploymentInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -845,10 +749,7 @@ export const serializeAws_json1_1ListDeploymentsCommand = async ( input: ListDeploymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ListDeployments", - }; + const headers: __HeaderBag = sharedHeaders("ListDeployments"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDeploymentsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -858,10 +759,7 @@ export const serializeAws_json1_1ListDeploymentTargetsCommand = async ( input: ListDeploymentTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ListDeploymentTargets", - }; + const headers: __HeaderBag = sharedHeaders("ListDeploymentTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDeploymentTargetsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -871,10 +769,7 @@ export const serializeAws_json1_1ListGitHubAccountTokenNamesCommand = async ( input: ListGitHubAccountTokenNamesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ListGitHubAccountTokenNames", - }; + const headers: __HeaderBag = sharedHeaders("ListGitHubAccountTokenNames"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGitHubAccountTokenNamesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -884,10 +779,7 @@ export const serializeAws_json1_1ListOnPremisesInstancesCommand = async ( input: ListOnPremisesInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ListOnPremisesInstances", - }; + const headers: __HeaderBag = sharedHeaders("ListOnPremisesInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOnPremisesInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -897,10 +789,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -910,10 +799,7 @@ export const serializeAws_json1_1PutLifecycleEventHookExecutionStatusCommand = a input: PutLifecycleEventHookExecutionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.PutLifecycleEventHookExecutionStatus", - }; + const headers: __HeaderBag = sharedHeaders("PutLifecycleEventHookExecutionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1PutLifecycleEventHookExecutionStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -923,10 +809,7 @@ export const serializeAws_json1_1RegisterApplicationRevisionCommand = async ( input: RegisterApplicationRevisionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.RegisterApplicationRevision", - }; + const headers: __HeaderBag = sharedHeaders("RegisterApplicationRevision"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterApplicationRevisionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -936,10 +819,7 @@ export const serializeAws_json1_1RegisterOnPremisesInstanceCommand = async ( input: RegisterOnPremisesInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.RegisterOnPremisesInstance", - }; + const headers: __HeaderBag = sharedHeaders("RegisterOnPremisesInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterOnPremisesInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -949,10 +829,7 @@ export const serializeAws_json1_1RemoveTagsFromOnPremisesInstancesCommand = asyn input: RemoveTagsFromOnPremisesInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.RemoveTagsFromOnPremisesInstances", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTagsFromOnPremisesInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsFromOnPremisesInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -962,10 +839,7 @@ export const serializeAws_json1_1SkipWaitTimeForInstanceTerminationCommand = asy input: SkipWaitTimeForInstanceTerminationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.SkipWaitTimeForInstanceTermination", - }; + const headers: __HeaderBag = sharedHeaders("SkipWaitTimeForInstanceTermination"); let body: any; body = JSON.stringify(serializeAws_json1_1SkipWaitTimeForInstanceTerminationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -975,10 +849,7 @@ export const serializeAws_json1_1StopDeploymentCommand = async ( input: StopDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.StopDeployment", - }; + const headers: __HeaderBag = sharedHeaders("StopDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_1StopDeploymentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -988,10 +859,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1001,10 +869,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1014,10 +879,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( input: UpdateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.UpdateApplication", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApplicationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1027,10 +889,7 @@ export const serializeAws_json1_1UpdateDeploymentGroupCommand = async ( input: UpdateDeploymentGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeDeploy_20141006.UpdateDeploymentGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDeploymentGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDeploymentGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -8793,6 +8652,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `CodeDeploy_20141006.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-codepipeline/src/protocols/Aws_json1_1.ts b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts index 4e802cc799b9b..ef2e9c953d0cb 100644 --- a/clients/client-codepipeline/src/protocols/Aws_json1_1.ts +++ b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts @@ -298,10 +298,7 @@ export const serializeAws_json1_1AcknowledgeJobCommand = async ( input: AcknowledgeJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.AcknowledgeJob", - }; + const headers: __HeaderBag = sharedHeaders("AcknowledgeJob"); let body: any; body = JSON.stringify(serializeAws_json1_1AcknowledgeJobInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -311,10 +308,7 @@ export const serializeAws_json1_1AcknowledgeThirdPartyJobCommand = async ( input: AcknowledgeThirdPartyJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.AcknowledgeThirdPartyJob", - }; + const headers: __HeaderBag = sharedHeaders("AcknowledgeThirdPartyJob"); let body: any; body = JSON.stringify(serializeAws_json1_1AcknowledgeThirdPartyJobInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -324,10 +318,7 @@ export const serializeAws_json1_1CreateCustomActionTypeCommand = async ( input: CreateCustomActionTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.CreateCustomActionType", - }; + const headers: __HeaderBag = sharedHeaders("CreateCustomActionType"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCustomActionTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -337,10 +328,7 @@ export const serializeAws_json1_1CreatePipelineCommand = async ( input: CreatePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.CreatePipeline", - }; + const headers: __HeaderBag = sharedHeaders("CreatePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePipelineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -350,10 +338,7 @@ export const serializeAws_json1_1DeleteCustomActionTypeCommand = async ( input: DeleteCustomActionTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.DeleteCustomActionType", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCustomActionType"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCustomActionTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -363,10 +348,7 @@ export const serializeAws_json1_1DeletePipelineCommand = async ( input: DeletePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.DeletePipeline", - }; + const headers: __HeaderBag = sharedHeaders("DeletePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePipelineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -376,10 +358,7 @@ export const serializeAws_json1_1DeleteWebhookCommand = async ( input: DeleteWebhookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.DeleteWebhook", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWebhook"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWebhookInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -389,10 +368,7 @@ export const serializeAws_json1_1DeregisterWebhookWithThirdPartyCommand = async input: DeregisterWebhookWithThirdPartyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.DeregisterWebhookWithThirdParty", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterWebhookWithThirdParty"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterWebhookWithThirdPartyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -402,10 +378,7 @@ export const serializeAws_json1_1DisableStageTransitionCommand = async ( input: DisableStageTransitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.DisableStageTransition", - }; + const headers: __HeaderBag = sharedHeaders("DisableStageTransition"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableStageTransitionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -415,10 +388,7 @@ export const serializeAws_json1_1EnableStageTransitionCommand = async ( input: EnableStageTransitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.EnableStageTransition", - }; + const headers: __HeaderBag = sharedHeaders("EnableStageTransition"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableStageTransitionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -428,10 +398,7 @@ export const serializeAws_json1_1GetActionTypeCommand = async ( input: GetActionTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.GetActionType", - }; + const headers: __HeaderBag = sharedHeaders("GetActionType"); let body: any; body = JSON.stringify(serializeAws_json1_1GetActionTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -441,10 +408,7 @@ export const serializeAws_json1_1GetJobDetailsCommand = async ( input: GetJobDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.GetJobDetails", - }; + const headers: __HeaderBag = sharedHeaders("GetJobDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1GetJobDetailsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -454,10 +418,7 @@ export const serializeAws_json1_1GetPipelineCommand = async ( input: GetPipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.GetPipeline", - }; + const headers: __HeaderBag = sharedHeaders("GetPipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPipelineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -467,10 +428,7 @@ export const serializeAws_json1_1GetPipelineExecutionCommand = async ( input: GetPipelineExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.GetPipelineExecution", - }; + const headers: __HeaderBag = sharedHeaders("GetPipelineExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPipelineExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -480,10 +438,7 @@ export const serializeAws_json1_1GetPipelineStateCommand = async ( input: GetPipelineStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.GetPipelineState", - }; + const headers: __HeaderBag = sharedHeaders("GetPipelineState"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPipelineStateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -493,10 +448,7 @@ export const serializeAws_json1_1GetThirdPartyJobDetailsCommand = async ( input: GetThirdPartyJobDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.GetThirdPartyJobDetails", - }; + const headers: __HeaderBag = sharedHeaders("GetThirdPartyJobDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1GetThirdPartyJobDetailsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -506,10 +458,7 @@ export const serializeAws_json1_1ListActionExecutionsCommand = async ( input: ListActionExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.ListActionExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListActionExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListActionExecutionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -519,10 +468,7 @@ export const serializeAws_json1_1ListActionTypesCommand = async ( input: ListActionTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.ListActionTypes", - }; + const headers: __HeaderBag = sharedHeaders("ListActionTypes"); let body: any; body = JSON.stringify(serializeAws_json1_1ListActionTypesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -532,10 +478,7 @@ export const serializeAws_json1_1ListPipelineExecutionsCommand = async ( input: ListPipelineExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.ListPipelineExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListPipelineExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPipelineExecutionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -545,10 +488,7 @@ export const serializeAws_json1_1ListPipelinesCommand = async ( input: ListPipelinesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.ListPipelines", - }; + const headers: __HeaderBag = sharedHeaders("ListPipelines"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPipelinesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -558,10 +498,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -571,10 +508,7 @@ export const serializeAws_json1_1ListWebhooksCommand = async ( input: ListWebhooksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.ListWebhooks", - }; + const headers: __HeaderBag = sharedHeaders("ListWebhooks"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWebhooksInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -584,10 +518,7 @@ export const serializeAws_json1_1PollForJobsCommand = async ( input: PollForJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.PollForJobs", - }; + const headers: __HeaderBag = sharedHeaders("PollForJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1PollForJobsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -597,10 +528,7 @@ export const serializeAws_json1_1PollForThirdPartyJobsCommand = async ( input: PollForThirdPartyJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.PollForThirdPartyJobs", - }; + const headers: __HeaderBag = sharedHeaders("PollForThirdPartyJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1PollForThirdPartyJobsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -610,10 +538,7 @@ export const serializeAws_json1_1PutActionRevisionCommand = async ( input: PutActionRevisionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.PutActionRevision", - }; + const headers: __HeaderBag = sharedHeaders("PutActionRevision"); let body: any; body = JSON.stringify(serializeAws_json1_1PutActionRevisionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -623,10 +548,7 @@ export const serializeAws_json1_1PutApprovalResultCommand = async ( input: PutApprovalResultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.PutApprovalResult", - }; + const headers: __HeaderBag = sharedHeaders("PutApprovalResult"); let body: any; body = JSON.stringify(serializeAws_json1_1PutApprovalResultInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -636,10 +558,7 @@ export const serializeAws_json1_1PutJobFailureResultCommand = async ( input: PutJobFailureResultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.PutJobFailureResult", - }; + const headers: __HeaderBag = sharedHeaders("PutJobFailureResult"); let body: any; body = JSON.stringify(serializeAws_json1_1PutJobFailureResultInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -649,10 +568,7 @@ export const serializeAws_json1_1PutJobSuccessResultCommand = async ( input: PutJobSuccessResultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.PutJobSuccessResult", - }; + const headers: __HeaderBag = sharedHeaders("PutJobSuccessResult"); let body: any; body = JSON.stringify(serializeAws_json1_1PutJobSuccessResultInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -662,10 +578,7 @@ export const serializeAws_json1_1PutThirdPartyJobFailureResultCommand = async ( input: PutThirdPartyJobFailureResultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.PutThirdPartyJobFailureResult", - }; + const headers: __HeaderBag = sharedHeaders("PutThirdPartyJobFailureResult"); let body: any; body = JSON.stringify(serializeAws_json1_1PutThirdPartyJobFailureResultInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -675,10 +588,7 @@ export const serializeAws_json1_1PutThirdPartyJobSuccessResultCommand = async ( input: PutThirdPartyJobSuccessResultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.PutThirdPartyJobSuccessResult", - }; + const headers: __HeaderBag = sharedHeaders("PutThirdPartyJobSuccessResult"); let body: any; body = JSON.stringify(serializeAws_json1_1PutThirdPartyJobSuccessResultInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -688,10 +598,7 @@ export const serializeAws_json1_1PutWebhookCommand = async ( input: PutWebhookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.PutWebhook", - }; + const headers: __HeaderBag = sharedHeaders("PutWebhook"); let body: any; body = JSON.stringify(serializeAws_json1_1PutWebhookInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -701,10 +608,7 @@ export const serializeAws_json1_1RegisterWebhookWithThirdPartyCommand = async ( input: RegisterWebhookWithThirdPartyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.RegisterWebhookWithThirdParty", - }; + const headers: __HeaderBag = sharedHeaders("RegisterWebhookWithThirdParty"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterWebhookWithThirdPartyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -714,10 +618,7 @@ export const serializeAws_json1_1RetryStageExecutionCommand = async ( input: RetryStageExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.RetryStageExecution", - }; + const headers: __HeaderBag = sharedHeaders("RetryStageExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1RetryStageExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -727,10 +628,7 @@ export const serializeAws_json1_1StartPipelineExecutionCommand = async ( input: StartPipelineExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.StartPipelineExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartPipelineExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StartPipelineExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -740,10 +638,7 @@ export const serializeAws_json1_1StopPipelineExecutionCommand = async ( input: StopPipelineExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.StopPipelineExecution", - }; + const headers: __HeaderBag = sharedHeaders("StopPipelineExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StopPipelineExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -753,10 +648,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -766,10 +658,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -779,10 +668,7 @@ export const serializeAws_json1_1UpdateActionTypeCommand = async ( input: UpdateActionTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.UpdateActionType", - }; + const headers: __HeaderBag = sharedHeaders("UpdateActionType"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateActionTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -792,10 +678,7 @@ export const serializeAws_json1_1UpdatePipelineCommand = async ( input: UpdatePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodePipeline_20150709.UpdatePipeline", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePipelineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5681,6 +5564,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `CodePipeline_20150709.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts index a7bd3a8d7cf34..226f4fa372282 100644 --- a/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts +++ b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts @@ -68,10 +68,7 @@ export const serializeAws_json1_0CreateConnectionCommand = async ( input: CreateConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.CreateConnection", - }; + const headers: __HeaderBag = sharedHeaders("CreateConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -81,10 +78,7 @@ export const serializeAws_json1_0CreateHostCommand = async ( input: CreateHostCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.CreateHost", - }; + const headers: __HeaderBag = sharedHeaders("CreateHost"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateHostInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -94,10 +88,7 @@ export const serializeAws_json1_0DeleteConnectionCommand = async ( input: DeleteConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.DeleteConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -107,10 +98,7 @@ export const serializeAws_json1_0DeleteHostCommand = async ( input: DeleteHostCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.DeleteHost", - }; + const headers: __HeaderBag = sharedHeaders("DeleteHost"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteHostInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -120,10 +108,7 @@ export const serializeAws_json1_0GetConnectionCommand = async ( input: GetConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.GetConnection", - }; + const headers: __HeaderBag = sharedHeaders("GetConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0GetConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -133,10 +118,7 @@ export const serializeAws_json1_0GetHostCommand = async ( input: GetHostCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.GetHost", - }; + const headers: __HeaderBag = sharedHeaders("GetHost"); let body: any; body = JSON.stringify(serializeAws_json1_0GetHostInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -146,10 +128,7 @@ export const serializeAws_json1_0ListConnectionsCommand = async ( input: ListConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.ListConnections", - }; + const headers: __HeaderBag = sharedHeaders("ListConnections"); let body: any; body = JSON.stringify(serializeAws_json1_0ListConnectionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -159,10 +138,7 @@ export const serializeAws_json1_0ListHostsCommand = async ( input: ListHostsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.ListHosts", - }; + const headers: __HeaderBag = sharedHeaders("ListHosts"); let body: any; body = JSON.stringify(serializeAws_json1_0ListHostsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -172,10 +148,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -185,10 +158,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -198,10 +168,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -211,10 +178,7 @@ export const serializeAws_json1_0UpdateHostCommand = async ( input: UpdateHostCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "CodeStar_connections_20191201.UpdateHost", - }; + const headers: __HeaderBag = sharedHeaders("UpdateHost"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateHostInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1201,6 +1165,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `CodeStar_connections_20191201.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-codestar/src/protocols/Aws_json1_1.ts b/clients/client-codestar/src/protocols/Aws_json1_1.ts index 83ec6126dbace..90ed7aeafad96 100644 --- a/clients/client-codestar/src/protocols/Aws_json1_1.ts +++ b/clients/client-codestar/src/protocols/Aws_json1_1.ts @@ -113,10 +113,7 @@ export const serializeAws_json1_1AssociateTeamMemberCommand = async ( input: AssociateTeamMemberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.AssociateTeamMember", - }; + const headers: __HeaderBag = sharedHeaders("AssociateTeamMember"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateTeamMemberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -126,10 +123,7 @@ export const serializeAws_json1_1CreateProjectCommand = async ( input: CreateProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.CreateProject", - }; + const headers: __HeaderBag = sharedHeaders("CreateProject"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -139,10 +133,7 @@ export const serializeAws_json1_1CreateUserProfileCommand = async ( input: CreateUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.CreateUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("CreateUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -152,10 +143,7 @@ export const serializeAws_json1_1DeleteProjectCommand = async ( input: DeleteProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.DeleteProject", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProject"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -165,10 +153,7 @@ export const serializeAws_json1_1DeleteUserProfileCommand = async ( input: DeleteUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.DeleteUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -178,10 +163,7 @@ export const serializeAws_json1_1DescribeProjectCommand = async ( input: DescribeProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.DescribeProject", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProject"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -191,10 +173,7 @@ export const serializeAws_json1_1DescribeUserProfileCommand = async ( input: DescribeUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.DescribeUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -204,10 +183,7 @@ export const serializeAws_json1_1DisassociateTeamMemberCommand = async ( input: DisassociateTeamMemberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.DisassociateTeamMember", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateTeamMember"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateTeamMemberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -217,10 +193,7 @@ export const serializeAws_json1_1ListProjectsCommand = async ( input: ListProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.ListProjects", - }; + const headers: __HeaderBag = sharedHeaders("ListProjects"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProjectsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -230,10 +203,7 @@ export const serializeAws_json1_1ListResourcesCommand = async ( input: ListResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.ListResources", - }; + const headers: __HeaderBag = sharedHeaders("ListResources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -243,10 +213,7 @@ export const serializeAws_json1_1ListTagsForProjectCommand = async ( input: ListTagsForProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.ListTagsForProject", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForProject"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -256,10 +223,7 @@ export const serializeAws_json1_1ListTeamMembersCommand = async ( input: ListTeamMembersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.ListTeamMembers", - }; + const headers: __HeaderBag = sharedHeaders("ListTeamMembers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTeamMembersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -269,10 +233,7 @@ export const serializeAws_json1_1ListUserProfilesCommand = async ( input: ListUserProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.ListUserProfiles", - }; + const headers: __HeaderBag = sharedHeaders("ListUserProfiles"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUserProfilesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -282,10 +243,7 @@ export const serializeAws_json1_1TagProjectCommand = async ( input: TagProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.TagProject", - }; + const headers: __HeaderBag = sharedHeaders("TagProject"); let body: any; body = JSON.stringify(serializeAws_json1_1TagProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -295,10 +253,7 @@ export const serializeAws_json1_1UntagProjectCommand = async ( input: UntagProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.UntagProject", - }; + const headers: __HeaderBag = sharedHeaders("UntagProject"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -308,10 +263,7 @@ export const serializeAws_json1_1UpdateProjectCommand = async ( input: UpdateProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.UpdateProject", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProject"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -321,10 +273,7 @@ export const serializeAws_json1_1UpdateTeamMemberCommand = async ( input: UpdateTeamMemberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.UpdateTeamMember", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTeamMember"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTeamMemberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -334,10 +283,7 @@ export const serializeAws_json1_1UpdateUserProfileCommand = async ( input: UpdateUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "CodeStar_20170419.UpdateUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2080,6 +2026,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `CodeStar_20170419.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts index 369aff37e2768..157b96fc475da 100644 --- a/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts @@ -601,10 +601,7 @@ export const serializeAws_json1_1AddCustomAttributesCommand = async ( input: AddCustomAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AddCustomAttributes", - }; + const headers: __HeaderBag = sharedHeaders("AddCustomAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1AddCustomAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -614,10 +611,7 @@ export const serializeAws_json1_1AdminAddUserToGroupCommand = async ( input: AdminAddUserToGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminAddUserToGroup", - }; + const headers: __HeaderBag = sharedHeaders("AdminAddUserToGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminAddUserToGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -627,10 +621,7 @@ export const serializeAws_json1_1AdminConfirmSignUpCommand = async ( input: AdminConfirmSignUpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminConfirmSignUp", - }; + const headers: __HeaderBag = sharedHeaders("AdminConfirmSignUp"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminConfirmSignUpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -640,10 +631,7 @@ export const serializeAws_json1_1AdminCreateUserCommand = async ( input: AdminCreateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminCreateUser", - }; + const headers: __HeaderBag = sharedHeaders("AdminCreateUser"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminCreateUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -653,10 +641,7 @@ export const serializeAws_json1_1AdminDeleteUserCommand = async ( input: AdminDeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminDeleteUser", - }; + const headers: __HeaderBag = sharedHeaders("AdminDeleteUser"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminDeleteUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -666,10 +651,7 @@ export const serializeAws_json1_1AdminDeleteUserAttributesCommand = async ( input: AdminDeleteUserAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminDeleteUserAttributes", - }; + const headers: __HeaderBag = sharedHeaders("AdminDeleteUserAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminDeleteUserAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -679,10 +661,7 @@ export const serializeAws_json1_1AdminDisableProviderForUserCommand = async ( input: AdminDisableProviderForUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminDisableProviderForUser", - }; + const headers: __HeaderBag = sharedHeaders("AdminDisableProviderForUser"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminDisableProviderForUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -692,10 +671,7 @@ export const serializeAws_json1_1AdminDisableUserCommand = async ( input: AdminDisableUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminDisableUser", - }; + const headers: __HeaderBag = sharedHeaders("AdminDisableUser"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminDisableUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -705,10 +681,7 @@ export const serializeAws_json1_1AdminEnableUserCommand = async ( input: AdminEnableUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminEnableUser", - }; + const headers: __HeaderBag = sharedHeaders("AdminEnableUser"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminEnableUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -718,10 +691,7 @@ export const serializeAws_json1_1AdminForgetDeviceCommand = async ( input: AdminForgetDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminForgetDevice", - }; + const headers: __HeaderBag = sharedHeaders("AdminForgetDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminForgetDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -731,10 +701,7 @@ export const serializeAws_json1_1AdminGetDeviceCommand = async ( input: AdminGetDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminGetDevice", - }; + const headers: __HeaderBag = sharedHeaders("AdminGetDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminGetDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -744,10 +711,7 @@ export const serializeAws_json1_1AdminGetUserCommand = async ( input: AdminGetUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminGetUser", - }; + const headers: __HeaderBag = sharedHeaders("AdminGetUser"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminGetUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -757,10 +721,7 @@ export const serializeAws_json1_1AdminInitiateAuthCommand = async ( input: AdminInitiateAuthCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminInitiateAuth", - }; + const headers: __HeaderBag = sharedHeaders("AdminInitiateAuth"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminInitiateAuthRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -770,10 +731,7 @@ export const serializeAws_json1_1AdminLinkProviderForUserCommand = async ( input: AdminLinkProviderForUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminLinkProviderForUser", - }; + const headers: __HeaderBag = sharedHeaders("AdminLinkProviderForUser"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminLinkProviderForUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -783,10 +741,7 @@ export const serializeAws_json1_1AdminListDevicesCommand = async ( input: AdminListDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminListDevices", - }; + const headers: __HeaderBag = sharedHeaders("AdminListDevices"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminListDevicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -796,10 +751,7 @@ export const serializeAws_json1_1AdminListGroupsForUserCommand = async ( input: AdminListGroupsForUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminListGroupsForUser", - }; + const headers: __HeaderBag = sharedHeaders("AdminListGroupsForUser"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminListGroupsForUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -809,10 +761,7 @@ export const serializeAws_json1_1AdminListUserAuthEventsCommand = async ( input: AdminListUserAuthEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminListUserAuthEvents", - }; + const headers: __HeaderBag = sharedHeaders("AdminListUserAuthEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminListUserAuthEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -822,10 +771,7 @@ export const serializeAws_json1_1AdminRemoveUserFromGroupCommand = async ( input: AdminRemoveUserFromGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminRemoveUserFromGroup", - }; + const headers: __HeaderBag = sharedHeaders("AdminRemoveUserFromGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminRemoveUserFromGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -835,10 +781,7 @@ export const serializeAws_json1_1AdminResetUserPasswordCommand = async ( input: AdminResetUserPasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminResetUserPassword", - }; + const headers: __HeaderBag = sharedHeaders("AdminResetUserPassword"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminResetUserPasswordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -848,10 +791,7 @@ export const serializeAws_json1_1AdminRespondToAuthChallengeCommand = async ( input: AdminRespondToAuthChallengeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminRespondToAuthChallenge", - }; + const headers: __HeaderBag = sharedHeaders("AdminRespondToAuthChallenge"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminRespondToAuthChallengeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -861,10 +801,7 @@ export const serializeAws_json1_1AdminSetUserMFAPreferenceCommand = async ( input: AdminSetUserMFAPreferenceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminSetUserMFAPreference", - }; + const headers: __HeaderBag = sharedHeaders("AdminSetUserMFAPreference"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminSetUserMFAPreferenceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -874,10 +811,7 @@ export const serializeAws_json1_1AdminSetUserPasswordCommand = async ( input: AdminSetUserPasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminSetUserPassword", - }; + const headers: __HeaderBag = sharedHeaders("AdminSetUserPassword"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminSetUserPasswordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -887,10 +821,7 @@ export const serializeAws_json1_1AdminSetUserSettingsCommand = async ( input: AdminSetUserSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminSetUserSettings", - }; + const headers: __HeaderBag = sharedHeaders("AdminSetUserSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminSetUserSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -900,10 +831,7 @@ export const serializeAws_json1_1AdminUpdateAuthEventFeedbackCommand = async ( input: AdminUpdateAuthEventFeedbackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminUpdateAuthEventFeedback", - }; + const headers: __HeaderBag = sharedHeaders("AdminUpdateAuthEventFeedback"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminUpdateAuthEventFeedbackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -913,10 +841,7 @@ export const serializeAws_json1_1AdminUpdateDeviceStatusCommand = async ( input: AdminUpdateDeviceStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminUpdateDeviceStatus", - }; + const headers: __HeaderBag = sharedHeaders("AdminUpdateDeviceStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminUpdateDeviceStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -926,10 +851,7 @@ export const serializeAws_json1_1AdminUpdateUserAttributesCommand = async ( input: AdminUpdateUserAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminUpdateUserAttributes", - }; + const headers: __HeaderBag = sharedHeaders("AdminUpdateUserAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminUpdateUserAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -939,10 +861,7 @@ export const serializeAws_json1_1AdminUserGlobalSignOutCommand = async ( input: AdminUserGlobalSignOutCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AdminUserGlobalSignOut", - }; + const headers: __HeaderBag = sharedHeaders("AdminUserGlobalSignOut"); let body: any; body = JSON.stringify(serializeAws_json1_1AdminUserGlobalSignOutRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -952,10 +871,7 @@ export const serializeAws_json1_1AssociateSoftwareTokenCommand = async ( input: AssociateSoftwareTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.AssociateSoftwareToken", - }; + const headers: __HeaderBag = sharedHeaders("AssociateSoftwareToken"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateSoftwareTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -965,10 +881,7 @@ export const serializeAws_json1_1ChangePasswordCommand = async ( input: ChangePasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ChangePassword", - }; + const headers: __HeaderBag = sharedHeaders("ChangePassword"); let body: any; body = JSON.stringify(serializeAws_json1_1ChangePasswordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -978,10 +891,7 @@ export const serializeAws_json1_1ConfirmDeviceCommand = async ( input: ConfirmDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ConfirmDevice", - }; + const headers: __HeaderBag = sharedHeaders("ConfirmDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1ConfirmDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -991,10 +901,7 @@ export const serializeAws_json1_1ConfirmForgotPasswordCommand = async ( input: ConfirmForgotPasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ConfirmForgotPassword", - }; + const headers: __HeaderBag = sharedHeaders("ConfirmForgotPassword"); let body: any; body = JSON.stringify(serializeAws_json1_1ConfirmForgotPasswordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1004,10 +911,7 @@ export const serializeAws_json1_1ConfirmSignUpCommand = async ( input: ConfirmSignUpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ConfirmSignUp", - }; + const headers: __HeaderBag = sharedHeaders("ConfirmSignUp"); let body: any; body = JSON.stringify(serializeAws_json1_1ConfirmSignUpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1017,10 +921,7 @@ export const serializeAws_json1_1CreateGroupCommand = async ( input: CreateGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.CreateGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1030,10 +931,7 @@ export const serializeAws_json1_1CreateIdentityProviderCommand = async ( input: CreateIdentityProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.CreateIdentityProvider", - }; + const headers: __HeaderBag = sharedHeaders("CreateIdentityProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateIdentityProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1043,10 +941,7 @@ export const serializeAws_json1_1CreateResourceServerCommand = async ( input: CreateResourceServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.CreateResourceServer", - }; + const headers: __HeaderBag = sharedHeaders("CreateResourceServer"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateResourceServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1056,10 +951,7 @@ export const serializeAws_json1_1CreateUserImportJobCommand = async ( input: CreateUserImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.CreateUserImportJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateUserImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1069,10 +961,7 @@ export const serializeAws_json1_1CreateUserPoolCommand = async ( input: CreateUserPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.CreateUserPool", - }; + const headers: __HeaderBag = sharedHeaders("CreateUserPool"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserPoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1082,10 +971,7 @@ export const serializeAws_json1_1CreateUserPoolClientCommand = async ( input: CreateUserPoolClientCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.CreateUserPoolClient", - }; + const headers: __HeaderBag = sharedHeaders("CreateUserPoolClient"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserPoolClientRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1095,10 +981,7 @@ export const serializeAws_json1_1CreateUserPoolDomainCommand = async ( input: CreateUserPoolDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.CreateUserPoolDomain", - }; + const headers: __HeaderBag = sharedHeaders("CreateUserPoolDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserPoolDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1108,10 +991,7 @@ export const serializeAws_json1_1DeleteGroupCommand = async ( input: DeleteGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DeleteGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1121,10 +1001,7 @@ export const serializeAws_json1_1DeleteIdentityProviderCommand = async ( input: DeleteIdentityProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DeleteIdentityProvider", - }; + const headers: __HeaderBag = sharedHeaders("DeleteIdentityProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteIdentityProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1134,10 +1011,7 @@ export const serializeAws_json1_1DeleteResourceServerCommand = async ( input: DeleteResourceServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DeleteResourceServer", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourceServer"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourceServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1147,10 +1021,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DeleteUser", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1160,10 +1031,7 @@ export const serializeAws_json1_1DeleteUserAttributesCommand = async ( input: DeleteUserAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DeleteUserAttributes", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUserAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1173,10 +1041,7 @@ export const serializeAws_json1_1DeleteUserPoolCommand = async ( input: DeleteUserPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DeleteUserPool", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUserPool"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserPoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1186,10 +1051,7 @@ export const serializeAws_json1_1DeleteUserPoolClientCommand = async ( input: DeleteUserPoolClientCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DeleteUserPoolClient", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUserPoolClient"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserPoolClientRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1199,10 +1061,7 @@ export const serializeAws_json1_1DeleteUserPoolDomainCommand = async ( input: DeleteUserPoolDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DeleteUserPoolDomain", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUserPoolDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserPoolDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1212,10 +1071,7 @@ export const serializeAws_json1_1DescribeIdentityProviderCommand = async ( input: DescribeIdentityProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DescribeIdentityProvider", - }; + const headers: __HeaderBag = sharedHeaders("DescribeIdentityProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeIdentityProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1225,10 +1081,7 @@ export const serializeAws_json1_1DescribeResourceServerCommand = async ( input: DescribeResourceServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DescribeResourceServer", - }; + const headers: __HeaderBag = sharedHeaders("DescribeResourceServer"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeResourceServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1238,10 +1091,7 @@ export const serializeAws_json1_1DescribeRiskConfigurationCommand = async ( input: DescribeRiskConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DescribeRiskConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRiskConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRiskConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1251,10 +1101,7 @@ export const serializeAws_json1_1DescribeUserImportJobCommand = async ( input: DescribeUserImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DescribeUserImportJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUserImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1264,10 +1111,7 @@ export const serializeAws_json1_1DescribeUserPoolCommand = async ( input: DescribeUserPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DescribeUserPool", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUserPool"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserPoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1277,10 +1121,7 @@ export const serializeAws_json1_1DescribeUserPoolClientCommand = async ( input: DescribeUserPoolClientCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DescribeUserPoolClient", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUserPoolClient"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserPoolClientRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1290,10 +1131,7 @@ export const serializeAws_json1_1DescribeUserPoolDomainCommand = async ( input: DescribeUserPoolDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.DescribeUserPoolDomain", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUserPoolDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserPoolDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1303,10 +1141,7 @@ export const serializeAws_json1_1ForgetDeviceCommand = async ( input: ForgetDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ForgetDevice", - }; + const headers: __HeaderBag = sharedHeaders("ForgetDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1ForgetDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1316,10 +1151,7 @@ export const serializeAws_json1_1ForgotPasswordCommand = async ( input: ForgotPasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ForgotPassword", - }; + const headers: __HeaderBag = sharedHeaders("ForgotPassword"); let body: any; body = JSON.stringify(serializeAws_json1_1ForgotPasswordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1329,10 +1161,7 @@ export const serializeAws_json1_1GetCSVHeaderCommand = async ( input: GetCSVHeaderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.GetCSVHeader", - }; + const headers: __HeaderBag = sharedHeaders("GetCSVHeader"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCSVHeaderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1342,10 +1171,7 @@ export const serializeAws_json1_1GetDeviceCommand = async ( input: GetDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.GetDevice", - }; + const headers: __HeaderBag = sharedHeaders("GetDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1355,10 +1181,7 @@ export const serializeAws_json1_1GetGroupCommand = async ( input: GetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.GetGroup", - }; + const headers: __HeaderBag = sharedHeaders("GetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1368,10 +1191,7 @@ export const serializeAws_json1_1GetIdentityProviderByIdentifierCommand = async input: GetIdentityProviderByIdentifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.GetIdentityProviderByIdentifier", - }; + const headers: __HeaderBag = sharedHeaders("GetIdentityProviderByIdentifier"); let body: any; body = JSON.stringify(serializeAws_json1_1GetIdentityProviderByIdentifierRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1381,10 +1201,7 @@ export const serializeAws_json1_1GetSigningCertificateCommand = async ( input: GetSigningCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.GetSigningCertificate", - }; + const headers: __HeaderBag = sharedHeaders("GetSigningCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSigningCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1394,10 +1211,7 @@ export const serializeAws_json1_1GetUICustomizationCommand = async ( input: GetUICustomizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.GetUICustomization", - }; + const headers: __HeaderBag = sharedHeaders("GetUICustomization"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUICustomizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1407,10 +1221,7 @@ export const serializeAws_json1_1GetUserCommand = async ( input: GetUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.GetUser", - }; + const headers: __HeaderBag = sharedHeaders("GetUser"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1420,10 +1231,7 @@ export const serializeAws_json1_1GetUserAttributeVerificationCodeCommand = async input: GetUserAttributeVerificationCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.GetUserAttributeVerificationCode", - }; + const headers: __HeaderBag = sharedHeaders("GetUserAttributeVerificationCode"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUserAttributeVerificationCodeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1433,10 +1241,7 @@ export const serializeAws_json1_1GetUserPoolMfaConfigCommand = async ( input: GetUserPoolMfaConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.GetUserPoolMfaConfig", - }; + const headers: __HeaderBag = sharedHeaders("GetUserPoolMfaConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUserPoolMfaConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1446,10 +1251,7 @@ export const serializeAws_json1_1GlobalSignOutCommand = async ( input: GlobalSignOutCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.GlobalSignOut", - }; + const headers: __HeaderBag = sharedHeaders("GlobalSignOut"); let body: any; body = JSON.stringify(serializeAws_json1_1GlobalSignOutRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1459,10 +1261,7 @@ export const serializeAws_json1_1InitiateAuthCommand = async ( input: InitiateAuthCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.InitiateAuth", - }; + const headers: __HeaderBag = sharedHeaders("InitiateAuth"); let body: any; body = JSON.stringify(serializeAws_json1_1InitiateAuthRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1472,10 +1271,7 @@ export const serializeAws_json1_1ListDevicesCommand = async ( input: ListDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ListDevices", - }; + const headers: __HeaderBag = sharedHeaders("ListDevices"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDevicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1485,10 +1281,7 @@ export const serializeAws_json1_1ListGroupsCommand = async ( input: ListGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ListGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1498,10 +1291,7 @@ export const serializeAws_json1_1ListIdentityProvidersCommand = async ( input: ListIdentityProvidersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ListIdentityProviders", - }; + const headers: __HeaderBag = sharedHeaders("ListIdentityProviders"); let body: any; body = JSON.stringify(serializeAws_json1_1ListIdentityProvidersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1511,10 +1301,7 @@ export const serializeAws_json1_1ListResourceServersCommand = async ( input: ListResourceServersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ListResourceServers", - }; + const headers: __HeaderBag = sharedHeaders("ListResourceServers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourceServersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1524,10 +1311,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1537,10 +1321,7 @@ export const serializeAws_json1_1ListUserImportJobsCommand = async ( input: ListUserImportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ListUserImportJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListUserImportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUserImportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1550,10 +1331,7 @@ export const serializeAws_json1_1ListUserPoolClientsCommand = async ( input: ListUserPoolClientsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ListUserPoolClients", - }; + const headers: __HeaderBag = sharedHeaders("ListUserPoolClients"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUserPoolClientsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1563,10 +1341,7 @@ export const serializeAws_json1_1ListUserPoolsCommand = async ( input: ListUserPoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ListUserPools", - }; + const headers: __HeaderBag = sharedHeaders("ListUserPools"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUserPoolsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1576,10 +1351,7 @@ export const serializeAws_json1_1ListUsersCommand = async ( input: ListUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ListUsers", - }; + const headers: __HeaderBag = sharedHeaders("ListUsers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUsersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1589,10 +1361,7 @@ export const serializeAws_json1_1ListUsersInGroupCommand = async ( input: ListUsersInGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ListUsersInGroup", - }; + const headers: __HeaderBag = sharedHeaders("ListUsersInGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUsersInGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1602,10 +1371,7 @@ export const serializeAws_json1_1ResendConfirmationCodeCommand = async ( input: ResendConfirmationCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.ResendConfirmationCode", - }; + const headers: __HeaderBag = sharedHeaders("ResendConfirmationCode"); let body: any; body = JSON.stringify(serializeAws_json1_1ResendConfirmationCodeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1615,10 +1381,7 @@ export const serializeAws_json1_1RespondToAuthChallengeCommand = async ( input: RespondToAuthChallengeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.RespondToAuthChallenge", - }; + const headers: __HeaderBag = sharedHeaders("RespondToAuthChallenge"); let body: any; body = JSON.stringify(serializeAws_json1_1RespondToAuthChallengeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1628,10 +1391,7 @@ export const serializeAws_json1_1RevokeTokenCommand = async ( input: RevokeTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.RevokeToken", - }; + const headers: __HeaderBag = sharedHeaders("RevokeToken"); let body: any; body = JSON.stringify(serializeAws_json1_1RevokeTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1641,10 +1401,7 @@ export const serializeAws_json1_1SetRiskConfigurationCommand = async ( input: SetRiskConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.SetRiskConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("SetRiskConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1SetRiskConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1654,10 +1411,7 @@ export const serializeAws_json1_1SetUICustomizationCommand = async ( input: SetUICustomizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.SetUICustomization", - }; + const headers: __HeaderBag = sharedHeaders("SetUICustomization"); let body: any; body = JSON.stringify(serializeAws_json1_1SetUICustomizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1667,10 +1421,7 @@ export const serializeAws_json1_1SetUserMFAPreferenceCommand = async ( input: SetUserMFAPreferenceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.SetUserMFAPreference", - }; + const headers: __HeaderBag = sharedHeaders("SetUserMFAPreference"); let body: any; body = JSON.stringify(serializeAws_json1_1SetUserMFAPreferenceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1680,10 +1431,7 @@ export const serializeAws_json1_1SetUserPoolMfaConfigCommand = async ( input: SetUserPoolMfaConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.SetUserPoolMfaConfig", - }; + const headers: __HeaderBag = sharedHeaders("SetUserPoolMfaConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1SetUserPoolMfaConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1693,10 +1441,7 @@ export const serializeAws_json1_1SetUserSettingsCommand = async ( input: SetUserSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.SetUserSettings", - }; + const headers: __HeaderBag = sharedHeaders("SetUserSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1SetUserSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1706,10 +1451,7 @@ export const serializeAws_json1_1SignUpCommand = async ( input: SignUpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.SignUp", - }; + const headers: __HeaderBag = sharedHeaders("SignUp"); let body: any; body = JSON.stringify(serializeAws_json1_1SignUpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1719,10 +1461,7 @@ export const serializeAws_json1_1StartUserImportJobCommand = async ( input: StartUserImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.StartUserImportJob", - }; + const headers: __HeaderBag = sharedHeaders("StartUserImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartUserImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1732,10 +1471,7 @@ export const serializeAws_json1_1StopUserImportJobCommand = async ( input: StopUserImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.StopUserImportJob", - }; + const headers: __HeaderBag = sharedHeaders("StopUserImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopUserImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1745,10 +1481,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1758,10 +1491,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1771,10 +1501,7 @@ export const serializeAws_json1_1UpdateAuthEventFeedbackCommand = async ( input: UpdateAuthEventFeedbackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.UpdateAuthEventFeedback", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAuthEventFeedback"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAuthEventFeedbackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1784,10 +1511,7 @@ export const serializeAws_json1_1UpdateDeviceStatusCommand = async ( input: UpdateDeviceStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.UpdateDeviceStatus", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDeviceStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDeviceStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1797,10 +1521,7 @@ export const serializeAws_json1_1UpdateGroupCommand = async ( input: UpdateGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.UpdateGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1810,10 +1531,7 @@ export const serializeAws_json1_1UpdateIdentityProviderCommand = async ( input: UpdateIdentityProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.UpdateIdentityProvider", - }; + const headers: __HeaderBag = sharedHeaders("UpdateIdentityProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateIdentityProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1823,10 +1541,7 @@ export const serializeAws_json1_1UpdateResourceServerCommand = async ( input: UpdateResourceServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.UpdateResourceServer", - }; + const headers: __HeaderBag = sharedHeaders("UpdateResourceServer"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateResourceServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1836,10 +1551,7 @@ export const serializeAws_json1_1UpdateUserAttributesCommand = async ( input: UpdateUserAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.UpdateUserAttributes", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUserAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1849,10 +1561,7 @@ export const serializeAws_json1_1UpdateUserPoolCommand = async ( input: UpdateUserPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.UpdateUserPool", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUserPool"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserPoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1862,10 +1571,7 @@ export const serializeAws_json1_1UpdateUserPoolClientCommand = async ( input: UpdateUserPoolClientCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.UpdateUserPoolClient", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUserPoolClient"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserPoolClientRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1875,10 +1581,7 @@ export const serializeAws_json1_1UpdateUserPoolDomainCommand = async ( input: UpdateUserPoolDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.UpdateUserPoolDomain", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUserPoolDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserPoolDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1888,10 +1591,7 @@ export const serializeAws_json1_1VerifySoftwareTokenCommand = async ( input: VerifySoftwareTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.VerifySoftwareToken", - }; + const headers: __HeaderBag = sharedHeaders("VerifySoftwareToken"); let body: any; body = JSON.stringify(serializeAws_json1_1VerifySoftwareTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1901,10 +1601,7 @@ export const serializeAws_json1_1VerifyUserAttributeCommand = async ( input: VerifyUserAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityProviderService.VerifyUserAttribute", - }; + const headers: __HeaderBag = sharedHeaders("VerifyUserAttribute"); let body: any; body = JSON.stringify(serializeAws_json1_1VerifyUserAttributeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -13335,6 +13032,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSCognitoIdentityProviderService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts index e9dcbd80c6f78..24d6aa15a6821 100644 --- a/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts @@ -137,10 +137,7 @@ export const serializeAws_json1_1CreateIdentityPoolCommand = async ( input: CreateIdentityPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.CreateIdentityPool", - }; + const headers: __HeaderBag = sharedHeaders("CreateIdentityPool"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateIdentityPoolInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -150,10 +147,7 @@ export const serializeAws_json1_1DeleteIdentitiesCommand = async ( input: DeleteIdentitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.DeleteIdentities", - }; + const headers: __HeaderBag = sharedHeaders("DeleteIdentities"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteIdentitiesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -163,10 +157,7 @@ export const serializeAws_json1_1DeleteIdentityPoolCommand = async ( input: DeleteIdentityPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.DeleteIdentityPool", - }; + const headers: __HeaderBag = sharedHeaders("DeleteIdentityPool"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteIdentityPoolInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -176,10 +167,7 @@ export const serializeAws_json1_1DescribeIdentityCommand = async ( input: DescribeIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.DescribeIdentity", - }; + const headers: __HeaderBag = sharedHeaders("DescribeIdentity"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeIdentityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -189,10 +177,7 @@ export const serializeAws_json1_1DescribeIdentityPoolCommand = async ( input: DescribeIdentityPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.DescribeIdentityPool", - }; + const headers: __HeaderBag = sharedHeaders("DescribeIdentityPool"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeIdentityPoolInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -202,10 +187,7 @@ export const serializeAws_json1_1GetCredentialsForIdentityCommand = async ( input: GetCredentialsForIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.GetCredentialsForIdentity", - }; + const headers: __HeaderBag = sharedHeaders("GetCredentialsForIdentity"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCredentialsForIdentityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -215,10 +197,7 @@ export const serializeAws_json1_1GetIdCommand = async ( input: GetIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.GetId", - }; + const headers: __HeaderBag = sharedHeaders("GetId"); let body: any; body = JSON.stringify(serializeAws_json1_1GetIdInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -228,10 +207,7 @@ export const serializeAws_json1_1GetIdentityPoolRolesCommand = async ( input: GetIdentityPoolRolesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.GetIdentityPoolRoles", - }; + const headers: __HeaderBag = sharedHeaders("GetIdentityPoolRoles"); let body: any; body = JSON.stringify(serializeAws_json1_1GetIdentityPoolRolesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -241,10 +217,7 @@ export const serializeAws_json1_1GetOpenIdTokenCommand = async ( input: GetOpenIdTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.GetOpenIdToken", - }; + const headers: __HeaderBag = sharedHeaders("GetOpenIdToken"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -254,10 +227,7 @@ export const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = asy input: GetOpenIdTokenForDeveloperIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.GetOpenIdTokenForDeveloperIdentity", - }; + const headers: __HeaderBag = sharedHeaders("GetOpenIdTokenForDeveloperIdentity"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -267,10 +237,7 @@ export const serializeAws_json1_1GetPrincipalTagAttributeMapCommand = async ( input: GetPrincipalTagAttributeMapCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.GetPrincipalTagAttributeMap", - }; + const headers: __HeaderBag = sharedHeaders("GetPrincipalTagAttributeMap"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPrincipalTagAttributeMapInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -280,10 +247,7 @@ export const serializeAws_json1_1ListIdentitiesCommand = async ( input: ListIdentitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.ListIdentities", - }; + const headers: __HeaderBag = sharedHeaders("ListIdentities"); let body: any; body = JSON.stringify(serializeAws_json1_1ListIdentitiesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -293,10 +257,7 @@ export const serializeAws_json1_1ListIdentityPoolsCommand = async ( input: ListIdentityPoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.ListIdentityPools", - }; + const headers: __HeaderBag = sharedHeaders("ListIdentityPools"); let body: any; body = JSON.stringify(serializeAws_json1_1ListIdentityPoolsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -306,10 +267,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -319,10 +277,7 @@ export const serializeAws_json1_1LookupDeveloperIdentityCommand = async ( input: LookupDeveloperIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.LookupDeveloperIdentity", - }; + const headers: __HeaderBag = sharedHeaders("LookupDeveloperIdentity"); let body: any; body = JSON.stringify(serializeAws_json1_1LookupDeveloperIdentityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -332,10 +287,7 @@ export const serializeAws_json1_1MergeDeveloperIdentitiesCommand = async ( input: MergeDeveloperIdentitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.MergeDeveloperIdentities", - }; + const headers: __HeaderBag = sharedHeaders("MergeDeveloperIdentities"); let body: any; body = JSON.stringify(serializeAws_json1_1MergeDeveloperIdentitiesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -345,10 +297,7 @@ export const serializeAws_json1_1SetIdentityPoolRolesCommand = async ( input: SetIdentityPoolRolesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.SetIdentityPoolRoles", - }; + const headers: __HeaderBag = sharedHeaders("SetIdentityPoolRoles"); let body: any; body = JSON.stringify(serializeAws_json1_1SetIdentityPoolRolesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -358,10 +307,7 @@ export const serializeAws_json1_1SetPrincipalTagAttributeMapCommand = async ( input: SetPrincipalTagAttributeMapCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.SetPrincipalTagAttributeMap", - }; + const headers: __HeaderBag = sharedHeaders("SetPrincipalTagAttributeMap"); let body: any; body = JSON.stringify(serializeAws_json1_1SetPrincipalTagAttributeMapInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -371,10 +317,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -384,10 +327,7 @@ export const serializeAws_json1_1UnlinkDeveloperIdentityCommand = async ( input: UnlinkDeveloperIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.UnlinkDeveloperIdentity", - }; + const headers: __HeaderBag = sharedHeaders("UnlinkDeveloperIdentity"); let body: any; body = JSON.stringify(serializeAws_json1_1UnlinkDeveloperIdentityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -397,10 +337,7 @@ export const serializeAws_json1_1UnlinkIdentityCommand = async ( input: UnlinkIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.UnlinkIdentity", - }; + const headers: __HeaderBag = sharedHeaders("UnlinkIdentity"); let body: any; body = JSON.stringify(serializeAws_json1_1UnlinkIdentityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -410,10 +347,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -423,10 +357,7 @@ export const serializeAws_json1_1UpdateIdentityPoolCommand = async ( input: UpdateIdentityPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSCognitoIdentityService.UpdateIdentityPool", - }; + const headers: __HeaderBag = sharedHeaders("UpdateIdentityPool"); let body: any; body = JSON.stringify(serializeAws_json1_1IdentityPool(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2809,6 +2740,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSCognitoIdentityService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-comprehend/src/protocols/Aws_json1_1.ts b/clients/client-comprehend/src/protocols/Aws_json1_1.ts index 2897f5a0a8a4f..0d5017f636150 100644 --- a/clients/client-comprehend/src/protocols/Aws_json1_1.ts +++ b/clients/client-comprehend/src/protocols/Aws_json1_1.ts @@ -580,10 +580,7 @@ export const serializeAws_json1_1BatchDetectDominantLanguageCommand = async ( input: BatchDetectDominantLanguageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.BatchDetectDominantLanguage", - }; + const headers: __HeaderBag = sharedHeaders("BatchDetectDominantLanguage"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDetectDominantLanguageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -593,10 +590,7 @@ export const serializeAws_json1_1BatchDetectEntitiesCommand = async ( input: BatchDetectEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.BatchDetectEntities", - }; + const headers: __HeaderBag = sharedHeaders("BatchDetectEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDetectEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -606,10 +600,7 @@ export const serializeAws_json1_1BatchDetectKeyPhrasesCommand = async ( input: BatchDetectKeyPhrasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.BatchDetectKeyPhrases", - }; + const headers: __HeaderBag = sharedHeaders("BatchDetectKeyPhrases"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDetectKeyPhrasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -619,10 +610,7 @@ export const serializeAws_json1_1BatchDetectSentimentCommand = async ( input: BatchDetectSentimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.BatchDetectSentiment", - }; + const headers: __HeaderBag = sharedHeaders("BatchDetectSentiment"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDetectSentimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -632,10 +620,7 @@ export const serializeAws_json1_1BatchDetectSyntaxCommand = async ( input: BatchDetectSyntaxCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.BatchDetectSyntax", - }; + const headers: __HeaderBag = sharedHeaders("BatchDetectSyntax"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDetectSyntaxRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -645,10 +630,7 @@ export const serializeAws_json1_1BatchDetectTargetedSentimentCommand = async ( input: BatchDetectTargetedSentimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.BatchDetectTargetedSentiment", - }; + const headers: __HeaderBag = sharedHeaders("BatchDetectTargetedSentiment"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDetectTargetedSentimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -658,10 +640,7 @@ export const serializeAws_json1_1ClassifyDocumentCommand = async ( input: ClassifyDocumentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ClassifyDocument", - }; + const headers: __HeaderBag = sharedHeaders("ClassifyDocument"); let body: any; body = JSON.stringify(serializeAws_json1_1ClassifyDocumentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -671,10 +650,7 @@ export const serializeAws_json1_1ContainsPiiEntitiesCommand = async ( input: ContainsPiiEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ContainsPiiEntities", - }; + const headers: __HeaderBag = sharedHeaders("ContainsPiiEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1ContainsPiiEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -684,10 +660,7 @@ export const serializeAws_json1_1CreateDatasetCommand = async ( input: CreateDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.CreateDataset", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -697,10 +670,7 @@ export const serializeAws_json1_1CreateDocumentClassifierCommand = async ( input: CreateDocumentClassifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.CreateDocumentClassifier", - }; + const headers: __HeaderBag = sharedHeaders("CreateDocumentClassifier"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDocumentClassifierRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -710,10 +680,7 @@ export const serializeAws_json1_1CreateEndpointCommand = async ( input: CreateEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.CreateEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("CreateEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -723,10 +690,7 @@ export const serializeAws_json1_1CreateEntityRecognizerCommand = async ( input: CreateEntityRecognizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.CreateEntityRecognizer", - }; + const headers: __HeaderBag = sharedHeaders("CreateEntityRecognizer"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEntityRecognizerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -736,10 +700,7 @@ export const serializeAws_json1_1CreateFlywheelCommand = async ( input: CreateFlywheelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.CreateFlywheel", - }; + const headers: __HeaderBag = sharedHeaders("CreateFlywheel"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFlywheelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -749,10 +710,7 @@ export const serializeAws_json1_1DeleteDocumentClassifierCommand = async ( input: DeleteDocumentClassifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DeleteDocumentClassifier", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDocumentClassifier"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDocumentClassifierRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -762,10 +720,7 @@ export const serializeAws_json1_1DeleteEndpointCommand = async ( input: DeleteEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DeleteEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -775,10 +730,7 @@ export const serializeAws_json1_1DeleteEntityRecognizerCommand = async ( input: DeleteEntityRecognizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DeleteEntityRecognizer", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEntityRecognizer"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEntityRecognizerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -788,10 +740,7 @@ export const serializeAws_json1_1DeleteFlywheelCommand = async ( input: DeleteFlywheelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DeleteFlywheel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFlywheel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFlywheelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -801,10 +750,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DeleteResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -814,10 +760,7 @@ export const serializeAws_json1_1DescribeDatasetCommand = async ( input: DescribeDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeDataset", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -827,10 +770,7 @@ export const serializeAws_json1_1DescribeDocumentClassificationJobCommand = asyn input: DescribeDocumentClassificationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeDocumentClassificationJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDocumentClassificationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDocumentClassificationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -840,10 +780,7 @@ export const serializeAws_json1_1DescribeDocumentClassifierCommand = async ( input: DescribeDocumentClassifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeDocumentClassifier", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDocumentClassifier"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDocumentClassifierRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -853,10 +790,7 @@ export const serializeAws_json1_1DescribeDominantLanguageDetectionJobCommand = a input: DescribeDominantLanguageDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeDominantLanguageDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDominantLanguageDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDominantLanguageDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -866,10 +800,7 @@ export const serializeAws_json1_1DescribeEndpointCommand = async ( input: DescribeEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -879,10 +810,7 @@ export const serializeAws_json1_1DescribeEntitiesDetectionJobCommand = async ( input: DescribeEntitiesDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeEntitiesDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEntitiesDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEntitiesDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -892,10 +820,7 @@ export const serializeAws_json1_1DescribeEntityRecognizerCommand = async ( input: DescribeEntityRecognizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeEntityRecognizer", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEntityRecognizer"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEntityRecognizerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -905,10 +830,7 @@ export const serializeAws_json1_1DescribeEventsDetectionJobCommand = async ( input: DescribeEventsDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeEventsDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventsDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventsDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -918,10 +840,7 @@ export const serializeAws_json1_1DescribeFlywheelCommand = async ( input: DescribeFlywheelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeFlywheel", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFlywheel"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFlywheelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -931,10 +850,7 @@ export const serializeAws_json1_1DescribeFlywheelIterationCommand = async ( input: DescribeFlywheelIterationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeFlywheelIteration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFlywheelIteration"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFlywheelIterationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -944,10 +860,7 @@ export const serializeAws_json1_1DescribeKeyPhrasesDetectionJobCommand = async ( input: DescribeKeyPhrasesDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeKeyPhrasesDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeKeyPhrasesDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeKeyPhrasesDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -957,10 +870,7 @@ export const serializeAws_json1_1DescribePiiEntitiesDetectionJobCommand = async input: DescribePiiEntitiesDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribePiiEntitiesDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribePiiEntitiesDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePiiEntitiesDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -970,10 +880,7 @@ export const serializeAws_json1_1DescribeResourcePolicyCommand = async ( input: DescribeResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DescribeResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -983,10 +890,7 @@ export const serializeAws_json1_1DescribeSentimentDetectionJobCommand = async ( input: DescribeSentimentDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeSentimentDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSentimentDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSentimentDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -996,10 +900,7 @@ export const serializeAws_json1_1DescribeTargetedSentimentDetectionJobCommand = input: DescribeTargetedSentimentDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeTargetedSentimentDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTargetedSentimentDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTargetedSentimentDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1009,10 +910,7 @@ export const serializeAws_json1_1DescribeTopicsDetectionJobCommand = async ( input: DescribeTopicsDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DescribeTopicsDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTopicsDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTopicsDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1022,10 +920,7 @@ export const serializeAws_json1_1DetectDominantLanguageCommand = async ( input: DetectDominantLanguageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DetectDominantLanguage", - }; + const headers: __HeaderBag = sharedHeaders("DetectDominantLanguage"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectDominantLanguageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1035,10 +930,7 @@ export const serializeAws_json1_1DetectEntitiesCommand = async ( input: DetectEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DetectEntities", - }; + const headers: __HeaderBag = sharedHeaders("DetectEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1048,10 +940,7 @@ export const serializeAws_json1_1DetectKeyPhrasesCommand = async ( input: DetectKeyPhrasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DetectKeyPhrases", - }; + const headers: __HeaderBag = sharedHeaders("DetectKeyPhrases"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectKeyPhrasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1061,10 +950,7 @@ export const serializeAws_json1_1DetectPiiEntitiesCommand = async ( input: DetectPiiEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DetectPiiEntities", - }; + const headers: __HeaderBag = sharedHeaders("DetectPiiEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectPiiEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1074,10 +960,7 @@ export const serializeAws_json1_1DetectSentimentCommand = async ( input: DetectSentimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DetectSentiment", - }; + const headers: __HeaderBag = sharedHeaders("DetectSentiment"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectSentimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1087,10 +970,7 @@ export const serializeAws_json1_1DetectSyntaxCommand = async ( input: DetectSyntaxCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DetectSyntax", - }; + const headers: __HeaderBag = sharedHeaders("DetectSyntax"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectSyntaxRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1100,10 +980,7 @@ export const serializeAws_json1_1DetectTargetedSentimentCommand = async ( input: DetectTargetedSentimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.DetectTargetedSentiment", - }; + const headers: __HeaderBag = sharedHeaders("DetectTargetedSentiment"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectTargetedSentimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1113,10 +990,7 @@ export const serializeAws_json1_1ImportModelCommand = async ( input: ImportModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ImportModel", - }; + const headers: __HeaderBag = sharedHeaders("ImportModel"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1126,10 +1000,7 @@ export const serializeAws_json1_1ListDatasetsCommand = async ( input: ListDatasetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListDatasets", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatasetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1139,10 +1010,7 @@ export const serializeAws_json1_1ListDocumentClassificationJobsCommand = async ( input: ListDocumentClassificationJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListDocumentClassificationJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListDocumentClassificationJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDocumentClassificationJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1152,10 +1020,7 @@ export const serializeAws_json1_1ListDocumentClassifiersCommand = async ( input: ListDocumentClassifiersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListDocumentClassifiers", - }; + const headers: __HeaderBag = sharedHeaders("ListDocumentClassifiers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDocumentClassifiersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1165,10 +1030,7 @@ export const serializeAws_json1_1ListDocumentClassifierSummariesCommand = async input: ListDocumentClassifierSummariesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListDocumentClassifierSummaries", - }; + const headers: __HeaderBag = sharedHeaders("ListDocumentClassifierSummaries"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDocumentClassifierSummariesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1178,10 +1040,7 @@ export const serializeAws_json1_1ListDominantLanguageDetectionJobsCommand = asyn input: ListDominantLanguageDetectionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListDominantLanguageDetectionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListDominantLanguageDetectionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDominantLanguageDetectionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1191,10 +1050,7 @@ export const serializeAws_json1_1ListEndpointsCommand = async ( input: ListEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("ListEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1204,10 +1060,7 @@ export const serializeAws_json1_1ListEntitiesDetectionJobsCommand = async ( input: ListEntitiesDetectionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListEntitiesDetectionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListEntitiesDetectionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEntitiesDetectionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1217,10 +1070,7 @@ export const serializeAws_json1_1ListEntityRecognizersCommand = async ( input: ListEntityRecognizersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListEntityRecognizers", - }; + const headers: __HeaderBag = sharedHeaders("ListEntityRecognizers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEntityRecognizersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1230,10 +1080,7 @@ export const serializeAws_json1_1ListEntityRecognizerSummariesCommand = async ( input: ListEntityRecognizerSummariesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListEntityRecognizerSummaries", - }; + const headers: __HeaderBag = sharedHeaders("ListEntityRecognizerSummaries"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEntityRecognizerSummariesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1243,10 +1090,7 @@ export const serializeAws_json1_1ListEventsDetectionJobsCommand = async ( input: ListEventsDetectionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListEventsDetectionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListEventsDetectionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEventsDetectionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1256,10 +1100,7 @@ export const serializeAws_json1_1ListFlywheelIterationHistoryCommand = async ( input: ListFlywheelIterationHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListFlywheelIterationHistory", - }; + const headers: __HeaderBag = sharedHeaders("ListFlywheelIterationHistory"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFlywheelIterationHistoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1269,10 +1110,7 @@ export const serializeAws_json1_1ListFlywheelsCommand = async ( input: ListFlywheelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListFlywheels", - }; + const headers: __HeaderBag = sharedHeaders("ListFlywheels"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFlywheelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1282,10 +1120,7 @@ export const serializeAws_json1_1ListKeyPhrasesDetectionJobsCommand = async ( input: ListKeyPhrasesDetectionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListKeyPhrasesDetectionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListKeyPhrasesDetectionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListKeyPhrasesDetectionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1295,10 +1130,7 @@ export const serializeAws_json1_1ListPiiEntitiesDetectionJobsCommand = async ( input: ListPiiEntitiesDetectionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListPiiEntitiesDetectionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListPiiEntitiesDetectionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPiiEntitiesDetectionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1308,10 +1140,7 @@ export const serializeAws_json1_1ListSentimentDetectionJobsCommand = async ( input: ListSentimentDetectionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListSentimentDetectionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListSentimentDetectionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSentimentDetectionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1321,10 +1150,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1334,10 +1160,7 @@ export const serializeAws_json1_1ListTargetedSentimentDetectionJobsCommand = asy input: ListTargetedSentimentDetectionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListTargetedSentimentDetectionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListTargetedSentimentDetectionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTargetedSentimentDetectionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1347,10 +1170,7 @@ export const serializeAws_json1_1ListTopicsDetectionJobsCommand = async ( input: ListTopicsDetectionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.ListTopicsDetectionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListTopicsDetectionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTopicsDetectionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1360,10 +1180,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( input: PutResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.PutResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1373,10 +1190,7 @@ export const serializeAws_json1_1StartDocumentClassificationJobCommand = async ( input: StartDocumentClassificationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StartDocumentClassificationJob", - }; + const headers: __HeaderBag = sharedHeaders("StartDocumentClassificationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartDocumentClassificationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1386,10 +1200,7 @@ export const serializeAws_json1_1StartDominantLanguageDetectionJobCommand = asyn input: StartDominantLanguageDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StartDominantLanguageDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartDominantLanguageDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartDominantLanguageDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1399,10 +1210,7 @@ export const serializeAws_json1_1StartEntitiesDetectionJobCommand = async ( input: StartEntitiesDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StartEntitiesDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartEntitiesDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartEntitiesDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1412,10 +1220,7 @@ export const serializeAws_json1_1StartEventsDetectionJobCommand = async ( input: StartEventsDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StartEventsDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartEventsDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartEventsDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1425,10 +1230,7 @@ export const serializeAws_json1_1StartFlywheelIterationCommand = async ( input: StartFlywheelIterationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StartFlywheelIteration", - }; + const headers: __HeaderBag = sharedHeaders("StartFlywheelIteration"); let body: any; body = JSON.stringify(serializeAws_json1_1StartFlywheelIterationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1438,10 +1240,7 @@ export const serializeAws_json1_1StartKeyPhrasesDetectionJobCommand = async ( input: StartKeyPhrasesDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StartKeyPhrasesDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartKeyPhrasesDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartKeyPhrasesDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1451,10 +1250,7 @@ export const serializeAws_json1_1StartPiiEntitiesDetectionJobCommand = async ( input: StartPiiEntitiesDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StartPiiEntitiesDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartPiiEntitiesDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartPiiEntitiesDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1464,10 +1260,7 @@ export const serializeAws_json1_1StartSentimentDetectionJobCommand = async ( input: StartSentimentDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StartSentimentDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartSentimentDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartSentimentDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1477,10 +1270,7 @@ export const serializeAws_json1_1StartTargetedSentimentDetectionJobCommand = asy input: StartTargetedSentimentDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StartTargetedSentimentDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartTargetedSentimentDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartTargetedSentimentDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1490,10 +1280,7 @@ export const serializeAws_json1_1StartTopicsDetectionJobCommand = async ( input: StartTopicsDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StartTopicsDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartTopicsDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartTopicsDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1503,10 +1290,7 @@ export const serializeAws_json1_1StopDominantLanguageDetectionJobCommand = async input: StopDominantLanguageDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StopDominantLanguageDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StopDominantLanguageDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopDominantLanguageDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1516,10 +1300,7 @@ export const serializeAws_json1_1StopEntitiesDetectionJobCommand = async ( input: StopEntitiesDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StopEntitiesDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StopEntitiesDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopEntitiesDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1529,10 +1310,7 @@ export const serializeAws_json1_1StopEventsDetectionJobCommand = async ( input: StopEventsDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StopEventsDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StopEventsDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopEventsDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1542,10 +1320,7 @@ export const serializeAws_json1_1StopKeyPhrasesDetectionJobCommand = async ( input: StopKeyPhrasesDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StopKeyPhrasesDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StopKeyPhrasesDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopKeyPhrasesDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1555,10 +1330,7 @@ export const serializeAws_json1_1StopPiiEntitiesDetectionJobCommand = async ( input: StopPiiEntitiesDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StopPiiEntitiesDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StopPiiEntitiesDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopPiiEntitiesDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1568,10 +1340,7 @@ export const serializeAws_json1_1StopSentimentDetectionJobCommand = async ( input: StopSentimentDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StopSentimentDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StopSentimentDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopSentimentDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1581,10 +1350,7 @@ export const serializeAws_json1_1StopTargetedSentimentDetectionJobCommand = asyn input: StopTargetedSentimentDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StopTargetedSentimentDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StopTargetedSentimentDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopTargetedSentimentDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1594,10 +1360,7 @@ export const serializeAws_json1_1StopTrainingDocumentClassifierCommand = async ( input: StopTrainingDocumentClassifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StopTrainingDocumentClassifier", - }; + const headers: __HeaderBag = sharedHeaders("StopTrainingDocumentClassifier"); let body: any; body = JSON.stringify(serializeAws_json1_1StopTrainingDocumentClassifierRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1607,10 +1370,7 @@ export const serializeAws_json1_1StopTrainingEntityRecognizerCommand = async ( input: StopTrainingEntityRecognizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.StopTrainingEntityRecognizer", - }; + const headers: __HeaderBag = sharedHeaders("StopTrainingEntityRecognizer"); let body: any; body = JSON.stringify(serializeAws_json1_1StopTrainingEntityRecognizerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1620,10 +1380,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1633,10 +1390,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1646,10 +1400,7 @@ export const serializeAws_json1_1UpdateEndpointCommand = async ( input: UpdateEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.UpdateEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1659,10 +1410,7 @@ export const serializeAws_json1_1UpdateFlywheelCommand = async ( input: UpdateFlywheelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Comprehend_20171127.UpdateFlywheel", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFlywheel"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFlywheelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -10727,6 +10475,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `Comprehend_20171127.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts index 32579e7e43c43..98e067f01bd40 100644 --- a/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts +++ b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts @@ -194,10 +194,7 @@ export const serializeAws_json1_1DescribeEntitiesDetectionV2JobCommand = async ( input: DescribeEntitiesDetectionV2JobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.DescribeEntitiesDetectionV2Job", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEntitiesDetectionV2Job"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEntitiesDetectionV2JobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -207,10 +204,7 @@ export const serializeAws_json1_1DescribeICD10CMInferenceJobCommand = async ( input: DescribeICD10CMInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.DescribeICD10CMInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeICD10CMInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeICD10CMInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -220,10 +214,7 @@ export const serializeAws_json1_1DescribePHIDetectionJobCommand = async ( input: DescribePHIDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.DescribePHIDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribePHIDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePHIDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -233,10 +224,7 @@ export const serializeAws_json1_1DescribeRxNormInferenceJobCommand = async ( input: DescribeRxNormInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.DescribeRxNormInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRxNormInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRxNormInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -246,10 +234,7 @@ export const serializeAws_json1_1DescribeSNOMEDCTInferenceJobCommand = async ( input: DescribeSNOMEDCTInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.DescribeSNOMEDCTInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSNOMEDCTInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSNOMEDCTInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -259,10 +244,7 @@ export const serializeAws_json1_1DetectEntitiesCommand = async ( input: DetectEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.DetectEntities", - }; + const headers: __HeaderBag = sharedHeaders("DetectEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -272,10 +254,7 @@ export const serializeAws_json1_1DetectEntitiesV2Command = async ( input: DetectEntitiesV2CommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.DetectEntitiesV2", - }; + const headers: __HeaderBag = sharedHeaders("DetectEntitiesV2"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectEntitiesV2Request(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -285,10 +264,7 @@ export const serializeAws_json1_1DetectPHICommand = async ( input: DetectPHICommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.DetectPHI", - }; + const headers: __HeaderBag = sharedHeaders("DetectPHI"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectPHIRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -298,10 +274,7 @@ export const serializeAws_json1_1InferICD10CMCommand = async ( input: InferICD10CMCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.InferICD10CM", - }; + const headers: __HeaderBag = sharedHeaders("InferICD10CM"); let body: any; body = JSON.stringify(serializeAws_json1_1InferICD10CMRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -311,10 +284,7 @@ export const serializeAws_json1_1InferRxNormCommand = async ( input: InferRxNormCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.InferRxNorm", - }; + const headers: __HeaderBag = sharedHeaders("InferRxNorm"); let body: any; body = JSON.stringify(serializeAws_json1_1InferRxNormRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -324,10 +294,7 @@ export const serializeAws_json1_1InferSNOMEDCTCommand = async ( input: InferSNOMEDCTCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.InferSNOMEDCT", - }; + const headers: __HeaderBag = sharedHeaders("InferSNOMEDCT"); let body: any; body = JSON.stringify(serializeAws_json1_1InferSNOMEDCTRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -337,10 +304,7 @@ export const serializeAws_json1_1ListEntitiesDetectionV2JobsCommand = async ( input: ListEntitiesDetectionV2JobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.ListEntitiesDetectionV2Jobs", - }; + const headers: __HeaderBag = sharedHeaders("ListEntitiesDetectionV2Jobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEntitiesDetectionV2JobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -350,10 +314,7 @@ export const serializeAws_json1_1ListICD10CMInferenceJobsCommand = async ( input: ListICD10CMInferenceJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.ListICD10CMInferenceJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListICD10CMInferenceJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListICD10CMInferenceJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -363,10 +324,7 @@ export const serializeAws_json1_1ListPHIDetectionJobsCommand = async ( input: ListPHIDetectionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.ListPHIDetectionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListPHIDetectionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPHIDetectionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -376,10 +334,7 @@ export const serializeAws_json1_1ListRxNormInferenceJobsCommand = async ( input: ListRxNormInferenceJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.ListRxNormInferenceJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListRxNormInferenceJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRxNormInferenceJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -389,10 +344,7 @@ export const serializeAws_json1_1ListSNOMEDCTInferenceJobsCommand = async ( input: ListSNOMEDCTInferenceJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.ListSNOMEDCTInferenceJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListSNOMEDCTInferenceJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSNOMEDCTInferenceJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -402,10 +354,7 @@ export const serializeAws_json1_1StartEntitiesDetectionV2JobCommand = async ( input: StartEntitiesDetectionV2JobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.StartEntitiesDetectionV2Job", - }; + const headers: __HeaderBag = sharedHeaders("StartEntitiesDetectionV2Job"); let body: any; body = JSON.stringify(serializeAws_json1_1StartEntitiesDetectionV2JobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -415,10 +364,7 @@ export const serializeAws_json1_1StartICD10CMInferenceJobCommand = async ( input: StartICD10CMInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.StartICD10CMInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("StartICD10CMInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartICD10CMInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -428,10 +374,7 @@ export const serializeAws_json1_1StartPHIDetectionJobCommand = async ( input: StartPHIDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.StartPHIDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartPHIDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartPHIDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -441,10 +384,7 @@ export const serializeAws_json1_1StartRxNormInferenceJobCommand = async ( input: StartRxNormInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.StartRxNormInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("StartRxNormInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartRxNormInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -454,10 +394,7 @@ export const serializeAws_json1_1StartSNOMEDCTInferenceJobCommand = async ( input: StartSNOMEDCTInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.StartSNOMEDCTInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("StartSNOMEDCTInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartSNOMEDCTInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -467,10 +404,7 @@ export const serializeAws_json1_1StopEntitiesDetectionV2JobCommand = async ( input: StopEntitiesDetectionV2JobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.StopEntitiesDetectionV2Job", - }; + const headers: __HeaderBag = sharedHeaders("StopEntitiesDetectionV2Job"); let body: any; body = JSON.stringify(serializeAws_json1_1StopEntitiesDetectionV2JobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -480,10 +414,7 @@ export const serializeAws_json1_1StopICD10CMInferenceJobCommand = async ( input: StopICD10CMInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.StopICD10CMInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("StopICD10CMInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopICD10CMInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -493,10 +424,7 @@ export const serializeAws_json1_1StopPHIDetectionJobCommand = async ( input: StopPHIDetectionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.StopPHIDetectionJob", - }; + const headers: __HeaderBag = sharedHeaders("StopPHIDetectionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopPHIDetectionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -506,10 +434,7 @@ export const serializeAws_json1_1StopRxNormInferenceJobCommand = async ( input: StopRxNormInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.StopRxNormInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("StopRxNormInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopRxNormInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -519,10 +444,7 @@ export const serializeAws_json1_1StopSNOMEDCTInferenceJobCommand = async ( input: StopSNOMEDCTInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ComprehendMedical_20181030.StopSNOMEDCTInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("StopSNOMEDCTInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopSNOMEDCTInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3125,6 +3047,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `ComprehendMedical_20181030.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts index 2a1d78a062cdc..e333f3d889985 100644 --- a/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts +++ b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts @@ -224,10 +224,7 @@ export const serializeAws_json1_0DeleteRecommendationPreferencesCommand = async input: DeleteRecommendationPreferencesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.DeleteRecommendationPreferences", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRecommendationPreferences"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteRecommendationPreferencesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -237,10 +234,7 @@ export const serializeAws_json1_0DescribeRecommendationExportJobsCommand = async input: DescribeRecommendationExportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.DescribeRecommendationExportJobs", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRecommendationExportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeRecommendationExportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -250,10 +244,7 @@ export const serializeAws_json1_0ExportAutoScalingGroupRecommendationsCommand = input: ExportAutoScalingGroupRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.ExportAutoScalingGroupRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("ExportAutoScalingGroupRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_0ExportAutoScalingGroupRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -263,10 +254,7 @@ export const serializeAws_json1_0ExportEBSVolumeRecommendationsCommand = async ( input: ExportEBSVolumeRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.ExportEBSVolumeRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("ExportEBSVolumeRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_0ExportEBSVolumeRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -276,10 +264,7 @@ export const serializeAws_json1_0ExportEC2InstanceRecommendationsCommand = async input: ExportEC2InstanceRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.ExportEC2InstanceRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("ExportEC2InstanceRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_0ExportEC2InstanceRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -289,10 +274,7 @@ export const serializeAws_json1_0ExportECSServiceRecommendationsCommand = async input: ExportECSServiceRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.ExportECSServiceRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("ExportECSServiceRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_0ExportECSServiceRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -302,10 +284,7 @@ export const serializeAws_json1_0ExportLambdaFunctionRecommendationsCommand = as input: ExportLambdaFunctionRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.ExportLambdaFunctionRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("ExportLambdaFunctionRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_0ExportLambdaFunctionRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -315,10 +294,7 @@ export const serializeAws_json1_0GetAutoScalingGroupRecommendationsCommand = asy input: GetAutoScalingGroupRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetAutoScalingGroupRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("GetAutoScalingGroupRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_0GetAutoScalingGroupRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -328,10 +304,7 @@ export const serializeAws_json1_0GetEBSVolumeRecommendationsCommand = async ( input: GetEBSVolumeRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetEBSVolumeRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("GetEBSVolumeRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_0GetEBSVolumeRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -341,10 +314,7 @@ export const serializeAws_json1_0GetEC2InstanceRecommendationsCommand = async ( input: GetEC2InstanceRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetEC2InstanceRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("GetEC2InstanceRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_0GetEC2InstanceRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -354,10 +324,7 @@ export const serializeAws_json1_0GetEC2RecommendationProjectedMetricsCommand = a input: GetEC2RecommendationProjectedMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetEC2RecommendationProjectedMetrics", - }; + const headers: __HeaderBag = sharedHeaders("GetEC2RecommendationProjectedMetrics"); let body: any; body = JSON.stringify(serializeAws_json1_0GetEC2RecommendationProjectedMetricsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -367,10 +334,7 @@ export const serializeAws_json1_0GetECSServiceRecommendationProjectedMetricsComm input: GetECSServiceRecommendationProjectedMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetECSServiceRecommendationProjectedMetrics", - }; + const headers: __HeaderBag = sharedHeaders("GetECSServiceRecommendationProjectedMetrics"); let body: any; body = JSON.stringify(serializeAws_json1_0GetECSServiceRecommendationProjectedMetricsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -380,10 +344,7 @@ export const serializeAws_json1_0GetECSServiceRecommendationsCommand = async ( input: GetECSServiceRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetECSServiceRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("GetECSServiceRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_0GetECSServiceRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -393,10 +354,7 @@ export const serializeAws_json1_0GetEffectiveRecommendationPreferencesCommand = input: GetEffectiveRecommendationPreferencesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetEffectiveRecommendationPreferences", - }; + const headers: __HeaderBag = sharedHeaders("GetEffectiveRecommendationPreferences"); let body: any; body = JSON.stringify(serializeAws_json1_0GetEffectiveRecommendationPreferencesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -406,10 +364,7 @@ export const serializeAws_json1_0GetEnrollmentStatusCommand = async ( input: GetEnrollmentStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetEnrollmentStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetEnrollmentStatus"); let body: any; body = JSON.stringify(serializeAws_json1_0GetEnrollmentStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -419,10 +374,7 @@ export const serializeAws_json1_0GetEnrollmentStatusesForOrganizationCommand = a input: GetEnrollmentStatusesForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetEnrollmentStatusesForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("GetEnrollmentStatusesForOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_0GetEnrollmentStatusesForOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -432,10 +384,7 @@ export const serializeAws_json1_0GetLambdaFunctionRecommendationsCommand = async input: GetLambdaFunctionRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetLambdaFunctionRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("GetLambdaFunctionRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_0GetLambdaFunctionRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -445,10 +394,7 @@ export const serializeAws_json1_0GetRecommendationPreferencesCommand = async ( input: GetRecommendationPreferencesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetRecommendationPreferences", - }; + const headers: __HeaderBag = sharedHeaders("GetRecommendationPreferences"); let body: any; body = JSON.stringify(serializeAws_json1_0GetRecommendationPreferencesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -458,10 +404,7 @@ export const serializeAws_json1_0GetRecommendationSummariesCommand = async ( input: GetRecommendationSummariesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.GetRecommendationSummaries", - }; + const headers: __HeaderBag = sharedHeaders("GetRecommendationSummaries"); let body: any; body = JSON.stringify(serializeAws_json1_0GetRecommendationSummariesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -471,10 +414,7 @@ export const serializeAws_json1_0PutRecommendationPreferencesCommand = async ( input: PutRecommendationPreferencesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.PutRecommendationPreferences", - }; + const headers: __HeaderBag = sharedHeaders("PutRecommendationPreferences"); let body: any; body = JSON.stringify(serializeAws_json1_0PutRecommendationPreferencesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -484,10 +424,7 @@ export const serializeAws_json1_0UpdateEnrollmentStatusCommand = async ( input: UpdateEnrollmentStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ComputeOptimizerService.UpdateEnrollmentStatus", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEnrollmentStatus"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateEnrollmentStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4070,6 +4007,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `ComputeOptimizerService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-config-service/src/protocols/Aws_json1_1.ts b/clients/client-config-service/src/protocols/Aws_json1_1.ts index 006a856348b95..f8677eeac1e24 100644 --- a/clients/client-config-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-config-service/src/protocols/Aws_json1_1.ts @@ -685,10 +685,7 @@ export const serializeAws_json1_1BatchGetAggregateResourceConfigCommand = async input: BatchGetAggregateResourceConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.BatchGetAggregateResourceConfig", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetAggregateResourceConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetAggregateResourceConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -698,10 +695,7 @@ export const serializeAws_json1_1BatchGetResourceConfigCommand = async ( input: BatchGetResourceConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.BatchGetResourceConfig", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetResourceConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetResourceConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -711,10 +705,7 @@ export const serializeAws_json1_1DeleteAggregationAuthorizationCommand = async ( input: DeleteAggregationAuthorizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteAggregationAuthorization", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAggregationAuthorization"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAggregationAuthorizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -724,10 +715,7 @@ export const serializeAws_json1_1DeleteConfigRuleCommand = async ( input: DeleteConfigRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteConfigRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConfigRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConfigRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -737,10 +725,7 @@ export const serializeAws_json1_1DeleteConfigurationAggregatorCommand = async ( input: DeleteConfigurationAggregatorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteConfigurationAggregator", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConfigurationAggregator"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConfigurationAggregatorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -750,10 +735,7 @@ export const serializeAws_json1_1DeleteConfigurationRecorderCommand = async ( input: DeleteConfigurationRecorderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteConfigurationRecorder", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConfigurationRecorder"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConfigurationRecorderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -763,10 +745,7 @@ export const serializeAws_json1_1DeleteConformancePackCommand = async ( input: DeleteConformancePackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteConformancePack", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConformancePack"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConformancePackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -776,10 +755,7 @@ export const serializeAws_json1_1DeleteDeliveryChannelCommand = async ( input: DeleteDeliveryChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteDeliveryChannel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDeliveryChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDeliveryChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -789,10 +765,7 @@ export const serializeAws_json1_1DeleteEvaluationResultsCommand = async ( input: DeleteEvaluationResultsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteEvaluationResults", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEvaluationResults"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEvaluationResultsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -802,10 +775,7 @@ export const serializeAws_json1_1DeleteOrganizationConfigRuleCommand = async ( input: DeleteOrganizationConfigRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteOrganizationConfigRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteOrganizationConfigRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteOrganizationConfigRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -815,10 +785,7 @@ export const serializeAws_json1_1DeleteOrganizationConformancePackCommand = asyn input: DeleteOrganizationConformancePackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteOrganizationConformancePack", - }; + const headers: __HeaderBag = sharedHeaders("DeleteOrganizationConformancePack"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteOrganizationConformancePackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -828,10 +795,7 @@ export const serializeAws_json1_1DeletePendingAggregationRequestCommand = async input: DeletePendingAggregationRequestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeletePendingAggregationRequest", - }; + const headers: __HeaderBag = sharedHeaders("DeletePendingAggregationRequest"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePendingAggregationRequestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -841,10 +805,7 @@ export const serializeAws_json1_1DeleteRemediationConfigurationCommand = async ( input: DeleteRemediationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteRemediationConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRemediationConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRemediationConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -854,10 +815,7 @@ export const serializeAws_json1_1DeleteRemediationExceptionsCommand = async ( input: DeleteRemediationExceptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteRemediationExceptions", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRemediationExceptions"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRemediationExceptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -867,10 +825,7 @@ export const serializeAws_json1_1DeleteResourceConfigCommand = async ( input: DeleteResourceConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteResourceConfig", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourceConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourceConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -880,10 +835,7 @@ export const serializeAws_json1_1DeleteRetentionConfigurationCommand = async ( input: DeleteRetentionConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteRetentionConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRetentionConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRetentionConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -893,10 +845,7 @@ export const serializeAws_json1_1DeleteStoredQueryCommand = async ( input: DeleteStoredQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeleteStoredQuery", - }; + const headers: __HeaderBag = sharedHeaders("DeleteStoredQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteStoredQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -906,10 +855,7 @@ export const serializeAws_json1_1DeliverConfigSnapshotCommand = async ( input: DeliverConfigSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DeliverConfigSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DeliverConfigSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DeliverConfigSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -919,10 +865,7 @@ export const serializeAws_json1_1DescribeAggregateComplianceByConfigRulesCommand input: DescribeAggregateComplianceByConfigRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeAggregateComplianceByConfigRules", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAggregateComplianceByConfigRules"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAggregateComplianceByConfigRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -932,10 +875,7 @@ export const serializeAws_json1_1DescribeAggregateComplianceByConformancePacksCo input: DescribeAggregateComplianceByConformancePacksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeAggregateComplianceByConformancePacks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAggregateComplianceByConformancePacks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAggregateComplianceByConformancePacksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -945,10 +885,7 @@ export const serializeAws_json1_1DescribeAggregationAuthorizationsCommand = asyn input: DescribeAggregationAuthorizationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeAggregationAuthorizations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAggregationAuthorizations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAggregationAuthorizationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -958,10 +895,7 @@ export const serializeAws_json1_1DescribeComplianceByConfigRuleCommand = async ( input: DescribeComplianceByConfigRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeComplianceByConfigRule", - }; + const headers: __HeaderBag = sharedHeaders("DescribeComplianceByConfigRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeComplianceByConfigRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -971,10 +905,7 @@ export const serializeAws_json1_1DescribeComplianceByResourceCommand = async ( input: DescribeComplianceByResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeComplianceByResource", - }; + const headers: __HeaderBag = sharedHeaders("DescribeComplianceByResource"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeComplianceByResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -984,10 +915,7 @@ export const serializeAws_json1_1DescribeConfigRuleEvaluationStatusCommand = asy input: DescribeConfigRuleEvaluationStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeConfigRuleEvaluationStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConfigRuleEvaluationStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConfigRuleEvaluationStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -997,10 +925,7 @@ export const serializeAws_json1_1DescribeConfigRulesCommand = async ( input: DescribeConfigRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeConfigRules", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConfigRules"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConfigRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1010,10 +935,7 @@ export const serializeAws_json1_1DescribeConfigurationAggregatorsCommand = async input: DescribeConfigurationAggregatorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeConfigurationAggregators", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConfigurationAggregators"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConfigurationAggregatorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1023,10 +945,7 @@ export const serializeAws_json1_1DescribeConfigurationAggregatorSourcesStatusCom input: DescribeConfigurationAggregatorSourcesStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeConfigurationAggregatorSourcesStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConfigurationAggregatorSourcesStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConfigurationAggregatorSourcesStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1036,10 +955,7 @@ export const serializeAws_json1_1DescribeConfigurationRecordersCommand = async ( input: DescribeConfigurationRecordersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeConfigurationRecorders", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConfigurationRecorders"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConfigurationRecordersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1049,10 +965,7 @@ export const serializeAws_json1_1DescribeConfigurationRecorderStatusCommand = as input: DescribeConfigurationRecorderStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeConfigurationRecorderStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConfigurationRecorderStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConfigurationRecorderStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1062,10 +975,7 @@ export const serializeAws_json1_1DescribeConformancePackComplianceCommand = asyn input: DescribeConformancePackComplianceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeConformancePackCompliance", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConformancePackCompliance"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConformancePackComplianceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1075,10 +985,7 @@ export const serializeAws_json1_1DescribeConformancePacksCommand = async ( input: DescribeConformancePacksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeConformancePacks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConformancePacks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConformancePacksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1088,10 +995,7 @@ export const serializeAws_json1_1DescribeConformancePackStatusCommand = async ( input: DescribeConformancePackStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeConformancePackStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConformancePackStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConformancePackStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1101,10 +1005,7 @@ export const serializeAws_json1_1DescribeDeliveryChannelsCommand = async ( input: DescribeDeliveryChannelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeDeliveryChannels", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDeliveryChannels"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDeliveryChannelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1114,10 +1015,7 @@ export const serializeAws_json1_1DescribeDeliveryChannelStatusCommand = async ( input: DescribeDeliveryChannelStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeDeliveryChannelStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDeliveryChannelStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDeliveryChannelStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1127,10 +1025,7 @@ export const serializeAws_json1_1DescribeOrganizationConfigRulesCommand = async input: DescribeOrganizationConfigRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeOrganizationConfigRules", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOrganizationConfigRules"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeOrganizationConfigRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1140,10 +1035,7 @@ export const serializeAws_json1_1DescribeOrganizationConfigRuleStatusesCommand = input: DescribeOrganizationConfigRuleStatusesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeOrganizationConfigRuleStatuses", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOrganizationConfigRuleStatuses"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeOrganizationConfigRuleStatusesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1153,10 +1045,7 @@ export const serializeAws_json1_1DescribeOrganizationConformancePacksCommand = a input: DescribeOrganizationConformancePacksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeOrganizationConformancePacks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOrganizationConformancePacks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeOrganizationConformancePacksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1166,10 +1055,7 @@ export const serializeAws_json1_1DescribeOrganizationConformancePackStatusesComm input: DescribeOrganizationConformancePackStatusesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeOrganizationConformancePackStatuses", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOrganizationConformancePackStatuses"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeOrganizationConformancePackStatusesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1179,10 +1065,7 @@ export const serializeAws_json1_1DescribePendingAggregationRequestsCommand = asy input: DescribePendingAggregationRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribePendingAggregationRequests", - }; + const headers: __HeaderBag = sharedHeaders("DescribePendingAggregationRequests"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePendingAggregationRequestsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1192,10 +1075,7 @@ export const serializeAws_json1_1DescribeRemediationConfigurationsCommand = asyn input: DescribeRemediationConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeRemediationConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRemediationConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRemediationConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1205,10 +1085,7 @@ export const serializeAws_json1_1DescribeRemediationExceptionsCommand = async ( input: DescribeRemediationExceptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeRemediationExceptions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRemediationExceptions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRemediationExceptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1218,10 +1095,7 @@ export const serializeAws_json1_1DescribeRemediationExecutionStatusCommand = asy input: DescribeRemediationExecutionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeRemediationExecutionStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRemediationExecutionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRemediationExecutionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1231,10 +1105,7 @@ export const serializeAws_json1_1DescribeRetentionConfigurationsCommand = async input: DescribeRetentionConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.DescribeRetentionConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRetentionConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRetentionConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1244,10 +1115,7 @@ export const serializeAws_json1_1GetAggregateComplianceDetailsByConfigRuleComman input: GetAggregateComplianceDetailsByConfigRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetAggregateComplianceDetailsByConfigRule", - }; + const headers: __HeaderBag = sharedHeaders("GetAggregateComplianceDetailsByConfigRule"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAggregateComplianceDetailsByConfigRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1257,10 +1125,7 @@ export const serializeAws_json1_1GetAggregateConfigRuleComplianceSummaryCommand input: GetAggregateConfigRuleComplianceSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetAggregateConfigRuleComplianceSummary", - }; + const headers: __HeaderBag = sharedHeaders("GetAggregateConfigRuleComplianceSummary"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAggregateConfigRuleComplianceSummaryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1270,10 +1135,7 @@ export const serializeAws_json1_1GetAggregateConformancePackComplianceSummaryCom input: GetAggregateConformancePackComplianceSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetAggregateConformancePackComplianceSummary", - }; + const headers: __HeaderBag = sharedHeaders("GetAggregateConformancePackComplianceSummary"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAggregateConformancePackComplianceSummaryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1283,10 +1145,7 @@ export const serializeAws_json1_1GetAggregateDiscoveredResourceCountsCommand = a input: GetAggregateDiscoveredResourceCountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetAggregateDiscoveredResourceCounts", - }; + const headers: __HeaderBag = sharedHeaders("GetAggregateDiscoveredResourceCounts"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAggregateDiscoveredResourceCountsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1296,10 +1155,7 @@ export const serializeAws_json1_1GetAggregateResourceConfigCommand = async ( input: GetAggregateResourceConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetAggregateResourceConfig", - }; + const headers: __HeaderBag = sharedHeaders("GetAggregateResourceConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAggregateResourceConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1309,10 +1165,7 @@ export const serializeAws_json1_1GetComplianceDetailsByConfigRuleCommand = async input: GetComplianceDetailsByConfigRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetComplianceDetailsByConfigRule", - }; + const headers: __HeaderBag = sharedHeaders("GetComplianceDetailsByConfigRule"); let body: any; body = JSON.stringify(serializeAws_json1_1GetComplianceDetailsByConfigRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1322,10 +1175,7 @@ export const serializeAws_json1_1GetComplianceDetailsByResourceCommand = async ( input: GetComplianceDetailsByResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetComplianceDetailsByResource", - }; + const headers: __HeaderBag = sharedHeaders("GetComplianceDetailsByResource"); let body: any; body = JSON.stringify(serializeAws_json1_1GetComplianceDetailsByResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1335,10 +1185,7 @@ export const serializeAws_json1_1GetComplianceSummaryByConfigRuleCommand = async input: GetComplianceSummaryByConfigRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetComplianceSummaryByConfigRule", - }; + const headers: __HeaderBag = sharedHeaders("GetComplianceSummaryByConfigRule"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -1347,10 +1194,7 @@ export const serializeAws_json1_1GetComplianceSummaryByResourceTypeCommand = asy input: GetComplianceSummaryByResourceTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetComplianceSummaryByResourceType", - }; + const headers: __HeaderBag = sharedHeaders("GetComplianceSummaryByResourceType"); let body: any; body = JSON.stringify(serializeAws_json1_1GetComplianceSummaryByResourceTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1360,10 +1204,7 @@ export const serializeAws_json1_1GetConformancePackComplianceDetailsCommand = as input: GetConformancePackComplianceDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetConformancePackComplianceDetails", - }; + const headers: __HeaderBag = sharedHeaders("GetConformancePackComplianceDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1GetConformancePackComplianceDetailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1373,10 +1214,7 @@ export const serializeAws_json1_1GetConformancePackComplianceSummaryCommand = as input: GetConformancePackComplianceSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetConformancePackComplianceSummary", - }; + const headers: __HeaderBag = sharedHeaders("GetConformancePackComplianceSummary"); let body: any; body = JSON.stringify(serializeAws_json1_1GetConformancePackComplianceSummaryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1386,10 +1224,7 @@ export const serializeAws_json1_1GetCustomRulePolicyCommand = async ( input: GetCustomRulePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetCustomRulePolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetCustomRulePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCustomRulePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1399,10 +1234,7 @@ export const serializeAws_json1_1GetDiscoveredResourceCountsCommand = async ( input: GetDiscoveredResourceCountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetDiscoveredResourceCounts", - }; + const headers: __HeaderBag = sharedHeaders("GetDiscoveredResourceCounts"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDiscoveredResourceCountsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1412,10 +1244,7 @@ export const serializeAws_json1_1GetOrganizationConfigRuleDetailedStatusCommand input: GetOrganizationConfigRuleDetailedStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetOrganizationConfigRuleDetailedStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetOrganizationConfigRuleDetailedStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOrganizationConfigRuleDetailedStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1425,10 +1254,7 @@ export const serializeAws_json1_1GetOrganizationConformancePackDetailedStatusCom input: GetOrganizationConformancePackDetailedStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetOrganizationConformancePackDetailedStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetOrganizationConformancePackDetailedStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOrganizationConformancePackDetailedStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1438,10 +1264,7 @@ export const serializeAws_json1_1GetOrganizationCustomRulePolicyCommand = async input: GetOrganizationCustomRulePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetOrganizationCustomRulePolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetOrganizationCustomRulePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOrganizationCustomRulePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1451,10 +1274,7 @@ export const serializeAws_json1_1GetResourceConfigHistoryCommand = async ( input: GetResourceConfigHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetResourceConfigHistory", - }; + const headers: __HeaderBag = sharedHeaders("GetResourceConfigHistory"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourceConfigHistoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1464,10 +1284,7 @@ export const serializeAws_json1_1GetResourceEvaluationSummaryCommand = async ( input: GetResourceEvaluationSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetResourceEvaluationSummary", - }; + const headers: __HeaderBag = sharedHeaders("GetResourceEvaluationSummary"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourceEvaluationSummaryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1477,10 +1294,7 @@ export const serializeAws_json1_1GetStoredQueryCommand = async ( input: GetStoredQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.GetStoredQuery", - }; + const headers: __HeaderBag = sharedHeaders("GetStoredQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1GetStoredQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1490,10 +1304,7 @@ export const serializeAws_json1_1ListAggregateDiscoveredResourcesCommand = async input: ListAggregateDiscoveredResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.ListAggregateDiscoveredResources", - }; + const headers: __HeaderBag = sharedHeaders("ListAggregateDiscoveredResources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAggregateDiscoveredResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1503,10 +1314,7 @@ export const serializeAws_json1_1ListConformancePackComplianceScoresCommand = as input: ListConformancePackComplianceScoresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.ListConformancePackComplianceScores", - }; + const headers: __HeaderBag = sharedHeaders("ListConformancePackComplianceScores"); let body: any; body = JSON.stringify(serializeAws_json1_1ListConformancePackComplianceScoresRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1516,10 +1324,7 @@ export const serializeAws_json1_1ListDiscoveredResourcesCommand = async ( input: ListDiscoveredResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.ListDiscoveredResources", - }; + const headers: __HeaderBag = sharedHeaders("ListDiscoveredResources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDiscoveredResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1529,10 +1334,7 @@ export const serializeAws_json1_1ListResourceEvaluationsCommand = async ( input: ListResourceEvaluationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.ListResourceEvaluations", - }; + const headers: __HeaderBag = sharedHeaders("ListResourceEvaluations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourceEvaluationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1542,10 +1344,7 @@ export const serializeAws_json1_1ListStoredQueriesCommand = async ( input: ListStoredQueriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.ListStoredQueries", - }; + const headers: __HeaderBag = sharedHeaders("ListStoredQueries"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStoredQueriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1555,10 +1354,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1568,10 +1364,7 @@ export const serializeAws_json1_1PutAggregationAuthorizationCommand = async ( input: PutAggregationAuthorizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutAggregationAuthorization", - }; + const headers: __HeaderBag = sharedHeaders("PutAggregationAuthorization"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAggregationAuthorizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1581,10 +1374,7 @@ export const serializeAws_json1_1PutConfigRuleCommand = async ( input: PutConfigRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutConfigRule", - }; + const headers: __HeaderBag = sharedHeaders("PutConfigRule"); let body: any; body = JSON.stringify(serializeAws_json1_1PutConfigRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1594,10 +1384,7 @@ export const serializeAws_json1_1PutConfigurationAggregatorCommand = async ( input: PutConfigurationAggregatorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutConfigurationAggregator", - }; + const headers: __HeaderBag = sharedHeaders("PutConfigurationAggregator"); let body: any; body = JSON.stringify(serializeAws_json1_1PutConfigurationAggregatorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1607,10 +1394,7 @@ export const serializeAws_json1_1PutConfigurationRecorderCommand = async ( input: PutConfigurationRecorderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutConfigurationRecorder", - }; + const headers: __HeaderBag = sharedHeaders("PutConfigurationRecorder"); let body: any; body = JSON.stringify(serializeAws_json1_1PutConfigurationRecorderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1620,10 +1404,7 @@ export const serializeAws_json1_1PutConformancePackCommand = async ( input: PutConformancePackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutConformancePack", - }; + const headers: __HeaderBag = sharedHeaders("PutConformancePack"); let body: any; body = JSON.stringify(serializeAws_json1_1PutConformancePackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1633,10 +1414,7 @@ export const serializeAws_json1_1PutDeliveryChannelCommand = async ( input: PutDeliveryChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutDeliveryChannel", - }; + const headers: __HeaderBag = sharedHeaders("PutDeliveryChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1PutDeliveryChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1646,10 +1424,7 @@ export const serializeAws_json1_1PutEvaluationsCommand = async ( input: PutEvaluationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutEvaluations", - }; + const headers: __HeaderBag = sharedHeaders("PutEvaluations"); let body: any; body = JSON.stringify(serializeAws_json1_1PutEvaluationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1659,10 +1434,7 @@ export const serializeAws_json1_1PutExternalEvaluationCommand = async ( input: PutExternalEvaluationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutExternalEvaluation", - }; + const headers: __HeaderBag = sharedHeaders("PutExternalEvaluation"); let body: any; body = JSON.stringify(serializeAws_json1_1PutExternalEvaluationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1672,10 +1444,7 @@ export const serializeAws_json1_1PutOrganizationConfigRuleCommand = async ( input: PutOrganizationConfigRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutOrganizationConfigRule", - }; + const headers: __HeaderBag = sharedHeaders("PutOrganizationConfigRule"); let body: any; body = JSON.stringify(serializeAws_json1_1PutOrganizationConfigRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1685,10 +1454,7 @@ export const serializeAws_json1_1PutOrganizationConformancePackCommand = async ( input: PutOrganizationConformancePackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutOrganizationConformancePack", - }; + const headers: __HeaderBag = sharedHeaders("PutOrganizationConformancePack"); let body: any; body = JSON.stringify(serializeAws_json1_1PutOrganizationConformancePackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1698,10 +1464,7 @@ export const serializeAws_json1_1PutRemediationConfigurationsCommand = async ( input: PutRemediationConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutRemediationConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("PutRemediationConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRemediationConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1711,10 +1474,7 @@ export const serializeAws_json1_1PutRemediationExceptionsCommand = async ( input: PutRemediationExceptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutRemediationExceptions", - }; + const headers: __HeaderBag = sharedHeaders("PutRemediationExceptions"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRemediationExceptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1724,10 +1484,7 @@ export const serializeAws_json1_1PutResourceConfigCommand = async ( input: PutResourceConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutResourceConfig", - }; + const headers: __HeaderBag = sharedHeaders("PutResourceConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourceConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1737,10 +1494,7 @@ export const serializeAws_json1_1PutRetentionConfigurationCommand = async ( input: PutRetentionConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutRetentionConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutRetentionConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRetentionConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1750,10 +1504,7 @@ export const serializeAws_json1_1PutStoredQueryCommand = async ( input: PutStoredQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.PutStoredQuery", - }; + const headers: __HeaderBag = sharedHeaders("PutStoredQuery"); let body: any; body = JSON.stringify(serializeAws_json1_1PutStoredQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1763,10 +1514,7 @@ export const serializeAws_json1_1SelectAggregateResourceConfigCommand = async ( input: SelectAggregateResourceConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.SelectAggregateResourceConfig", - }; + const headers: __HeaderBag = sharedHeaders("SelectAggregateResourceConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1SelectAggregateResourceConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1776,10 +1524,7 @@ export const serializeAws_json1_1SelectResourceConfigCommand = async ( input: SelectResourceConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.SelectResourceConfig", - }; + const headers: __HeaderBag = sharedHeaders("SelectResourceConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1SelectResourceConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1789,10 +1534,7 @@ export const serializeAws_json1_1StartConfigRulesEvaluationCommand = async ( input: StartConfigRulesEvaluationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.StartConfigRulesEvaluation", - }; + const headers: __HeaderBag = sharedHeaders("StartConfigRulesEvaluation"); let body: any; body = JSON.stringify(serializeAws_json1_1StartConfigRulesEvaluationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1802,10 +1544,7 @@ export const serializeAws_json1_1StartConfigurationRecorderCommand = async ( input: StartConfigurationRecorderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.StartConfigurationRecorder", - }; + const headers: __HeaderBag = sharedHeaders("StartConfigurationRecorder"); let body: any; body = JSON.stringify(serializeAws_json1_1StartConfigurationRecorderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1815,10 +1554,7 @@ export const serializeAws_json1_1StartRemediationExecutionCommand = async ( input: StartRemediationExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.StartRemediationExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartRemediationExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StartRemediationExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1828,10 +1564,7 @@ export const serializeAws_json1_1StartResourceEvaluationCommand = async ( input: StartResourceEvaluationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.StartResourceEvaluation", - }; + const headers: __HeaderBag = sharedHeaders("StartResourceEvaluation"); let body: any; body = JSON.stringify(serializeAws_json1_1StartResourceEvaluationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1841,10 +1574,7 @@ export const serializeAws_json1_1StopConfigurationRecorderCommand = async ( input: StopConfigurationRecorderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.StopConfigurationRecorder", - }; + const headers: __HeaderBag = sharedHeaders("StopConfigurationRecorder"); let body: any; body = JSON.stringify(serializeAws_json1_1StopConfigurationRecorderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1854,10 +1584,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1867,10 +1594,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StarlingDoveService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -12520,6 +12244,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `StarlingDoveService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts index 649561e4b8076..1ddc8c2baea40 100644 --- a/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts @@ -52,10 +52,7 @@ export const serializeAws_json1_1DeleteReportDefinitionCommand = async ( input: DeleteReportDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrigamiServiceGatewayService.DeleteReportDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DeleteReportDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteReportDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -65,10 +62,7 @@ export const serializeAws_json1_1DescribeReportDefinitionsCommand = async ( input: DescribeReportDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrigamiServiceGatewayService.DescribeReportDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReportDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReportDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -78,10 +72,7 @@ export const serializeAws_json1_1ModifyReportDefinitionCommand = async ( input: ModifyReportDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrigamiServiceGatewayService.ModifyReportDefinition", - }; + const headers: __HeaderBag = sharedHeaders("ModifyReportDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyReportDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -91,10 +82,7 @@ export const serializeAws_json1_1PutReportDefinitionCommand = async ( input: PutReportDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrigamiServiceGatewayService.PutReportDefinition", - }; + const headers: __HeaderBag = sharedHeaders("PutReportDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1PutReportDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -585,6 +573,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSOrigamiServiceGatewayService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts index 50353455d98dc..6ac9fb68f369f 100644 --- a/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts +++ b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts @@ -314,10 +314,7 @@ export const serializeAws_json1_1CreateAnomalyMonitorCommand = async ( input: CreateAnomalyMonitorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.CreateAnomalyMonitor", - }; + const headers: __HeaderBag = sharedHeaders("CreateAnomalyMonitor"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAnomalyMonitorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -327,10 +324,7 @@ export const serializeAws_json1_1CreateAnomalySubscriptionCommand = async ( input: CreateAnomalySubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.CreateAnomalySubscription", - }; + const headers: __HeaderBag = sharedHeaders("CreateAnomalySubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAnomalySubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -340,10 +334,7 @@ export const serializeAws_json1_1CreateCostCategoryDefinitionCommand = async ( input: CreateCostCategoryDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.CreateCostCategoryDefinition", - }; + const headers: __HeaderBag = sharedHeaders("CreateCostCategoryDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCostCategoryDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -353,10 +344,7 @@ export const serializeAws_json1_1DeleteAnomalyMonitorCommand = async ( input: DeleteAnomalyMonitorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.DeleteAnomalyMonitor", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAnomalyMonitor"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAnomalyMonitorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -366,10 +354,7 @@ export const serializeAws_json1_1DeleteAnomalySubscriptionCommand = async ( input: DeleteAnomalySubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.DeleteAnomalySubscription", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAnomalySubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAnomalySubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -379,10 +364,7 @@ export const serializeAws_json1_1DeleteCostCategoryDefinitionCommand = async ( input: DeleteCostCategoryDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.DeleteCostCategoryDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCostCategoryDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCostCategoryDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -392,10 +374,7 @@ export const serializeAws_json1_1DescribeCostCategoryDefinitionCommand = async ( input: DescribeCostCategoryDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.DescribeCostCategoryDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCostCategoryDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCostCategoryDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -405,10 +384,7 @@ export const serializeAws_json1_1GetAnomaliesCommand = async ( input: GetAnomaliesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetAnomalies", - }; + const headers: __HeaderBag = sharedHeaders("GetAnomalies"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAnomaliesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -418,10 +394,7 @@ export const serializeAws_json1_1GetAnomalyMonitorsCommand = async ( input: GetAnomalyMonitorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetAnomalyMonitors", - }; + const headers: __HeaderBag = sharedHeaders("GetAnomalyMonitors"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAnomalyMonitorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -431,10 +404,7 @@ export const serializeAws_json1_1GetAnomalySubscriptionsCommand = async ( input: GetAnomalySubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetAnomalySubscriptions", - }; + const headers: __HeaderBag = sharedHeaders("GetAnomalySubscriptions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAnomalySubscriptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -444,10 +414,7 @@ export const serializeAws_json1_1GetCostAndUsageCommand = async ( input: GetCostAndUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetCostAndUsage", - }; + const headers: __HeaderBag = sharedHeaders("GetCostAndUsage"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCostAndUsageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -457,10 +424,7 @@ export const serializeAws_json1_1GetCostAndUsageWithResourcesCommand = async ( input: GetCostAndUsageWithResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetCostAndUsageWithResources", - }; + const headers: __HeaderBag = sharedHeaders("GetCostAndUsageWithResources"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCostAndUsageWithResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -470,10 +434,7 @@ export const serializeAws_json1_1GetCostCategoriesCommand = async ( input: GetCostCategoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetCostCategories", - }; + const headers: __HeaderBag = sharedHeaders("GetCostCategories"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCostCategoriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -483,10 +444,7 @@ export const serializeAws_json1_1GetCostForecastCommand = async ( input: GetCostForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetCostForecast", - }; + const headers: __HeaderBag = sharedHeaders("GetCostForecast"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCostForecastRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -496,10 +454,7 @@ export const serializeAws_json1_1GetDimensionValuesCommand = async ( input: GetDimensionValuesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetDimensionValues", - }; + const headers: __HeaderBag = sharedHeaders("GetDimensionValues"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDimensionValuesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -509,10 +464,7 @@ export const serializeAws_json1_1GetReservationCoverageCommand = async ( input: GetReservationCoverageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetReservationCoverage", - }; + const headers: __HeaderBag = sharedHeaders("GetReservationCoverage"); let body: any; body = JSON.stringify(serializeAws_json1_1GetReservationCoverageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -522,10 +474,7 @@ export const serializeAws_json1_1GetReservationPurchaseRecommendationCommand = a input: GetReservationPurchaseRecommendationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetReservationPurchaseRecommendation", - }; + const headers: __HeaderBag = sharedHeaders("GetReservationPurchaseRecommendation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetReservationPurchaseRecommendationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -535,10 +484,7 @@ export const serializeAws_json1_1GetReservationUtilizationCommand = async ( input: GetReservationUtilizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetReservationUtilization", - }; + const headers: __HeaderBag = sharedHeaders("GetReservationUtilization"); let body: any; body = JSON.stringify(serializeAws_json1_1GetReservationUtilizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -548,10 +494,7 @@ export const serializeAws_json1_1GetRightsizingRecommendationCommand = async ( input: GetRightsizingRecommendationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetRightsizingRecommendation", - }; + const headers: __HeaderBag = sharedHeaders("GetRightsizingRecommendation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRightsizingRecommendationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -561,10 +504,7 @@ export const serializeAws_json1_1GetSavingsPlansCoverageCommand = async ( input: GetSavingsPlansCoverageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetSavingsPlansCoverage", - }; + const headers: __HeaderBag = sharedHeaders("GetSavingsPlansCoverage"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSavingsPlansCoverageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -574,10 +514,7 @@ export const serializeAws_json1_1GetSavingsPlansPurchaseRecommendationCommand = input: GetSavingsPlansPurchaseRecommendationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetSavingsPlansPurchaseRecommendation", - }; + const headers: __HeaderBag = sharedHeaders("GetSavingsPlansPurchaseRecommendation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSavingsPlansPurchaseRecommendationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -587,10 +524,7 @@ export const serializeAws_json1_1GetSavingsPlansUtilizationCommand = async ( input: GetSavingsPlansUtilizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetSavingsPlansUtilization", - }; + const headers: __HeaderBag = sharedHeaders("GetSavingsPlansUtilization"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSavingsPlansUtilizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -600,10 +534,7 @@ export const serializeAws_json1_1GetSavingsPlansUtilizationDetailsCommand = asyn input: GetSavingsPlansUtilizationDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetSavingsPlansUtilizationDetails", - }; + const headers: __HeaderBag = sharedHeaders("GetSavingsPlansUtilizationDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSavingsPlansUtilizationDetailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -613,10 +544,7 @@ export const serializeAws_json1_1GetTagsCommand = async ( input: GetTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetTags", - }; + const headers: __HeaderBag = sharedHeaders("GetTags"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -626,10 +554,7 @@ export const serializeAws_json1_1GetUsageForecastCommand = async ( input: GetUsageForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.GetUsageForecast", - }; + const headers: __HeaderBag = sharedHeaders("GetUsageForecast"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUsageForecastRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -639,10 +564,7 @@ export const serializeAws_json1_1ListCostAllocationTagsCommand = async ( input: ListCostAllocationTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.ListCostAllocationTags", - }; + const headers: __HeaderBag = sharedHeaders("ListCostAllocationTags"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCostAllocationTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -652,10 +574,7 @@ export const serializeAws_json1_1ListCostCategoryDefinitionsCommand = async ( input: ListCostCategoryDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.ListCostCategoryDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("ListCostCategoryDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCostCategoryDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -665,10 +584,7 @@ export const serializeAws_json1_1ListSavingsPlansPurchaseRecommendationGeneratio input: ListSavingsPlansPurchaseRecommendationGenerationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.ListSavingsPlansPurchaseRecommendationGeneration", - }; + const headers: __HeaderBag = sharedHeaders("ListSavingsPlansPurchaseRecommendationGeneration"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSavingsPlansPurchaseRecommendationGenerationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -678,10 +594,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -691,10 +604,7 @@ export const serializeAws_json1_1ProvideAnomalyFeedbackCommand = async ( input: ProvideAnomalyFeedbackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.ProvideAnomalyFeedback", - }; + const headers: __HeaderBag = sharedHeaders("ProvideAnomalyFeedback"); let body: any; body = JSON.stringify(serializeAws_json1_1ProvideAnomalyFeedbackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -704,10 +614,7 @@ export const serializeAws_json1_1StartSavingsPlansPurchaseRecommendationGenerati input: StartSavingsPlansPurchaseRecommendationGenerationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.StartSavingsPlansPurchaseRecommendationGeneration", - }; + const headers: __HeaderBag = sharedHeaders("StartSavingsPlansPurchaseRecommendationGeneration"); let body: any; body = JSON.stringify(serializeAws_json1_1StartSavingsPlansPurchaseRecommendationGenerationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -717,10 +624,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -730,10 +634,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -743,10 +644,7 @@ export const serializeAws_json1_1UpdateAnomalyMonitorCommand = async ( input: UpdateAnomalyMonitorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.UpdateAnomalyMonitor", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAnomalyMonitor"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAnomalyMonitorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -756,10 +654,7 @@ export const serializeAws_json1_1UpdateAnomalySubscriptionCommand = async ( input: UpdateAnomalySubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.UpdateAnomalySubscription", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAnomalySubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAnomalySubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -769,10 +664,7 @@ export const serializeAws_json1_1UpdateCostAllocationTagsStatusCommand = async ( input: UpdateCostAllocationTagsStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.UpdateCostAllocationTagsStatus", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCostAllocationTagsStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCostAllocationTagsStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -782,10 +674,7 @@ export const serializeAws_json1_1UpdateCostCategoryDefinitionCommand = async ( input: UpdateCostCategoryDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSInsightsIndexService.UpdateCostCategoryDefinition", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCostCategoryDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCostCategoryDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5697,6 +5586,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSInsightsIndexService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts index 7d747dcb866c2..6344d44e19b2d 100644 --- a/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts +++ b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts @@ -108,10 +108,7 @@ export const serializeAws_json1_1ActivatePipelineCommand = async ( input: ActivatePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.ActivatePipeline", - }; + const headers: __HeaderBag = sharedHeaders("ActivatePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1ActivatePipelineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -121,10 +118,7 @@ export const serializeAws_json1_1AddTagsCommand = async ( input: AddTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.AddTags", - }; + const headers: __HeaderBag = sharedHeaders("AddTags"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -134,10 +128,7 @@ export const serializeAws_json1_1CreatePipelineCommand = async ( input: CreatePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.CreatePipeline", - }; + const headers: __HeaderBag = sharedHeaders("CreatePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePipelineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -147,10 +138,7 @@ export const serializeAws_json1_1DeactivatePipelineCommand = async ( input: DeactivatePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.DeactivatePipeline", - }; + const headers: __HeaderBag = sharedHeaders("DeactivatePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1DeactivatePipelineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -160,10 +148,7 @@ export const serializeAws_json1_1DeletePipelineCommand = async ( input: DeletePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.DeletePipeline", - }; + const headers: __HeaderBag = sharedHeaders("DeletePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePipelineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -173,10 +158,7 @@ export const serializeAws_json1_1DescribeObjectsCommand = async ( input: DescribeObjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.DescribeObjects", - }; + const headers: __HeaderBag = sharedHeaders("DescribeObjects"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeObjectsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -186,10 +168,7 @@ export const serializeAws_json1_1DescribePipelinesCommand = async ( input: DescribePipelinesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.DescribePipelines", - }; + const headers: __HeaderBag = sharedHeaders("DescribePipelines"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePipelinesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -199,10 +178,7 @@ export const serializeAws_json1_1EvaluateExpressionCommand = async ( input: EvaluateExpressionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.EvaluateExpression", - }; + const headers: __HeaderBag = sharedHeaders("EvaluateExpression"); let body: any; body = JSON.stringify(serializeAws_json1_1EvaluateExpressionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -212,10 +188,7 @@ export const serializeAws_json1_1GetPipelineDefinitionCommand = async ( input: GetPipelineDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.GetPipelineDefinition", - }; + const headers: __HeaderBag = sharedHeaders("GetPipelineDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPipelineDefinitionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -225,10 +198,7 @@ export const serializeAws_json1_1ListPipelinesCommand = async ( input: ListPipelinesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.ListPipelines", - }; + const headers: __HeaderBag = sharedHeaders("ListPipelines"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPipelinesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -238,10 +208,7 @@ export const serializeAws_json1_1PollForTaskCommand = async ( input: PollForTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.PollForTask", - }; + const headers: __HeaderBag = sharedHeaders("PollForTask"); let body: any; body = JSON.stringify(serializeAws_json1_1PollForTaskInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -251,10 +218,7 @@ export const serializeAws_json1_1PutPipelineDefinitionCommand = async ( input: PutPipelineDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.PutPipelineDefinition", - }; + const headers: __HeaderBag = sharedHeaders("PutPipelineDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPipelineDefinitionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -264,10 +228,7 @@ export const serializeAws_json1_1QueryObjectsCommand = async ( input: QueryObjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.QueryObjects", - }; + const headers: __HeaderBag = sharedHeaders("QueryObjects"); let body: any; body = JSON.stringify(serializeAws_json1_1QueryObjectsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -277,10 +238,7 @@ export const serializeAws_json1_1RemoveTagsCommand = async ( input: RemoveTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.RemoveTags", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTags"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -290,10 +248,7 @@ export const serializeAws_json1_1ReportTaskProgressCommand = async ( input: ReportTaskProgressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.ReportTaskProgress", - }; + const headers: __HeaderBag = sharedHeaders("ReportTaskProgress"); let body: any; body = JSON.stringify(serializeAws_json1_1ReportTaskProgressInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -303,10 +258,7 @@ export const serializeAws_json1_1ReportTaskRunnerHeartbeatCommand = async ( input: ReportTaskRunnerHeartbeatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.ReportTaskRunnerHeartbeat", - }; + const headers: __HeaderBag = sharedHeaders("ReportTaskRunnerHeartbeat"); let body: any; body = JSON.stringify(serializeAws_json1_1ReportTaskRunnerHeartbeatInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -316,10 +268,7 @@ export const serializeAws_json1_1SetStatusCommand = async ( input: SetStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.SetStatus", - }; + const headers: __HeaderBag = sharedHeaders("SetStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1SetStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -329,10 +278,7 @@ export const serializeAws_json1_1SetTaskStatusCommand = async ( input: SetTaskStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.SetTaskStatus", - }; + const headers: __HeaderBag = sharedHeaders("SetTaskStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1SetTaskStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -342,10 +288,7 @@ export const serializeAws_json1_1ValidatePipelineDefinitionCommand = async ( input: ValidatePipelineDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DataPipeline.ValidatePipelineDefinition", - }; + const headers: __HeaderBag = sharedHeaders("ValidatePipelineDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1ValidatePipelineDefinitionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2148,6 +2091,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `DataPipeline.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts index 7e1184d25c026..d1ad876acf1f4 100644 --- a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts @@ -493,10 +493,7 @@ export const serializeAws_json1_1AddTagsToResourceCommand = async ( input: AddTagsToResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.AddTagsToResource", - }; + const headers: __HeaderBag = sharedHeaders("AddTagsToResource"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsToResourceMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -506,10 +503,7 @@ export const serializeAws_json1_1ApplyPendingMaintenanceActionCommand = async ( input: ApplyPendingMaintenanceActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.ApplyPendingMaintenanceAction", - }; + const headers: __HeaderBag = sharedHeaders("ApplyPendingMaintenanceAction"); let body: any; body = JSON.stringify(serializeAws_json1_1ApplyPendingMaintenanceActionMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -519,10 +513,7 @@ export const serializeAws_json1_1BatchStartRecommendationsCommand = async ( input: BatchStartRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.BatchStartRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("BatchStartRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchStartRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -532,10 +523,7 @@ export const serializeAws_json1_1CancelReplicationTaskAssessmentRunCommand = asy input: CancelReplicationTaskAssessmentRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.CancelReplicationTaskAssessmentRun", - }; + const headers: __HeaderBag = sharedHeaders("CancelReplicationTaskAssessmentRun"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelReplicationTaskAssessmentRunMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -545,10 +533,7 @@ export const serializeAws_json1_1CreateEndpointCommand = async ( input: CreateEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.CreateEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("CreateEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEndpointMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -558,10 +543,7 @@ export const serializeAws_json1_1CreateEventSubscriptionCommand = async ( input: CreateEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.CreateEventSubscription", - }; + const headers: __HeaderBag = sharedHeaders("CreateEventSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEventSubscriptionMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -571,10 +553,7 @@ export const serializeAws_json1_1CreateFleetAdvisorCollectorCommand = async ( input: CreateFleetAdvisorCollectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.CreateFleetAdvisorCollector", - }; + const headers: __HeaderBag = sharedHeaders("CreateFleetAdvisorCollector"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFleetAdvisorCollectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -584,10 +563,7 @@ export const serializeAws_json1_1CreateReplicationInstanceCommand = async ( input: CreateReplicationInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.CreateReplicationInstance", - }; + const headers: __HeaderBag = sharedHeaders("CreateReplicationInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateReplicationInstanceMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -597,10 +573,7 @@ export const serializeAws_json1_1CreateReplicationSubnetGroupCommand = async ( input: CreateReplicationSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.CreateReplicationSubnetGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateReplicationSubnetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateReplicationSubnetGroupMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -610,10 +583,7 @@ export const serializeAws_json1_1CreateReplicationTaskCommand = async ( input: CreateReplicationTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.CreateReplicationTask", - }; + const headers: __HeaderBag = sharedHeaders("CreateReplicationTask"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateReplicationTaskMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -623,10 +593,7 @@ export const serializeAws_json1_1DeleteCertificateCommand = async ( input: DeleteCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DeleteCertificate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCertificateMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -636,10 +603,7 @@ export const serializeAws_json1_1DeleteConnectionCommand = async ( input: DeleteConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DeleteConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConnectionMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -649,10 +613,7 @@ export const serializeAws_json1_1DeleteEndpointCommand = async ( input: DeleteEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DeleteEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEndpointMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -662,10 +623,7 @@ export const serializeAws_json1_1DeleteEventSubscriptionCommand = async ( input: DeleteEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DeleteEventSubscription", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEventSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEventSubscriptionMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -675,10 +633,7 @@ export const serializeAws_json1_1DeleteFleetAdvisorCollectorCommand = async ( input: DeleteFleetAdvisorCollectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DeleteFleetAdvisorCollector", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFleetAdvisorCollector"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCollectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -688,10 +643,7 @@ export const serializeAws_json1_1DeleteFleetAdvisorDatabasesCommand = async ( input: DeleteFleetAdvisorDatabasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DeleteFleetAdvisorDatabases", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFleetAdvisorDatabases"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFleetAdvisorDatabasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -701,10 +653,7 @@ export const serializeAws_json1_1DeleteReplicationInstanceCommand = async ( input: DeleteReplicationInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DeleteReplicationInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeleteReplicationInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteReplicationInstanceMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -714,10 +663,7 @@ export const serializeAws_json1_1DeleteReplicationSubnetGroupCommand = async ( input: DeleteReplicationSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DeleteReplicationSubnetGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteReplicationSubnetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteReplicationSubnetGroupMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -727,10 +673,7 @@ export const serializeAws_json1_1DeleteReplicationTaskCommand = async ( input: DeleteReplicationTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DeleteReplicationTask", - }; + const headers: __HeaderBag = sharedHeaders("DeleteReplicationTask"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteReplicationTaskMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -740,10 +683,7 @@ export const serializeAws_json1_1DeleteReplicationTaskAssessmentRunCommand = asy input: DeleteReplicationTaskAssessmentRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DeleteReplicationTaskAssessmentRun", - }; + const headers: __HeaderBag = sharedHeaders("DeleteReplicationTaskAssessmentRun"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteReplicationTaskAssessmentRunMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -753,10 +693,7 @@ export const serializeAws_json1_1DescribeAccountAttributesCommand = async ( input: DescribeAccountAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeAccountAttributes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccountAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAccountAttributesMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -766,10 +703,7 @@ export const serializeAws_json1_1DescribeApplicableIndividualAssessmentsCommand input: DescribeApplicableIndividualAssessmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeApplicableIndividualAssessments", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApplicableIndividualAssessments"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApplicableIndividualAssessmentsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -779,10 +713,7 @@ export const serializeAws_json1_1DescribeCertificatesCommand = async ( input: DescribeCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeCertificates", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCertificates"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCertificatesMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -792,10 +723,7 @@ export const serializeAws_json1_1DescribeConnectionsCommand = async ( input: DescribeConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeConnections", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConnections"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConnectionsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -805,10 +733,7 @@ export const serializeAws_json1_1DescribeEndpointsCommand = async ( input: DescribeEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEndpointsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -818,10 +743,7 @@ export const serializeAws_json1_1DescribeEndpointSettingsCommand = async ( input: DescribeEndpointSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeEndpointSettings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpointSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEndpointSettingsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -831,10 +753,7 @@ export const serializeAws_json1_1DescribeEndpointTypesCommand = async ( input: DescribeEndpointTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeEndpointTypes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpointTypes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEndpointTypesMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -844,10 +763,7 @@ export const serializeAws_json1_1DescribeEventCategoriesCommand = async ( input: DescribeEventCategoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeEventCategories", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventCategories"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventCategoriesMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -857,10 +773,7 @@ export const serializeAws_json1_1DescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeEvents", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -870,10 +783,7 @@ export const serializeAws_json1_1DescribeEventSubscriptionsCommand = async ( input: DescribeEventSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeEventSubscriptions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventSubscriptions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventSubscriptionsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -883,10 +793,7 @@ export const serializeAws_json1_1DescribeFleetAdvisorCollectorsCommand = async ( input: DescribeFleetAdvisorCollectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeFleetAdvisorCollectors", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetAdvisorCollectors"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetAdvisorCollectorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -896,10 +803,7 @@ export const serializeAws_json1_1DescribeFleetAdvisorDatabasesCommand = async ( input: DescribeFleetAdvisorDatabasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeFleetAdvisorDatabases", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetAdvisorDatabases"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetAdvisorDatabasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -909,10 +813,7 @@ export const serializeAws_json1_1DescribeFleetAdvisorLsaAnalysisCommand = async input: DescribeFleetAdvisorLsaAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeFleetAdvisorLsaAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetAdvisorLsaAnalysis"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetAdvisorLsaAnalysisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -922,10 +823,7 @@ export const serializeAws_json1_1DescribeFleetAdvisorSchemaObjectSummaryCommand input: DescribeFleetAdvisorSchemaObjectSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeFleetAdvisorSchemaObjectSummary", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetAdvisorSchemaObjectSummary"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetAdvisorSchemaObjectSummaryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -935,10 +833,7 @@ export const serializeAws_json1_1DescribeFleetAdvisorSchemasCommand = async ( input: DescribeFleetAdvisorSchemasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeFleetAdvisorSchemas", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetAdvisorSchemas"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetAdvisorSchemasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -948,10 +843,7 @@ export const serializeAws_json1_1DescribeOrderableReplicationInstancesCommand = input: DescribeOrderableReplicationInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeOrderableReplicationInstances", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOrderableReplicationInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeOrderableReplicationInstancesMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -961,10 +853,7 @@ export const serializeAws_json1_1DescribePendingMaintenanceActionsCommand = asyn input: DescribePendingMaintenanceActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribePendingMaintenanceActions", - }; + const headers: __HeaderBag = sharedHeaders("DescribePendingMaintenanceActions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePendingMaintenanceActionsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -974,10 +863,7 @@ export const serializeAws_json1_1DescribeRecommendationLimitationsCommand = asyn input: DescribeRecommendationLimitationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeRecommendationLimitations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRecommendationLimitations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRecommendationLimitationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -987,10 +873,7 @@ export const serializeAws_json1_1DescribeRecommendationsCommand = async ( input: DescribeRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1000,10 +883,7 @@ export const serializeAws_json1_1DescribeRefreshSchemasStatusCommand = async ( input: DescribeRefreshSchemasStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeRefreshSchemasStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRefreshSchemasStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRefreshSchemasStatusMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1013,10 +893,7 @@ export const serializeAws_json1_1DescribeReplicationInstancesCommand = async ( input: DescribeReplicationInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeReplicationInstances", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReplicationInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReplicationInstancesMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1026,10 +903,7 @@ export const serializeAws_json1_1DescribeReplicationInstanceTaskLogsCommand = as input: DescribeReplicationInstanceTaskLogsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeReplicationInstanceTaskLogs", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReplicationInstanceTaskLogs"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReplicationInstanceTaskLogsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1039,10 +913,7 @@ export const serializeAws_json1_1DescribeReplicationSubnetGroupsCommand = async input: DescribeReplicationSubnetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeReplicationSubnetGroups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReplicationSubnetGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReplicationSubnetGroupsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1052,10 +923,7 @@ export const serializeAws_json1_1DescribeReplicationTaskAssessmentResultsCommand input: DescribeReplicationTaskAssessmentResultsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeReplicationTaskAssessmentResults", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReplicationTaskAssessmentResults"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReplicationTaskAssessmentResultsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1065,10 +933,7 @@ export const serializeAws_json1_1DescribeReplicationTaskAssessmentRunsCommand = input: DescribeReplicationTaskAssessmentRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeReplicationTaskAssessmentRuns", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReplicationTaskAssessmentRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReplicationTaskAssessmentRunsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1078,10 +943,7 @@ export const serializeAws_json1_1DescribeReplicationTaskIndividualAssessmentsCom input: DescribeReplicationTaskIndividualAssessmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeReplicationTaskIndividualAssessments", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReplicationTaskIndividualAssessments"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReplicationTaskIndividualAssessmentsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1091,10 +953,7 @@ export const serializeAws_json1_1DescribeReplicationTasksCommand = async ( input: DescribeReplicationTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeReplicationTasks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReplicationTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReplicationTasksMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1104,10 +963,7 @@ export const serializeAws_json1_1DescribeSchemasCommand = async ( input: DescribeSchemasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeSchemas", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSchemas"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSchemasMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1117,10 +973,7 @@ export const serializeAws_json1_1DescribeTableStatisticsCommand = async ( input: DescribeTableStatisticsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.DescribeTableStatistics", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTableStatistics"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTableStatisticsMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1130,10 +983,7 @@ export const serializeAws_json1_1ImportCertificateCommand = async ( input: ImportCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.ImportCertificate", - }; + const headers: __HeaderBag = sharedHeaders("ImportCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportCertificateMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1143,10 +993,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1156,10 +1003,7 @@ export const serializeAws_json1_1ModifyEndpointCommand = async ( input: ModifyEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.ModifyEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("ModifyEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyEndpointMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1169,10 +1013,7 @@ export const serializeAws_json1_1ModifyEventSubscriptionCommand = async ( input: ModifyEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.ModifyEventSubscription", - }; + const headers: __HeaderBag = sharedHeaders("ModifyEventSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyEventSubscriptionMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1182,10 +1023,7 @@ export const serializeAws_json1_1ModifyReplicationInstanceCommand = async ( input: ModifyReplicationInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.ModifyReplicationInstance", - }; + const headers: __HeaderBag = sharedHeaders("ModifyReplicationInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyReplicationInstanceMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1195,10 +1033,7 @@ export const serializeAws_json1_1ModifyReplicationSubnetGroupCommand = async ( input: ModifyReplicationSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.ModifyReplicationSubnetGroup", - }; + const headers: __HeaderBag = sharedHeaders("ModifyReplicationSubnetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyReplicationSubnetGroupMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1208,10 +1043,7 @@ export const serializeAws_json1_1ModifyReplicationTaskCommand = async ( input: ModifyReplicationTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.ModifyReplicationTask", - }; + const headers: __HeaderBag = sharedHeaders("ModifyReplicationTask"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyReplicationTaskMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1221,10 +1053,7 @@ export const serializeAws_json1_1MoveReplicationTaskCommand = async ( input: MoveReplicationTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.MoveReplicationTask", - }; + const headers: __HeaderBag = sharedHeaders("MoveReplicationTask"); let body: any; body = JSON.stringify(serializeAws_json1_1MoveReplicationTaskMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1234,10 +1063,7 @@ export const serializeAws_json1_1RebootReplicationInstanceCommand = async ( input: RebootReplicationInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.RebootReplicationInstance", - }; + const headers: __HeaderBag = sharedHeaders("RebootReplicationInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1RebootReplicationInstanceMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1247,10 +1073,7 @@ export const serializeAws_json1_1RefreshSchemasCommand = async ( input: RefreshSchemasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.RefreshSchemas", - }; + const headers: __HeaderBag = sharedHeaders("RefreshSchemas"); let body: any; body = JSON.stringify(serializeAws_json1_1RefreshSchemasMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1260,10 +1083,7 @@ export const serializeAws_json1_1ReloadTablesCommand = async ( input: ReloadTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.ReloadTables", - }; + const headers: __HeaderBag = sharedHeaders("ReloadTables"); let body: any; body = JSON.stringify(serializeAws_json1_1ReloadTablesMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1273,10 +1093,7 @@ export const serializeAws_json1_1RemoveTagsFromResourceCommand = async ( input: RemoveTagsFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.RemoveTagsFromResource", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTagsFromResource"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsFromResourceMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1286,10 +1103,7 @@ export const serializeAws_json1_1RunFleetAdvisorLsaAnalysisCommand = async ( input: RunFleetAdvisorLsaAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.RunFleetAdvisorLsaAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("RunFleetAdvisorLsaAnalysis"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -1298,10 +1112,7 @@ export const serializeAws_json1_1StartRecommendationsCommand = async ( input: StartRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.StartRecommendations", - }; + const headers: __HeaderBag = sharedHeaders("StartRecommendations"); let body: any; body = JSON.stringify(serializeAws_json1_1StartRecommendationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1311,10 +1122,7 @@ export const serializeAws_json1_1StartReplicationTaskCommand = async ( input: StartReplicationTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.StartReplicationTask", - }; + const headers: __HeaderBag = sharedHeaders("StartReplicationTask"); let body: any; body = JSON.stringify(serializeAws_json1_1StartReplicationTaskMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1324,10 +1132,7 @@ export const serializeAws_json1_1StartReplicationTaskAssessmentCommand = async ( input: StartReplicationTaskAssessmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.StartReplicationTaskAssessment", - }; + const headers: __HeaderBag = sharedHeaders("StartReplicationTaskAssessment"); let body: any; body = JSON.stringify(serializeAws_json1_1StartReplicationTaskAssessmentMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1337,10 +1142,7 @@ export const serializeAws_json1_1StartReplicationTaskAssessmentRunCommand = asyn input: StartReplicationTaskAssessmentRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.StartReplicationTaskAssessmentRun", - }; + const headers: __HeaderBag = sharedHeaders("StartReplicationTaskAssessmentRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartReplicationTaskAssessmentRunMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1350,10 +1152,7 @@ export const serializeAws_json1_1StopReplicationTaskCommand = async ( input: StopReplicationTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.StopReplicationTask", - }; + const headers: __HeaderBag = sharedHeaders("StopReplicationTask"); let body: any; body = JSON.stringify(serializeAws_json1_1StopReplicationTaskMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1363,10 +1162,7 @@ export const serializeAws_json1_1TestConnectionCommand = async ( input: TestConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.TestConnection", - }; + const headers: __HeaderBag = sharedHeaders("TestConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1TestConnectionMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1376,10 +1172,7 @@ export const serializeAws_json1_1UpdateSubscriptionsToEventBridgeCommand = async input: UpdateSubscriptionsToEventBridgeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDMSv20160101.UpdateSubscriptionsToEventBridge", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSubscriptionsToEventBridge"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSubscriptionsToEventBridgeMessage(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -9062,6 +8855,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonDMSv20160101.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-datasync/src/protocols/Aws_json1_1.ts b/clients/client-datasync/src/protocols/Aws_json1_1.ts index 6558ef38d3b5a..e3cb593971462 100644 --- a/clients/client-datasync/src/protocols/Aws_json1_1.ts +++ b/clients/client-datasync/src/protocols/Aws_json1_1.ts @@ -238,10 +238,7 @@ export const serializeAws_json1_1CancelTaskExecutionCommand = async ( input: CancelTaskExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CancelTaskExecution", - }; + const headers: __HeaderBag = sharedHeaders("CancelTaskExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelTaskExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -251,10 +248,7 @@ export const serializeAws_json1_1CreateAgentCommand = async ( input: CreateAgentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateAgent", - }; + const headers: __HeaderBag = sharedHeaders("CreateAgent"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAgentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -264,10 +258,7 @@ export const serializeAws_json1_1CreateLocationEfsCommand = async ( input: CreateLocationEfsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateLocationEfs", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocationEfs"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationEfsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -277,10 +268,7 @@ export const serializeAws_json1_1CreateLocationFsxLustreCommand = async ( input: CreateLocationFsxLustreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateLocationFsxLustre", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocationFsxLustre"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationFsxLustreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -290,10 +278,7 @@ export const serializeAws_json1_1CreateLocationFsxOntapCommand = async ( input: CreateLocationFsxOntapCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateLocationFsxOntap", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocationFsxOntap"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationFsxOntapRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -303,10 +288,7 @@ export const serializeAws_json1_1CreateLocationFsxOpenZfsCommand = async ( input: CreateLocationFsxOpenZfsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateLocationFsxOpenZfs", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocationFsxOpenZfs"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationFsxOpenZfsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -316,10 +298,7 @@ export const serializeAws_json1_1CreateLocationFsxWindowsCommand = async ( input: CreateLocationFsxWindowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateLocationFsxWindows", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocationFsxWindows"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationFsxWindowsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -329,10 +308,7 @@ export const serializeAws_json1_1CreateLocationHdfsCommand = async ( input: CreateLocationHdfsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateLocationHdfs", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocationHdfs"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationHdfsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -342,10 +318,7 @@ export const serializeAws_json1_1CreateLocationNfsCommand = async ( input: CreateLocationNfsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateLocationNfs", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocationNfs"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationNfsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -355,10 +328,7 @@ export const serializeAws_json1_1CreateLocationObjectStorageCommand = async ( input: CreateLocationObjectStorageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateLocationObjectStorage", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocationObjectStorage"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationObjectStorageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -368,10 +338,7 @@ export const serializeAws_json1_1CreateLocationS3Command = async ( input: CreateLocationS3CommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateLocationS3", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocationS3"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationS3Request(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -381,10 +348,7 @@ export const serializeAws_json1_1CreateLocationSmbCommand = async ( input: CreateLocationSmbCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateLocationSmb", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocationSmb"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationSmbRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -394,10 +358,7 @@ export const serializeAws_json1_1CreateTaskCommand = async ( input: CreateTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.CreateTask", - }; + const headers: __HeaderBag = sharedHeaders("CreateTask"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -407,10 +368,7 @@ export const serializeAws_json1_1DeleteAgentCommand = async ( input: DeleteAgentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DeleteAgent", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAgent"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAgentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -420,10 +378,7 @@ export const serializeAws_json1_1DeleteLocationCommand = async ( input: DeleteLocationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DeleteLocation", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLocation"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLocationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -433,10 +388,7 @@ export const serializeAws_json1_1DeleteTaskCommand = async ( input: DeleteTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DeleteTask", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTask"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -446,10 +398,7 @@ export const serializeAws_json1_1DescribeAgentCommand = async ( input: DescribeAgentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeAgent", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAgent"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAgentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -459,10 +408,7 @@ export const serializeAws_json1_1DescribeLocationEfsCommand = async ( input: DescribeLocationEfsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeLocationEfs", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocationEfs"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLocationEfsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -472,10 +418,7 @@ export const serializeAws_json1_1DescribeLocationFsxLustreCommand = async ( input: DescribeLocationFsxLustreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeLocationFsxLustre", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocationFsxLustre"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLocationFsxLustreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -485,10 +428,7 @@ export const serializeAws_json1_1DescribeLocationFsxOntapCommand = async ( input: DescribeLocationFsxOntapCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeLocationFsxOntap", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocationFsxOntap"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLocationFsxOntapRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -498,10 +438,7 @@ export const serializeAws_json1_1DescribeLocationFsxOpenZfsCommand = async ( input: DescribeLocationFsxOpenZfsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeLocationFsxOpenZfs", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocationFsxOpenZfs"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLocationFsxOpenZfsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -511,10 +448,7 @@ export const serializeAws_json1_1DescribeLocationFsxWindowsCommand = async ( input: DescribeLocationFsxWindowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeLocationFsxWindows", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocationFsxWindows"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLocationFsxWindowsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -524,10 +458,7 @@ export const serializeAws_json1_1DescribeLocationHdfsCommand = async ( input: DescribeLocationHdfsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeLocationHdfs", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocationHdfs"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLocationHdfsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -537,10 +468,7 @@ export const serializeAws_json1_1DescribeLocationNfsCommand = async ( input: DescribeLocationNfsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeLocationNfs", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocationNfs"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLocationNfsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -550,10 +478,7 @@ export const serializeAws_json1_1DescribeLocationObjectStorageCommand = async ( input: DescribeLocationObjectStorageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeLocationObjectStorage", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocationObjectStorage"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLocationObjectStorageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -563,10 +488,7 @@ export const serializeAws_json1_1DescribeLocationS3Command = async ( input: DescribeLocationS3CommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeLocationS3", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocationS3"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLocationS3Request(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -576,10 +498,7 @@ export const serializeAws_json1_1DescribeLocationSmbCommand = async ( input: DescribeLocationSmbCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeLocationSmb", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocationSmb"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLocationSmbRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -589,10 +508,7 @@ export const serializeAws_json1_1DescribeTaskCommand = async ( input: DescribeTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeTask", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTask"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -602,10 +518,7 @@ export const serializeAws_json1_1DescribeTaskExecutionCommand = async ( input: DescribeTaskExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.DescribeTaskExecution", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTaskExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTaskExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -615,10 +528,7 @@ export const serializeAws_json1_1ListAgentsCommand = async ( input: ListAgentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.ListAgents", - }; + const headers: __HeaderBag = sharedHeaders("ListAgents"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAgentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -628,10 +538,7 @@ export const serializeAws_json1_1ListLocationsCommand = async ( input: ListLocationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.ListLocations", - }; + const headers: __HeaderBag = sharedHeaders("ListLocations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLocationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -641,10 +548,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -654,10 +558,7 @@ export const serializeAws_json1_1ListTaskExecutionsCommand = async ( input: ListTaskExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.ListTaskExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListTaskExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTaskExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -667,10 +568,7 @@ export const serializeAws_json1_1ListTasksCommand = async ( input: ListTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.ListTasks", - }; + const headers: __HeaderBag = sharedHeaders("ListTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -680,10 +578,7 @@ export const serializeAws_json1_1StartTaskExecutionCommand = async ( input: StartTaskExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.StartTaskExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartTaskExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StartTaskExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -693,10 +588,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -706,10 +598,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -719,10 +608,7 @@ export const serializeAws_json1_1UpdateAgentCommand = async ( input: UpdateAgentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.UpdateAgent", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAgent"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAgentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -732,10 +618,7 @@ export const serializeAws_json1_1UpdateLocationHdfsCommand = async ( input: UpdateLocationHdfsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.UpdateLocationHdfs", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLocationHdfs"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLocationHdfsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -745,10 +628,7 @@ export const serializeAws_json1_1UpdateLocationNfsCommand = async ( input: UpdateLocationNfsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.UpdateLocationNfs", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLocationNfs"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLocationNfsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -758,10 +638,7 @@ export const serializeAws_json1_1UpdateLocationObjectStorageCommand = async ( input: UpdateLocationObjectStorageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.UpdateLocationObjectStorage", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLocationObjectStorage"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLocationObjectStorageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -771,10 +648,7 @@ export const serializeAws_json1_1UpdateLocationSmbCommand = async ( input: UpdateLocationSmbCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.UpdateLocationSmb", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLocationSmb"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLocationSmbRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -784,10 +658,7 @@ export const serializeAws_json1_1UpdateTaskCommand = async ( input: UpdateTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.UpdateTask", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTask"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -797,10 +668,7 @@ export const serializeAws_json1_1UpdateTaskExecutionCommand = async ( input: UpdateTaskExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "FmrsService.UpdateTaskExecution", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTaskExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTaskExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4369,6 +4237,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `FmrsService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-dax/src/protocols/Aws_json1_1.ts b/clients/client-dax/src/protocols/Aws_json1_1.ts index 7aec6b84dc8a6..0579a7c7fefb2 100644 --- a/clients/client-dax/src/protocols/Aws_json1_1.ts +++ b/clients/client-dax/src/protocols/Aws_json1_1.ts @@ -154,10 +154,7 @@ export const serializeAws_json1_1CreateClusterCommand = async ( input: CreateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.CreateCluster", - }; + const headers: __HeaderBag = sharedHeaders("CreateCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -167,10 +164,7 @@ export const serializeAws_json1_1CreateParameterGroupCommand = async ( input: CreateParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.CreateParameterGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateParameterGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateParameterGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -180,10 +174,7 @@ export const serializeAws_json1_1CreateSubnetGroupCommand = async ( input: CreateSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.CreateSubnetGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateSubnetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSubnetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -193,10 +184,7 @@ export const serializeAws_json1_1DecreaseReplicationFactorCommand = async ( input: DecreaseReplicationFactorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.DecreaseReplicationFactor", - }; + const headers: __HeaderBag = sharedHeaders("DecreaseReplicationFactor"); let body: any; body = JSON.stringify(serializeAws_json1_1DecreaseReplicationFactorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -206,10 +194,7 @@ export const serializeAws_json1_1DeleteClusterCommand = async ( input: DeleteClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.DeleteCluster", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -219,10 +204,7 @@ export const serializeAws_json1_1DeleteParameterGroupCommand = async ( input: DeleteParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.DeleteParameterGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteParameterGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteParameterGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -232,10 +214,7 @@ export const serializeAws_json1_1DeleteSubnetGroupCommand = async ( input: DeleteSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.DeleteSubnetGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSubnetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSubnetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -245,10 +224,7 @@ export const serializeAws_json1_1DescribeClustersCommand = async ( input: DescribeClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.DescribeClusters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeClusters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeClustersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -258,10 +234,7 @@ export const serializeAws_json1_1DescribeDefaultParametersCommand = async ( input: DescribeDefaultParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.DescribeDefaultParameters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDefaultParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDefaultParametersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -271,10 +244,7 @@ export const serializeAws_json1_1DescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.DescribeEvents", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -284,10 +254,7 @@ export const serializeAws_json1_1DescribeParameterGroupsCommand = async ( input: DescribeParameterGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.DescribeParameterGroups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeParameterGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeParameterGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -297,10 +264,7 @@ export const serializeAws_json1_1DescribeParametersCommand = async ( input: DescribeParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.DescribeParameters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeParametersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -310,10 +274,7 @@ export const serializeAws_json1_1DescribeSubnetGroupsCommand = async ( input: DescribeSubnetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.DescribeSubnetGroups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSubnetGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSubnetGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -323,10 +284,7 @@ export const serializeAws_json1_1IncreaseReplicationFactorCommand = async ( input: IncreaseReplicationFactorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.IncreaseReplicationFactor", - }; + const headers: __HeaderBag = sharedHeaders("IncreaseReplicationFactor"); let body: any; body = JSON.stringify(serializeAws_json1_1IncreaseReplicationFactorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -336,10 +294,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.ListTags", - }; + const headers: __HeaderBag = sharedHeaders("ListTags"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -349,10 +304,7 @@ export const serializeAws_json1_1RebootNodeCommand = async ( input: RebootNodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.RebootNode", - }; + const headers: __HeaderBag = sharedHeaders("RebootNode"); let body: any; body = JSON.stringify(serializeAws_json1_1RebootNodeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -362,10 +314,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -375,10 +324,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -388,10 +334,7 @@ export const serializeAws_json1_1UpdateClusterCommand = async ( input: UpdateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.UpdateCluster", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -401,10 +344,7 @@ export const serializeAws_json1_1UpdateParameterGroupCommand = async ( input: UpdateParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.UpdateParameterGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateParameterGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateParameterGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -414,10 +354,7 @@ export const serializeAws_json1_1UpdateSubnetGroupCommand = async ( input: UpdateSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonDAXV3.UpdateSubnetGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSubnetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSubnetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3003,6 +2940,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonDAXV3.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-device-farm/src/protocols/Aws_json1_1.ts b/clients/client-device-farm/src/protocols/Aws_json1_1.ts index b6b7af7150975..d39c4068ad85a 100644 --- a/clients/client-device-farm/src/protocols/Aws_json1_1.ts +++ b/clients/client-device-farm/src/protocols/Aws_json1_1.ts @@ -419,10 +419,7 @@ export const serializeAws_json1_1CreateDevicePoolCommand = async ( input: CreateDevicePoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.CreateDevicePool", - }; + const headers: __HeaderBag = sharedHeaders("CreateDevicePool"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDevicePoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -432,10 +429,7 @@ export const serializeAws_json1_1CreateInstanceProfileCommand = async ( input: CreateInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.CreateInstanceProfile", - }; + const headers: __HeaderBag = sharedHeaders("CreateInstanceProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateInstanceProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -445,10 +439,7 @@ export const serializeAws_json1_1CreateNetworkProfileCommand = async ( input: CreateNetworkProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.CreateNetworkProfile", - }; + const headers: __HeaderBag = sharedHeaders("CreateNetworkProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateNetworkProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -458,10 +449,7 @@ export const serializeAws_json1_1CreateProjectCommand = async ( input: CreateProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.CreateProject", - }; + const headers: __HeaderBag = sharedHeaders("CreateProject"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -471,10 +459,7 @@ export const serializeAws_json1_1CreateRemoteAccessSessionCommand = async ( input: CreateRemoteAccessSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.CreateRemoteAccessSession", - }; + const headers: __HeaderBag = sharedHeaders("CreateRemoteAccessSession"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRemoteAccessSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -484,10 +469,7 @@ export const serializeAws_json1_1CreateTestGridProjectCommand = async ( input: CreateTestGridProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.CreateTestGridProject", - }; + const headers: __HeaderBag = sharedHeaders("CreateTestGridProject"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTestGridProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -497,10 +479,7 @@ export const serializeAws_json1_1CreateTestGridUrlCommand = async ( input: CreateTestGridUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.CreateTestGridUrl", - }; + const headers: __HeaderBag = sharedHeaders("CreateTestGridUrl"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTestGridUrlRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -510,10 +489,7 @@ export const serializeAws_json1_1CreateUploadCommand = async ( input: CreateUploadCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.CreateUpload", - }; + const headers: __HeaderBag = sharedHeaders("CreateUpload"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUploadRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -523,10 +499,7 @@ export const serializeAws_json1_1CreateVPCEConfigurationCommand = async ( input: CreateVPCEConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.CreateVPCEConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("CreateVPCEConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateVPCEConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -536,10 +509,7 @@ export const serializeAws_json1_1DeleteDevicePoolCommand = async ( input: DeleteDevicePoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.DeleteDevicePool", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDevicePool"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDevicePoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -549,10 +519,7 @@ export const serializeAws_json1_1DeleteInstanceProfileCommand = async ( input: DeleteInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.DeleteInstanceProfile", - }; + const headers: __HeaderBag = sharedHeaders("DeleteInstanceProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteInstanceProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -562,10 +529,7 @@ export const serializeAws_json1_1DeleteNetworkProfileCommand = async ( input: DeleteNetworkProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.DeleteNetworkProfile", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNetworkProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNetworkProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -575,10 +539,7 @@ export const serializeAws_json1_1DeleteProjectCommand = async ( input: DeleteProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.DeleteProject", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProject"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -588,10 +549,7 @@ export const serializeAws_json1_1DeleteRemoteAccessSessionCommand = async ( input: DeleteRemoteAccessSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.DeleteRemoteAccessSession", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRemoteAccessSession"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRemoteAccessSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -601,10 +559,7 @@ export const serializeAws_json1_1DeleteRunCommand = async ( input: DeleteRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.DeleteRun", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRun"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -614,10 +569,7 @@ export const serializeAws_json1_1DeleteTestGridProjectCommand = async ( input: DeleteTestGridProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.DeleteTestGridProject", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTestGridProject"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTestGridProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -627,10 +579,7 @@ export const serializeAws_json1_1DeleteUploadCommand = async ( input: DeleteUploadCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.DeleteUpload", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUpload"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUploadRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -640,10 +589,7 @@ export const serializeAws_json1_1DeleteVPCEConfigurationCommand = async ( input: DeleteVPCEConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.DeleteVPCEConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVPCEConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteVPCEConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -653,10 +599,7 @@ export const serializeAws_json1_1GetAccountSettingsCommand = async ( input: GetAccountSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetAccountSettings", - }; + const headers: __HeaderBag = sharedHeaders("GetAccountSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAccountSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -666,10 +609,7 @@ export const serializeAws_json1_1GetDeviceCommand = async ( input: GetDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetDevice", - }; + const headers: __HeaderBag = sharedHeaders("GetDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -679,10 +619,7 @@ export const serializeAws_json1_1GetDeviceInstanceCommand = async ( input: GetDeviceInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetDeviceInstance", - }; + const headers: __HeaderBag = sharedHeaders("GetDeviceInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeviceInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -692,10 +629,7 @@ export const serializeAws_json1_1GetDevicePoolCommand = async ( input: GetDevicePoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetDevicePool", - }; + const headers: __HeaderBag = sharedHeaders("GetDevicePool"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDevicePoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -705,10 +639,7 @@ export const serializeAws_json1_1GetDevicePoolCompatibilityCommand = async ( input: GetDevicePoolCompatibilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetDevicePoolCompatibility", - }; + const headers: __HeaderBag = sharedHeaders("GetDevicePoolCompatibility"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDevicePoolCompatibilityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -718,10 +649,7 @@ export const serializeAws_json1_1GetInstanceProfileCommand = async ( input: GetInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetInstanceProfile", - }; + const headers: __HeaderBag = sharedHeaders("GetInstanceProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstanceProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -731,10 +659,7 @@ export const serializeAws_json1_1GetJobCommand = async ( input: GetJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetJob", - }; + const headers: __HeaderBag = sharedHeaders("GetJob"); let body: any; body = JSON.stringify(serializeAws_json1_1GetJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -744,10 +669,7 @@ export const serializeAws_json1_1GetNetworkProfileCommand = async ( input: GetNetworkProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetNetworkProfile", - }; + const headers: __HeaderBag = sharedHeaders("GetNetworkProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1GetNetworkProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -757,10 +679,7 @@ export const serializeAws_json1_1GetOfferingStatusCommand = async ( input: GetOfferingStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetOfferingStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetOfferingStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOfferingStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -770,10 +689,7 @@ export const serializeAws_json1_1GetProjectCommand = async ( input: GetProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetProject", - }; + const headers: __HeaderBag = sharedHeaders("GetProject"); let body: any; body = JSON.stringify(serializeAws_json1_1GetProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -783,10 +699,7 @@ export const serializeAws_json1_1GetRemoteAccessSessionCommand = async ( input: GetRemoteAccessSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetRemoteAccessSession", - }; + const headers: __HeaderBag = sharedHeaders("GetRemoteAccessSession"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRemoteAccessSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -796,10 +709,7 @@ export const serializeAws_json1_1GetRunCommand = async ( input: GetRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetRun", - }; + const headers: __HeaderBag = sharedHeaders("GetRun"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -809,10 +719,7 @@ export const serializeAws_json1_1GetSuiteCommand = async ( input: GetSuiteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetSuite", - }; + const headers: __HeaderBag = sharedHeaders("GetSuite"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSuiteRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -822,10 +729,7 @@ export const serializeAws_json1_1GetTestCommand = async ( input: GetTestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetTest", - }; + const headers: __HeaderBag = sharedHeaders("GetTest"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -835,10 +739,7 @@ export const serializeAws_json1_1GetTestGridProjectCommand = async ( input: GetTestGridProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetTestGridProject", - }; + const headers: __HeaderBag = sharedHeaders("GetTestGridProject"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTestGridProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -848,10 +749,7 @@ export const serializeAws_json1_1GetTestGridSessionCommand = async ( input: GetTestGridSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetTestGridSession", - }; + const headers: __HeaderBag = sharedHeaders("GetTestGridSession"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTestGridSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -861,10 +759,7 @@ export const serializeAws_json1_1GetUploadCommand = async ( input: GetUploadCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetUpload", - }; + const headers: __HeaderBag = sharedHeaders("GetUpload"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUploadRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -874,10 +769,7 @@ export const serializeAws_json1_1GetVPCEConfigurationCommand = async ( input: GetVPCEConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.GetVPCEConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetVPCEConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetVPCEConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -887,10 +779,7 @@ export const serializeAws_json1_1InstallToRemoteAccessSessionCommand = async ( input: InstallToRemoteAccessSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.InstallToRemoteAccessSession", - }; + const headers: __HeaderBag = sharedHeaders("InstallToRemoteAccessSession"); let body: any; body = JSON.stringify(serializeAws_json1_1InstallToRemoteAccessSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -900,10 +789,7 @@ export const serializeAws_json1_1ListArtifactsCommand = async ( input: ListArtifactsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListArtifacts", - }; + const headers: __HeaderBag = sharedHeaders("ListArtifacts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListArtifactsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -913,10 +799,7 @@ export const serializeAws_json1_1ListDeviceInstancesCommand = async ( input: ListDeviceInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListDeviceInstances", - }; + const headers: __HeaderBag = sharedHeaders("ListDeviceInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDeviceInstancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -926,10 +809,7 @@ export const serializeAws_json1_1ListDevicePoolsCommand = async ( input: ListDevicePoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListDevicePools", - }; + const headers: __HeaderBag = sharedHeaders("ListDevicePools"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDevicePoolsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -939,10 +819,7 @@ export const serializeAws_json1_1ListDevicesCommand = async ( input: ListDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListDevices", - }; + const headers: __HeaderBag = sharedHeaders("ListDevices"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDevicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -952,10 +829,7 @@ export const serializeAws_json1_1ListInstanceProfilesCommand = async ( input: ListInstanceProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListInstanceProfiles", - }; + const headers: __HeaderBag = sharedHeaders("ListInstanceProfiles"); let body: any; body = JSON.stringify(serializeAws_json1_1ListInstanceProfilesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -965,10 +839,7 @@ export const serializeAws_json1_1ListJobsCommand = async ( input: ListJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -978,10 +849,7 @@ export const serializeAws_json1_1ListNetworkProfilesCommand = async ( input: ListNetworkProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListNetworkProfiles", - }; + const headers: __HeaderBag = sharedHeaders("ListNetworkProfiles"); let body: any; body = JSON.stringify(serializeAws_json1_1ListNetworkProfilesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -991,10 +859,7 @@ export const serializeAws_json1_1ListOfferingPromotionsCommand = async ( input: ListOfferingPromotionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListOfferingPromotions", - }; + const headers: __HeaderBag = sharedHeaders("ListOfferingPromotions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOfferingPromotionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1004,10 +869,7 @@ export const serializeAws_json1_1ListOfferingsCommand = async ( input: ListOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListOfferings", - }; + const headers: __HeaderBag = sharedHeaders("ListOfferings"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOfferingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1017,10 +879,7 @@ export const serializeAws_json1_1ListOfferingTransactionsCommand = async ( input: ListOfferingTransactionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListOfferingTransactions", - }; + const headers: __HeaderBag = sharedHeaders("ListOfferingTransactions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOfferingTransactionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1030,10 +889,7 @@ export const serializeAws_json1_1ListProjectsCommand = async ( input: ListProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListProjects", - }; + const headers: __HeaderBag = sharedHeaders("ListProjects"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProjectsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1043,10 +899,7 @@ export const serializeAws_json1_1ListRemoteAccessSessionsCommand = async ( input: ListRemoteAccessSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListRemoteAccessSessions", - }; + const headers: __HeaderBag = sharedHeaders("ListRemoteAccessSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRemoteAccessSessionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1056,10 +909,7 @@ export const serializeAws_json1_1ListRunsCommand = async ( input: ListRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListRuns", - }; + const headers: __HeaderBag = sharedHeaders("ListRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRunsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1069,10 +919,7 @@ export const serializeAws_json1_1ListSamplesCommand = async ( input: ListSamplesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListSamples", - }; + const headers: __HeaderBag = sharedHeaders("ListSamples"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSamplesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1082,10 +929,7 @@ export const serializeAws_json1_1ListSuitesCommand = async ( input: ListSuitesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListSuites", - }; + const headers: __HeaderBag = sharedHeaders("ListSuites"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSuitesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1095,10 +939,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1108,10 +949,7 @@ export const serializeAws_json1_1ListTestGridProjectsCommand = async ( input: ListTestGridProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListTestGridProjects", - }; + const headers: __HeaderBag = sharedHeaders("ListTestGridProjects"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTestGridProjectsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1121,10 +959,7 @@ export const serializeAws_json1_1ListTestGridSessionActionsCommand = async ( input: ListTestGridSessionActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListTestGridSessionActions", - }; + const headers: __HeaderBag = sharedHeaders("ListTestGridSessionActions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTestGridSessionActionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1134,10 +969,7 @@ export const serializeAws_json1_1ListTestGridSessionArtifactsCommand = async ( input: ListTestGridSessionArtifactsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListTestGridSessionArtifacts", - }; + const headers: __HeaderBag = sharedHeaders("ListTestGridSessionArtifacts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTestGridSessionArtifactsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1147,10 +979,7 @@ export const serializeAws_json1_1ListTestGridSessionsCommand = async ( input: ListTestGridSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListTestGridSessions", - }; + const headers: __HeaderBag = sharedHeaders("ListTestGridSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTestGridSessionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1160,10 +989,7 @@ export const serializeAws_json1_1ListTestsCommand = async ( input: ListTestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListTests", - }; + const headers: __HeaderBag = sharedHeaders("ListTests"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTestsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1173,10 +999,7 @@ export const serializeAws_json1_1ListUniqueProblemsCommand = async ( input: ListUniqueProblemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListUniqueProblems", - }; + const headers: __HeaderBag = sharedHeaders("ListUniqueProblems"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUniqueProblemsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1186,10 +1009,7 @@ export const serializeAws_json1_1ListUploadsCommand = async ( input: ListUploadsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListUploads", - }; + const headers: __HeaderBag = sharedHeaders("ListUploads"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUploadsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1199,10 +1019,7 @@ export const serializeAws_json1_1ListVPCEConfigurationsCommand = async ( input: ListVPCEConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ListVPCEConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListVPCEConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListVPCEConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1212,10 +1029,7 @@ export const serializeAws_json1_1PurchaseOfferingCommand = async ( input: PurchaseOfferingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.PurchaseOffering", - }; + const headers: __HeaderBag = sharedHeaders("PurchaseOffering"); let body: any; body = JSON.stringify(serializeAws_json1_1PurchaseOfferingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1225,10 +1039,7 @@ export const serializeAws_json1_1RenewOfferingCommand = async ( input: RenewOfferingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.RenewOffering", - }; + const headers: __HeaderBag = sharedHeaders("RenewOffering"); let body: any; body = JSON.stringify(serializeAws_json1_1RenewOfferingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1238,10 +1049,7 @@ export const serializeAws_json1_1ScheduleRunCommand = async ( input: ScheduleRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.ScheduleRun", - }; + const headers: __HeaderBag = sharedHeaders("ScheduleRun"); let body: any; body = JSON.stringify(serializeAws_json1_1ScheduleRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1251,10 +1059,7 @@ export const serializeAws_json1_1StopJobCommand = async ( input: StopJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.StopJob", - }; + const headers: __HeaderBag = sharedHeaders("StopJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1264,10 +1069,7 @@ export const serializeAws_json1_1StopRemoteAccessSessionCommand = async ( input: StopRemoteAccessSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.StopRemoteAccessSession", - }; + const headers: __HeaderBag = sharedHeaders("StopRemoteAccessSession"); let body: any; body = JSON.stringify(serializeAws_json1_1StopRemoteAccessSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1277,10 +1079,7 @@ export const serializeAws_json1_1StopRunCommand = async ( input: StopRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.StopRun", - }; + const headers: __HeaderBag = sharedHeaders("StopRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StopRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1290,10 +1089,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1303,10 +1099,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1316,10 +1109,7 @@ export const serializeAws_json1_1UpdateDeviceInstanceCommand = async ( input: UpdateDeviceInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.UpdateDeviceInstance", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDeviceInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDeviceInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1329,10 +1119,7 @@ export const serializeAws_json1_1UpdateDevicePoolCommand = async ( input: UpdateDevicePoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.UpdateDevicePool", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDevicePool"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDevicePoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1342,10 +1129,7 @@ export const serializeAws_json1_1UpdateInstanceProfileCommand = async ( input: UpdateInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.UpdateInstanceProfile", - }; + const headers: __HeaderBag = sharedHeaders("UpdateInstanceProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateInstanceProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1355,10 +1139,7 @@ export const serializeAws_json1_1UpdateNetworkProfileCommand = async ( input: UpdateNetworkProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.UpdateNetworkProfile", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNetworkProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNetworkProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1368,10 +1149,7 @@ export const serializeAws_json1_1UpdateProjectCommand = async ( input: UpdateProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.UpdateProject", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProject"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1381,10 +1159,7 @@ export const serializeAws_json1_1UpdateTestGridProjectCommand = async ( input: UpdateTestGridProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.UpdateTestGridProject", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTestGridProject"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTestGridProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1394,10 +1169,7 @@ export const serializeAws_json1_1UpdateUploadCommand = async ( input: UpdateUploadCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.UpdateUpload", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUpload"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUploadRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1407,10 +1179,7 @@ export const serializeAws_json1_1UpdateVPCEConfigurationCommand = async ( input: UpdateVPCEConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DeviceFarm_20150623.UpdateVPCEConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVPCEConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateVPCEConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -8330,6 +8099,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `DeviceFarm_20150623.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-direct-connect/src/protocols/Aws_json1_1.ts b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts index 58c939a9ee99c..b44e989efbb83 100644 --- a/clients/client-direct-connect/src/protocols/Aws_json1_1.ts +++ b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts @@ -357,10 +357,7 @@ export const serializeAws_json1_1AcceptDirectConnectGatewayAssociationProposalCo input: AcceptDirectConnectGatewayAssociationProposalCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.AcceptDirectConnectGatewayAssociationProposal", - }; + const headers: __HeaderBag = sharedHeaders("AcceptDirectConnectGatewayAssociationProposal"); let body: any; body = JSON.stringify(serializeAws_json1_1AcceptDirectConnectGatewayAssociationProposalRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -370,10 +367,7 @@ export const serializeAws_json1_1AllocateConnectionOnInterconnectCommand = async input: AllocateConnectionOnInterconnectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.AllocateConnectionOnInterconnect", - }; + const headers: __HeaderBag = sharedHeaders("AllocateConnectionOnInterconnect"); let body: any; body = JSON.stringify(serializeAws_json1_1AllocateConnectionOnInterconnectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -383,10 +377,7 @@ export const serializeAws_json1_1AllocateHostedConnectionCommand = async ( input: AllocateHostedConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.AllocateHostedConnection", - }; + const headers: __HeaderBag = sharedHeaders("AllocateHostedConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1AllocateHostedConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -396,10 +387,7 @@ export const serializeAws_json1_1AllocatePrivateVirtualInterfaceCommand = async input: AllocatePrivateVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.AllocatePrivateVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("AllocatePrivateVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1AllocatePrivateVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -409,10 +397,7 @@ export const serializeAws_json1_1AllocatePublicVirtualInterfaceCommand = async ( input: AllocatePublicVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.AllocatePublicVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("AllocatePublicVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1AllocatePublicVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -422,10 +407,7 @@ export const serializeAws_json1_1AllocateTransitVirtualInterfaceCommand = async input: AllocateTransitVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.AllocateTransitVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("AllocateTransitVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1AllocateTransitVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -435,10 +417,7 @@ export const serializeAws_json1_1AssociateConnectionWithLagCommand = async ( input: AssociateConnectionWithLagCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.AssociateConnectionWithLag", - }; + const headers: __HeaderBag = sharedHeaders("AssociateConnectionWithLag"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateConnectionWithLagRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -448,10 +427,7 @@ export const serializeAws_json1_1AssociateHostedConnectionCommand = async ( input: AssociateHostedConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.AssociateHostedConnection", - }; + const headers: __HeaderBag = sharedHeaders("AssociateHostedConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateHostedConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -461,10 +437,7 @@ export const serializeAws_json1_1AssociateMacSecKeyCommand = async ( input: AssociateMacSecKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.AssociateMacSecKey", - }; + const headers: __HeaderBag = sharedHeaders("AssociateMacSecKey"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateMacSecKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -474,10 +447,7 @@ export const serializeAws_json1_1AssociateVirtualInterfaceCommand = async ( input: AssociateVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.AssociateVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("AssociateVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -487,10 +457,7 @@ export const serializeAws_json1_1ConfirmConnectionCommand = async ( input: ConfirmConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.ConfirmConnection", - }; + const headers: __HeaderBag = sharedHeaders("ConfirmConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1ConfirmConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -500,10 +467,7 @@ export const serializeAws_json1_1ConfirmCustomerAgreementCommand = async ( input: ConfirmCustomerAgreementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.ConfirmCustomerAgreement", - }; + const headers: __HeaderBag = sharedHeaders("ConfirmCustomerAgreement"); let body: any; body = JSON.stringify(serializeAws_json1_1ConfirmCustomerAgreementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -513,10 +477,7 @@ export const serializeAws_json1_1ConfirmPrivateVirtualInterfaceCommand = async ( input: ConfirmPrivateVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.ConfirmPrivateVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("ConfirmPrivateVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1ConfirmPrivateVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -526,10 +487,7 @@ export const serializeAws_json1_1ConfirmPublicVirtualInterfaceCommand = async ( input: ConfirmPublicVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.ConfirmPublicVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("ConfirmPublicVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1ConfirmPublicVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -539,10 +497,7 @@ export const serializeAws_json1_1ConfirmTransitVirtualInterfaceCommand = async ( input: ConfirmTransitVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.ConfirmTransitVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("ConfirmTransitVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1ConfirmTransitVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -552,10 +507,7 @@ export const serializeAws_json1_1CreateBGPPeerCommand = async ( input: CreateBGPPeerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.CreateBGPPeer", - }; + const headers: __HeaderBag = sharedHeaders("CreateBGPPeer"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBGPPeerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -565,10 +517,7 @@ export const serializeAws_json1_1CreateConnectionCommand = async ( input: CreateConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.CreateConnection", - }; + const headers: __HeaderBag = sharedHeaders("CreateConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -578,10 +527,7 @@ export const serializeAws_json1_1CreateDirectConnectGatewayCommand = async ( input: CreateDirectConnectGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.CreateDirectConnectGateway", - }; + const headers: __HeaderBag = sharedHeaders("CreateDirectConnectGateway"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDirectConnectGatewayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -591,10 +537,7 @@ export const serializeAws_json1_1CreateDirectConnectGatewayAssociationCommand = input: CreateDirectConnectGatewayAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.CreateDirectConnectGatewayAssociation", - }; + const headers: __HeaderBag = sharedHeaders("CreateDirectConnectGatewayAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDirectConnectGatewayAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -604,10 +547,7 @@ export const serializeAws_json1_1CreateDirectConnectGatewayAssociationProposalCo input: CreateDirectConnectGatewayAssociationProposalCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.CreateDirectConnectGatewayAssociationProposal", - }; + const headers: __HeaderBag = sharedHeaders("CreateDirectConnectGatewayAssociationProposal"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDirectConnectGatewayAssociationProposalRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -617,10 +557,7 @@ export const serializeAws_json1_1CreateInterconnectCommand = async ( input: CreateInterconnectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.CreateInterconnect", - }; + const headers: __HeaderBag = sharedHeaders("CreateInterconnect"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateInterconnectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -630,10 +567,7 @@ export const serializeAws_json1_1CreateLagCommand = async ( input: CreateLagCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.CreateLag", - }; + const headers: __HeaderBag = sharedHeaders("CreateLag"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLagRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -643,10 +577,7 @@ export const serializeAws_json1_1CreatePrivateVirtualInterfaceCommand = async ( input: CreatePrivateVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.CreatePrivateVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("CreatePrivateVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePrivateVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -656,10 +587,7 @@ export const serializeAws_json1_1CreatePublicVirtualInterfaceCommand = async ( input: CreatePublicVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.CreatePublicVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("CreatePublicVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePublicVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -669,10 +597,7 @@ export const serializeAws_json1_1CreateTransitVirtualInterfaceCommand = async ( input: CreateTransitVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.CreateTransitVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("CreateTransitVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTransitVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -682,10 +607,7 @@ export const serializeAws_json1_1DeleteBGPPeerCommand = async ( input: DeleteBGPPeerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DeleteBGPPeer", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBGPPeer"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBGPPeerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -695,10 +617,7 @@ export const serializeAws_json1_1DeleteConnectionCommand = async ( input: DeleteConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DeleteConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -708,10 +627,7 @@ export const serializeAws_json1_1DeleteDirectConnectGatewayCommand = async ( input: DeleteDirectConnectGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DeleteDirectConnectGateway", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDirectConnectGateway"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDirectConnectGatewayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -721,10 +637,7 @@ export const serializeAws_json1_1DeleteDirectConnectGatewayAssociationCommand = input: DeleteDirectConnectGatewayAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DeleteDirectConnectGatewayAssociation", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDirectConnectGatewayAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDirectConnectGatewayAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -734,10 +647,7 @@ export const serializeAws_json1_1DeleteDirectConnectGatewayAssociationProposalCo input: DeleteDirectConnectGatewayAssociationProposalCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DeleteDirectConnectGatewayAssociationProposal", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDirectConnectGatewayAssociationProposal"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDirectConnectGatewayAssociationProposalRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -747,10 +657,7 @@ export const serializeAws_json1_1DeleteInterconnectCommand = async ( input: DeleteInterconnectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DeleteInterconnect", - }; + const headers: __HeaderBag = sharedHeaders("DeleteInterconnect"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteInterconnectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -760,10 +667,7 @@ export const serializeAws_json1_1DeleteLagCommand = async ( input: DeleteLagCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DeleteLag", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLag"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLagRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -773,10 +677,7 @@ export const serializeAws_json1_1DeleteVirtualInterfaceCommand = async ( input: DeleteVirtualInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DeleteVirtualInterface", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVirtualInterface"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteVirtualInterfaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -786,10 +687,7 @@ export const serializeAws_json1_1DescribeConnectionLoaCommand = async ( input: DescribeConnectionLoaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeConnectionLoa", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConnectionLoa"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConnectionLoaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -799,10 +697,7 @@ export const serializeAws_json1_1DescribeConnectionsCommand = async ( input: DescribeConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeConnections", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConnections"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConnectionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -812,10 +707,7 @@ export const serializeAws_json1_1DescribeConnectionsOnInterconnectCommand = asyn input: DescribeConnectionsOnInterconnectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeConnectionsOnInterconnect", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConnectionsOnInterconnect"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConnectionsOnInterconnectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -825,10 +717,7 @@ export const serializeAws_json1_1DescribeCustomerMetadataCommand = async ( input: DescribeCustomerMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeCustomerMetadata", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCustomerMetadata"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -837,10 +726,7 @@ export const serializeAws_json1_1DescribeDirectConnectGatewayAssociationProposal input: DescribeDirectConnectGatewayAssociationProposalsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeDirectConnectGatewayAssociationProposals", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDirectConnectGatewayAssociationProposals"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDirectConnectGatewayAssociationProposalsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -850,10 +736,7 @@ export const serializeAws_json1_1DescribeDirectConnectGatewayAssociationsCommand input: DescribeDirectConnectGatewayAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeDirectConnectGatewayAssociations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDirectConnectGatewayAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDirectConnectGatewayAssociationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -863,10 +746,7 @@ export const serializeAws_json1_1DescribeDirectConnectGatewayAttachmentsCommand input: DescribeDirectConnectGatewayAttachmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeDirectConnectGatewayAttachments", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDirectConnectGatewayAttachments"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDirectConnectGatewayAttachmentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -876,10 +756,7 @@ export const serializeAws_json1_1DescribeDirectConnectGatewaysCommand = async ( input: DescribeDirectConnectGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeDirectConnectGateways", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDirectConnectGateways"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDirectConnectGatewaysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -889,10 +766,7 @@ export const serializeAws_json1_1DescribeHostedConnectionsCommand = async ( input: DescribeHostedConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeHostedConnections", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHostedConnections"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeHostedConnectionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -902,10 +776,7 @@ export const serializeAws_json1_1DescribeInterconnectLoaCommand = async ( input: DescribeInterconnectLoaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeInterconnectLoa", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInterconnectLoa"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInterconnectLoaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -915,10 +786,7 @@ export const serializeAws_json1_1DescribeInterconnectsCommand = async ( input: DescribeInterconnectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeInterconnects", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInterconnects"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInterconnectsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -928,10 +796,7 @@ export const serializeAws_json1_1DescribeLagsCommand = async ( input: DescribeLagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeLags", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLags"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -941,10 +806,7 @@ export const serializeAws_json1_1DescribeLoaCommand = async ( input: DescribeLoaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeLoa", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLoa"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLoaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -954,10 +816,7 @@ export const serializeAws_json1_1DescribeLocationsCommand = async ( input: DescribeLocationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeLocations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLocations"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -966,10 +825,7 @@ export const serializeAws_json1_1DescribeRouterConfigurationCommand = async ( input: DescribeRouterConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeRouterConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRouterConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRouterConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -979,10 +835,7 @@ export const serializeAws_json1_1DescribeTagsCommand = async ( input: DescribeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeTags", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTags"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -992,10 +845,7 @@ export const serializeAws_json1_1DescribeVirtualGatewaysCommand = async ( input: DescribeVirtualGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeVirtualGateways", - }; + const headers: __HeaderBag = sharedHeaders("DescribeVirtualGateways"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -1004,10 +854,7 @@ export const serializeAws_json1_1DescribeVirtualInterfacesCommand = async ( input: DescribeVirtualInterfacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DescribeVirtualInterfaces", - }; + const headers: __HeaderBag = sharedHeaders("DescribeVirtualInterfaces"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeVirtualInterfacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1017,10 +864,7 @@ export const serializeAws_json1_1DisassociateConnectionFromLagCommand = async ( input: DisassociateConnectionFromLagCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DisassociateConnectionFromLag", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateConnectionFromLag"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateConnectionFromLagRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1030,10 +874,7 @@ export const serializeAws_json1_1DisassociateMacSecKeyCommand = async ( input: DisassociateMacSecKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.DisassociateMacSecKey", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateMacSecKey"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateMacSecKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1043,10 +884,7 @@ export const serializeAws_json1_1ListVirtualInterfaceTestHistoryCommand = async input: ListVirtualInterfaceTestHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.ListVirtualInterfaceTestHistory", - }; + const headers: __HeaderBag = sharedHeaders("ListVirtualInterfaceTestHistory"); let body: any; body = JSON.stringify(serializeAws_json1_1ListVirtualInterfaceTestHistoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1056,10 +894,7 @@ export const serializeAws_json1_1StartBgpFailoverTestCommand = async ( input: StartBgpFailoverTestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.StartBgpFailoverTest", - }; + const headers: __HeaderBag = sharedHeaders("StartBgpFailoverTest"); let body: any; body = JSON.stringify(serializeAws_json1_1StartBgpFailoverTestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1069,10 +904,7 @@ export const serializeAws_json1_1StopBgpFailoverTestCommand = async ( input: StopBgpFailoverTestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.StopBgpFailoverTest", - }; + const headers: __HeaderBag = sharedHeaders("StopBgpFailoverTest"); let body: any; body = JSON.stringify(serializeAws_json1_1StopBgpFailoverTestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1082,10 +914,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1095,10 +924,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1108,10 +934,7 @@ export const serializeAws_json1_1UpdateConnectionCommand = async ( input: UpdateConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.UpdateConnection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1121,10 +944,7 @@ export const serializeAws_json1_1UpdateDirectConnectGatewayCommand = async ( input: UpdateDirectConnectGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.UpdateDirectConnectGateway", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDirectConnectGateway"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDirectConnectGatewayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1134,10 +954,7 @@ export const serializeAws_json1_1UpdateDirectConnectGatewayAssociationCommand = input: UpdateDirectConnectGatewayAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.UpdateDirectConnectGatewayAssociation", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDirectConnectGatewayAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDirectConnectGatewayAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1147,10 +964,7 @@ export const serializeAws_json1_1UpdateLagCommand = async ( input: UpdateLagCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.UpdateLag", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLag"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLagRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1160,10 +974,7 @@ export const serializeAws_json1_1UpdateVirtualInterfaceAttributesCommand = async input: UpdateVirtualInterfaceAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OvertureService.UpdateVirtualInterfaceAttributes", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVirtualInterfaceAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateVirtualInterfaceAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5996,6 +5807,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `OvertureService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-directory-service/src/protocols/Aws_json1_1.ts b/clients/client-directory-service/src/protocols/Aws_json1_1.ts index 73950b686b7b4..815ac5fa1c354 100644 --- a/clients/client-directory-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-directory-service/src/protocols/Aws_json1_1.ts @@ -390,10 +390,7 @@ export const serializeAws_json1_1AcceptSharedDirectoryCommand = async ( input: AcceptSharedDirectoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.AcceptSharedDirectory", - }; + const headers: __HeaderBag = sharedHeaders("AcceptSharedDirectory"); let body: any; body = JSON.stringify(serializeAws_json1_1AcceptSharedDirectoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -403,10 +400,7 @@ export const serializeAws_json1_1AddIpRoutesCommand = async ( input: AddIpRoutesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.AddIpRoutes", - }; + const headers: __HeaderBag = sharedHeaders("AddIpRoutes"); let body: any; body = JSON.stringify(serializeAws_json1_1AddIpRoutesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -416,10 +410,7 @@ export const serializeAws_json1_1AddRegionCommand = async ( input: AddRegionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.AddRegion", - }; + const headers: __HeaderBag = sharedHeaders("AddRegion"); let body: any; body = JSON.stringify(serializeAws_json1_1AddRegionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -429,10 +420,7 @@ export const serializeAws_json1_1AddTagsToResourceCommand = async ( input: AddTagsToResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.AddTagsToResource", - }; + const headers: __HeaderBag = sharedHeaders("AddTagsToResource"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsToResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -442,10 +430,7 @@ export const serializeAws_json1_1CancelSchemaExtensionCommand = async ( input: CancelSchemaExtensionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.CancelSchemaExtension", - }; + const headers: __HeaderBag = sharedHeaders("CancelSchemaExtension"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelSchemaExtensionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -455,10 +440,7 @@ export const serializeAws_json1_1ConnectDirectoryCommand = async ( input: ConnectDirectoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.ConnectDirectory", - }; + const headers: __HeaderBag = sharedHeaders("ConnectDirectory"); let body: any; body = JSON.stringify(serializeAws_json1_1ConnectDirectoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -468,10 +450,7 @@ export const serializeAws_json1_1CreateAliasCommand = async ( input: CreateAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.CreateAlias", - }; + const headers: __HeaderBag = sharedHeaders("CreateAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAliasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -481,10 +460,7 @@ export const serializeAws_json1_1CreateComputerCommand = async ( input: CreateComputerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.CreateComputer", - }; + const headers: __HeaderBag = sharedHeaders("CreateComputer"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateComputerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -494,10 +470,7 @@ export const serializeAws_json1_1CreateConditionalForwarderCommand = async ( input: CreateConditionalForwarderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.CreateConditionalForwarder", - }; + const headers: __HeaderBag = sharedHeaders("CreateConditionalForwarder"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateConditionalForwarderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -507,10 +480,7 @@ export const serializeAws_json1_1CreateDirectoryCommand = async ( input: CreateDirectoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.CreateDirectory", - }; + const headers: __HeaderBag = sharedHeaders("CreateDirectory"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDirectoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -520,10 +490,7 @@ export const serializeAws_json1_1CreateLogSubscriptionCommand = async ( input: CreateLogSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.CreateLogSubscription", - }; + const headers: __HeaderBag = sharedHeaders("CreateLogSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLogSubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -533,10 +500,7 @@ export const serializeAws_json1_1CreateMicrosoftADCommand = async ( input: CreateMicrosoftADCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.CreateMicrosoftAD", - }; + const headers: __HeaderBag = sharedHeaders("CreateMicrosoftAD"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMicrosoftADRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -546,10 +510,7 @@ export const serializeAws_json1_1CreateSnapshotCommand = async ( input: CreateSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.CreateSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -559,10 +520,7 @@ export const serializeAws_json1_1CreateTrustCommand = async ( input: CreateTrustCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.CreateTrust", - }; + const headers: __HeaderBag = sharedHeaders("CreateTrust"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTrustRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -572,10 +530,7 @@ export const serializeAws_json1_1DeleteConditionalForwarderCommand = async ( input: DeleteConditionalForwarderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DeleteConditionalForwarder", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConditionalForwarder"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConditionalForwarderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -585,10 +540,7 @@ export const serializeAws_json1_1DeleteDirectoryCommand = async ( input: DeleteDirectoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DeleteDirectory", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDirectory"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDirectoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -598,10 +550,7 @@ export const serializeAws_json1_1DeleteLogSubscriptionCommand = async ( input: DeleteLogSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DeleteLogSubscription", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLogSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLogSubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -611,10 +560,7 @@ export const serializeAws_json1_1DeleteSnapshotCommand = async ( input: DeleteSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DeleteSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -624,10 +570,7 @@ export const serializeAws_json1_1DeleteTrustCommand = async ( input: DeleteTrustCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DeleteTrust", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTrust"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTrustRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -637,10 +580,7 @@ export const serializeAws_json1_1DeregisterCertificateCommand = async ( input: DeregisterCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DeregisterCertificate", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -650,10 +590,7 @@ export const serializeAws_json1_1DeregisterEventTopicCommand = async ( input: DeregisterEventTopicCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DeregisterEventTopic", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterEventTopic"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterEventTopicRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -663,10 +600,7 @@ export const serializeAws_json1_1DescribeCertificateCommand = async ( input: DescribeCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeCertificate", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -676,10 +610,7 @@ export const serializeAws_json1_1DescribeClientAuthenticationSettingsCommand = a input: DescribeClientAuthenticationSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeClientAuthenticationSettings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeClientAuthenticationSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeClientAuthenticationSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -689,10 +620,7 @@ export const serializeAws_json1_1DescribeConditionalForwardersCommand = async ( input: DescribeConditionalForwardersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeConditionalForwarders", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConditionalForwarders"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConditionalForwardersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -702,10 +630,7 @@ export const serializeAws_json1_1DescribeDirectoriesCommand = async ( input: DescribeDirectoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeDirectories", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDirectories"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDirectoriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -715,10 +640,7 @@ export const serializeAws_json1_1DescribeDomainControllersCommand = async ( input: DescribeDomainControllersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeDomainControllers", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDomainControllers"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDomainControllersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -728,10 +650,7 @@ export const serializeAws_json1_1DescribeEventTopicsCommand = async ( input: DescribeEventTopicsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeEventTopics", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventTopics"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventTopicsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -741,10 +660,7 @@ export const serializeAws_json1_1DescribeLDAPSSettingsCommand = async ( input: DescribeLDAPSSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeLDAPSSettings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLDAPSSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLDAPSSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -754,10 +670,7 @@ export const serializeAws_json1_1DescribeRegionsCommand = async ( input: DescribeRegionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeRegions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRegions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRegionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -767,10 +680,7 @@ export const serializeAws_json1_1DescribeSettingsCommand = async ( input: DescribeSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeSettings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -780,10 +690,7 @@ export const serializeAws_json1_1DescribeSharedDirectoriesCommand = async ( input: DescribeSharedDirectoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeSharedDirectories", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSharedDirectories"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSharedDirectoriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -793,10 +700,7 @@ export const serializeAws_json1_1DescribeSnapshotsCommand = async ( input: DescribeSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -806,10 +710,7 @@ export const serializeAws_json1_1DescribeTrustsCommand = async ( input: DescribeTrustsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeTrusts", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTrusts"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTrustsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -819,10 +720,7 @@ export const serializeAws_json1_1DescribeUpdateDirectoryCommand = async ( input: DescribeUpdateDirectoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DescribeUpdateDirectory", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUpdateDirectory"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUpdateDirectoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -832,10 +730,7 @@ export const serializeAws_json1_1DisableClientAuthenticationCommand = async ( input: DisableClientAuthenticationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DisableClientAuthentication", - }; + const headers: __HeaderBag = sharedHeaders("DisableClientAuthentication"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableClientAuthenticationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -845,10 +740,7 @@ export const serializeAws_json1_1DisableLDAPSCommand = async ( input: DisableLDAPSCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DisableLDAPS", - }; + const headers: __HeaderBag = sharedHeaders("DisableLDAPS"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableLDAPSRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -858,10 +750,7 @@ export const serializeAws_json1_1DisableRadiusCommand = async ( input: DisableRadiusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DisableRadius", - }; + const headers: __HeaderBag = sharedHeaders("DisableRadius"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableRadiusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -871,10 +760,7 @@ export const serializeAws_json1_1DisableSsoCommand = async ( input: DisableSsoCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.DisableSso", - }; + const headers: __HeaderBag = sharedHeaders("DisableSso"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableSsoRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -884,10 +770,7 @@ export const serializeAws_json1_1EnableClientAuthenticationCommand = async ( input: EnableClientAuthenticationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.EnableClientAuthentication", - }; + const headers: __HeaderBag = sharedHeaders("EnableClientAuthentication"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableClientAuthenticationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -897,10 +780,7 @@ export const serializeAws_json1_1EnableLDAPSCommand = async ( input: EnableLDAPSCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.EnableLDAPS", - }; + const headers: __HeaderBag = sharedHeaders("EnableLDAPS"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableLDAPSRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -910,10 +790,7 @@ export const serializeAws_json1_1EnableRadiusCommand = async ( input: EnableRadiusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.EnableRadius", - }; + const headers: __HeaderBag = sharedHeaders("EnableRadius"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableRadiusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -923,10 +800,7 @@ export const serializeAws_json1_1EnableSsoCommand = async ( input: EnableSsoCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.EnableSso", - }; + const headers: __HeaderBag = sharedHeaders("EnableSso"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableSsoRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -936,10 +810,7 @@ export const serializeAws_json1_1GetDirectoryLimitsCommand = async ( input: GetDirectoryLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.GetDirectoryLimits", - }; + const headers: __HeaderBag = sharedHeaders("GetDirectoryLimits"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDirectoryLimitsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -949,10 +820,7 @@ export const serializeAws_json1_1GetSnapshotLimitsCommand = async ( input: GetSnapshotLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.GetSnapshotLimits", - }; + const headers: __HeaderBag = sharedHeaders("GetSnapshotLimits"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSnapshotLimitsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -962,10 +830,7 @@ export const serializeAws_json1_1ListCertificatesCommand = async ( input: ListCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.ListCertificates", - }; + const headers: __HeaderBag = sharedHeaders("ListCertificates"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCertificatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -975,10 +840,7 @@ export const serializeAws_json1_1ListIpRoutesCommand = async ( input: ListIpRoutesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.ListIpRoutes", - }; + const headers: __HeaderBag = sharedHeaders("ListIpRoutes"); let body: any; body = JSON.stringify(serializeAws_json1_1ListIpRoutesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -988,10 +850,7 @@ export const serializeAws_json1_1ListLogSubscriptionsCommand = async ( input: ListLogSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.ListLogSubscriptions", - }; + const headers: __HeaderBag = sharedHeaders("ListLogSubscriptions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLogSubscriptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1001,10 +860,7 @@ export const serializeAws_json1_1ListSchemaExtensionsCommand = async ( input: ListSchemaExtensionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.ListSchemaExtensions", - }; + const headers: __HeaderBag = sharedHeaders("ListSchemaExtensions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSchemaExtensionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1014,10 +870,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1027,10 +880,7 @@ export const serializeAws_json1_1RegisterCertificateCommand = async ( input: RegisterCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.RegisterCertificate", - }; + const headers: __HeaderBag = sharedHeaders("RegisterCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1040,10 +890,7 @@ export const serializeAws_json1_1RegisterEventTopicCommand = async ( input: RegisterEventTopicCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.RegisterEventTopic", - }; + const headers: __HeaderBag = sharedHeaders("RegisterEventTopic"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterEventTopicRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1053,10 +900,7 @@ export const serializeAws_json1_1RejectSharedDirectoryCommand = async ( input: RejectSharedDirectoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.RejectSharedDirectory", - }; + const headers: __HeaderBag = sharedHeaders("RejectSharedDirectory"); let body: any; body = JSON.stringify(serializeAws_json1_1RejectSharedDirectoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1066,10 +910,7 @@ export const serializeAws_json1_1RemoveIpRoutesCommand = async ( input: RemoveIpRoutesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.RemoveIpRoutes", - }; + const headers: __HeaderBag = sharedHeaders("RemoveIpRoutes"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveIpRoutesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1079,10 +920,7 @@ export const serializeAws_json1_1RemoveRegionCommand = async ( input: RemoveRegionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.RemoveRegion", - }; + const headers: __HeaderBag = sharedHeaders("RemoveRegion"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveRegionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1092,10 +930,7 @@ export const serializeAws_json1_1RemoveTagsFromResourceCommand = async ( input: RemoveTagsFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.RemoveTagsFromResource", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTagsFromResource"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsFromResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1105,10 +940,7 @@ export const serializeAws_json1_1ResetUserPasswordCommand = async ( input: ResetUserPasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.ResetUserPassword", - }; + const headers: __HeaderBag = sharedHeaders("ResetUserPassword"); let body: any; body = JSON.stringify(serializeAws_json1_1ResetUserPasswordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1118,10 +950,7 @@ export const serializeAws_json1_1RestoreFromSnapshotCommand = async ( input: RestoreFromSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.RestoreFromSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("RestoreFromSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreFromSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1131,10 +960,7 @@ export const serializeAws_json1_1ShareDirectoryCommand = async ( input: ShareDirectoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.ShareDirectory", - }; + const headers: __HeaderBag = sharedHeaders("ShareDirectory"); let body: any; body = JSON.stringify(serializeAws_json1_1ShareDirectoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1144,10 +970,7 @@ export const serializeAws_json1_1StartSchemaExtensionCommand = async ( input: StartSchemaExtensionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.StartSchemaExtension", - }; + const headers: __HeaderBag = sharedHeaders("StartSchemaExtension"); let body: any; body = JSON.stringify(serializeAws_json1_1StartSchemaExtensionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1157,10 +980,7 @@ export const serializeAws_json1_1UnshareDirectoryCommand = async ( input: UnshareDirectoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.UnshareDirectory", - }; + const headers: __HeaderBag = sharedHeaders("UnshareDirectory"); let body: any; body = JSON.stringify(serializeAws_json1_1UnshareDirectoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1170,10 +990,7 @@ export const serializeAws_json1_1UpdateConditionalForwarderCommand = async ( input: UpdateConditionalForwarderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.UpdateConditionalForwarder", - }; + const headers: __HeaderBag = sharedHeaders("UpdateConditionalForwarder"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateConditionalForwarderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1183,10 +1000,7 @@ export const serializeAws_json1_1UpdateDirectorySetupCommand = async ( input: UpdateDirectorySetupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.UpdateDirectorySetup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDirectorySetup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDirectorySetupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1196,10 +1010,7 @@ export const serializeAws_json1_1UpdateNumberOfDomainControllersCommand = async input: UpdateNumberOfDomainControllersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.UpdateNumberOfDomainControllers", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNumberOfDomainControllers"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNumberOfDomainControllersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1209,10 +1020,7 @@ export const serializeAws_json1_1UpdateRadiusCommand = async ( input: UpdateRadiusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.UpdateRadius", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRadius"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRadiusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1222,10 +1030,7 @@ export const serializeAws_json1_1UpdateSettingsCommand = async ( input: UpdateSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.UpdateSettings", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1235,10 +1040,7 @@ export const serializeAws_json1_1UpdateTrustCommand = async ( input: UpdateTrustCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.UpdateTrust", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTrust"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTrustRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1248,10 +1050,7 @@ export const serializeAws_json1_1VerifyTrustCommand = async ( input: VerifyTrustCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "DirectoryService_20150416.VerifyTrust", - }; + const headers: __HeaderBag = sharedHeaders("VerifyTrust"); let body: any; body = JSON.stringify(serializeAws_json1_1VerifyTrustRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -7961,6 +7760,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `DirectoryService_20150416.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-docdb/src/protocols/Aws_query.ts b/clients/client-docdb/src/protocols/Aws_query.ts index eb707a35ec5a1..f31f61a4c9fc6 100644 --- a/clients/client-docdb/src/protocols/Aws_query.ts +++ b/clients/client-docdb/src/protocols/Aws_query.ts @@ -391,9 +391,7 @@ export const serializeAws_queryAddSourceIdentifierToSubscriptionCommand = async input: AddSourceIdentifierToSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddSourceIdentifierToSubscriptionMessage(input, context), @@ -407,9 +405,7 @@ export const serializeAws_queryAddTagsToResourceCommand = async ( input: AddTagsToResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddTagsToResourceMessage(input, context), @@ -423,9 +419,7 @@ export const serializeAws_queryApplyPendingMaintenanceActionCommand = async ( input: ApplyPendingMaintenanceActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryApplyPendingMaintenanceActionMessage(input, context), @@ -439,9 +433,7 @@ export const serializeAws_queryCopyDBClusterParameterGroupCommand = async ( input: CopyDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyDBClusterParameterGroupMessage(input, context), @@ -455,9 +447,7 @@ export const serializeAws_queryCopyDBClusterSnapshotCommand = async ( input: CopyDBClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyDBClusterSnapshotMessage(input, context), @@ -471,9 +461,7 @@ export const serializeAws_queryCreateDBClusterCommand = async ( input: CreateDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterMessage(input, context), @@ -487,9 +475,7 @@ export const serializeAws_queryCreateDBClusterParameterGroupCommand = async ( input: CreateDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterParameterGroupMessage(input, context), @@ -503,9 +489,7 @@ export const serializeAws_queryCreateDBClusterSnapshotCommand = async ( input: CreateDBClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterSnapshotMessage(input, context), @@ -519,9 +503,7 @@ export const serializeAws_queryCreateDBInstanceCommand = async ( input: CreateDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBInstanceMessage(input, context), @@ -535,9 +517,7 @@ export const serializeAws_queryCreateDBSubnetGroupCommand = async ( input: CreateDBSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBSubnetGroupMessage(input, context), @@ -551,9 +531,7 @@ export const serializeAws_queryCreateEventSubscriptionCommand = async ( input: CreateEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateEventSubscriptionMessage(input, context), @@ -567,9 +545,7 @@ export const serializeAws_queryCreateGlobalClusterCommand = async ( input: CreateGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateGlobalClusterMessage(input, context), @@ -583,9 +559,7 @@ export const serializeAws_queryDeleteDBClusterCommand = async ( input: DeleteDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterMessage(input, context), @@ -599,9 +573,7 @@ export const serializeAws_queryDeleteDBClusterParameterGroupCommand = async ( input: DeleteDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterParameterGroupMessage(input, context), @@ -615,9 +587,7 @@ export const serializeAws_queryDeleteDBClusterSnapshotCommand = async ( input: DeleteDBClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterSnapshotMessage(input, context), @@ -631,9 +601,7 @@ export const serializeAws_queryDeleteDBInstanceCommand = async ( input: DeleteDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBInstanceMessage(input, context), @@ -647,9 +615,7 @@ export const serializeAws_queryDeleteDBSubnetGroupCommand = async ( input: DeleteDBSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBSubnetGroupMessage(input, context), @@ -663,9 +629,7 @@ export const serializeAws_queryDeleteEventSubscriptionCommand = async ( input: DeleteEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteEventSubscriptionMessage(input, context), @@ -679,9 +643,7 @@ export const serializeAws_queryDeleteGlobalClusterCommand = async ( input: DeleteGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteGlobalClusterMessage(input, context), @@ -695,9 +657,7 @@ export const serializeAws_queryDescribeCertificatesCommand = async ( input: DescribeCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeCertificatesMessage(input, context), @@ -711,9 +671,7 @@ export const serializeAws_queryDescribeDBClusterParameterGroupsCommand = async ( input: DescribeDBClusterParameterGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterParameterGroupsMessage(input, context), @@ -727,9 +685,7 @@ export const serializeAws_queryDescribeDBClusterParametersCommand = async ( input: DescribeDBClusterParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterParametersMessage(input, context), @@ -743,9 +699,7 @@ export const serializeAws_queryDescribeDBClustersCommand = async ( input: DescribeDBClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClustersMessage(input, context), @@ -759,9 +713,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotAttributesCommand = asyn input: DescribeDBClusterSnapshotAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterSnapshotAttributesMessage(input, context), @@ -775,9 +727,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotsCommand = async ( input: DescribeDBClusterSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterSnapshotsMessage(input, context), @@ -791,9 +741,7 @@ export const serializeAws_queryDescribeDBEngineVersionsCommand = async ( input: DescribeDBEngineVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBEngineVersionsMessage(input, context), @@ -807,9 +755,7 @@ export const serializeAws_queryDescribeDBInstancesCommand = async ( input: DescribeDBInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBInstancesMessage(input, context), @@ -823,9 +769,7 @@ export const serializeAws_queryDescribeDBSubnetGroupsCommand = async ( input: DescribeDBSubnetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBSubnetGroupsMessage(input, context), @@ -839,9 +783,7 @@ export const serializeAws_queryDescribeEngineDefaultClusterParametersCommand = a input: DescribeEngineDefaultClusterParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEngineDefaultClusterParametersMessage(input, context), @@ -855,9 +797,7 @@ export const serializeAws_queryDescribeEventCategoriesCommand = async ( input: DescribeEventCategoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventCategoriesMessage(input, context), @@ -871,9 +811,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventsMessage(input, context), @@ -887,9 +825,7 @@ export const serializeAws_queryDescribeEventSubscriptionsCommand = async ( input: DescribeEventSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventSubscriptionsMessage(input, context), @@ -903,9 +839,7 @@ export const serializeAws_queryDescribeGlobalClustersCommand = async ( input: DescribeGlobalClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeGlobalClustersMessage(input, context), @@ -919,9 +853,7 @@ export const serializeAws_queryDescribeOrderableDBInstanceOptionsCommand = async input: DescribeOrderableDBInstanceOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeOrderableDBInstanceOptionsMessage(input, context), @@ -935,9 +867,7 @@ export const serializeAws_queryDescribePendingMaintenanceActionsCommand = async input: DescribePendingMaintenanceActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribePendingMaintenanceActionsMessage(input, context), @@ -951,9 +881,7 @@ export const serializeAws_queryFailoverDBClusterCommand = async ( input: FailoverDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryFailoverDBClusterMessage(input, context), @@ -967,9 +895,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTagsForResourceMessage(input, context), @@ -983,9 +909,7 @@ export const serializeAws_queryModifyDBClusterCommand = async ( input: ModifyDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterMessage(input, context), @@ -999,9 +923,7 @@ export const serializeAws_queryModifyDBClusterParameterGroupCommand = async ( input: ModifyDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterParameterGroupMessage(input, context), @@ -1015,9 +937,7 @@ export const serializeAws_queryModifyDBClusterSnapshotAttributeCommand = async ( input: ModifyDBClusterSnapshotAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterSnapshotAttributeMessage(input, context), @@ -1031,9 +951,7 @@ export const serializeAws_queryModifyDBInstanceCommand = async ( input: ModifyDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBInstanceMessage(input, context), @@ -1047,9 +965,7 @@ export const serializeAws_queryModifyDBSubnetGroupCommand = async ( input: ModifyDBSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBSubnetGroupMessage(input, context), @@ -1063,9 +979,7 @@ export const serializeAws_queryModifyEventSubscriptionCommand = async ( input: ModifyEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyEventSubscriptionMessage(input, context), @@ -1079,9 +993,7 @@ export const serializeAws_queryModifyGlobalClusterCommand = async ( input: ModifyGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyGlobalClusterMessage(input, context), @@ -1095,9 +1007,7 @@ export const serializeAws_queryRebootDBInstanceCommand = async ( input: RebootDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRebootDBInstanceMessage(input, context), @@ -1111,9 +1021,7 @@ export const serializeAws_queryRemoveFromGlobalClusterCommand = async ( input: RemoveFromGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveFromGlobalClusterMessage(input, context), @@ -1127,9 +1035,7 @@ export const serializeAws_queryRemoveSourceIdentifierFromSubscriptionCommand = a input: RemoveSourceIdentifierFromSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveSourceIdentifierFromSubscriptionMessage(input, context), @@ -1143,9 +1049,7 @@ export const serializeAws_queryRemoveTagsFromResourceCommand = async ( input: RemoveTagsFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveTagsFromResourceMessage(input, context), @@ -1159,9 +1063,7 @@ export const serializeAws_queryResetDBClusterParameterGroupCommand = async ( input: ResetDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResetDBClusterParameterGroupMessage(input, context), @@ -1175,9 +1077,7 @@ export const serializeAws_queryRestoreDBClusterFromSnapshotCommand = async ( input: RestoreDBClusterFromSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreDBClusterFromSnapshotMessage(input, context), @@ -1191,9 +1091,7 @@ export const serializeAws_queryRestoreDBClusterToPointInTimeCommand = async ( input: RestoreDBClusterToPointInTimeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreDBClusterToPointInTimeMessage(input, context), @@ -1207,9 +1105,7 @@ export const serializeAws_queryStartDBClusterCommand = async ( input: StartDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStartDBClusterMessage(input, context), @@ -1223,9 +1119,7 @@ export const serializeAws_queryStopDBClusterCommand = async ( input: StopDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStopDBClusterMessage(input, context), @@ -8772,6 +8666,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts index daf4d16b61078..63639c804cb36 100644 --- a/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts @@ -52,10 +52,7 @@ export const serializeAws_json1_0DescribeStreamCommand = async ( input: DescribeStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDBStreams_20120810.DescribeStream", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStream"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -65,10 +62,7 @@ export const serializeAws_json1_0GetRecordsCommand = async ( input: GetRecordsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDBStreams_20120810.GetRecords", - }; + const headers: __HeaderBag = sharedHeaders("GetRecords"); let body: any; body = JSON.stringify(serializeAws_json1_0GetRecordsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -78,10 +72,7 @@ export const serializeAws_json1_0GetShardIteratorCommand = async ( input: GetShardIteratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDBStreams_20120810.GetShardIterator", - }; + const headers: __HeaderBag = sharedHeaders("GetShardIterator"); let body: any; body = JSON.stringify(serializeAws_json1_0GetShardIteratorInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -91,10 +82,7 @@ export const serializeAws_json1_0ListStreamsCommand = async ( input: ListStreamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDBStreams_20120810.ListStreams", - }; + const headers: __HeaderBag = sharedHeaders("ListStreams"); let body: any; body = JSON.stringify(serializeAws_json1_0ListStreamsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -747,6 +735,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `DynamoDBStreams_20120810.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-dynamodb/src/protocols/Aws_json1_0.ts b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts index b97ee0d62eaee..e2132ed9c955b 100644 --- a/clients/client-dynamodb/src/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts @@ -369,10 +369,7 @@ export const serializeAws_json1_0BatchExecuteStatementCommand = async ( input: BatchExecuteStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.BatchExecuteStatement", - }; + const headers: __HeaderBag = sharedHeaders("BatchExecuteStatement"); let body: any; body = JSON.stringify(serializeAws_json1_0BatchExecuteStatementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -382,10 +379,7 @@ export const serializeAws_json1_0BatchGetItemCommand = async ( input: BatchGetItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.BatchGetItem", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetItem"); let body: any; body = JSON.stringify(serializeAws_json1_0BatchGetItemInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -395,10 +389,7 @@ export const serializeAws_json1_0BatchWriteItemCommand = async ( input: BatchWriteItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.BatchWriteItem", - }; + const headers: __HeaderBag = sharedHeaders("BatchWriteItem"); let body: any; body = JSON.stringify(serializeAws_json1_0BatchWriteItemInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -408,10 +399,7 @@ export const serializeAws_json1_0CreateBackupCommand = async ( input: CreateBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.CreateBackup", - }; + const headers: __HeaderBag = sharedHeaders("CreateBackup"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateBackupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -421,10 +409,7 @@ export const serializeAws_json1_0CreateGlobalTableCommand = async ( input: CreateGlobalTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.CreateGlobalTable", - }; + const headers: __HeaderBag = sharedHeaders("CreateGlobalTable"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateGlobalTableInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -434,10 +419,7 @@ export const serializeAws_json1_0CreateTableCommand = async ( input: CreateTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.CreateTable", - }; + const headers: __HeaderBag = sharedHeaders("CreateTable"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateTableInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -447,10 +429,7 @@ export const serializeAws_json1_0DeleteBackupCommand = async ( input: DeleteBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DeleteBackup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBackup"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteBackupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -460,10 +439,7 @@ export const serializeAws_json1_0DeleteItemCommand = async ( input: DeleteItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DeleteItem", - }; + const headers: __HeaderBag = sharedHeaders("DeleteItem"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteItemInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -473,10 +449,7 @@ export const serializeAws_json1_0DeleteTableCommand = async ( input: DeleteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DeleteTable", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTable"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteTableInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -486,10 +459,7 @@ export const serializeAws_json1_0DescribeBackupCommand = async ( input: DescribeBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeBackup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBackup"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeBackupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -499,10 +469,7 @@ export const serializeAws_json1_0DescribeContinuousBackupsCommand = async ( input: DescribeContinuousBackupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeContinuousBackups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeContinuousBackups"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeContinuousBackupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -512,10 +479,7 @@ export const serializeAws_json1_0DescribeContributorInsightsCommand = async ( input: DescribeContributorInsightsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeContributorInsights", - }; + const headers: __HeaderBag = sharedHeaders("DescribeContributorInsights"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeContributorInsightsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -525,10 +489,7 @@ export const serializeAws_json1_0DescribeEndpointsCommand = async ( input: DescribeEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -538,10 +499,7 @@ export const serializeAws_json1_0DescribeExportCommand = async ( input: DescribeExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeExport", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExport"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeExportInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -551,10 +509,7 @@ export const serializeAws_json1_0DescribeGlobalTableCommand = async ( input: DescribeGlobalTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeGlobalTable", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGlobalTable"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeGlobalTableInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -564,10 +519,7 @@ export const serializeAws_json1_0DescribeGlobalTableSettingsCommand = async ( input: DescribeGlobalTableSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeGlobalTableSettings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGlobalTableSettings"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeGlobalTableSettingsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -577,10 +529,7 @@ export const serializeAws_json1_0DescribeImportCommand = async ( input: DescribeImportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeImport", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImport"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeImportInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -590,10 +539,7 @@ export const serializeAws_json1_0DescribeKinesisStreamingDestinationCommand = as input: DescribeKinesisStreamingDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeKinesisStreamingDestination", - }; + const headers: __HeaderBag = sharedHeaders("DescribeKinesisStreamingDestination"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeKinesisStreamingDestinationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -603,10 +549,7 @@ export const serializeAws_json1_0DescribeLimitsCommand = async ( input: DescribeLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeLimits", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLimits"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeLimitsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -616,10 +559,7 @@ export const serializeAws_json1_0DescribeTableCommand = async ( input: DescribeTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeTable", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTable"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeTableInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -629,10 +569,7 @@ export const serializeAws_json1_0DescribeTableReplicaAutoScalingCommand = async input: DescribeTableReplicaAutoScalingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeTableReplicaAutoScaling", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTableReplicaAutoScaling"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeTableReplicaAutoScalingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -642,10 +579,7 @@ export const serializeAws_json1_0DescribeTimeToLiveCommand = async ( input: DescribeTimeToLiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DescribeTimeToLive", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTimeToLive"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeTimeToLiveInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -655,10 +589,7 @@ export const serializeAws_json1_0DisableKinesisStreamingDestinationCommand = asy input: DisableKinesisStreamingDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.DisableKinesisStreamingDestination", - }; + const headers: __HeaderBag = sharedHeaders("DisableKinesisStreamingDestination"); let body: any; body = JSON.stringify(serializeAws_json1_0KinesisStreamingDestinationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -668,10 +599,7 @@ export const serializeAws_json1_0EnableKinesisStreamingDestinationCommand = asyn input: EnableKinesisStreamingDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.EnableKinesisStreamingDestination", - }; + const headers: __HeaderBag = sharedHeaders("EnableKinesisStreamingDestination"); let body: any; body = JSON.stringify(serializeAws_json1_0KinesisStreamingDestinationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -681,10 +609,7 @@ export const serializeAws_json1_0ExecuteStatementCommand = async ( input: ExecuteStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ExecuteStatement", - }; + const headers: __HeaderBag = sharedHeaders("ExecuteStatement"); let body: any; body = JSON.stringify(serializeAws_json1_0ExecuteStatementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -694,10 +619,7 @@ export const serializeAws_json1_0ExecuteTransactionCommand = async ( input: ExecuteTransactionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ExecuteTransaction", - }; + const headers: __HeaderBag = sharedHeaders("ExecuteTransaction"); let body: any; body = JSON.stringify(serializeAws_json1_0ExecuteTransactionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -707,10 +629,7 @@ export const serializeAws_json1_0ExportTableToPointInTimeCommand = async ( input: ExportTableToPointInTimeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ExportTableToPointInTime", - }; + const headers: __HeaderBag = sharedHeaders("ExportTableToPointInTime"); let body: any; body = JSON.stringify(serializeAws_json1_0ExportTableToPointInTimeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -720,10 +639,7 @@ export const serializeAws_json1_0GetItemCommand = async ( input: GetItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.GetItem", - }; + const headers: __HeaderBag = sharedHeaders("GetItem"); let body: any; body = JSON.stringify(serializeAws_json1_0GetItemInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -733,10 +649,7 @@ export const serializeAws_json1_0ImportTableCommand = async ( input: ImportTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ImportTable", - }; + const headers: __HeaderBag = sharedHeaders("ImportTable"); let body: any; body = JSON.stringify(serializeAws_json1_0ImportTableInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -746,10 +659,7 @@ export const serializeAws_json1_0ListBackupsCommand = async ( input: ListBackupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ListBackups", - }; + const headers: __HeaderBag = sharedHeaders("ListBackups"); let body: any; body = JSON.stringify(serializeAws_json1_0ListBackupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -759,10 +669,7 @@ export const serializeAws_json1_0ListContributorInsightsCommand = async ( input: ListContributorInsightsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ListContributorInsights", - }; + const headers: __HeaderBag = sharedHeaders("ListContributorInsights"); let body: any; body = JSON.stringify(serializeAws_json1_0ListContributorInsightsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -772,10 +679,7 @@ export const serializeAws_json1_0ListExportsCommand = async ( input: ListExportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ListExports", - }; + const headers: __HeaderBag = sharedHeaders("ListExports"); let body: any; body = JSON.stringify(serializeAws_json1_0ListExportsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -785,10 +689,7 @@ export const serializeAws_json1_0ListGlobalTablesCommand = async ( input: ListGlobalTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ListGlobalTables", - }; + const headers: __HeaderBag = sharedHeaders("ListGlobalTables"); let body: any; body = JSON.stringify(serializeAws_json1_0ListGlobalTablesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -798,10 +699,7 @@ export const serializeAws_json1_0ListImportsCommand = async ( input: ListImportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ListImports", - }; + const headers: __HeaderBag = sharedHeaders("ListImports"); let body: any; body = JSON.stringify(serializeAws_json1_0ListImportsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -811,10 +709,7 @@ export const serializeAws_json1_0ListTablesCommand = async ( input: ListTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ListTables", - }; + const headers: __HeaderBag = sharedHeaders("ListTables"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTablesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -824,10 +719,7 @@ export const serializeAws_json1_0ListTagsOfResourceCommand = async ( input: ListTagsOfResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.ListTagsOfResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsOfResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsOfResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -837,10 +729,7 @@ export const serializeAws_json1_0PutItemCommand = async ( input: PutItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.PutItem", - }; + const headers: __HeaderBag = sharedHeaders("PutItem"); let body: any; body = JSON.stringify(serializeAws_json1_0PutItemInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -850,10 +739,7 @@ export const serializeAws_json1_0QueryCommand = async ( input: QueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.Query", - }; + const headers: __HeaderBag = sharedHeaders("Query"); let body: any; body = JSON.stringify(serializeAws_json1_0QueryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -863,10 +749,7 @@ export const serializeAws_json1_0RestoreTableFromBackupCommand = async ( input: RestoreTableFromBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.RestoreTableFromBackup", - }; + const headers: __HeaderBag = sharedHeaders("RestoreTableFromBackup"); let body: any; body = JSON.stringify(serializeAws_json1_0RestoreTableFromBackupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -876,10 +759,7 @@ export const serializeAws_json1_0RestoreTableToPointInTimeCommand = async ( input: RestoreTableToPointInTimeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.RestoreTableToPointInTime", - }; + const headers: __HeaderBag = sharedHeaders("RestoreTableToPointInTime"); let body: any; body = JSON.stringify(serializeAws_json1_0RestoreTableToPointInTimeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -889,10 +769,7 @@ export const serializeAws_json1_0ScanCommand = async ( input: ScanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.Scan", - }; + const headers: __HeaderBag = sharedHeaders("Scan"); let body: any; body = JSON.stringify(serializeAws_json1_0ScanInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -902,10 +779,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -915,10 +789,7 @@ export const serializeAws_json1_0TransactGetItemsCommand = async ( input: TransactGetItemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.TransactGetItems", - }; + const headers: __HeaderBag = sharedHeaders("TransactGetItems"); let body: any; body = JSON.stringify(serializeAws_json1_0TransactGetItemsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -928,10 +799,7 @@ export const serializeAws_json1_0TransactWriteItemsCommand = async ( input: TransactWriteItemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.TransactWriteItems", - }; + const headers: __HeaderBag = sharedHeaders("TransactWriteItems"); let body: any; body = JSON.stringify(serializeAws_json1_0TransactWriteItemsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -941,10 +809,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -954,10 +819,7 @@ export const serializeAws_json1_0UpdateContinuousBackupsCommand = async ( input: UpdateContinuousBackupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.UpdateContinuousBackups", - }; + const headers: __HeaderBag = sharedHeaders("UpdateContinuousBackups"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateContinuousBackupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -967,10 +829,7 @@ export const serializeAws_json1_0UpdateContributorInsightsCommand = async ( input: UpdateContributorInsightsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.UpdateContributorInsights", - }; + const headers: __HeaderBag = sharedHeaders("UpdateContributorInsights"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateContributorInsightsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -980,10 +839,7 @@ export const serializeAws_json1_0UpdateGlobalTableCommand = async ( input: UpdateGlobalTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.UpdateGlobalTable", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGlobalTable"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateGlobalTableInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -993,10 +849,7 @@ export const serializeAws_json1_0UpdateGlobalTableSettingsCommand = async ( input: UpdateGlobalTableSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.UpdateGlobalTableSettings", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGlobalTableSettings"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateGlobalTableSettingsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1006,10 +859,7 @@ export const serializeAws_json1_0UpdateItemCommand = async ( input: UpdateItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.UpdateItem", - }; + const headers: __HeaderBag = sharedHeaders("UpdateItem"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateItemInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1019,10 +869,7 @@ export const serializeAws_json1_0UpdateTableCommand = async ( input: UpdateTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.UpdateTable", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTable"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateTableInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1032,10 +879,7 @@ export const serializeAws_json1_0UpdateTableReplicaAutoScalingCommand = async ( input: UpdateTableReplicaAutoScalingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.UpdateTableReplicaAutoScaling", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTableReplicaAutoScaling"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateTableReplicaAutoScalingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1045,10 +889,7 @@ export const serializeAws_json1_0UpdateTimeToLiveCommand = async ( input: UpdateTimeToLiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "DynamoDB_20120810.UpdateTimeToLive", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTimeToLive"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateTimeToLiveInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -8473,6 +8314,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `DynamoDB_20120810.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts index b79cda59c5ff6..e1b54963fe1da 100644 --- a/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts +++ b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts @@ -41,10 +41,7 @@ export const serializeAws_json1_1SendSerialConsoleSSHPublicKeyCommand = async ( input: SendSerialConsoleSSHPublicKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEC2InstanceConnectService.SendSerialConsoleSSHPublicKey", - }; + const headers: __HeaderBag = sharedHeaders("SendSerialConsoleSSHPublicKey"); let body: any; body = JSON.stringify(serializeAws_json1_1SendSerialConsoleSSHPublicKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -54,10 +51,7 @@ export const serializeAws_json1_1SendSSHPublicKeyCommand = async ( input: SendSSHPublicKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEC2InstanceConnectService.SendSSHPublicKey", - }; + const headers: __HeaderBag = sharedHeaders("SendSSHPublicKey"); let body: any; body = JSON.stringify(serializeAws_json1_1SendSSHPublicKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -507,6 +501,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSEC2InstanceConnectService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-ec2/src/protocols/Aws_ec2.ts b/clients/client-ec2/src/protocols/Aws_ec2.ts index 7c76aa262874b..d0bf0c73026bb 100644 --- a/clients/client-ec2/src/protocols/Aws_ec2.ts +++ b/clients/client-ec2/src/protocols/Aws_ec2.ts @@ -3877,9 +3877,7 @@ export const serializeAws_ec2AcceptAddressTransferCommand = async ( input: AcceptAddressTransferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AcceptAddressTransferRequest(input, context), @@ -3893,9 +3891,7 @@ export const serializeAws_ec2AcceptReservedInstancesExchangeQuoteCommand = async input: AcceptReservedInstancesExchangeQuoteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AcceptReservedInstancesExchangeQuoteRequest(input, context), @@ -3909,9 +3905,7 @@ export const serializeAws_ec2AcceptTransitGatewayMulticastDomainAssociationsComm input: AcceptTransitGatewayMulticastDomainAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AcceptTransitGatewayMulticastDomainAssociationsRequest(input, context), @@ -3925,9 +3919,7 @@ export const serializeAws_ec2AcceptTransitGatewayPeeringAttachmentCommand = asyn input: AcceptTransitGatewayPeeringAttachmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AcceptTransitGatewayPeeringAttachmentRequest(input, context), @@ -3941,9 +3933,7 @@ export const serializeAws_ec2AcceptTransitGatewayVpcAttachmentCommand = async ( input: AcceptTransitGatewayVpcAttachmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AcceptTransitGatewayVpcAttachmentRequest(input, context), @@ -3957,9 +3947,7 @@ export const serializeAws_ec2AcceptVpcEndpointConnectionsCommand = async ( input: AcceptVpcEndpointConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AcceptVpcEndpointConnectionsRequest(input, context), @@ -3973,9 +3961,7 @@ export const serializeAws_ec2AcceptVpcPeeringConnectionCommand = async ( input: AcceptVpcPeeringConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AcceptVpcPeeringConnectionRequest(input, context), @@ -3989,9 +3975,7 @@ export const serializeAws_ec2AdvertiseByoipCidrCommand = async ( input: AdvertiseByoipCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AdvertiseByoipCidrRequest(input, context), @@ -4005,9 +3989,7 @@ export const serializeAws_ec2AllocateAddressCommand = async ( input: AllocateAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AllocateAddressRequest(input, context), @@ -4021,9 +4003,7 @@ export const serializeAws_ec2AllocateHostsCommand = async ( input: AllocateHostsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AllocateHostsRequest(input, context), @@ -4037,9 +4017,7 @@ export const serializeAws_ec2AllocateIpamPoolCidrCommand = async ( input: AllocateIpamPoolCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AllocateIpamPoolCidrRequest(input, context), @@ -4053,9 +4031,7 @@ export const serializeAws_ec2ApplySecurityGroupsToClientVpnTargetNetworkCommand input: ApplySecurityGroupsToClientVpnTargetNetworkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ApplySecurityGroupsToClientVpnTargetNetworkRequest(input, context), @@ -4069,9 +4045,7 @@ export const serializeAws_ec2AssignIpv6AddressesCommand = async ( input: AssignIpv6AddressesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssignIpv6AddressesRequest(input, context), @@ -4085,9 +4059,7 @@ export const serializeAws_ec2AssignPrivateIpAddressesCommand = async ( input: AssignPrivateIpAddressesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssignPrivateIpAddressesRequest(input, context), @@ -4101,9 +4073,7 @@ export const serializeAws_ec2AssignPrivateNatGatewayAddressCommand = async ( input: AssignPrivateNatGatewayAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssignPrivateNatGatewayAddressRequest(input, context), @@ -4117,9 +4087,7 @@ export const serializeAws_ec2AssociateAddressCommand = async ( input: AssociateAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateAddressRequest(input, context), @@ -4133,9 +4101,7 @@ export const serializeAws_ec2AssociateClientVpnTargetNetworkCommand = async ( input: AssociateClientVpnTargetNetworkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateClientVpnTargetNetworkRequest(input, context), @@ -4149,9 +4115,7 @@ export const serializeAws_ec2AssociateDhcpOptionsCommand = async ( input: AssociateDhcpOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateDhcpOptionsRequest(input, context), @@ -4165,9 +4129,7 @@ export const serializeAws_ec2AssociateEnclaveCertificateIamRoleCommand = async ( input: AssociateEnclaveCertificateIamRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateEnclaveCertificateIamRoleRequest(input, context), @@ -4181,9 +4143,7 @@ export const serializeAws_ec2AssociateIamInstanceProfileCommand = async ( input: AssociateIamInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateIamInstanceProfileRequest(input, context), @@ -4197,9 +4157,7 @@ export const serializeAws_ec2AssociateInstanceEventWindowCommand = async ( input: AssociateInstanceEventWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateInstanceEventWindowRequest(input, context), @@ -4213,9 +4171,7 @@ export const serializeAws_ec2AssociateIpamResourceDiscoveryCommand = async ( input: AssociateIpamResourceDiscoveryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateIpamResourceDiscoveryRequest(input, context), @@ -4229,9 +4185,7 @@ export const serializeAws_ec2AssociateNatGatewayAddressCommand = async ( input: AssociateNatGatewayAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateNatGatewayAddressRequest(input, context), @@ -4245,9 +4199,7 @@ export const serializeAws_ec2AssociateRouteTableCommand = async ( input: AssociateRouteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateRouteTableRequest(input, context), @@ -4261,9 +4213,7 @@ export const serializeAws_ec2AssociateSubnetCidrBlockCommand = async ( input: AssociateSubnetCidrBlockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateSubnetCidrBlockRequest(input, context), @@ -4277,9 +4227,7 @@ export const serializeAws_ec2AssociateTransitGatewayMulticastDomainCommand = asy input: AssociateTransitGatewayMulticastDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateTransitGatewayMulticastDomainRequest(input, context), @@ -4293,9 +4241,7 @@ export const serializeAws_ec2AssociateTransitGatewayPolicyTableCommand = async ( input: AssociateTransitGatewayPolicyTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateTransitGatewayPolicyTableRequest(input, context), @@ -4309,9 +4255,7 @@ export const serializeAws_ec2AssociateTransitGatewayRouteTableCommand = async ( input: AssociateTransitGatewayRouteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateTransitGatewayRouteTableRequest(input, context), @@ -4325,9 +4269,7 @@ export const serializeAws_ec2AssociateTrunkInterfaceCommand = async ( input: AssociateTrunkInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateTrunkInterfaceRequest(input, context), @@ -4341,9 +4283,7 @@ export const serializeAws_ec2AssociateVpcCidrBlockCommand = async ( input: AssociateVpcCidrBlockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AssociateVpcCidrBlockRequest(input, context), @@ -4357,9 +4297,7 @@ export const serializeAws_ec2AttachClassicLinkVpcCommand = async ( input: AttachClassicLinkVpcCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AttachClassicLinkVpcRequest(input, context), @@ -4373,9 +4311,7 @@ export const serializeAws_ec2AttachInternetGatewayCommand = async ( input: AttachInternetGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AttachInternetGatewayRequest(input, context), @@ -4389,9 +4325,7 @@ export const serializeAws_ec2AttachNetworkInterfaceCommand = async ( input: AttachNetworkInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AttachNetworkInterfaceRequest(input, context), @@ -4405,9 +4339,7 @@ export const serializeAws_ec2AttachVerifiedAccessTrustProviderCommand = async ( input: AttachVerifiedAccessTrustProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AttachVerifiedAccessTrustProviderRequest(input, context), @@ -4421,9 +4353,7 @@ export const serializeAws_ec2AttachVolumeCommand = async ( input: AttachVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AttachVolumeRequest(input, context), @@ -4437,9 +4367,7 @@ export const serializeAws_ec2AttachVpnGatewayCommand = async ( input: AttachVpnGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AttachVpnGatewayRequest(input, context), @@ -4453,9 +4381,7 @@ export const serializeAws_ec2AuthorizeClientVpnIngressCommand = async ( input: AuthorizeClientVpnIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AuthorizeClientVpnIngressRequest(input, context), @@ -4469,9 +4395,7 @@ export const serializeAws_ec2AuthorizeSecurityGroupEgressCommand = async ( input: AuthorizeSecurityGroupEgressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AuthorizeSecurityGroupEgressRequest(input, context), @@ -4485,9 +4409,7 @@ export const serializeAws_ec2AuthorizeSecurityGroupIngressCommand = async ( input: AuthorizeSecurityGroupIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2AuthorizeSecurityGroupIngressRequest(input, context), @@ -4501,9 +4423,7 @@ export const serializeAws_ec2BundleInstanceCommand = async ( input: BundleInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2BundleInstanceRequest(input, context), @@ -4517,9 +4437,7 @@ export const serializeAws_ec2CancelBundleTaskCommand = async ( input: CancelBundleTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CancelBundleTaskRequest(input, context), @@ -4533,9 +4451,7 @@ export const serializeAws_ec2CancelCapacityReservationCommand = async ( input: CancelCapacityReservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CancelCapacityReservationRequest(input, context), @@ -4549,9 +4465,7 @@ export const serializeAws_ec2CancelCapacityReservationFleetsCommand = async ( input: CancelCapacityReservationFleetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CancelCapacityReservationFleetsRequest(input, context), @@ -4565,9 +4479,7 @@ export const serializeAws_ec2CancelConversionTaskCommand = async ( input: CancelConversionTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CancelConversionRequest(input, context), @@ -4581,9 +4493,7 @@ export const serializeAws_ec2CancelExportTaskCommand = async ( input: CancelExportTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CancelExportTaskRequest(input, context), @@ -4597,9 +4507,7 @@ export const serializeAws_ec2CancelImageLaunchPermissionCommand = async ( input: CancelImageLaunchPermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CancelImageLaunchPermissionRequest(input, context), @@ -4613,9 +4521,7 @@ export const serializeAws_ec2CancelImportTaskCommand = async ( input: CancelImportTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CancelImportTaskRequest(input, context), @@ -4629,9 +4535,7 @@ export const serializeAws_ec2CancelReservedInstancesListingCommand = async ( input: CancelReservedInstancesListingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CancelReservedInstancesListingRequest(input, context), @@ -4645,9 +4549,7 @@ export const serializeAws_ec2CancelSpotFleetRequestsCommand = async ( input: CancelSpotFleetRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CancelSpotFleetRequestsRequest(input, context), @@ -4661,9 +4563,7 @@ export const serializeAws_ec2CancelSpotInstanceRequestsCommand = async ( input: CancelSpotInstanceRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CancelSpotInstanceRequestsRequest(input, context), @@ -4677,9 +4577,7 @@ export const serializeAws_ec2ConfirmProductInstanceCommand = async ( input: ConfirmProductInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ConfirmProductInstanceRequest(input, context), @@ -4693,9 +4591,7 @@ export const serializeAws_ec2CopyFpgaImageCommand = async ( input: CopyFpgaImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CopyFpgaImageRequest(input, context), @@ -4709,9 +4605,7 @@ export const serializeAws_ec2CopyImageCommand = async ( input: CopyImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CopyImageRequest(input, context), @@ -4725,9 +4619,7 @@ export const serializeAws_ec2CopySnapshotCommand = async ( input: CopySnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CopySnapshotRequest(input, context), @@ -4741,9 +4633,7 @@ export const serializeAws_ec2CreateCapacityReservationCommand = async ( input: CreateCapacityReservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateCapacityReservationRequest(input, context), @@ -4757,9 +4647,7 @@ export const serializeAws_ec2CreateCapacityReservationFleetCommand = async ( input: CreateCapacityReservationFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateCapacityReservationFleetRequest(input, context), @@ -4773,9 +4661,7 @@ export const serializeAws_ec2CreateCarrierGatewayCommand = async ( input: CreateCarrierGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateCarrierGatewayRequest(input, context), @@ -4789,9 +4675,7 @@ export const serializeAws_ec2CreateClientVpnEndpointCommand = async ( input: CreateClientVpnEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateClientVpnEndpointRequest(input, context), @@ -4805,9 +4689,7 @@ export const serializeAws_ec2CreateClientVpnRouteCommand = async ( input: CreateClientVpnRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateClientVpnRouteRequest(input, context), @@ -4821,9 +4703,7 @@ export const serializeAws_ec2CreateCoipCidrCommand = async ( input: CreateCoipCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateCoipCidrRequest(input, context), @@ -4837,9 +4717,7 @@ export const serializeAws_ec2CreateCoipPoolCommand = async ( input: CreateCoipPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateCoipPoolRequest(input, context), @@ -4853,9 +4731,7 @@ export const serializeAws_ec2CreateCustomerGatewayCommand = async ( input: CreateCustomerGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateCustomerGatewayRequest(input, context), @@ -4869,9 +4745,7 @@ export const serializeAws_ec2CreateDefaultSubnetCommand = async ( input: CreateDefaultSubnetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateDefaultSubnetRequest(input, context), @@ -4885,9 +4759,7 @@ export const serializeAws_ec2CreateDefaultVpcCommand = async ( input: CreateDefaultVpcCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateDefaultVpcRequest(input, context), @@ -4901,9 +4773,7 @@ export const serializeAws_ec2CreateDhcpOptionsCommand = async ( input: CreateDhcpOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateDhcpOptionsRequest(input, context), @@ -4917,9 +4787,7 @@ export const serializeAws_ec2CreateEgressOnlyInternetGatewayCommand = async ( input: CreateEgressOnlyInternetGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateEgressOnlyInternetGatewayRequest(input, context), @@ -4933,9 +4801,7 @@ export const serializeAws_ec2CreateFleetCommand = async ( input: CreateFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateFleetRequest(input, context), @@ -4949,9 +4815,7 @@ export const serializeAws_ec2CreateFlowLogsCommand = async ( input: CreateFlowLogsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateFlowLogsRequest(input, context), @@ -4965,9 +4829,7 @@ export const serializeAws_ec2CreateFpgaImageCommand = async ( input: CreateFpgaImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateFpgaImageRequest(input, context), @@ -4981,9 +4843,7 @@ export const serializeAws_ec2CreateImageCommand = async ( input: CreateImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateImageRequest(input, context), @@ -4997,9 +4857,7 @@ export const serializeAws_ec2CreateInstanceEventWindowCommand = async ( input: CreateInstanceEventWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateInstanceEventWindowRequest(input, context), @@ -5013,9 +4871,7 @@ export const serializeAws_ec2CreateInstanceExportTaskCommand = async ( input: CreateInstanceExportTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateInstanceExportTaskRequest(input, context), @@ -5029,9 +4885,7 @@ export const serializeAws_ec2CreateInternetGatewayCommand = async ( input: CreateInternetGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateInternetGatewayRequest(input, context), @@ -5045,9 +4899,7 @@ export const serializeAws_ec2CreateIpamCommand = async ( input: CreateIpamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateIpamRequest(input, context), @@ -5061,9 +4913,7 @@ export const serializeAws_ec2CreateIpamPoolCommand = async ( input: CreateIpamPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateIpamPoolRequest(input, context), @@ -5077,9 +4927,7 @@ export const serializeAws_ec2CreateIpamResourceDiscoveryCommand = async ( input: CreateIpamResourceDiscoveryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateIpamResourceDiscoveryRequest(input, context), @@ -5093,9 +4941,7 @@ export const serializeAws_ec2CreateIpamScopeCommand = async ( input: CreateIpamScopeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateIpamScopeRequest(input, context), @@ -5109,9 +4955,7 @@ export const serializeAws_ec2CreateKeyPairCommand = async ( input: CreateKeyPairCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateKeyPairRequest(input, context), @@ -5125,9 +4969,7 @@ export const serializeAws_ec2CreateLaunchTemplateCommand = async ( input: CreateLaunchTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateLaunchTemplateRequest(input, context), @@ -5141,9 +4983,7 @@ export const serializeAws_ec2CreateLaunchTemplateVersionCommand = async ( input: CreateLaunchTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateLaunchTemplateVersionRequest(input, context), @@ -5157,9 +4997,7 @@ export const serializeAws_ec2CreateLocalGatewayRouteCommand = async ( input: CreateLocalGatewayRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateLocalGatewayRouteRequest(input, context), @@ -5173,9 +5011,7 @@ export const serializeAws_ec2CreateLocalGatewayRouteTableCommand = async ( input: CreateLocalGatewayRouteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateLocalGatewayRouteTableRequest(input, context), @@ -5189,9 +5025,7 @@ export const serializeAws_ec2CreateLocalGatewayRouteTableVirtualInterfaceGroupAs input: CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationRequest(input, context), @@ -5205,9 +5039,7 @@ export const serializeAws_ec2CreateLocalGatewayRouteTableVpcAssociationCommand = input: CreateLocalGatewayRouteTableVpcAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateLocalGatewayRouteTableVpcAssociationRequest(input, context), @@ -5221,9 +5053,7 @@ export const serializeAws_ec2CreateManagedPrefixListCommand = async ( input: CreateManagedPrefixListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateManagedPrefixListRequest(input, context), @@ -5237,9 +5067,7 @@ export const serializeAws_ec2CreateNatGatewayCommand = async ( input: CreateNatGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateNatGatewayRequest(input, context), @@ -5253,9 +5081,7 @@ export const serializeAws_ec2CreateNetworkAclCommand = async ( input: CreateNetworkAclCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateNetworkAclRequest(input, context), @@ -5269,9 +5095,7 @@ export const serializeAws_ec2CreateNetworkAclEntryCommand = async ( input: CreateNetworkAclEntryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateNetworkAclEntryRequest(input, context), @@ -5285,9 +5109,7 @@ export const serializeAws_ec2CreateNetworkInsightsAccessScopeCommand = async ( input: CreateNetworkInsightsAccessScopeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateNetworkInsightsAccessScopeRequest(input, context), @@ -5301,9 +5123,7 @@ export const serializeAws_ec2CreateNetworkInsightsPathCommand = async ( input: CreateNetworkInsightsPathCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateNetworkInsightsPathRequest(input, context), @@ -5317,9 +5137,7 @@ export const serializeAws_ec2CreateNetworkInterfaceCommand = async ( input: CreateNetworkInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateNetworkInterfaceRequest(input, context), @@ -5333,9 +5151,7 @@ export const serializeAws_ec2CreateNetworkInterfacePermissionCommand = async ( input: CreateNetworkInterfacePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateNetworkInterfacePermissionRequest(input, context), @@ -5349,9 +5165,7 @@ export const serializeAws_ec2CreatePlacementGroupCommand = async ( input: CreatePlacementGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreatePlacementGroupRequest(input, context), @@ -5365,9 +5179,7 @@ export const serializeAws_ec2CreatePublicIpv4PoolCommand = async ( input: CreatePublicIpv4PoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreatePublicIpv4PoolRequest(input, context), @@ -5381,9 +5193,7 @@ export const serializeAws_ec2CreateReplaceRootVolumeTaskCommand = async ( input: CreateReplaceRootVolumeTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateReplaceRootVolumeTaskRequest(input, context), @@ -5397,9 +5207,7 @@ export const serializeAws_ec2CreateReservedInstancesListingCommand = async ( input: CreateReservedInstancesListingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateReservedInstancesListingRequest(input, context), @@ -5413,9 +5221,7 @@ export const serializeAws_ec2CreateRestoreImageTaskCommand = async ( input: CreateRestoreImageTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateRestoreImageTaskRequest(input, context), @@ -5429,9 +5235,7 @@ export const serializeAws_ec2CreateRouteCommand = async ( input: CreateRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateRouteRequest(input, context), @@ -5445,9 +5249,7 @@ export const serializeAws_ec2CreateRouteTableCommand = async ( input: CreateRouteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateRouteTableRequest(input, context), @@ -5461,9 +5263,7 @@ export const serializeAws_ec2CreateSecurityGroupCommand = async ( input: CreateSecurityGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateSecurityGroupRequest(input, context), @@ -5477,9 +5277,7 @@ export const serializeAws_ec2CreateSnapshotCommand = async ( input: CreateSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateSnapshotRequest(input, context), @@ -5493,9 +5291,7 @@ export const serializeAws_ec2CreateSnapshotsCommand = async ( input: CreateSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateSnapshotsRequest(input, context), @@ -5509,9 +5305,7 @@ export const serializeAws_ec2CreateSpotDatafeedSubscriptionCommand = async ( input: CreateSpotDatafeedSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateSpotDatafeedSubscriptionRequest(input, context), @@ -5525,9 +5319,7 @@ export const serializeAws_ec2CreateStoreImageTaskCommand = async ( input: CreateStoreImageTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateStoreImageTaskRequest(input, context), @@ -5541,9 +5333,7 @@ export const serializeAws_ec2CreateSubnetCommand = async ( input: CreateSubnetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateSubnetRequest(input, context), @@ -5557,9 +5347,7 @@ export const serializeAws_ec2CreateSubnetCidrReservationCommand = async ( input: CreateSubnetCidrReservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateSubnetCidrReservationRequest(input, context), @@ -5573,9 +5361,7 @@ export const serializeAws_ec2CreateTagsCommand = async ( input: CreateTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTagsRequest(input, context), @@ -5589,9 +5375,7 @@ export const serializeAws_ec2CreateTrafficMirrorFilterCommand = async ( input: CreateTrafficMirrorFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTrafficMirrorFilterRequest(input, context), @@ -5605,9 +5389,7 @@ export const serializeAws_ec2CreateTrafficMirrorFilterRuleCommand = async ( input: CreateTrafficMirrorFilterRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTrafficMirrorFilterRuleRequest(input, context), @@ -5621,9 +5403,7 @@ export const serializeAws_ec2CreateTrafficMirrorSessionCommand = async ( input: CreateTrafficMirrorSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTrafficMirrorSessionRequest(input, context), @@ -5637,9 +5417,7 @@ export const serializeAws_ec2CreateTrafficMirrorTargetCommand = async ( input: CreateTrafficMirrorTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTrafficMirrorTargetRequest(input, context), @@ -5653,9 +5431,7 @@ export const serializeAws_ec2CreateTransitGatewayCommand = async ( input: CreateTransitGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayRequest(input, context), @@ -5669,9 +5445,7 @@ export const serializeAws_ec2CreateTransitGatewayConnectCommand = async ( input: CreateTransitGatewayConnectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayConnectRequest(input, context), @@ -5685,9 +5459,7 @@ export const serializeAws_ec2CreateTransitGatewayConnectPeerCommand = async ( input: CreateTransitGatewayConnectPeerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayConnectPeerRequest(input, context), @@ -5701,9 +5473,7 @@ export const serializeAws_ec2CreateTransitGatewayMulticastDomainCommand = async input: CreateTransitGatewayMulticastDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayMulticastDomainRequest(input, context), @@ -5717,9 +5487,7 @@ export const serializeAws_ec2CreateTransitGatewayPeeringAttachmentCommand = asyn input: CreateTransitGatewayPeeringAttachmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayPeeringAttachmentRequest(input, context), @@ -5733,9 +5501,7 @@ export const serializeAws_ec2CreateTransitGatewayPolicyTableCommand = async ( input: CreateTransitGatewayPolicyTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayPolicyTableRequest(input, context), @@ -5749,9 +5515,7 @@ export const serializeAws_ec2CreateTransitGatewayPrefixListReferenceCommand = as input: CreateTransitGatewayPrefixListReferenceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayPrefixListReferenceRequest(input, context), @@ -5765,9 +5529,7 @@ export const serializeAws_ec2CreateTransitGatewayRouteCommand = async ( input: CreateTransitGatewayRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayRouteRequest(input, context), @@ -5781,9 +5543,7 @@ export const serializeAws_ec2CreateTransitGatewayRouteTableCommand = async ( input: CreateTransitGatewayRouteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayRouteTableRequest(input, context), @@ -5797,9 +5557,7 @@ export const serializeAws_ec2CreateTransitGatewayRouteTableAnnouncementCommand = input: CreateTransitGatewayRouteTableAnnouncementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayRouteTableAnnouncementRequest(input, context), @@ -5813,9 +5571,7 @@ export const serializeAws_ec2CreateTransitGatewayVpcAttachmentCommand = async ( input: CreateTransitGatewayVpcAttachmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateTransitGatewayVpcAttachmentRequest(input, context), @@ -5829,9 +5585,7 @@ export const serializeAws_ec2CreateVerifiedAccessEndpointCommand = async ( input: CreateVerifiedAccessEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVerifiedAccessEndpointRequest(input, context), @@ -5845,9 +5599,7 @@ export const serializeAws_ec2CreateVerifiedAccessGroupCommand = async ( input: CreateVerifiedAccessGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVerifiedAccessGroupRequest(input, context), @@ -5861,9 +5613,7 @@ export const serializeAws_ec2CreateVerifiedAccessInstanceCommand = async ( input: CreateVerifiedAccessInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVerifiedAccessInstanceRequest(input, context), @@ -5877,9 +5627,7 @@ export const serializeAws_ec2CreateVerifiedAccessTrustProviderCommand = async ( input: CreateVerifiedAccessTrustProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVerifiedAccessTrustProviderRequest(input, context), @@ -5893,9 +5641,7 @@ export const serializeAws_ec2CreateVolumeCommand = async ( input: CreateVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVolumeRequest(input, context), @@ -5909,9 +5655,7 @@ export const serializeAws_ec2CreateVpcCommand = async ( input: CreateVpcCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVpcRequest(input, context), @@ -5925,9 +5669,7 @@ export const serializeAws_ec2CreateVpcEndpointCommand = async ( input: CreateVpcEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVpcEndpointRequest(input, context), @@ -5941,9 +5683,7 @@ export const serializeAws_ec2CreateVpcEndpointConnectionNotificationCommand = as input: CreateVpcEndpointConnectionNotificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVpcEndpointConnectionNotificationRequest(input, context), @@ -5957,9 +5697,7 @@ export const serializeAws_ec2CreateVpcEndpointServiceConfigurationCommand = asyn input: CreateVpcEndpointServiceConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVpcEndpointServiceConfigurationRequest(input, context), @@ -5973,9 +5711,7 @@ export const serializeAws_ec2CreateVpcPeeringConnectionCommand = async ( input: CreateVpcPeeringConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVpcPeeringConnectionRequest(input, context), @@ -5989,9 +5725,7 @@ export const serializeAws_ec2CreateVpnConnectionCommand = async ( input: CreateVpnConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVpnConnectionRequest(input, context), @@ -6005,9 +5739,7 @@ export const serializeAws_ec2CreateVpnConnectionRouteCommand = async ( input: CreateVpnConnectionRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVpnConnectionRouteRequest(input, context), @@ -6021,9 +5753,7 @@ export const serializeAws_ec2CreateVpnGatewayCommand = async ( input: CreateVpnGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2CreateVpnGatewayRequest(input, context), @@ -6037,9 +5767,7 @@ export const serializeAws_ec2DeleteCarrierGatewayCommand = async ( input: DeleteCarrierGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteCarrierGatewayRequest(input, context), @@ -6053,9 +5781,7 @@ export const serializeAws_ec2DeleteClientVpnEndpointCommand = async ( input: DeleteClientVpnEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteClientVpnEndpointRequest(input, context), @@ -6069,9 +5795,7 @@ export const serializeAws_ec2DeleteClientVpnRouteCommand = async ( input: DeleteClientVpnRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteClientVpnRouteRequest(input, context), @@ -6085,9 +5809,7 @@ export const serializeAws_ec2DeleteCoipCidrCommand = async ( input: DeleteCoipCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteCoipCidrRequest(input, context), @@ -6101,9 +5823,7 @@ export const serializeAws_ec2DeleteCoipPoolCommand = async ( input: DeleteCoipPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteCoipPoolRequest(input, context), @@ -6117,9 +5837,7 @@ export const serializeAws_ec2DeleteCustomerGatewayCommand = async ( input: DeleteCustomerGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteCustomerGatewayRequest(input, context), @@ -6133,9 +5851,7 @@ export const serializeAws_ec2DeleteDhcpOptionsCommand = async ( input: DeleteDhcpOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteDhcpOptionsRequest(input, context), @@ -6149,9 +5865,7 @@ export const serializeAws_ec2DeleteEgressOnlyInternetGatewayCommand = async ( input: DeleteEgressOnlyInternetGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteEgressOnlyInternetGatewayRequest(input, context), @@ -6165,9 +5879,7 @@ export const serializeAws_ec2DeleteFleetsCommand = async ( input: DeleteFleetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteFleetsRequest(input, context), @@ -6181,9 +5893,7 @@ export const serializeAws_ec2DeleteFlowLogsCommand = async ( input: DeleteFlowLogsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteFlowLogsRequest(input, context), @@ -6197,9 +5907,7 @@ export const serializeAws_ec2DeleteFpgaImageCommand = async ( input: DeleteFpgaImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteFpgaImageRequest(input, context), @@ -6213,9 +5921,7 @@ export const serializeAws_ec2DeleteInstanceEventWindowCommand = async ( input: DeleteInstanceEventWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteInstanceEventWindowRequest(input, context), @@ -6229,9 +5935,7 @@ export const serializeAws_ec2DeleteInternetGatewayCommand = async ( input: DeleteInternetGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteInternetGatewayRequest(input, context), @@ -6245,9 +5949,7 @@ export const serializeAws_ec2DeleteIpamCommand = async ( input: DeleteIpamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteIpamRequest(input, context), @@ -6261,9 +5963,7 @@ export const serializeAws_ec2DeleteIpamPoolCommand = async ( input: DeleteIpamPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteIpamPoolRequest(input, context), @@ -6277,9 +5977,7 @@ export const serializeAws_ec2DeleteIpamResourceDiscoveryCommand = async ( input: DeleteIpamResourceDiscoveryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteIpamResourceDiscoveryRequest(input, context), @@ -6293,9 +5991,7 @@ export const serializeAws_ec2DeleteIpamScopeCommand = async ( input: DeleteIpamScopeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteIpamScopeRequest(input, context), @@ -6309,9 +6005,7 @@ export const serializeAws_ec2DeleteKeyPairCommand = async ( input: DeleteKeyPairCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteKeyPairRequest(input, context), @@ -6325,9 +6019,7 @@ export const serializeAws_ec2DeleteLaunchTemplateCommand = async ( input: DeleteLaunchTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteLaunchTemplateRequest(input, context), @@ -6341,9 +6033,7 @@ export const serializeAws_ec2DeleteLaunchTemplateVersionsCommand = async ( input: DeleteLaunchTemplateVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteLaunchTemplateVersionsRequest(input, context), @@ -6357,9 +6047,7 @@ export const serializeAws_ec2DeleteLocalGatewayRouteCommand = async ( input: DeleteLocalGatewayRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteLocalGatewayRouteRequest(input, context), @@ -6373,9 +6061,7 @@ export const serializeAws_ec2DeleteLocalGatewayRouteTableCommand = async ( input: DeleteLocalGatewayRouteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteLocalGatewayRouteTableRequest(input, context), @@ -6389,9 +6075,7 @@ export const serializeAws_ec2DeleteLocalGatewayRouteTableVirtualInterfaceGroupAs input: DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationRequest(input, context), @@ -6405,9 +6089,7 @@ export const serializeAws_ec2DeleteLocalGatewayRouteTableVpcAssociationCommand = input: DeleteLocalGatewayRouteTableVpcAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteLocalGatewayRouteTableVpcAssociationRequest(input, context), @@ -6421,9 +6103,7 @@ export const serializeAws_ec2DeleteManagedPrefixListCommand = async ( input: DeleteManagedPrefixListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteManagedPrefixListRequest(input, context), @@ -6437,9 +6117,7 @@ export const serializeAws_ec2DeleteNatGatewayCommand = async ( input: DeleteNatGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteNatGatewayRequest(input, context), @@ -6453,9 +6131,7 @@ export const serializeAws_ec2DeleteNetworkAclCommand = async ( input: DeleteNetworkAclCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteNetworkAclRequest(input, context), @@ -6469,9 +6145,7 @@ export const serializeAws_ec2DeleteNetworkAclEntryCommand = async ( input: DeleteNetworkAclEntryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteNetworkAclEntryRequest(input, context), @@ -6485,9 +6159,7 @@ export const serializeAws_ec2DeleteNetworkInsightsAccessScopeCommand = async ( input: DeleteNetworkInsightsAccessScopeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteNetworkInsightsAccessScopeRequest(input, context), @@ -6501,9 +6173,7 @@ export const serializeAws_ec2DeleteNetworkInsightsAccessScopeAnalysisCommand = a input: DeleteNetworkInsightsAccessScopeAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteNetworkInsightsAccessScopeAnalysisRequest(input, context), @@ -6517,9 +6187,7 @@ export const serializeAws_ec2DeleteNetworkInsightsAnalysisCommand = async ( input: DeleteNetworkInsightsAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteNetworkInsightsAnalysisRequest(input, context), @@ -6533,9 +6201,7 @@ export const serializeAws_ec2DeleteNetworkInsightsPathCommand = async ( input: DeleteNetworkInsightsPathCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteNetworkInsightsPathRequest(input, context), @@ -6549,9 +6215,7 @@ export const serializeAws_ec2DeleteNetworkInterfaceCommand = async ( input: DeleteNetworkInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteNetworkInterfaceRequest(input, context), @@ -6565,9 +6229,7 @@ export const serializeAws_ec2DeleteNetworkInterfacePermissionCommand = async ( input: DeleteNetworkInterfacePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteNetworkInterfacePermissionRequest(input, context), @@ -6581,9 +6243,7 @@ export const serializeAws_ec2DeletePlacementGroupCommand = async ( input: DeletePlacementGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeletePlacementGroupRequest(input, context), @@ -6597,9 +6257,7 @@ export const serializeAws_ec2DeletePublicIpv4PoolCommand = async ( input: DeletePublicIpv4PoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeletePublicIpv4PoolRequest(input, context), @@ -6613,9 +6271,7 @@ export const serializeAws_ec2DeleteQueuedReservedInstancesCommand = async ( input: DeleteQueuedReservedInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteQueuedReservedInstancesRequest(input, context), @@ -6629,9 +6285,7 @@ export const serializeAws_ec2DeleteRouteCommand = async ( input: DeleteRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteRouteRequest(input, context), @@ -6645,9 +6299,7 @@ export const serializeAws_ec2DeleteRouteTableCommand = async ( input: DeleteRouteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteRouteTableRequest(input, context), @@ -6661,9 +6313,7 @@ export const serializeAws_ec2DeleteSecurityGroupCommand = async ( input: DeleteSecurityGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteSecurityGroupRequest(input, context), @@ -6677,9 +6327,7 @@ export const serializeAws_ec2DeleteSnapshotCommand = async ( input: DeleteSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteSnapshotRequest(input, context), @@ -6693,9 +6341,7 @@ export const serializeAws_ec2DeleteSpotDatafeedSubscriptionCommand = async ( input: DeleteSpotDatafeedSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteSpotDatafeedSubscriptionRequest(input, context), @@ -6709,9 +6355,7 @@ export const serializeAws_ec2DeleteSubnetCommand = async ( input: DeleteSubnetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteSubnetRequest(input, context), @@ -6725,9 +6369,7 @@ export const serializeAws_ec2DeleteSubnetCidrReservationCommand = async ( input: DeleteSubnetCidrReservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteSubnetCidrReservationRequest(input, context), @@ -6741,9 +6383,7 @@ export const serializeAws_ec2DeleteTagsCommand = async ( input: DeleteTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTagsRequest(input, context), @@ -6757,9 +6397,7 @@ export const serializeAws_ec2DeleteTrafficMirrorFilterCommand = async ( input: DeleteTrafficMirrorFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTrafficMirrorFilterRequest(input, context), @@ -6773,9 +6411,7 @@ export const serializeAws_ec2DeleteTrafficMirrorFilterRuleCommand = async ( input: DeleteTrafficMirrorFilterRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTrafficMirrorFilterRuleRequest(input, context), @@ -6789,9 +6425,7 @@ export const serializeAws_ec2DeleteTrafficMirrorSessionCommand = async ( input: DeleteTrafficMirrorSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTrafficMirrorSessionRequest(input, context), @@ -6805,9 +6439,7 @@ export const serializeAws_ec2DeleteTrafficMirrorTargetCommand = async ( input: DeleteTrafficMirrorTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTrafficMirrorTargetRequest(input, context), @@ -6821,9 +6453,7 @@ export const serializeAws_ec2DeleteTransitGatewayCommand = async ( input: DeleteTransitGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayRequest(input, context), @@ -6837,9 +6467,7 @@ export const serializeAws_ec2DeleteTransitGatewayConnectCommand = async ( input: DeleteTransitGatewayConnectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayConnectRequest(input, context), @@ -6853,9 +6481,7 @@ export const serializeAws_ec2DeleteTransitGatewayConnectPeerCommand = async ( input: DeleteTransitGatewayConnectPeerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayConnectPeerRequest(input, context), @@ -6869,9 +6495,7 @@ export const serializeAws_ec2DeleteTransitGatewayMulticastDomainCommand = async input: DeleteTransitGatewayMulticastDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayMulticastDomainRequest(input, context), @@ -6885,9 +6509,7 @@ export const serializeAws_ec2DeleteTransitGatewayPeeringAttachmentCommand = asyn input: DeleteTransitGatewayPeeringAttachmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayPeeringAttachmentRequest(input, context), @@ -6901,9 +6523,7 @@ export const serializeAws_ec2DeleteTransitGatewayPolicyTableCommand = async ( input: DeleteTransitGatewayPolicyTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayPolicyTableRequest(input, context), @@ -6917,9 +6537,7 @@ export const serializeAws_ec2DeleteTransitGatewayPrefixListReferenceCommand = as input: DeleteTransitGatewayPrefixListReferenceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayPrefixListReferenceRequest(input, context), @@ -6933,9 +6551,7 @@ export const serializeAws_ec2DeleteTransitGatewayRouteCommand = async ( input: DeleteTransitGatewayRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayRouteRequest(input, context), @@ -6949,9 +6565,7 @@ export const serializeAws_ec2DeleteTransitGatewayRouteTableCommand = async ( input: DeleteTransitGatewayRouteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayRouteTableRequest(input, context), @@ -6965,9 +6579,7 @@ export const serializeAws_ec2DeleteTransitGatewayRouteTableAnnouncementCommand = input: DeleteTransitGatewayRouteTableAnnouncementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayRouteTableAnnouncementRequest(input, context), @@ -6981,9 +6593,7 @@ export const serializeAws_ec2DeleteTransitGatewayVpcAttachmentCommand = async ( input: DeleteTransitGatewayVpcAttachmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteTransitGatewayVpcAttachmentRequest(input, context), @@ -6997,9 +6607,7 @@ export const serializeAws_ec2DeleteVerifiedAccessEndpointCommand = async ( input: DeleteVerifiedAccessEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVerifiedAccessEndpointRequest(input, context), @@ -7013,9 +6621,7 @@ export const serializeAws_ec2DeleteVerifiedAccessGroupCommand = async ( input: DeleteVerifiedAccessGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVerifiedAccessGroupRequest(input, context), @@ -7029,9 +6635,7 @@ export const serializeAws_ec2DeleteVerifiedAccessInstanceCommand = async ( input: DeleteVerifiedAccessInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVerifiedAccessInstanceRequest(input, context), @@ -7045,9 +6649,7 @@ export const serializeAws_ec2DeleteVerifiedAccessTrustProviderCommand = async ( input: DeleteVerifiedAccessTrustProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVerifiedAccessTrustProviderRequest(input, context), @@ -7061,9 +6663,7 @@ export const serializeAws_ec2DeleteVolumeCommand = async ( input: DeleteVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVolumeRequest(input, context), @@ -7077,9 +6677,7 @@ export const serializeAws_ec2DeleteVpcCommand = async ( input: DeleteVpcCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVpcRequest(input, context), @@ -7093,9 +6691,7 @@ export const serializeAws_ec2DeleteVpcEndpointConnectionNotificationsCommand = a input: DeleteVpcEndpointConnectionNotificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVpcEndpointConnectionNotificationsRequest(input, context), @@ -7109,9 +6705,7 @@ export const serializeAws_ec2DeleteVpcEndpointsCommand = async ( input: DeleteVpcEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVpcEndpointsRequest(input, context), @@ -7125,9 +6719,7 @@ export const serializeAws_ec2DeleteVpcEndpointServiceConfigurationsCommand = asy input: DeleteVpcEndpointServiceConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVpcEndpointServiceConfigurationsRequest(input, context), @@ -7141,9 +6733,7 @@ export const serializeAws_ec2DeleteVpcPeeringConnectionCommand = async ( input: DeleteVpcPeeringConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVpcPeeringConnectionRequest(input, context), @@ -7157,9 +6747,7 @@ export const serializeAws_ec2DeleteVpnConnectionCommand = async ( input: DeleteVpnConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVpnConnectionRequest(input, context), @@ -7173,9 +6761,7 @@ export const serializeAws_ec2DeleteVpnConnectionRouteCommand = async ( input: DeleteVpnConnectionRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVpnConnectionRouteRequest(input, context), @@ -7189,9 +6775,7 @@ export const serializeAws_ec2DeleteVpnGatewayCommand = async ( input: DeleteVpnGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeleteVpnGatewayRequest(input, context), @@ -7205,9 +6789,7 @@ export const serializeAws_ec2DeprovisionByoipCidrCommand = async ( input: DeprovisionByoipCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeprovisionByoipCidrRequest(input, context), @@ -7221,9 +6803,7 @@ export const serializeAws_ec2DeprovisionIpamPoolCidrCommand = async ( input: DeprovisionIpamPoolCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeprovisionIpamPoolCidrRequest(input, context), @@ -7237,9 +6817,7 @@ export const serializeAws_ec2DeprovisionPublicIpv4PoolCidrCommand = async ( input: DeprovisionPublicIpv4PoolCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeprovisionPublicIpv4PoolCidrRequest(input, context), @@ -7253,9 +6831,7 @@ export const serializeAws_ec2DeregisterImageCommand = async ( input: DeregisterImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeregisterImageRequest(input, context), @@ -7269,9 +6845,7 @@ export const serializeAws_ec2DeregisterInstanceEventNotificationAttributesComman input: DeregisterInstanceEventNotificationAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeregisterInstanceEventNotificationAttributesRequest(input, context), @@ -7285,9 +6859,7 @@ export const serializeAws_ec2DeregisterTransitGatewayMulticastGroupMembersComman input: DeregisterTransitGatewayMulticastGroupMembersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeregisterTransitGatewayMulticastGroupMembersRequest(input, context), @@ -7301,9 +6873,7 @@ export const serializeAws_ec2DeregisterTransitGatewayMulticastGroupSourcesComman input: DeregisterTransitGatewayMulticastGroupSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DeregisterTransitGatewayMulticastGroupSourcesRequest(input, context), @@ -7317,9 +6887,7 @@ export const serializeAws_ec2DescribeAccountAttributesCommand = async ( input: DescribeAccountAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeAccountAttributesRequest(input, context), @@ -7333,9 +6901,7 @@ export const serializeAws_ec2DescribeAddressesCommand = async ( input: DescribeAddressesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeAddressesRequest(input, context), @@ -7349,9 +6915,7 @@ export const serializeAws_ec2DescribeAddressesAttributeCommand = async ( input: DescribeAddressesAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeAddressesAttributeRequest(input, context), @@ -7365,9 +6929,7 @@ export const serializeAws_ec2DescribeAddressTransfersCommand = async ( input: DescribeAddressTransfersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeAddressTransfersRequest(input, context), @@ -7381,9 +6943,7 @@ export const serializeAws_ec2DescribeAggregateIdFormatCommand = async ( input: DescribeAggregateIdFormatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeAggregateIdFormatRequest(input, context), @@ -7397,9 +6957,7 @@ export const serializeAws_ec2DescribeAvailabilityZonesCommand = async ( input: DescribeAvailabilityZonesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeAvailabilityZonesRequest(input, context), @@ -7413,9 +6971,7 @@ export const serializeAws_ec2DescribeAwsNetworkPerformanceMetricSubscriptionsCom input: DescribeAwsNetworkPerformanceMetricSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeAwsNetworkPerformanceMetricSubscriptionsRequest(input, context), @@ -7429,9 +6985,7 @@ export const serializeAws_ec2DescribeBundleTasksCommand = async ( input: DescribeBundleTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeBundleTasksRequest(input, context), @@ -7445,9 +6999,7 @@ export const serializeAws_ec2DescribeByoipCidrsCommand = async ( input: DescribeByoipCidrsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeByoipCidrsRequest(input, context), @@ -7461,9 +7013,7 @@ export const serializeAws_ec2DescribeCapacityReservationFleetsCommand = async ( input: DescribeCapacityReservationFleetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeCapacityReservationFleetsRequest(input, context), @@ -7477,9 +7027,7 @@ export const serializeAws_ec2DescribeCapacityReservationsCommand = async ( input: DescribeCapacityReservationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeCapacityReservationsRequest(input, context), @@ -7493,9 +7041,7 @@ export const serializeAws_ec2DescribeCarrierGatewaysCommand = async ( input: DescribeCarrierGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeCarrierGatewaysRequest(input, context), @@ -7509,9 +7055,7 @@ export const serializeAws_ec2DescribeClassicLinkInstancesCommand = async ( input: DescribeClassicLinkInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeClassicLinkInstancesRequest(input, context), @@ -7525,9 +7069,7 @@ export const serializeAws_ec2DescribeClientVpnAuthorizationRulesCommand = async input: DescribeClientVpnAuthorizationRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeClientVpnAuthorizationRulesRequest(input, context), @@ -7541,9 +7083,7 @@ export const serializeAws_ec2DescribeClientVpnConnectionsCommand = async ( input: DescribeClientVpnConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeClientVpnConnectionsRequest(input, context), @@ -7557,9 +7097,7 @@ export const serializeAws_ec2DescribeClientVpnEndpointsCommand = async ( input: DescribeClientVpnEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeClientVpnEndpointsRequest(input, context), @@ -7573,9 +7111,7 @@ export const serializeAws_ec2DescribeClientVpnRoutesCommand = async ( input: DescribeClientVpnRoutesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeClientVpnRoutesRequest(input, context), @@ -7589,9 +7125,7 @@ export const serializeAws_ec2DescribeClientVpnTargetNetworksCommand = async ( input: DescribeClientVpnTargetNetworksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeClientVpnTargetNetworksRequest(input, context), @@ -7605,9 +7139,7 @@ export const serializeAws_ec2DescribeCoipPoolsCommand = async ( input: DescribeCoipPoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeCoipPoolsRequest(input, context), @@ -7621,9 +7153,7 @@ export const serializeAws_ec2DescribeConversionTasksCommand = async ( input: DescribeConversionTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeConversionTasksRequest(input, context), @@ -7637,9 +7167,7 @@ export const serializeAws_ec2DescribeCustomerGatewaysCommand = async ( input: DescribeCustomerGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeCustomerGatewaysRequest(input, context), @@ -7653,9 +7181,7 @@ export const serializeAws_ec2DescribeDhcpOptionsCommand = async ( input: DescribeDhcpOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeDhcpOptionsRequest(input, context), @@ -7669,9 +7195,7 @@ export const serializeAws_ec2DescribeEgressOnlyInternetGatewaysCommand = async ( input: DescribeEgressOnlyInternetGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeEgressOnlyInternetGatewaysRequest(input, context), @@ -7685,9 +7209,7 @@ export const serializeAws_ec2DescribeElasticGpusCommand = async ( input: DescribeElasticGpusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeElasticGpusRequest(input, context), @@ -7701,9 +7223,7 @@ export const serializeAws_ec2DescribeExportImageTasksCommand = async ( input: DescribeExportImageTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeExportImageTasksRequest(input, context), @@ -7717,9 +7237,7 @@ export const serializeAws_ec2DescribeExportTasksCommand = async ( input: DescribeExportTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeExportTasksRequest(input, context), @@ -7733,9 +7251,7 @@ export const serializeAws_ec2DescribeFastLaunchImagesCommand = async ( input: DescribeFastLaunchImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeFastLaunchImagesRequest(input, context), @@ -7749,9 +7265,7 @@ export const serializeAws_ec2DescribeFastSnapshotRestoresCommand = async ( input: DescribeFastSnapshotRestoresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeFastSnapshotRestoresRequest(input, context), @@ -7765,9 +7279,7 @@ export const serializeAws_ec2DescribeFleetHistoryCommand = async ( input: DescribeFleetHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeFleetHistoryRequest(input, context), @@ -7781,9 +7293,7 @@ export const serializeAws_ec2DescribeFleetInstancesCommand = async ( input: DescribeFleetInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeFleetInstancesRequest(input, context), @@ -7797,9 +7307,7 @@ export const serializeAws_ec2DescribeFleetsCommand = async ( input: DescribeFleetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeFleetsRequest(input, context), @@ -7813,9 +7321,7 @@ export const serializeAws_ec2DescribeFlowLogsCommand = async ( input: DescribeFlowLogsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeFlowLogsRequest(input, context), @@ -7829,9 +7335,7 @@ export const serializeAws_ec2DescribeFpgaImageAttributeCommand = async ( input: DescribeFpgaImageAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeFpgaImageAttributeRequest(input, context), @@ -7845,9 +7349,7 @@ export const serializeAws_ec2DescribeFpgaImagesCommand = async ( input: DescribeFpgaImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeFpgaImagesRequest(input, context), @@ -7861,9 +7363,7 @@ export const serializeAws_ec2DescribeHostReservationOfferingsCommand = async ( input: DescribeHostReservationOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeHostReservationOfferingsRequest(input, context), @@ -7877,9 +7377,7 @@ export const serializeAws_ec2DescribeHostReservationsCommand = async ( input: DescribeHostReservationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeHostReservationsRequest(input, context), @@ -7893,9 +7391,7 @@ export const serializeAws_ec2DescribeHostsCommand = async ( input: DescribeHostsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeHostsRequest(input, context), @@ -7909,9 +7405,7 @@ export const serializeAws_ec2DescribeIamInstanceProfileAssociationsCommand = asy input: DescribeIamInstanceProfileAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeIamInstanceProfileAssociationsRequest(input, context), @@ -7925,9 +7419,7 @@ export const serializeAws_ec2DescribeIdentityIdFormatCommand = async ( input: DescribeIdentityIdFormatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeIdentityIdFormatRequest(input, context), @@ -7941,9 +7433,7 @@ export const serializeAws_ec2DescribeIdFormatCommand = async ( input: DescribeIdFormatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeIdFormatRequest(input, context), @@ -7957,9 +7447,7 @@ export const serializeAws_ec2DescribeImageAttributeCommand = async ( input: DescribeImageAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeImageAttributeRequest(input, context), @@ -7973,9 +7461,7 @@ export const serializeAws_ec2DescribeImagesCommand = async ( input: DescribeImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeImagesRequest(input, context), @@ -7989,9 +7475,7 @@ export const serializeAws_ec2DescribeImportImageTasksCommand = async ( input: DescribeImportImageTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeImportImageTasksRequest(input, context), @@ -8005,9 +7489,7 @@ export const serializeAws_ec2DescribeImportSnapshotTasksCommand = async ( input: DescribeImportSnapshotTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeImportSnapshotTasksRequest(input, context), @@ -8021,9 +7503,7 @@ export const serializeAws_ec2DescribeInstanceAttributeCommand = async ( input: DescribeInstanceAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeInstanceAttributeRequest(input, context), @@ -8037,9 +7517,7 @@ export const serializeAws_ec2DescribeInstanceCreditSpecificationsCommand = async input: DescribeInstanceCreditSpecificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeInstanceCreditSpecificationsRequest(input, context), @@ -8053,9 +7531,7 @@ export const serializeAws_ec2DescribeInstanceEventNotificationAttributesCommand input: DescribeInstanceEventNotificationAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeInstanceEventNotificationAttributesRequest(input, context), @@ -8069,9 +7545,7 @@ export const serializeAws_ec2DescribeInstanceEventWindowsCommand = async ( input: DescribeInstanceEventWindowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeInstanceEventWindowsRequest(input, context), @@ -8085,9 +7559,7 @@ export const serializeAws_ec2DescribeInstancesCommand = async ( input: DescribeInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeInstancesRequest(input, context), @@ -8101,9 +7573,7 @@ export const serializeAws_ec2DescribeInstanceStatusCommand = async ( input: DescribeInstanceStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeInstanceStatusRequest(input, context), @@ -8117,9 +7587,7 @@ export const serializeAws_ec2DescribeInstanceTypeOfferingsCommand = async ( input: DescribeInstanceTypeOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeInstanceTypeOfferingsRequest(input, context), @@ -8133,9 +7601,7 @@ export const serializeAws_ec2DescribeInstanceTypesCommand = async ( input: DescribeInstanceTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeInstanceTypesRequest(input, context), @@ -8149,9 +7615,7 @@ export const serializeAws_ec2DescribeInternetGatewaysCommand = async ( input: DescribeInternetGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeInternetGatewaysRequest(input, context), @@ -8165,9 +7629,7 @@ export const serializeAws_ec2DescribeIpamPoolsCommand = async ( input: DescribeIpamPoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeIpamPoolsRequest(input, context), @@ -8181,9 +7643,7 @@ export const serializeAws_ec2DescribeIpamResourceDiscoveriesCommand = async ( input: DescribeIpamResourceDiscoveriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeIpamResourceDiscoveriesRequest(input, context), @@ -8197,9 +7657,7 @@ export const serializeAws_ec2DescribeIpamResourceDiscoveryAssociationsCommand = input: DescribeIpamResourceDiscoveryAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeIpamResourceDiscoveryAssociationsRequest(input, context), @@ -8213,9 +7671,7 @@ export const serializeAws_ec2DescribeIpamsCommand = async ( input: DescribeIpamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeIpamsRequest(input, context), @@ -8229,9 +7685,7 @@ export const serializeAws_ec2DescribeIpamScopesCommand = async ( input: DescribeIpamScopesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeIpamScopesRequest(input, context), @@ -8245,9 +7699,7 @@ export const serializeAws_ec2DescribeIpv6PoolsCommand = async ( input: DescribeIpv6PoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeIpv6PoolsRequest(input, context), @@ -8261,9 +7713,7 @@ export const serializeAws_ec2DescribeKeyPairsCommand = async ( input: DescribeKeyPairsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeKeyPairsRequest(input, context), @@ -8277,9 +7727,7 @@ export const serializeAws_ec2DescribeLaunchTemplatesCommand = async ( input: DescribeLaunchTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeLaunchTemplatesRequest(input, context), @@ -8293,9 +7741,7 @@ export const serializeAws_ec2DescribeLaunchTemplateVersionsCommand = async ( input: DescribeLaunchTemplateVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeLaunchTemplateVersionsRequest(input, context), @@ -8309,9 +7755,7 @@ export const serializeAws_ec2DescribeLocalGatewayRouteTablesCommand = async ( input: DescribeLocalGatewayRouteTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeLocalGatewayRouteTablesRequest(input, context), @@ -8325,9 +7769,7 @@ export const serializeAws_ec2DescribeLocalGatewayRouteTableVirtualInterfaceGroup input: DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsRequest(input, context), @@ -8341,9 +7783,7 @@ export const serializeAws_ec2DescribeLocalGatewayRouteTableVpcAssociationsComman input: DescribeLocalGatewayRouteTableVpcAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeLocalGatewayRouteTableVpcAssociationsRequest(input, context), @@ -8357,9 +7797,7 @@ export const serializeAws_ec2DescribeLocalGatewaysCommand = async ( input: DescribeLocalGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeLocalGatewaysRequest(input, context), @@ -8373,9 +7811,7 @@ export const serializeAws_ec2DescribeLocalGatewayVirtualInterfaceGroupsCommand = input: DescribeLocalGatewayVirtualInterfaceGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeLocalGatewayVirtualInterfaceGroupsRequest(input, context), @@ -8389,9 +7825,7 @@ export const serializeAws_ec2DescribeLocalGatewayVirtualInterfacesCommand = asyn input: DescribeLocalGatewayVirtualInterfacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeLocalGatewayVirtualInterfacesRequest(input, context), @@ -8405,9 +7839,7 @@ export const serializeAws_ec2DescribeManagedPrefixListsCommand = async ( input: DescribeManagedPrefixListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeManagedPrefixListsRequest(input, context), @@ -8421,9 +7853,7 @@ export const serializeAws_ec2DescribeMovingAddressesCommand = async ( input: DescribeMovingAddressesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeMovingAddressesRequest(input, context), @@ -8437,9 +7867,7 @@ export const serializeAws_ec2DescribeNatGatewaysCommand = async ( input: DescribeNatGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeNatGatewaysRequest(input, context), @@ -8453,9 +7881,7 @@ export const serializeAws_ec2DescribeNetworkAclsCommand = async ( input: DescribeNetworkAclsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeNetworkAclsRequest(input, context), @@ -8469,9 +7895,7 @@ export const serializeAws_ec2DescribeNetworkInsightsAccessScopeAnalysesCommand = input: DescribeNetworkInsightsAccessScopeAnalysesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeNetworkInsightsAccessScopeAnalysesRequest(input, context), @@ -8485,9 +7909,7 @@ export const serializeAws_ec2DescribeNetworkInsightsAccessScopesCommand = async input: DescribeNetworkInsightsAccessScopesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeNetworkInsightsAccessScopesRequest(input, context), @@ -8501,9 +7923,7 @@ export const serializeAws_ec2DescribeNetworkInsightsAnalysesCommand = async ( input: DescribeNetworkInsightsAnalysesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeNetworkInsightsAnalysesRequest(input, context), @@ -8517,9 +7937,7 @@ export const serializeAws_ec2DescribeNetworkInsightsPathsCommand = async ( input: DescribeNetworkInsightsPathsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeNetworkInsightsPathsRequest(input, context), @@ -8533,9 +7951,7 @@ export const serializeAws_ec2DescribeNetworkInterfaceAttributeCommand = async ( input: DescribeNetworkInterfaceAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeNetworkInterfaceAttributeRequest(input, context), @@ -8549,9 +7965,7 @@ export const serializeAws_ec2DescribeNetworkInterfacePermissionsCommand = async input: DescribeNetworkInterfacePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeNetworkInterfacePermissionsRequest(input, context), @@ -8565,9 +7979,7 @@ export const serializeAws_ec2DescribeNetworkInterfacesCommand = async ( input: DescribeNetworkInterfacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeNetworkInterfacesRequest(input, context), @@ -8581,9 +7993,7 @@ export const serializeAws_ec2DescribePlacementGroupsCommand = async ( input: DescribePlacementGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribePlacementGroupsRequest(input, context), @@ -8597,9 +8007,7 @@ export const serializeAws_ec2DescribePrefixListsCommand = async ( input: DescribePrefixListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribePrefixListsRequest(input, context), @@ -8613,9 +8021,7 @@ export const serializeAws_ec2DescribePrincipalIdFormatCommand = async ( input: DescribePrincipalIdFormatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribePrincipalIdFormatRequest(input, context), @@ -8629,9 +8035,7 @@ export const serializeAws_ec2DescribePublicIpv4PoolsCommand = async ( input: DescribePublicIpv4PoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribePublicIpv4PoolsRequest(input, context), @@ -8645,9 +8049,7 @@ export const serializeAws_ec2DescribeRegionsCommand = async ( input: DescribeRegionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeRegionsRequest(input, context), @@ -8661,9 +8063,7 @@ export const serializeAws_ec2DescribeReplaceRootVolumeTasksCommand = async ( input: DescribeReplaceRootVolumeTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeReplaceRootVolumeTasksRequest(input, context), @@ -8677,9 +8077,7 @@ export const serializeAws_ec2DescribeReservedInstancesCommand = async ( input: DescribeReservedInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeReservedInstancesRequest(input, context), @@ -8693,9 +8091,7 @@ export const serializeAws_ec2DescribeReservedInstancesListingsCommand = async ( input: DescribeReservedInstancesListingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeReservedInstancesListingsRequest(input, context), @@ -8709,9 +8105,7 @@ export const serializeAws_ec2DescribeReservedInstancesModificationsCommand = asy input: DescribeReservedInstancesModificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeReservedInstancesModificationsRequest(input, context), @@ -8725,9 +8119,7 @@ export const serializeAws_ec2DescribeReservedInstancesOfferingsCommand = async ( input: DescribeReservedInstancesOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeReservedInstancesOfferingsRequest(input, context), @@ -8741,9 +8133,7 @@ export const serializeAws_ec2DescribeRouteTablesCommand = async ( input: DescribeRouteTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeRouteTablesRequest(input, context), @@ -8757,9 +8147,7 @@ export const serializeAws_ec2DescribeScheduledInstanceAvailabilityCommand = asyn input: DescribeScheduledInstanceAvailabilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeScheduledInstanceAvailabilityRequest(input, context), @@ -8773,9 +8161,7 @@ export const serializeAws_ec2DescribeScheduledInstancesCommand = async ( input: DescribeScheduledInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeScheduledInstancesRequest(input, context), @@ -8789,9 +8175,7 @@ export const serializeAws_ec2DescribeSecurityGroupReferencesCommand = async ( input: DescribeSecurityGroupReferencesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSecurityGroupReferencesRequest(input, context), @@ -8805,9 +8189,7 @@ export const serializeAws_ec2DescribeSecurityGroupRulesCommand = async ( input: DescribeSecurityGroupRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSecurityGroupRulesRequest(input, context), @@ -8821,9 +8203,7 @@ export const serializeAws_ec2DescribeSecurityGroupsCommand = async ( input: DescribeSecurityGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSecurityGroupsRequest(input, context), @@ -8837,9 +8217,7 @@ export const serializeAws_ec2DescribeSnapshotAttributeCommand = async ( input: DescribeSnapshotAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSnapshotAttributeRequest(input, context), @@ -8853,9 +8231,7 @@ export const serializeAws_ec2DescribeSnapshotsCommand = async ( input: DescribeSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSnapshotsRequest(input, context), @@ -8869,9 +8245,7 @@ export const serializeAws_ec2DescribeSnapshotTierStatusCommand = async ( input: DescribeSnapshotTierStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSnapshotTierStatusRequest(input, context), @@ -8885,9 +8259,7 @@ export const serializeAws_ec2DescribeSpotDatafeedSubscriptionCommand = async ( input: DescribeSpotDatafeedSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSpotDatafeedSubscriptionRequest(input, context), @@ -8901,9 +8273,7 @@ export const serializeAws_ec2DescribeSpotFleetInstancesCommand = async ( input: DescribeSpotFleetInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSpotFleetInstancesRequest(input, context), @@ -8917,9 +8287,7 @@ export const serializeAws_ec2DescribeSpotFleetRequestHistoryCommand = async ( input: DescribeSpotFleetRequestHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSpotFleetRequestHistoryRequest(input, context), @@ -8933,9 +8301,7 @@ export const serializeAws_ec2DescribeSpotFleetRequestsCommand = async ( input: DescribeSpotFleetRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSpotFleetRequestsRequest(input, context), @@ -8949,9 +8315,7 @@ export const serializeAws_ec2DescribeSpotInstanceRequestsCommand = async ( input: DescribeSpotInstanceRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSpotInstanceRequestsRequest(input, context), @@ -8965,9 +8329,7 @@ export const serializeAws_ec2DescribeSpotPriceHistoryCommand = async ( input: DescribeSpotPriceHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSpotPriceHistoryRequest(input, context), @@ -8981,9 +8343,7 @@ export const serializeAws_ec2DescribeStaleSecurityGroupsCommand = async ( input: DescribeStaleSecurityGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeStaleSecurityGroupsRequest(input, context), @@ -8997,9 +8357,7 @@ export const serializeAws_ec2DescribeStoreImageTasksCommand = async ( input: DescribeStoreImageTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeStoreImageTasksRequest(input, context), @@ -9013,9 +8371,7 @@ export const serializeAws_ec2DescribeSubnetsCommand = async ( input: DescribeSubnetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeSubnetsRequest(input, context), @@ -9029,9 +8385,7 @@ export const serializeAws_ec2DescribeTagsCommand = async ( input: DescribeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTagsRequest(input, context), @@ -9045,9 +8399,7 @@ export const serializeAws_ec2DescribeTrafficMirrorFiltersCommand = async ( input: DescribeTrafficMirrorFiltersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTrafficMirrorFiltersRequest(input, context), @@ -9061,9 +8413,7 @@ export const serializeAws_ec2DescribeTrafficMirrorSessionsCommand = async ( input: DescribeTrafficMirrorSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTrafficMirrorSessionsRequest(input, context), @@ -9077,9 +8427,7 @@ export const serializeAws_ec2DescribeTrafficMirrorTargetsCommand = async ( input: DescribeTrafficMirrorTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTrafficMirrorTargetsRequest(input, context), @@ -9093,9 +8441,7 @@ export const serializeAws_ec2DescribeTransitGatewayAttachmentsCommand = async ( input: DescribeTransitGatewayAttachmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTransitGatewayAttachmentsRequest(input, context), @@ -9109,9 +8455,7 @@ export const serializeAws_ec2DescribeTransitGatewayConnectPeersCommand = async ( input: DescribeTransitGatewayConnectPeersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTransitGatewayConnectPeersRequest(input, context), @@ -9125,9 +8469,7 @@ export const serializeAws_ec2DescribeTransitGatewayConnectsCommand = async ( input: DescribeTransitGatewayConnectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTransitGatewayConnectsRequest(input, context), @@ -9141,9 +8483,7 @@ export const serializeAws_ec2DescribeTransitGatewayMulticastDomainsCommand = asy input: DescribeTransitGatewayMulticastDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTransitGatewayMulticastDomainsRequest(input, context), @@ -9157,9 +8497,7 @@ export const serializeAws_ec2DescribeTransitGatewayPeeringAttachmentsCommand = a input: DescribeTransitGatewayPeeringAttachmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTransitGatewayPeeringAttachmentsRequest(input, context), @@ -9173,9 +8511,7 @@ export const serializeAws_ec2DescribeTransitGatewayPolicyTablesCommand = async ( input: DescribeTransitGatewayPolicyTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTransitGatewayPolicyTablesRequest(input, context), @@ -9189,9 +8525,7 @@ export const serializeAws_ec2DescribeTransitGatewayRouteTableAnnouncementsComman input: DescribeTransitGatewayRouteTableAnnouncementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTransitGatewayRouteTableAnnouncementsRequest(input, context), @@ -9205,9 +8539,7 @@ export const serializeAws_ec2DescribeTransitGatewayRouteTablesCommand = async ( input: DescribeTransitGatewayRouteTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTransitGatewayRouteTablesRequest(input, context), @@ -9221,9 +8553,7 @@ export const serializeAws_ec2DescribeTransitGatewaysCommand = async ( input: DescribeTransitGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTransitGatewaysRequest(input, context), @@ -9237,9 +8567,7 @@ export const serializeAws_ec2DescribeTransitGatewayVpcAttachmentsCommand = async input: DescribeTransitGatewayVpcAttachmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTransitGatewayVpcAttachmentsRequest(input, context), @@ -9253,9 +8581,7 @@ export const serializeAws_ec2DescribeTrunkInterfaceAssociationsCommand = async ( input: DescribeTrunkInterfaceAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeTrunkInterfaceAssociationsRequest(input, context), @@ -9269,9 +8595,7 @@ export const serializeAws_ec2DescribeVerifiedAccessEndpointsCommand = async ( input: DescribeVerifiedAccessEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVerifiedAccessEndpointsRequest(input, context), @@ -9285,9 +8609,7 @@ export const serializeAws_ec2DescribeVerifiedAccessGroupsCommand = async ( input: DescribeVerifiedAccessGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVerifiedAccessGroupsRequest(input, context), @@ -9301,9 +8623,7 @@ export const serializeAws_ec2DescribeVerifiedAccessInstanceLoggingConfigurations input: DescribeVerifiedAccessInstanceLoggingConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVerifiedAccessInstanceLoggingConfigurationsRequest(input, context), @@ -9317,9 +8637,7 @@ export const serializeAws_ec2DescribeVerifiedAccessInstancesCommand = async ( input: DescribeVerifiedAccessInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVerifiedAccessInstancesRequest(input, context), @@ -9333,9 +8651,7 @@ export const serializeAws_ec2DescribeVerifiedAccessTrustProvidersCommand = async input: DescribeVerifiedAccessTrustProvidersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVerifiedAccessTrustProvidersRequest(input, context), @@ -9349,9 +8665,7 @@ export const serializeAws_ec2DescribeVolumeAttributeCommand = async ( input: DescribeVolumeAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVolumeAttributeRequest(input, context), @@ -9365,9 +8679,7 @@ export const serializeAws_ec2DescribeVolumesCommand = async ( input: DescribeVolumesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVolumesRequest(input, context), @@ -9381,9 +8693,7 @@ export const serializeAws_ec2DescribeVolumesModificationsCommand = async ( input: DescribeVolumesModificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVolumesModificationsRequest(input, context), @@ -9397,9 +8707,7 @@ export const serializeAws_ec2DescribeVolumeStatusCommand = async ( input: DescribeVolumeStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVolumeStatusRequest(input, context), @@ -9413,9 +8721,7 @@ export const serializeAws_ec2DescribeVpcAttributeCommand = async ( input: DescribeVpcAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcAttributeRequest(input, context), @@ -9429,9 +8735,7 @@ export const serializeAws_ec2DescribeVpcClassicLinkCommand = async ( input: DescribeVpcClassicLinkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcClassicLinkRequest(input, context), @@ -9445,9 +8749,7 @@ export const serializeAws_ec2DescribeVpcClassicLinkDnsSupportCommand = async ( input: DescribeVpcClassicLinkDnsSupportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcClassicLinkDnsSupportRequest(input, context), @@ -9461,9 +8763,7 @@ export const serializeAws_ec2DescribeVpcEndpointConnectionNotificationsCommand = input: DescribeVpcEndpointConnectionNotificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcEndpointConnectionNotificationsRequest(input, context), @@ -9477,9 +8777,7 @@ export const serializeAws_ec2DescribeVpcEndpointConnectionsCommand = async ( input: DescribeVpcEndpointConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcEndpointConnectionsRequest(input, context), @@ -9493,9 +8791,7 @@ export const serializeAws_ec2DescribeVpcEndpointsCommand = async ( input: DescribeVpcEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcEndpointsRequest(input, context), @@ -9509,9 +8805,7 @@ export const serializeAws_ec2DescribeVpcEndpointServiceConfigurationsCommand = a input: DescribeVpcEndpointServiceConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcEndpointServiceConfigurationsRequest(input, context), @@ -9525,9 +8819,7 @@ export const serializeAws_ec2DescribeVpcEndpointServicePermissionsCommand = asyn input: DescribeVpcEndpointServicePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcEndpointServicePermissionsRequest(input, context), @@ -9541,9 +8833,7 @@ export const serializeAws_ec2DescribeVpcEndpointServicesCommand = async ( input: DescribeVpcEndpointServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcEndpointServicesRequest(input, context), @@ -9557,9 +8847,7 @@ export const serializeAws_ec2DescribeVpcPeeringConnectionsCommand = async ( input: DescribeVpcPeeringConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcPeeringConnectionsRequest(input, context), @@ -9573,9 +8861,7 @@ export const serializeAws_ec2DescribeVpcsCommand = async ( input: DescribeVpcsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpcsRequest(input, context), @@ -9589,9 +8875,7 @@ export const serializeAws_ec2DescribeVpnConnectionsCommand = async ( input: DescribeVpnConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpnConnectionsRequest(input, context), @@ -9605,9 +8889,7 @@ export const serializeAws_ec2DescribeVpnGatewaysCommand = async ( input: DescribeVpnGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DescribeVpnGatewaysRequest(input, context), @@ -9621,9 +8903,7 @@ export const serializeAws_ec2DetachClassicLinkVpcCommand = async ( input: DetachClassicLinkVpcCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DetachClassicLinkVpcRequest(input, context), @@ -9637,9 +8917,7 @@ export const serializeAws_ec2DetachInternetGatewayCommand = async ( input: DetachInternetGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DetachInternetGatewayRequest(input, context), @@ -9653,9 +8931,7 @@ export const serializeAws_ec2DetachNetworkInterfaceCommand = async ( input: DetachNetworkInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DetachNetworkInterfaceRequest(input, context), @@ -9669,9 +8945,7 @@ export const serializeAws_ec2DetachVerifiedAccessTrustProviderCommand = async ( input: DetachVerifiedAccessTrustProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DetachVerifiedAccessTrustProviderRequest(input, context), @@ -9685,9 +8959,7 @@ export const serializeAws_ec2DetachVolumeCommand = async ( input: DetachVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DetachVolumeRequest(input, context), @@ -9701,9 +8973,7 @@ export const serializeAws_ec2DetachVpnGatewayCommand = async ( input: DetachVpnGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DetachVpnGatewayRequest(input, context), @@ -9717,9 +8987,7 @@ export const serializeAws_ec2DisableAddressTransferCommand = async ( input: DisableAddressTransferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableAddressTransferRequest(input, context), @@ -9733,9 +9001,7 @@ export const serializeAws_ec2DisableAwsNetworkPerformanceMetricSubscriptionComma input: DisableAwsNetworkPerformanceMetricSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableAwsNetworkPerformanceMetricSubscriptionRequest(input, context), @@ -9749,9 +9015,7 @@ export const serializeAws_ec2DisableEbsEncryptionByDefaultCommand = async ( input: DisableEbsEncryptionByDefaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableEbsEncryptionByDefaultRequest(input, context), @@ -9765,9 +9029,7 @@ export const serializeAws_ec2DisableFastLaunchCommand = async ( input: DisableFastLaunchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableFastLaunchRequest(input, context), @@ -9781,9 +9043,7 @@ export const serializeAws_ec2DisableFastSnapshotRestoresCommand = async ( input: DisableFastSnapshotRestoresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableFastSnapshotRestoresRequest(input, context), @@ -9797,9 +9057,7 @@ export const serializeAws_ec2DisableImageDeprecationCommand = async ( input: DisableImageDeprecationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableImageDeprecationRequest(input, context), @@ -9813,9 +9071,7 @@ export const serializeAws_ec2DisableIpamOrganizationAdminAccountCommand = async input: DisableIpamOrganizationAdminAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableIpamOrganizationAdminAccountRequest(input, context), @@ -9829,9 +9085,7 @@ export const serializeAws_ec2DisableSerialConsoleAccessCommand = async ( input: DisableSerialConsoleAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableSerialConsoleAccessRequest(input, context), @@ -9845,9 +9099,7 @@ export const serializeAws_ec2DisableTransitGatewayRouteTablePropagationCommand = input: DisableTransitGatewayRouteTablePropagationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableTransitGatewayRouteTablePropagationRequest(input, context), @@ -9861,9 +9113,7 @@ export const serializeAws_ec2DisableVgwRoutePropagationCommand = async ( input: DisableVgwRoutePropagationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableVgwRoutePropagationRequest(input, context), @@ -9877,9 +9127,7 @@ export const serializeAws_ec2DisableVpcClassicLinkCommand = async ( input: DisableVpcClassicLinkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableVpcClassicLinkRequest(input, context), @@ -9893,9 +9141,7 @@ export const serializeAws_ec2DisableVpcClassicLinkDnsSupportCommand = async ( input: DisableVpcClassicLinkDnsSupportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisableVpcClassicLinkDnsSupportRequest(input, context), @@ -9909,9 +9155,7 @@ export const serializeAws_ec2DisassociateAddressCommand = async ( input: DisassociateAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateAddressRequest(input, context), @@ -9925,9 +9169,7 @@ export const serializeAws_ec2DisassociateClientVpnTargetNetworkCommand = async ( input: DisassociateClientVpnTargetNetworkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateClientVpnTargetNetworkRequest(input, context), @@ -9941,9 +9183,7 @@ export const serializeAws_ec2DisassociateEnclaveCertificateIamRoleCommand = asyn input: DisassociateEnclaveCertificateIamRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateEnclaveCertificateIamRoleRequest(input, context), @@ -9957,9 +9197,7 @@ export const serializeAws_ec2DisassociateIamInstanceProfileCommand = async ( input: DisassociateIamInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateIamInstanceProfileRequest(input, context), @@ -9973,9 +9211,7 @@ export const serializeAws_ec2DisassociateInstanceEventWindowCommand = async ( input: DisassociateInstanceEventWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateInstanceEventWindowRequest(input, context), @@ -9989,9 +9225,7 @@ export const serializeAws_ec2DisassociateIpamResourceDiscoveryCommand = async ( input: DisassociateIpamResourceDiscoveryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateIpamResourceDiscoveryRequest(input, context), @@ -10005,9 +9239,7 @@ export const serializeAws_ec2DisassociateNatGatewayAddressCommand = async ( input: DisassociateNatGatewayAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateNatGatewayAddressRequest(input, context), @@ -10021,9 +9253,7 @@ export const serializeAws_ec2DisassociateRouteTableCommand = async ( input: DisassociateRouteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateRouteTableRequest(input, context), @@ -10037,9 +9267,7 @@ export const serializeAws_ec2DisassociateSubnetCidrBlockCommand = async ( input: DisassociateSubnetCidrBlockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateSubnetCidrBlockRequest(input, context), @@ -10053,9 +9281,7 @@ export const serializeAws_ec2DisassociateTransitGatewayMulticastDomainCommand = input: DisassociateTransitGatewayMulticastDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateTransitGatewayMulticastDomainRequest(input, context), @@ -10069,9 +9295,7 @@ export const serializeAws_ec2DisassociateTransitGatewayPolicyTableCommand = asyn input: DisassociateTransitGatewayPolicyTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateTransitGatewayPolicyTableRequest(input, context), @@ -10085,9 +9309,7 @@ export const serializeAws_ec2DisassociateTransitGatewayRouteTableCommand = async input: DisassociateTransitGatewayRouteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateTransitGatewayRouteTableRequest(input, context), @@ -10101,9 +9323,7 @@ export const serializeAws_ec2DisassociateTrunkInterfaceCommand = async ( input: DisassociateTrunkInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateTrunkInterfaceRequest(input, context), @@ -10117,9 +9337,7 @@ export const serializeAws_ec2DisassociateVpcCidrBlockCommand = async ( input: DisassociateVpcCidrBlockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2DisassociateVpcCidrBlockRequest(input, context), @@ -10133,9 +9351,7 @@ export const serializeAws_ec2EnableAddressTransferCommand = async ( input: EnableAddressTransferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableAddressTransferRequest(input, context), @@ -10149,9 +9365,7 @@ export const serializeAws_ec2EnableAwsNetworkPerformanceMetricSubscriptionComman input: EnableAwsNetworkPerformanceMetricSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableAwsNetworkPerformanceMetricSubscriptionRequest(input, context), @@ -10165,9 +9379,7 @@ export const serializeAws_ec2EnableEbsEncryptionByDefaultCommand = async ( input: EnableEbsEncryptionByDefaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableEbsEncryptionByDefaultRequest(input, context), @@ -10181,9 +9393,7 @@ export const serializeAws_ec2EnableFastLaunchCommand = async ( input: EnableFastLaunchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableFastLaunchRequest(input, context), @@ -10197,9 +9407,7 @@ export const serializeAws_ec2EnableFastSnapshotRestoresCommand = async ( input: EnableFastSnapshotRestoresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableFastSnapshotRestoresRequest(input, context), @@ -10213,9 +9421,7 @@ export const serializeAws_ec2EnableImageDeprecationCommand = async ( input: EnableImageDeprecationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableImageDeprecationRequest(input, context), @@ -10229,9 +9435,7 @@ export const serializeAws_ec2EnableIpamOrganizationAdminAccountCommand = async ( input: EnableIpamOrganizationAdminAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableIpamOrganizationAdminAccountRequest(input, context), @@ -10245,9 +9449,7 @@ export const serializeAws_ec2EnableReachabilityAnalyzerOrganizationSharingComman input: EnableReachabilityAnalyzerOrganizationSharingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableReachabilityAnalyzerOrganizationSharingRequest(input, context), @@ -10261,9 +9463,7 @@ export const serializeAws_ec2EnableSerialConsoleAccessCommand = async ( input: EnableSerialConsoleAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableSerialConsoleAccessRequest(input, context), @@ -10277,9 +9477,7 @@ export const serializeAws_ec2EnableTransitGatewayRouteTablePropagationCommand = input: EnableTransitGatewayRouteTablePropagationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableTransitGatewayRouteTablePropagationRequest(input, context), @@ -10293,9 +9491,7 @@ export const serializeAws_ec2EnableVgwRoutePropagationCommand = async ( input: EnableVgwRoutePropagationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableVgwRoutePropagationRequest(input, context), @@ -10309,9 +9505,7 @@ export const serializeAws_ec2EnableVolumeIOCommand = async ( input: EnableVolumeIOCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableVolumeIORequest(input, context), @@ -10325,9 +9519,7 @@ export const serializeAws_ec2EnableVpcClassicLinkCommand = async ( input: EnableVpcClassicLinkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableVpcClassicLinkRequest(input, context), @@ -10341,9 +9533,7 @@ export const serializeAws_ec2EnableVpcClassicLinkDnsSupportCommand = async ( input: EnableVpcClassicLinkDnsSupportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EnableVpcClassicLinkDnsSupportRequest(input, context), @@ -10357,9 +9547,7 @@ export const serializeAws_ec2ExportClientVpnClientCertificateRevocationListComma input: ExportClientVpnClientCertificateRevocationListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ExportClientVpnClientCertificateRevocationListRequest(input, context), @@ -10373,9 +9561,7 @@ export const serializeAws_ec2ExportClientVpnClientConfigurationCommand = async ( input: ExportClientVpnClientConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ExportClientVpnClientConfigurationRequest(input, context), @@ -10389,9 +9575,7 @@ export const serializeAws_ec2ExportImageCommand = async ( input: ExportImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ExportImageRequest(input, context), @@ -10405,9 +9589,7 @@ export const serializeAws_ec2ExportTransitGatewayRoutesCommand = async ( input: ExportTransitGatewayRoutesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ExportTransitGatewayRoutesRequest(input, context), @@ -10421,9 +9603,7 @@ export const serializeAws_ec2GetAssociatedEnclaveCertificateIamRolesCommand = as input: GetAssociatedEnclaveCertificateIamRolesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetAssociatedEnclaveCertificateIamRolesRequest(input, context), @@ -10437,9 +9617,7 @@ export const serializeAws_ec2GetAssociatedIpv6PoolCidrsCommand = async ( input: GetAssociatedIpv6PoolCidrsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetAssociatedIpv6PoolCidrsRequest(input, context), @@ -10453,9 +9631,7 @@ export const serializeAws_ec2GetAwsNetworkPerformanceDataCommand = async ( input: GetAwsNetworkPerformanceDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetAwsNetworkPerformanceDataRequest(input, context), @@ -10469,9 +9645,7 @@ export const serializeAws_ec2GetCapacityReservationUsageCommand = async ( input: GetCapacityReservationUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetCapacityReservationUsageRequest(input, context), @@ -10485,9 +9659,7 @@ export const serializeAws_ec2GetCoipPoolUsageCommand = async ( input: GetCoipPoolUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetCoipPoolUsageRequest(input, context), @@ -10501,9 +9673,7 @@ export const serializeAws_ec2GetConsoleOutputCommand = async ( input: GetConsoleOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetConsoleOutputRequest(input, context), @@ -10517,9 +9687,7 @@ export const serializeAws_ec2GetConsoleScreenshotCommand = async ( input: GetConsoleScreenshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetConsoleScreenshotRequest(input, context), @@ -10533,9 +9701,7 @@ export const serializeAws_ec2GetDefaultCreditSpecificationCommand = async ( input: GetDefaultCreditSpecificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetDefaultCreditSpecificationRequest(input, context), @@ -10549,9 +9715,7 @@ export const serializeAws_ec2GetEbsDefaultKmsKeyIdCommand = async ( input: GetEbsDefaultKmsKeyIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetEbsDefaultKmsKeyIdRequest(input, context), @@ -10565,9 +9729,7 @@ export const serializeAws_ec2GetEbsEncryptionByDefaultCommand = async ( input: GetEbsEncryptionByDefaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetEbsEncryptionByDefaultRequest(input, context), @@ -10581,9 +9743,7 @@ export const serializeAws_ec2GetFlowLogsIntegrationTemplateCommand = async ( input: GetFlowLogsIntegrationTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetFlowLogsIntegrationTemplateRequest(input, context), @@ -10597,9 +9757,7 @@ export const serializeAws_ec2GetGroupsForCapacityReservationCommand = async ( input: GetGroupsForCapacityReservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetGroupsForCapacityReservationRequest(input, context), @@ -10613,9 +9771,7 @@ export const serializeAws_ec2GetHostReservationPurchasePreviewCommand = async ( input: GetHostReservationPurchasePreviewCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetHostReservationPurchasePreviewRequest(input, context), @@ -10629,9 +9785,7 @@ export const serializeAws_ec2GetInstanceTypesFromInstanceRequirementsCommand = a input: GetInstanceTypesFromInstanceRequirementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetInstanceTypesFromInstanceRequirementsRequest(input, context), @@ -10645,9 +9799,7 @@ export const serializeAws_ec2GetInstanceUefiDataCommand = async ( input: GetInstanceUefiDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetInstanceUefiDataRequest(input, context), @@ -10661,9 +9813,7 @@ export const serializeAws_ec2GetIpamAddressHistoryCommand = async ( input: GetIpamAddressHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetIpamAddressHistoryRequest(input, context), @@ -10677,9 +9827,7 @@ export const serializeAws_ec2GetIpamDiscoveredAccountsCommand = async ( input: GetIpamDiscoveredAccountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetIpamDiscoveredAccountsRequest(input, context), @@ -10693,9 +9841,7 @@ export const serializeAws_ec2GetIpamDiscoveredResourceCidrsCommand = async ( input: GetIpamDiscoveredResourceCidrsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetIpamDiscoveredResourceCidrsRequest(input, context), @@ -10709,9 +9855,7 @@ export const serializeAws_ec2GetIpamPoolAllocationsCommand = async ( input: GetIpamPoolAllocationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetIpamPoolAllocationsRequest(input, context), @@ -10725,9 +9869,7 @@ export const serializeAws_ec2GetIpamPoolCidrsCommand = async ( input: GetIpamPoolCidrsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetIpamPoolCidrsRequest(input, context), @@ -10741,9 +9883,7 @@ export const serializeAws_ec2GetIpamResourceCidrsCommand = async ( input: GetIpamResourceCidrsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetIpamResourceCidrsRequest(input, context), @@ -10757,9 +9897,7 @@ export const serializeAws_ec2GetLaunchTemplateDataCommand = async ( input: GetLaunchTemplateDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetLaunchTemplateDataRequest(input, context), @@ -10773,9 +9911,7 @@ export const serializeAws_ec2GetManagedPrefixListAssociationsCommand = async ( input: GetManagedPrefixListAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetManagedPrefixListAssociationsRequest(input, context), @@ -10789,9 +9925,7 @@ export const serializeAws_ec2GetManagedPrefixListEntriesCommand = async ( input: GetManagedPrefixListEntriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetManagedPrefixListEntriesRequest(input, context), @@ -10805,9 +9939,7 @@ export const serializeAws_ec2GetNetworkInsightsAccessScopeAnalysisFindingsComman input: GetNetworkInsightsAccessScopeAnalysisFindingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetNetworkInsightsAccessScopeAnalysisFindingsRequest(input, context), @@ -10821,9 +9953,7 @@ export const serializeAws_ec2GetNetworkInsightsAccessScopeContentCommand = async input: GetNetworkInsightsAccessScopeContentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetNetworkInsightsAccessScopeContentRequest(input, context), @@ -10837,9 +9967,7 @@ export const serializeAws_ec2GetPasswordDataCommand = async ( input: GetPasswordDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetPasswordDataRequest(input, context), @@ -10853,9 +9981,7 @@ export const serializeAws_ec2GetReservedInstancesExchangeQuoteCommand = async ( input: GetReservedInstancesExchangeQuoteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetReservedInstancesExchangeQuoteRequest(input, context), @@ -10869,9 +9995,7 @@ export const serializeAws_ec2GetSerialConsoleAccessStatusCommand = async ( input: GetSerialConsoleAccessStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetSerialConsoleAccessStatusRequest(input, context), @@ -10885,9 +10009,7 @@ export const serializeAws_ec2GetSpotPlacementScoresCommand = async ( input: GetSpotPlacementScoresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetSpotPlacementScoresRequest(input, context), @@ -10901,9 +10023,7 @@ export const serializeAws_ec2GetSubnetCidrReservationsCommand = async ( input: GetSubnetCidrReservationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetSubnetCidrReservationsRequest(input, context), @@ -10917,9 +10037,7 @@ export const serializeAws_ec2GetTransitGatewayAttachmentPropagationsCommand = as input: GetTransitGatewayAttachmentPropagationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetTransitGatewayAttachmentPropagationsRequest(input, context), @@ -10933,9 +10051,7 @@ export const serializeAws_ec2GetTransitGatewayMulticastDomainAssociationsCommand input: GetTransitGatewayMulticastDomainAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetTransitGatewayMulticastDomainAssociationsRequest(input, context), @@ -10949,9 +10065,7 @@ export const serializeAws_ec2GetTransitGatewayPolicyTableAssociationsCommand = a input: GetTransitGatewayPolicyTableAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetTransitGatewayPolicyTableAssociationsRequest(input, context), @@ -10965,9 +10079,7 @@ export const serializeAws_ec2GetTransitGatewayPolicyTableEntriesCommand = async input: GetTransitGatewayPolicyTableEntriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetTransitGatewayPolicyTableEntriesRequest(input, context), @@ -10981,9 +10093,7 @@ export const serializeAws_ec2GetTransitGatewayPrefixListReferencesCommand = asyn input: GetTransitGatewayPrefixListReferencesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetTransitGatewayPrefixListReferencesRequest(input, context), @@ -10997,9 +10107,7 @@ export const serializeAws_ec2GetTransitGatewayRouteTableAssociationsCommand = as input: GetTransitGatewayRouteTableAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetTransitGatewayRouteTableAssociationsRequest(input, context), @@ -11013,9 +10121,7 @@ export const serializeAws_ec2GetTransitGatewayRouteTablePropagationsCommand = as input: GetTransitGatewayRouteTablePropagationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetTransitGatewayRouteTablePropagationsRequest(input, context), @@ -11029,9 +10135,7 @@ export const serializeAws_ec2GetVerifiedAccessEndpointPolicyCommand = async ( input: GetVerifiedAccessEndpointPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetVerifiedAccessEndpointPolicyRequest(input, context), @@ -11045,9 +10149,7 @@ export const serializeAws_ec2GetVerifiedAccessGroupPolicyCommand = async ( input: GetVerifiedAccessGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetVerifiedAccessGroupPolicyRequest(input, context), @@ -11061,9 +10163,7 @@ export const serializeAws_ec2GetVpnConnectionDeviceSampleConfigurationCommand = input: GetVpnConnectionDeviceSampleConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetVpnConnectionDeviceSampleConfigurationRequest(input, context), @@ -11077,9 +10177,7 @@ export const serializeAws_ec2GetVpnConnectionDeviceTypesCommand = async ( input: GetVpnConnectionDeviceTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2GetVpnConnectionDeviceTypesRequest(input, context), @@ -11093,9 +10191,7 @@ export const serializeAws_ec2ImportClientVpnClientCertificateRevocationListComma input: ImportClientVpnClientCertificateRevocationListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ImportClientVpnClientCertificateRevocationListRequest(input, context), @@ -11109,9 +10205,7 @@ export const serializeAws_ec2ImportImageCommand = async ( input: ImportImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ImportImageRequest(input, context), @@ -11125,9 +10219,7 @@ export const serializeAws_ec2ImportInstanceCommand = async ( input: ImportInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ImportInstanceRequest(input, context), @@ -11141,9 +10233,7 @@ export const serializeAws_ec2ImportKeyPairCommand = async ( input: ImportKeyPairCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ImportKeyPairRequest(input, context), @@ -11157,9 +10247,7 @@ export const serializeAws_ec2ImportSnapshotCommand = async ( input: ImportSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ImportSnapshotRequest(input, context), @@ -11173,9 +10261,7 @@ export const serializeAws_ec2ImportVolumeCommand = async ( input: ImportVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ImportVolumeRequest(input, context), @@ -11189,9 +10275,7 @@ export const serializeAws_ec2ListImagesInRecycleBinCommand = async ( input: ListImagesInRecycleBinCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ListImagesInRecycleBinRequest(input, context), @@ -11205,9 +10289,7 @@ export const serializeAws_ec2ListSnapshotsInRecycleBinCommand = async ( input: ListSnapshotsInRecycleBinCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ListSnapshotsInRecycleBinRequest(input, context), @@ -11221,9 +10303,7 @@ export const serializeAws_ec2ModifyAddressAttributeCommand = async ( input: ModifyAddressAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyAddressAttributeRequest(input, context), @@ -11237,9 +10317,7 @@ export const serializeAws_ec2ModifyAvailabilityZoneGroupCommand = async ( input: ModifyAvailabilityZoneGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyAvailabilityZoneGroupRequest(input, context), @@ -11253,9 +10331,7 @@ export const serializeAws_ec2ModifyCapacityReservationCommand = async ( input: ModifyCapacityReservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyCapacityReservationRequest(input, context), @@ -11269,9 +10345,7 @@ export const serializeAws_ec2ModifyCapacityReservationFleetCommand = async ( input: ModifyCapacityReservationFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyCapacityReservationFleetRequest(input, context), @@ -11285,9 +10359,7 @@ export const serializeAws_ec2ModifyClientVpnEndpointCommand = async ( input: ModifyClientVpnEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyClientVpnEndpointRequest(input, context), @@ -11301,9 +10373,7 @@ export const serializeAws_ec2ModifyDefaultCreditSpecificationCommand = async ( input: ModifyDefaultCreditSpecificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyDefaultCreditSpecificationRequest(input, context), @@ -11317,9 +10387,7 @@ export const serializeAws_ec2ModifyEbsDefaultKmsKeyIdCommand = async ( input: ModifyEbsDefaultKmsKeyIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyEbsDefaultKmsKeyIdRequest(input, context), @@ -11333,9 +10401,7 @@ export const serializeAws_ec2ModifyFleetCommand = async ( input: ModifyFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyFleetRequest(input, context), @@ -11349,9 +10415,7 @@ export const serializeAws_ec2ModifyFpgaImageAttributeCommand = async ( input: ModifyFpgaImageAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyFpgaImageAttributeRequest(input, context), @@ -11365,9 +10429,7 @@ export const serializeAws_ec2ModifyHostsCommand = async ( input: ModifyHostsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyHostsRequest(input, context), @@ -11381,9 +10443,7 @@ export const serializeAws_ec2ModifyIdentityIdFormatCommand = async ( input: ModifyIdentityIdFormatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyIdentityIdFormatRequest(input, context), @@ -11397,9 +10457,7 @@ export const serializeAws_ec2ModifyIdFormatCommand = async ( input: ModifyIdFormatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyIdFormatRequest(input, context), @@ -11413,9 +10471,7 @@ export const serializeAws_ec2ModifyImageAttributeCommand = async ( input: ModifyImageAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyImageAttributeRequest(input, context), @@ -11429,9 +10485,7 @@ export const serializeAws_ec2ModifyInstanceAttributeCommand = async ( input: ModifyInstanceAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyInstanceAttributeRequest(input, context), @@ -11445,9 +10499,7 @@ export const serializeAws_ec2ModifyInstanceCapacityReservationAttributesCommand input: ModifyInstanceCapacityReservationAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyInstanceCapacityReservationAttributesRequest(input, context), @@ -11461,9 +10513,7 @@ export const serializeAws_ec2ModifyInstanceCreditSpecificationCommand = async ( input: ModifyInstanceCreditSpecificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyInstanceCreditSpecificationRequest(input, context), @@ -11477,9 +10527,7 @@ export const serializeAws_ec2ModifyInstanceEventStartTimeCommand = async ( input: ModifyInstanceEventStartTimeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyInstanceEventStartTimeRequest(input, context), @@ -11493,9 +10541,7 @@ export const serializeAws_ec2ModifyInstanceEventWindowCommand = async ( input: ModifyInstanceEventWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyInstanceEventWindowRequest(input, context), @@ -11509,9 +10555,7 @@ export const serializeAws_ec2ModifyInstanceMaintenanceOptionsCommand = async ( input: ModifyInstanceMaintenanceOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyInstanceMaintenanceOptionsRequest(input, context), @@ -11525,9 +10569,7 @@ export const serializeAws_ec2ModifyInstanceMetadataOptionsCommand = async ( input: ModifyInstanceMetadataOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyInstanceMetadataOptionsRequest(input, context), @@ -11541,9 +10583,7 @@ export const serializeAws_ec2ModifyInstancePlacementCommand = async ( input: ModifyInstancePlacementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyInstancePlacementRequest(input, context), @@ -11557,9 +10597,7 @@ export const serializeAws_ec2ModifyIpamCommand = async ( input: ModifyIpamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyIpamRequest(input, context), @@ -11573,9 +10611,7 @@ export const serializeAws_ec2ModifyIpamPoolCommand = async ( input: ModifyIpamPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyIpamPoolRequest(input, context), @@ -11589,9 +10625,7 @@ export const serializeAws_ec2ModifyIpamResourceCidrCommand = async ( input: ModifyIpamResourceCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyIpamResourceCidrRequest(input, context), @@ -11605,9 +10639,7 @@ export const serializeAws_ec2ModifyIpamResourceDiscoveryCommand = async ( input: ModifyIpamResourceDiscoveryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyIpamResourceDiscoveryRequest(input, context), @@ -11621,9 +10653,7 @@ export const serializeAws_ec2ModifyIpamScopeCommand = async ( input: ModifyIpamScopeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyIpamScopeRequest(input, context), @@ -11637,9 +10667,7 @@ export const serializeAws_ec2ModifyLaunchTemplateCommand = async ( input: ModifyLaunchTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyLaunchTemplateRequest(input, context), @@ -11653,9 +10681,7 @@ export const serializeAws_ec2ModifyLocalGatewayRouteCommand = async ( input: ModifyLocalGatewayRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyLocalGatewayRouteRequest(input, context), @@ -11669,9 +10695,7 @@ export const serializeAws_ec2ModifyManagedPrefixListCommand = async ( input: ModifyManagedPrefixListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyManagedPrefixListRequest(input, context), @@ -11685,9 +10709,7 @@ export const serializeAws_ec2ModifyNetworkInterfaceAttributeCommand = async ( input: ModifyNetworkInterfaceAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyNetworkInterfaceAttributeRequest(input, context), @@ -11701,9 +10723,7 @@ export const serializeAws_ec2ModifyPrivateDnsNameOptionsCommand = async ( input: ModifyPrivateDnsNameOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyPrivateDnsNameOptionsRequest(input, context), @@ -11717,9 +10737,7 @@ export const serializeAws_ec2ModifyReservedInstancesCommand = async ( input: ModifyReservedInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyReservedInstancesRequest(input, context), @@ -11733,9 +10751,7 @@ export const serializeAws_ec2ModifySecurityGroupRulesCommand = async ( input: ModifySecurityGroupRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifySecurityGroupRulesRequest(input, context), @@ -11749,9 +10765,7 @@ export const serializeAws_ec2ModifySnapshotAttributeCommand = async ( input: ModifySnapshotAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifySnapshotAttributeRequest(input, context), @@ -11765,9 +10779,7 @@ export const serializeAws_ec2ModifySnapshotTierCommand = async ( input: ModifySnapshotTierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifySnapshotTierRequest(input, context), @@ -11781,9 +10793,7 @@ export const serializeAws_ec2ModifySpotFleetRequestCommand = async ( input: ModifySpotFleetRequestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifySpotFleetRequestRequest(input, context), @@ -11797,9 +10807,7 @@ export const serializeAws_ec2ModifySubnetAttributeCommand = async ( input: ModifySubnetAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifySubnetAttributeRequest(input, context), @@ -11813,9 +10821,7 @@ export const serializeAws_ec2ModifyTrafficMirrorFilterNetworkServicesCommand = a input: ModifyTrafficMirrorFilterNetworkServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyTrafficMirrorFilterNetworkServicesRequest(input, context), @@ -11829,9 +10835,7 @@ export const serializeAws_ec2ModifyTrafficMirrorFilterRuleCommand = async ( input: ModifyTrafficMirrorFilterRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyTrafficMirrorFilterRuleRequest(input, context), @@ -11845,9 +10849,7 @@ export const serializeAws_ec2ModifyTrafficMirrorSessionCommand = async ( input: ModifyTrafficMirrorSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyTrafficMirrorSessionRequest(input, context), @@ -11861,9 +10863,7 @@ export const serializeAws_ec2ModifyTransitGatewayCommand = async ( input: ModifyTransitGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyTransitGatewayRequest(input, context), @@ -11877,9 +10877,7 @@ export const serializeAws_ec2ModifyTransitGatewayPrefixListReferenceCommand = as input: ModifyTransitGatewayPrefixListReferenceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyTransitGatewayPrefixListReferenceRequest(input, context), @@ -11893,9 +10891,7 @@ export const serializeAws_ec2ModifyTransitGatewayVpcAttachmentCommand = async ( input: ModifyTransitGatewayVpcAttachmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyTransitGatewayVpcAttachmentRequest(input, context), @@ -11909,9 +10905,7 @@ export const serializeAws_ec2ModifyVerifiedAccessEndpointCommand = async ( input: ModifyVerifiedAccessEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVerifiedAccessEndpointRequest(input, context), @@ -11925,9 +10919,7 @@ export const serializeAws_ec2ModifyVerifiedAccessEndpointPolicyCommand = async ( input: ModifyVerifiedAccessEndpointPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVerifiedAccessEndpointPolicyRequest(input, context), @@ -11941,9 +10933,7 @@ export const serializeAws_ec2ModifyVerifiedAccessGroupCommand = async ( input: ModifyVerifiedAccessGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVerifiedAccessGroupRequest(input, context), @@ -11957,9 +10947,7 @@ export const serializeAws_ec2ModifyVerifiedAccessGroupPolicyCommand = async ( input: ModifyVerifiedAccessGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVerifiedAccessGroupPolicyRequest(input, context), @@ -11973,9 +10961,7 @@ export const serializeAws_ec2ModifyVerifiedAccessInstanceCommand = async ( input: ModifyVerifiedAccessInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVerifiedAccessInstanceRequest(input, context), @@ -11989,9 +10975,7 @@ export const serializeAws_ec2ModifyVerifiedAccessInstanceLoggingConfigurationCom input: ModifyVerifiedAccessInstanceLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVerifiedAccessInstanceLoggingConfigurationRequest(input, context), @@ -12005,9 +10989,7 @@ export const serializeAws_ec2ModifyVerifiedAccessTrustProviderCommand = async ( input: ModifyVerifiedAccessTrustProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVerifiedAccessTrustProviderRequest(input, context), @@ -12021,9 +11003,7 @@ export const serializeAws_ec2ModifyVolumeCommand = async ( input: ModifyVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVolumeRequest(input, context), @@ -12037,9 +11017,7 @@ export const serializeAws_ec2ModifyVolumeAttributeCommand = async ( input: ModifyVolumeAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVolumeAttributeRequest(input, context), @@ -12053,9 +11031,7 @@ export const serializeAws_ec2ModifyVpcAttributeCommand = async ( input: ModifyVpcAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpcAttributeRequest(input, context), @@ -12069,9 +11045,7 @@ export const serializeAws_ec2ModifyVpcEndpointCommand = async ( input: ModifyVpcEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpcEndpointRequest(input, context), @@ -12085,9 +11059,7 @@ export const serializeAws_ec2ModifyVpcEndpointConnectionNotificationCommand = as input: ModifyVpcEndpointConnectionNotificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpcEndpointConnectionNotificationRequest(input, context), @@ -12101,9 +11073,7 @@ export const serializeAws_ec2ModifyVpcEndpointServiceConfigurationCommand = asyn input: ModifyVpcEndpointServiceConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpcEndpointServiceConfigurationRequest(input, context), @@ -12117,9 +11087,7 @@ export const serializeAws_ec2ModifyVpcEndpointServicePayerResponsibilityCommand input: ModifyVpcEndpointServicePayerResponsibilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpcEndpointServicePayerResponsibilityRequest(input, context), @@ -12133,9 +11101,7 @@ export const serializeAws_ec2ModifyVpcEndpointServicePermissionsCommand = async input: ModifyVpcEndpointServicePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpcEndpointServicePermissionsRequest(input, context), @@ -12149,9 +11115,7 @@ export const serializeAws_ec2ModifyVpcPeeringConnectionOptionsCommand = async ( input: ModifyVpcPeeringConnectionOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpcPeeringConnectionOptionsRequest(input, context), @@ -12165,9 +11129,7 @@ export const serializeAws_ec2ModifyVpcTenancyCommand = async ( input: ModifyVpcTenancyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpcTenancyRequest(input, context), @@ -12181,9 +11143,7 @@ export const serializeAws_ec2ModifyVpnConnectionCommand = async ( input: ModifyVpnConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpnConnectionRequest(input, context), @@ -12197,9 +11157,7 @@ export const serializeAws_ec2ModifyVpnConnectionOptionsCommand = async ( input: ModifyVpnConnectionOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpnConnectionOptionsRequest(input, context), @@ -12213,9 +11171,7 @@ export const serializeAws_ec2ModifyVpnTunnelCertificateCommand = async ( input: ModifyVpnTunnelCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpnTunnelCertificateRequest(input, context), @@ -12229,9 +11185,7 @@ export const serializeAws_ec2ModifyVpnTunnelOptionsCommand = async ( input: ModifyVpnTunnelOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ModifyVpnTunnelOptionsRequest(input, context), @@ -12245,9 +11199,7 @@ export const serializeAws_ec2MonitorInstancesCommand = async ( input: MonitorInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2MonitorInstancesRequest(input, context), @@ -12261,9 +11213,7 @@ export const serializeAws_ec2MoveAddressToVpcCommand = async ( input: MoveAddressToVpcCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2MoveAddressToVpcRequest(input, context), @@ -12277,9 +11227,7 @@ export const serializeAws_ec2MoveByoipCidrToIpamCommand = async ( input: MoveByoipCidrToIpamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2MoveByoipCidrToIpamRequest(input, context), @@ -12293,9 +11241,7 @@ export const serializeAws_ec2ProvisionByoipCidrCommand = async ( input: ProvisionByoipCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ProvisionByoipCidrRequest(input, context), @@ -12309,9 +11255,7 @@ export const serializeAws_ec2ProvisionIpamPoolCidrCommand = async ( input: ProvisionIpamPoolCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ProvisionIpamPoolCidrRequest(input, context), @@ -12325,9 +11269,7 @@ export const serializeAws_ec2ProvisionPublicIpv4PoolCidrCommand = async ( input: ProvisionPublicIpv4PoolCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ProvisionPublicIpv4PoolCidrRequest(input, context), @@ -12341,9 +11283,7 @@ export const serializeAws_ec2PurchaseHostReservationCommand = async ( input: PurchaseHostReservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2PurchaseHostReservationRequest(input, context), @@ -12357,9 +11297,7 @@ export const serializeAws_ec2PurchaseReservedInstancesOfferingCommand = async ( input: PurchaseReservedInstancesOfferingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2PurchaseReservedInstancesOfferingRequest(input, context), @@ -12373,9 +11311,7 @@ export const serializeAws_ec2PurchaseScheduledInstancesCommand = async ( input: PurchaseScheduledInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2PurchaseScheduledInstancesRequest(input, context), @@ -12389,9 +11325,7 @@ export const serializeAws_ec2RebootInstancesCommand = async ( input: RebootInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RebootInstancesRequest(input, context), @@ -12405,9 +11339,7 @@ export const serializeAws_ec2RegisterImageCommand = async ( input: RegisterImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RegisterImageRequest(input, context), @@ -12421,9 +11353,7 @@ export const serializeAws_ec2RegisterInstanceEventNotificationAttributesCommand input: RegisterInstanceEventNotificationAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RegisterInstanceEventNotificationAttributesRequest(input, context), @@ -12437,9 +11367,7 @@ export const serializeAws_ec2RegisterTransitGatewayMulticastGroupMembersCommand input: RegisterTransitGatewayMulticastGroupMembersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RegisterTransitGatewayMulticastGroupMembersRequest(input, context), @@ -12453,9 +11381,7 @@ export const serializeAws_ec2RegisterTransitGatewayMulticastGroupSourcesCommand input: RegisterTransitGatewayMulticastGroupSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RegisterTransitGatewayMulticastGroupSourcesRequest(input, context), @@ -12469,9 +11395,7 @@ export const serializeAws_ec2RejectTransitGatewayMulticastDomainAssociationsComm input: RejectTransitGatewayMulticastDomainAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RejectTransitGatewayMulticastDomainAssociationsRequest(input, context), @@ -12485,9 +11409,7 @@ export const serializeAws_ec2RejectTransitGatewayPeeringAttachmentCommand = asyn input: RejectTransitGatewayPeeringAttachmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RejectTransitGatewayPeeringAttachmentRequest(input, context), @@ -12501,9 +11423,7 @@ export const serializeAws_ec2RejectTransitGatewayVpcAttachmentCommand = async ( input: RejectTransitGatewayVpcAttachmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RejectTransitGatewayVpcAttachmentRequest(input, context), @@ -12517,9 +11437,7 @@ export const serializeAws_ec2RejectVpcEndpointConnectionsCommand = async ( input: RejectVpcEndpointConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RejectVpcEndpointConnectionsRequest(input, context), @@ -12533,9 +11451,7 @@ export const serializeAws_ec2RejectVpcPeeringConnectionCommand = async ( input: RejectVpcPeeringConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RejectVpcPeeringConnectionRequest(input, context), @@ -12549,9 +11465,7 @@ export const serializeAws_ec2ReleaseAddressCommand = async ( input: ReleaseAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ReleaseAddressRequest(input, context), @@ -12565,9 +11479,7 @@ export const serializeAws_ec2ReleaseHostsCommand = async ( input: ReleaseHostsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ReleaseHostsRequest(input, context), @@ -12581,9 +11493,7 @@ export const serializeAws_ec2ReleaseIpamPoolAllocationCommand = async ( input: ReleaseIpamPoolAllocationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ReleaseIpamPoolAllocationRequest(input, context), @@ -12597,9 +11507,7 @@ export const serializeAws_ec2ReplaceIamInstanceProfileAssociationCommand = async input: ReplaceIamInstanceProfileAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ReplaceIamInstanceProfileAssociationRequest(input, context), @@ -12613,9 +11521,7 @@ export const serializeAws_ec2ReplaceNetworkAclAssociationCommand = async ( input: ReplaceNetworkAclAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ReplaceNetworkAclAssociationRequest(input, context), @@ -12629,9 +11535,7 @@ export const serializeAws_ec2ReplaceNetworkAclEntryCommand = async ( input: ReplaceNetworkAclEntryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ReplaceNetworkAclEntryRequest(input, context), @@ -12645,9 +11549,7 @@ export const serializeAws_ec2ReplaceRouteCommand = async ( input: ReplaceRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ReplaceRouteRequest(input, context), @@ -12661,9 +11563,7 @@ export const serializeAws_ec2ReplaceRouteTableAssociationCommand = async ( input: ReplaceRouteTableAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ReplaceRouteTableAssociationRequest(input, context), @@ -12677,9 +11577,7 @@ export const serializeAws_ec2ReplaceTransitGatewayRouteCommand = async ( input: ReplaceTransitGatewayRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ReplaceTransitGatewayRouteRequest(input, context), @@ -12693,9 +11591,7 @@ export const serializeAws_ec2ReportInstanceStatusCommand = async ( input: ReportInstanceStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ReportInstanceStatusRequest(input, context), @@ -12709,9 +11605,7 @@ export const serializeAws_ec2RequestSpotFleetCommand = async ( input: RequestSpotFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RequestSpotFleetRequest(input, context), @@ -12725,9 +11619,7 @@ export const serializeAws_ec2RequestSpotInstancesCommand = async ( input: RequestSpotInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RequestSpotInstancesRequest(input, context), @@ -12741,9 +11633,7 @@ export const serializeAws_ec2ResetAddressAttributeCommand = async ( input: ResetAddressAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ResetAddressAttributeRequest(input, context), @@ -12757,9 +11647,7 @@ export const serializeAws_ec2ResetEbsDefaultKmsKeyIdCommand = async ( input: ResetEbsDefaultKmsKeyIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ResetEbsDefaultKmsKeyIdRequest(input, context), @@ -12773,9 +11661,7 @@ export const serializeAws_ec2ResetFpgaImageAttributeCommand = async ( input: ResetFpgaImageAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ResetFpgaImageAttributeRequest(input, context), @@ -12789,9 +11675,7 @@ export const serializeAws_ec2ResetImageAttributeCommand = async ( input: ResetImageAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ResetImageAttributeRequest(input, context), @@ -12805,9 +11689,7 @@ export const serializeAws_ec2ResetInstanceAttributeCommand = async ( input: ResetInstanceAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ResetInstanceAttributeRequest(input, context), @@ -12821,9 +11703,7 @@ export const serializeAws_ec2ResetNetworkInterfaceAttributeCommand = async ( input: ResetNetworkInterfaceAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ResetNetworkInterfaceAttributeRequest(input, context), @@ -12837,9 +11717,7 @@ export const serializeAws_ec2ResetSnapshotAttributeCommand = async ( input: ResetSnapshotAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2ResetSnapshotAttributeRequest(input, context), @@ -12853,9 +11731,7 @@ export const serializeAws_ec2RestoreAddressToClassicCommand = async ( input: RestoreAddressToClassicCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RestoreAddressToClassicRequest(input, context), @@ -12869,9 +11745,7 @@ export const serializeAws_ec2RestoreImageFromRecycleBinCommand = async ( input: RestoreImageFromRecycleBinCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RestoreImageFromRecycleBinRequest(input, context), @@ -12885,9 +11759,7 @@ export const serializeAws_ec2RestoreManagedPrefixListVersionCommand = async ( input: RestoreManagedPrefixListVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RestoreManagedPrefixListVersionRequest(input, context), @@ -12901,9 +11773,7 @@ export const serializeAws_ec2RestoreSnapshotFromRecycleBinCommand = async ( input: RestoreSnapshotFromRecycleBinCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RestoreSnapshotFromRecycleBinRequest(input, context), @@ -12917,9 +11787,7 @@ export const serializeAws_ec2RestoreSnapshotTierCommand = async ( input: RestoreSnapshotTierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RestoreSnapshotTierRequest(input, context), @@ -12933,9 +11801,7 @@ export const serializeAws_ec2RevokeClientVpnIngressCommand = async ( input: RevokeClientVpnIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RevokeClientVpnIngressRequest(input, context), @@ -12949,9 +11815,7 @@ export const serializeAws_ec2RevokeSecurityGroupEgressCommand = async ( input: RevokeSecurityGroupEgressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RevokeSecurityGroupEgressRequest(input, context), @@ -12965,9 +11829,7 @@ export const serializeAws_ec2RevokeSecurityGroupIngressCommand = async ( input: RevokeSecurityGroupIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RevokeSecurityGroupIngressRequest(input, context), @@ -12981,9 +11843,7 @@ export const serializeAws_ec2RunInstancesCommand = async ( input: RunInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RunInstancesRequest(input, context), @@ -12997,9 +11857,7 @@ export const serializeAws_ec2RunScheduledInstancesCommand = async ( input: RunScheduledInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2RunScheduledInstancesRequest(input, context), @@ -13013,9 +11871,7 @@ export const serializeAws_ec2SearchLocalGatewayRoutesCommand = async ( input: SearchLocalGatewayRoutesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2SearchLocalGatewayRoutesRequest(input, context), @@ -13029,9 +11885,7 @@ export const serializeAws_ec2SearchTransitGatewayMulticastGroupsCommand = async input: SearchTransitGatewayMulticastGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2SearchTransitGatewayMulticastGroupsRequest(input, context), @@ -13045,9 +11899,7 @@ export const serializeAws_ec2SearchTransitGatewayRoutesCommand = async ( input: SearchTransitGatewayRoutesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2SearchTransitGatewayRoutesRequest(input, context), @@ -13061,9 +11913,7 @@ export const serializeAws_ec2SendDiagnosticInterruptCommand = async ( input: SendDiagnosticInterruptCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2SendDiagnosticInterruptRequest(input, context), @@ -13077,9 +11927,7 @@ export const serializeAws_ec2StartInstancesCommand = async ( input: StartInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2StartInstancesRequest(input, context), @@ -13093,9 +11941,7 @@ export const serializeAws_ec2StartNetworkInsightsAccessScopeAnalysisCommand = as input: StartNetworkInsightsAccessScopeAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2StartNetworkInsightsAccessScopeAnalysisRequest(input, context), @@ -13109,9 +11955,7 @@ export const serializeAws_ec2StartNetworkInsightsAnalysisCommand = async ( input: StartNetworkInsightsAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2StartNetworkInsightsAnalysisRequest(input, context), @@ -13125,9 +11969,7 @@ export const serializeAws_ec2StartVpcEndpointServicePrivateDnsVerificationComman input: StartVpcEndpointServicePrivateDnsVerificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2StartVpcEndpointServicePrivateDnsVerificationRequest(input, context), @@ -13141,9 +11983,7 @@ export const serializeAws_ec2StopInstancesCommand = async ( input: StopInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2StopInstancesRequest(input, context), @@ -13157,9 +11997,7 @@ export const serializeAws_ec2TerminateClientVpnConnectionsCommand = async ( input: TerminateClientVpnConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2TerminateClientVpnConnectionsRequest(input, context), @@ -13173,9 +12011,7 @@ export const serializeAws_ec2TerminateInstancesCommand = async ( input: TerminateInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2TerminateInstancesRequest(input, context), @@ -13189,9 +12025,7 @@ export const serializeAws_ec2UnassignIpv6AddressesCommand = async ( input: UnassignIpv6AddressesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2UnassignIpv6AddressesRequest(input, context), @@ -13205,9 +12039,7 @@ export const serializeAws_ec2UnassignPrivateIpAddressesCommand = async ( input: UnassignPrivateIpAddressesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2UnassignPrivateIpAddressesRequest(input, context), @@ -13221,9 +12053,7 @@ export const serializeAws_ec2UnassignPrivateNatGatewayAddressCommand = async ( input: UnassignPrivateNatGatewayAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2UnassignPrivateNatGatewayAddressRequest(input, context), @@ -13237,9 +12067,7 @@ export const serializeAws_ec2UnmonitorInstancesCommand = async ( input: UnmonitorInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2UnmonitorInstancesRequest(input, context), @@ -13253,9 +12081,7 @@ export const serializeAws_ec2UpdateSecurityGroupRuleDescriptionsEgressCommand = input: UpdateSecurityGroupRuleDescriptionsEgressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2UpdateSecurityGroupRuleDescriptionsEgressRequest(input, context), @@ -13269,9 +12095,7 @@ export const serializeAws_ec2UpdateSecurityGroupRuleDescriptionsIngressCommand = input: UpdateSecurityGroupRuleDescriptionsIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2UpdateSecurityGroupRuleDescriptionsIngressRequest(input, context), @@ -13285,9 +12109,7 @@ export const serializeAws_ec2WithdrawByoipCidrCommand = async ( input: WithdrawByoipCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2WithdrawByoipCidrRequest(input, context), @@ -84392,6 +83214,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-ecr-public/src/protocols/Aws_json1_1.ts b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts index 2b6efe961a0c5..ceb3e7f486ff6 100644 --- a/clients/client-ecr-public/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts @@ -173,10 +173,7 @@ export const serializeAws_json1_1BatchCheckLayerAvailabilityCommand = async ( input: BatchCheckLayerAvailabilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.BatchCheckLayerAvailability", - }; + const headers: __HeaderBag = sharedHeaders("BatchCheckLayerAvailability"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchCheckLayerAvailabilityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -186,10 +183,7 @@ export const serializeAws_json1_1BatchDeleteImageCommand = async ( input: BatchDeleteImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.BatchDeleteImage", - }; + const headers: __HeaderBag = sharedHeaders("BatchDeleteImage"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDeleteImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -199,10 +193,7 @@ export const serializeAws_json1_1CompleteLayerUploadCommand = async ( input: CompleteLayerUploadCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.CompleteLayerUpload", - }; + const headers: __HeaderBag = sharedHeaders("CompleteLayerUpload"); let body: any; body = JSON.stringify(serializeAws_json1_1CompleteLayerUploadRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -212,10 +203,7 @@ export const serializeAws_json1_1CreateRepositoryCommand = async ( input: CreateRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.CreateRepository", - }; + const headers: __HeaderBag = sharedHeaders("CreateRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRepositoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -225,10 +213,7 @@ export const serializeAws_json1_1DeleteRepositoryCommand = async ( input: DeleteRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.DeleteRepository", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRepositoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -238,10 +223,7 @@ export const serializeAws_json1_1DeleteRepositoryPolicyCommand = async ( input: DeleteRepositoryPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.DeleteRepositoryPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRepositoryPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRepositoryPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -251,10 +233,7 @@ export const serializeAws_json1_1DescribeImagesCommand = async ( input: DescribeImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.DescribeImages", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImages"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -264,10 +243,7 @@ export const serializeAws_json1_1DescribeImageTagsCommand = async ( input: DescribeImageTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.DescribeImageTags", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImageTags"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImageTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -277,10 +253,7 @@ export const serializeAws_json1_1DescribeRegistriesCommand = async ( input: DescribeRegistriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.DescribeRegistries", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRegistries"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRegistriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -290,10 +263,7 @@ export const serializeAws_json1_1DescribeRepositoriesCommand = async ( input: DescribeRepositoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.DescribeRepositories", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRepositories"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRepositoriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -303,10 +273,7 @@ export const serializeAws_json1_1GetAuthorizationTokenCommand = async ( input: GetAuthorizationTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.GetAuthorizationToken", - }; + const headers: __HeaderBag = sharedHeaders("GetAuthorizationToken"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAuthorizationTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -316,10 +283,7 @@ export const serializeAws_json1_1GetRegistryCatalogDataCommand = async ( input: GetRegistryCatalogDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.GetRegistryCatalogData", - }; + const headers: __HeaderBag = sharedHeaders("GetRegistryCatalogData"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRegistryCatalogDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -329,10 +293,7 @@ export const serializeAws_json1_1GetRepositoryCatalogDataCommand = async ( input: GetRepositoryCatalogDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.GetRepositoryCatalogData", - }; + const headers: __HeaderBag = sharedHeaders("GetRepositoryCatalogData"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRepositoryCatalogDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -342,10 +303,7 @@ export const serializeAws_json1_1GetRepositoryPolicyCommand = async ( input: GetRepositoryPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.GetRepositoryPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetRepositoryPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRepositoryPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -355,10 +313,7 @@ export const serializeAws_json1_1InitiateLayerUploadCommand = async ( input: InitiateLayerUploadCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.InitiateLayerUpload", - }; + const headers: __HeaderBag = sharedHeaders("InitiateLayerUpload"); let body: any; body = JSON.stringify(serializeAws_json1_1InitiateLayerUploadRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -368,10 +323,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -381,10 +333,7 @@ export const serializeAws_json1_1PutImageCommand = async ( input: PutImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.PutImage", - }; + const headers: __HeaderBag = sharedHeaders("PutImage"); let body: any; body = JSON.stringify(serializeAws_json1_1PutImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -394,10 +343,7 @@ export const serializeAws_json1_1PutRegistryCatalogDataCommand = async ( input: PutRegistryCatalogDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.PutRegistryCatalogData", - }; + const headers: __HeaderBag = sharedHeaders("PutRegistryCatalogData"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRegistryCatalogDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -407,10 +353,7 @@ export const serializeAws_json1_1PutRepositoryCatalogDataCommand = async ( input: PutRepositoryCatalogDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.PutRepositoryCatalogData", - }; + const headers: __HeaderBag = sharedHeaders("PutRepositoryCatalogData"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRepositoryCatalogDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -420,10 +363,7 @@ export const serializeAws_json1_1SetRepositoryPolicyCommand = async ( input: SetRepositoryPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.SetRepositoryPolicy", - }; + const headers: __HeaderBag = sharedHeaders("SetRepositoryPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1SetRepositoryPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -433,10 +373,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -446,10 +383,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -459,10 +393,7 @@ export const serializeAws_json1_1UploadLayerPartCommand = async ( input: UploadLayerPartCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SpencerFrontendService.UploadLayerPart", - }; + const headers: __HeaderBag = sharedHeaders("UploadLayerPart"); let body: any; body = JSON.stringify(serializeAws_json1_1UploadLayerPartRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3114,6 +3045,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `SpencerFrontendService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-ecr/src/protocols/Aws_json1_1.ts b/clients/client-ecr/src/protocols/Aws_json1_1.ts index 23818dfd5e70a..76dde64569ac8 100644 --- a/clients/client-ecr/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr/src/protocols/Aws_json1_1.ts @@ -304,10 +304,7 @@ export const serializeAws_json1_1BatchCheckLayerAvailabilityCommand = async ( input: BatchCheckLayerAvailabilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.BatchCheckLayerAvailability", - }; + const headers: __HeaderBag = sharedHeaders("BatchCheckLayerAvailability"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchCheckLayerAvailabilityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -317,10 +314,7 @@ export const serializeAws_json1_1BatchDeleteImageCommand = async ( input: BatchDeleteImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage", - }; + const headers: __HeaderBag = sharedHeaders("BatchDeleteImage"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDeleteImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -330,10 +324,7 @@ export const serializeAws_json1_1BatchGetImageCommand = async ( input: BatchGetImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.BatchGetImage", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetImage"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -343,10 +334,7 @@ export const serializeAws_json1_1BatchGetRepositoryScanningConfigurationCommand input: BatchGetRepositoryScanningConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.BatchGetRepositoryScanningConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetRepositoryScanningConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetRepositoryScanningConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -356,10 +344,7 @@ export const serializeAws_json1_1CompleteLayerUploadCommand = async ( input: CompleteLayerUploadCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.CompleteLayerUpload", - }; + const headers: __HeaderBag = sharedHeaders("CompleteLayerUpload"); let body: any; body = JSON.stringify(serializeAws_json1_1CompleteLayerUploadRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -369,10 +354,7 @@ export const serializeAws_json1_1CreatePullThroughCacheRuleCommand = async ( input: CreatePullThroughCacheRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.CreatePullThroughCacheRule", - }; + const headers: __HeaderBag = sharedHeaders("CreatePullThroughCacheRule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePullThroughCacheRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -382,10 +364,7 @@ export const serializeAws_json1_1CreateRepositoryCommand = async ( input: CreateRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.CreateRepository", - }; + const headers: __HeaderBag = sharedHeaders("CreateRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRepositoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -395,10 +374,7 @@ export const serializeAws_json1_1DeleteLifecyclePolicyCommand = async ( input: DeleteLifecyclePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DeleteLifecyclePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLifecyclePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLifecyclePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -408,10 +384,7 @@ export const serializeAws_json1_1DeletePullThroughCacheRuleCommand = async ( input: DeletePullThroughCacheRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DeletePullThroughCacheRule", - }; + const headers: __HeaderBag = sharedHeaders("DeletePullThroughCacheRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePullThroughCacheRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -421,10 +394,7 @@ export const serializeAws_json1_1DeleteRegistryPolicyCommand = async ( input: DeleteRegistryPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DeleteRegistryPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRegistryPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRegistryPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -434,10 +404,7 @@ export const serializeAws_json1_1DeleteRepositoryCommand = async ( input: DeleteRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DeleteRepository", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRepositoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -447,10 +414,7 @@ export const serializeAws_json1_1DeleteRepositoryPolicyCommand = async ( input: DeleteRepositoryPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DeleteRepositoryPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRepositoryPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRepositoryPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -460,10 +424,7 @@ export const serializeAws_json1_1DescribeImageReplicationStatusCommand = async ( input: DescribeImageReplicationStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DescribeImageReplicationStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImageReplicationStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImageReplicationStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -473,10 +434,7 @@ export const serializeAws_json1_1DescribeImagesCommand = async ( input: DescribeImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DescribeImages", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImages"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -486,10 +444,7 @@ export const serializeAws_json1_1DescribeImageScanFindingsCommand = async ( input: DescribeImageScanFindingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DescribeImageScanFindings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImageScanFindings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImageScanFindingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -499,10 +454,7 @@ export const serializeAws_json1_1DescribePullThroughCacheRulesCommand = async ( input: DescribePullThroughCacheRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DescribePullThroughCacheRules", - }; + const headers: __HeaderBag = sharedHeaders("DescribePullThroughCacheRules"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePullThroughCacheRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -512,10 +464,7 @@ export const serializeAws_json1_1DescribeRegistryCommand = async ( input: DescribeRegistryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DescribeRegistry", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRegistry"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRegistryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -525,10 +474,7 @@ export const serializeAws_json1_1DescribeRepositoriesCommand = async ( input: DescribeRepositoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.DescribeRepositories", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRepositories"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRepositoriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -538,10 +484,7 @@ export const serializeAws_json1_1GetAuthorizationTokenCommand = async ( input: GetAuthorizationTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken", - }; + const headers: __HeaderBag = sharedHeaders("GetAuthorizationToken"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAuthorizationTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -551,10 +494,7 @@ export const serializeAws_json1_1GetDownloadUrlForLayerCommand = async ( input: GetDownloadUrlForLayerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.GetDownloadUrlForLayer", - }; + const headers: __HeaderBag = sharedHeaders("GetDownloadUrlForLayer"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDownloadUrlForLayerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -564,10 +504,7 @@ export const serializeAws_json1_1GetLifecyclePolicyCommand = async ( input: GetLifecyclePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetLifecyclePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLifecyclePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -577,10 +514,7 @@ export const serializeAws_json1_1GetLifecyclePolicyPreviewCommand = async ( input: GetLifecyclePolicyPreviewCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview", - }; + const headers: __HeaderBag = sharedHeaders("GetLifecyclePolicyPreview"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLifecyclePolicyPreviewRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -590,10 +524,7 @@ export const serializeAws_json1_1GetRegistryPolicyCommand = async ( input: GetRegistryPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.GetRegistryPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetRegistryPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRegistryPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -603,10 +534,7 @@ export const serializeAws_json1_1GetRegistryScanningConfigurationCommand = async input: GetRegistryScanningConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.GetRegistryScanningConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetRegistryScanningConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRegistryScanningConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -616,10 +544,7 @@ export const serializeAws_json1_1GetRepositoryPolicyCommand = async ( input: GetRepositoryPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetRepositoryPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRepositoryPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -629,10 +554,7 @@ export const serializeAws_json1_1InitiateLayerUploadCommand = async ( input: InitiateLayerUploadCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.InitiateLayerUpload", - }; + const headers: __HeaderBag = sharedHeaders("InitiateLayerUpload"); let body: any; body = JSON.stringify(serializeAws_json1_1InitiateLayerUploadRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -642,10 +564,7 @@ export const serializeAws_json1_1ListImagesCommand = async ( input: ListImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.ListImages", - }; + const headers: __HeaderBag = sharedHeaders("ListImages"); let body: any; body = JSON.stringify(serializeAws_json1_1ListImagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -655,10 +574,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -668,10 +584,7 @@ export const serializeAws_json1_1PutImageCommand = async ( input: PutImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.PutImage", - }; + const headers: __HeaderBag = sharedHeaders("PutImage"); let body: any; body = JSON.stringify(serializeAws_json1_1PutImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -681,10 +594,7 @@ export const serializeAws_json1_1PutImageScanningConfigurationCommand = async ( input: PutImageScanningConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.PutImageScanningConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutImageScanningConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutImageScanningConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -694,10 +604,7 @@ export const serializeAws_json1_1PutImageTagMutabilityCommand = async ( input: PutImageTagMutabilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.PutImageTagMutability", - }; + const headers: __HeaderBag = sharedHeaders("PutImageTagMutability"); let body: any; body = JSON.stringify(serializeAws_json1_1PutImageTagMutabilityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -707,10 +614,7 @@ export const serializeAws_json1_1PutLifecyclePolicyCommand = async ( input: PutLifecyclePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.PutLifecyclePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutLifecyclePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutLifecyclePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -720,10 +624,7 @@ export const serializeAws_json1_1PutRegistryPolicyCommand = async ( input: PutRegistryPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.PutRegistryPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutRegistryPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRegistryPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -733,10 +634,7 @@ export const serializeAws_json1_1PutRegistryScanningConfigurationCommand = async input: PutRegistryScanningConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.PutRegistryScanningConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutRegistryScanningConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRegistryScanningConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -746,10 +644,7 @@ export const serializeAws_json1_1PutReplicationConfigurationCommand = async ( input: PutReplicationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.PutReplicationConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutReplicationConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutReplicationConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -759,10 +654,7 @@ export const serializeAws_json1_1SetRepositoryPolicyCommand = async ( input: SetRepositoryPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy", - }; + const headers: __HeaderBag = sharedHeaders("SetRepositoryPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1SetRepositoryPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -772,10 +664,7 @@ export const serializeAws_json1_1StartImageScanCommand = async ( input: StartImageScanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.StartImageScan", - }; + const headers: __HeaderBag = sharedHeaders("StartImageScan"); let body: any; body = JSON.stringify(serializeAws_json1_1StartImageScanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -785,10 +674,7 @@ export const serializeAws_json1_1StartLifecyclePolicyPreviewCommand = async ( input: StartLifecyclePolicyPreviewCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview", - }; + const headers: __HeaderBag = sharedHeaders("StartLifecyclePolicyPreview"); let body: any; body = JSON.stringify(serializeAws_json1_1StartLifecyclePolicyPreviewRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -798,10 +684,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -811,10 +694,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -824,10 +704,7 @@ export const serializeAws_json1_1UploadLayerPartCommand = async ( input: UploadLayerPartCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerRegistry_V20150921.UploadLayerPart", - }; + const headers: __HeaderBag = sharedHeaders("UploadLayerPart"); let body: any; body = JSON.stringify(serializeAws_json1_1UploadLayerPartRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5710,6 +5587,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonEC2ContainerRegistry_V20150921.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-ecs/src/protocols/Aws_json1_1.ts b/clients/client-ecs/src/protocols/Aws_json1_1.ts index 2e99020eabc47..1989d8731de72 100644 --- a/clients/client-ecs/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecs/src/protocols/Aws_json1_1.ts @@ -405,10 +405,7 @@ export const serializeAws_json1_1CreateCapacityProviderCommand = async ( input: CreateCapacityProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.CreateCapacityProvider", - }; + const headers: __HeaderBag = sharedHeaders("CreateCapacityProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCapacityProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -418,10 +415,7 @@ export const serializeAws_json1_1CreateClusterCommand = async ( input: CreateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.CreateCluster", - }; + const headers: __HeaderBag = sharedHeaders("CreateCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -431,10 +425,7 @@ export const serializeAws_json1_1CreateServiceCommand = async ( input: CreateServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.CreateService", - }; + const headers: __HeaderBag = sharedHeaders("CreateService"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -444,10 +435,7 @@ export const serializeAws_json1_1CreateTaskSetCommand = async ( input: CreateTaskSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.CreateTaskSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateTaskSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTaskSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -457,10 +445,7 @@ export const serializeAws_json1_1DeleteAccountSettingCommand = async ( input: DeleteAccountSettingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DeleteAccountSetting", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAccountSetting"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAccountSettingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -470,10 +455,7 @@ export const serializeAws_json1_1DeleteAttributesCommand = async ( input: DeleteAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DeleteAttributes", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -483,10 +465,7 @@ export const serializeAws_json1_1DeleteCapacityProviderCommand = async ( input: DeleteCapacityProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DeleteCapacityProvider", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCapacityProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCapacityProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -496,10 +475,7 @@ export const serializeAws_json1_1DeleteClusterCommand = async ( input: DeleteClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DeleteCluster", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -509,10 +485,7 @@ export const serializeAws_json1_1DeleteServiceCommand = async ( input: DeleteServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DeleteService", - }; + const headers: __HeaderBag = sharedHeaders("DeleteService"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -522,10 +495,7 @@ export const serializeAws_json1_1DeleteTaskDefinitionsCommand = async ( input: DeleteTaskDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DeleteTaskDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTaskDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTaskDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -535,10 +505,7 @@ export const serializeAws_json1_1DeleteTaskSetCommand = async ( input: DeleteTaskSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DeleteTaskSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTaskSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTaskSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -548,10 +515,7 @@ export const serializeAws_json1_1DeregisterContainerInstanceCommand = async ( input: DeregisterContainerInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DeregisterContainerInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterContainerInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterContainerInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -561,10 +525,7 @@ export const serializeAws_json1_1DeregisterTaskDefinitionCommand = async ( input: DeregisterTaskDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DeregisterTaskDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterTaskDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterTaskDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -574,10 +535,7 @@ export const serializeAws_json1_1DescribeCapacityProvidersCommand = async ( input: DescribeCapacityProvidersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DescribeCapacityProviders", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCapacityProviders"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCapacityProvidersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -587,10 +545,7 @@ export const serializeAws_json1_1DescribeClustersCommand = async ( input: DescribeClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DescribeClusters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeClusters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeClustersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -600,10 +555,7 @@ export const serializeAws_json1_1DescribeContainerInstancesCommand = async ( input: DescribeContainerInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DescribeContainerInstances", - }; + const headers: __HeaderBag = sharedHeaders("DescribeContainerInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeContainerInstancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -613,10 +565,7 @@ export const serializeAws_json1_1DescribeServicesCommand = async ( input: DescribeServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DescribeServices", - }; + const headers: __HeaderBag = sharedHeaders("DescribeServices"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeServicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -626,10 +575,7 @@ export const serializeAws_json1_1DescribeTaskDefinitionCommand = async ( input: DescribeTaskDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DescribeTaskDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTaskDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTaskDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -639,10 +585,7 @@ export const serializeAws_json1_1DescribeTasksCommand = async ( input: DescribeTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DescribeTasks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -652,10 +595,7 @@ export const serializeAws_json1_1DescribeTaskSetsCommand = async ( input: DescribeTaskSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DescribeTaskSets", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTaskSets"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTaskSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -665,10 +605,7 @@ export const serializeAws_json1_1DiscoverPollEndpointCommand = async ( input: DiscoverPollEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.DiscoverPollEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DiscoverPollEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DiscoverPollEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -678,10 +615,7 @@ export const serializeAws_json1_1ExecuteCommandCommand = async ( input: ExecuteCommandCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ExecuteCommand", - }; + const headers: __HeaderBag = sharedHeaders("ExecuteCommand"); let body: any; body = JSON.stringify(serializeAws_json1_1ExecuteCommandRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -691,10 +625,7 @@ export const serializeAws_json1_1GetTaskProtectionCommand = async ( input: GetTaskProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.GetTaskProtection", - }; + const headers: __HeaderBag = sharedHeaders("GetTaskProtection"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTaskProtectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -704,10 +635,7 @@ export const serializeAws_json1_1ListAccountSettingsCommand = async ( input: ListAccountSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ListAccountSettings", - }; + const headers: __HeaderBag = sharedHeaders("ListAccountSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAccountSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -717,10 +645,7 @@ export const serializeAws_json1_1ListAttributesCommand = async ( input: ListAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ListAttributes", - }; + const headers: __HeaderBag = sharedHeaders("ListAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -730,10 +655,7 @@ export const serializeAws_json1_1ListClustersCommand = async ( input: ListClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ListClusters", - }; + const headers: __HeaderBag = sharedHeaders("ListClusters"); let body: any; body = JSON.stringify(serializeAws_json1_1ListClustersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -743,10 +665,7 @@ export const serializeAws_json1_1ListContainerInstancesCommand = async ( input: ListContainerInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ListContainerInstances", - }; + const headers: __HeaderBag = sharedHeaders("ListContainerInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1ListContainerInstancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -756,10 +675,7 @@ export const serializeAws_json1_1ListServicesCommand = async ( input: ListServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ListServices", - }; + const headers: __HeaderBag = sharedHeaders("ListServices"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -769,10 +685,7 @@ export const serializeAws_json1_1ListServicesByNamespaceCommand = async ( input: ListServicesByNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ListServicesByNamespace", - }; + const headers: __HeaderBag = sharedHeaders("ListServicesByNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServicesByNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -782,10 +695,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -795,10 +705,7 @@ export const serializeAws_json1_1ListTaskDefinitionFamiliesCommand = async ( input: ListTaskDefinitionFamiliesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ListTaskDefinitionFamilies", - }; + const headers: __HeaderBag = sharedHeaders("ListTaskDefinitionFamilies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTaskDefinitionFamiliesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -808,10 +715,7 @@ export const serializeAws_json1_1ListTaskDefinitionsCommand = async ( input: ListTaskDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ListTaskDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("ListTaskDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTaskDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -821,10 +725,7 @@ export const serializeAws_json1_1ListTasksCommand = async ( input: ListTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.ListTasks", - }; + const headers: __HeaderBag = sharedHeaders("ListTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -834,10 +735,7 @@ export const serializeAws_json1_1PutAccountSettingCommand = async ( input: PutAccountSettingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.PutAccountSetting", - }; + const headers: __HeaderBag = sharedHeaders("PutAccountSetting"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAccountSettingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -847,10 +745,7 @@ export const serializeAws_json1_1PutAccountSettingDefaultCommand = async ( input: PutAccountSettingDefaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.PutAccountSettingDefault", - }; + const headers: __HeaderBag = sharedHeaders("PutAccountSettingDefault"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAccountSettingDefaultRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -860,10 +755,7 @@ export const serializeAws_json1_1PutAttributesCommand = async ( input: PutAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.PutAttributes", - }; + const headers: __HeaderBag = sharedHeaders("PutAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -873,10 +765,7 @@ export const serializeAws_json1_1PutClusterCapacityProvidersCommand = async ( input: PutClusterCapacityProvidersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.PutClusterCapacityProviders", - }; + const headers: __HeaderBag = sharedHeaders("PutClusterCapacityProviders"); let body: any; body = JSON.stringify(serializeAws_json1_1PutClusterCapacityProvidersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -886,10 +775,7 @@ export const serializeAws_json1_1RegisterContainerInstanceCommand = async ( input: RegisterContainerInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.RegisterContainerInstance", - }; + const headers: __HeaderBag = sharedHeaders("RegisterContainerInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterContainerInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -899,10 +785,7 @@ export const serializeAws_json1_1RegisterTaskDefinitionCommand = async ( input: RegisterTaskDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.RegisterTaskDefinition", - }; + const headers: __HeaderBag = sharedHeaders("RegisterTaskDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterTaskDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -912,10 +795,7 @@ export const serializeAws_json1_1RunTaskCommand = async ( input: RunTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.RunTask", - }; + const headers: __HeaderBag = sharedHeaders("RunTask"); let body: any; body = JSON.stringify(serializeAws_json1_1RunTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -925,10 +805,7 @@ export const serializeAws_json1_1StartTaskCommand = async ( input: StartTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.StartTask", - }; + const headers: __HeaderBag = sharedHeaders("StartTask"); let body: any; body = JSON.stringify(serializeAws_json1_1StartTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -938,10 +815,7 @@ export const serializeAws_json1_1StopTaskCommand = async ( input: StopTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.StopTask", - }; + const headers: __HeaderBag = sharedHeaders("StopTask"); let body: any; body = JSON.stringify(serializeAws_json1_1StopTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -951,10 +825,7 @@ export const serializeAws_json1_1SubmitAttachmentStateChangesCommand = async ( input: SubmitAttachmentStateChangesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.SubmitAttachmentStateChanges", - }; + const headers: __HeaderBag = sharedHeaders("SubmitAttachmentStateChanges"); let body: any; body = JSON.stringify(serializeAws_json1_1SubmitAttachmentStateChangesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -964,10 +835,7 @@ export const serializeAws_json1_1SubmitContainerStateChangeCommand = async ( input: SubmitContainerStateChangeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.SubmitContainerStateChange", - }; + const headers: __HeaderBag = sharedHeaders("SubmitContainerStateChange"); let body: any; body = JSON.stringify(serializeAws_json1_1SubmitContainerStateChangeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -977,10 +845,7 @@ export const serializeAws_json1_1SubmitTaskStateChangeCommand = async ( input: SubmitTaskStateChangeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.SubmitTaskStateChange", - }; + const headers: __HeaderBag = sharedHeaders("SubmitTaskStateChange"); let body: any; body = JSON.stringify(serializeAws_json1_1SubmitTaskStateChangeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -990,10 +855,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1003,10 +865,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1016,10 +875,7 @@ export const serializeAws_json1_1UpdateCapacityProviderCommand = async ( input: UpdateCapacityProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.UpdateCapacityProvider", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCapacityProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCapacityProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1029,10 +885,7 @@ export const serializeAws_json1_1UpdateClusterCommand = async ( input: UpdateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.UpdateCluster", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1042,10 +895,7 @@ export const serializeAws_json1_1UpdateClusterSettingsCommand = async ( input: UpdateClusterSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.UpdateClusterSettings", - }; + const headers: __HeaderBag = sharedHeaders("UpdateClusterSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateClusterSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1055,10 +905,7 @@ export const serializeAws_json1_1UpdateContainerAgentCommand = async ( input: UpdateContainerAgentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.UpdateContainerAgent", - }; + const headers: __HeaderBag = sharedHeaders("UpdateContainerAgent"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateContainerAgentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1068,10 +915,7 @@ export const serializeAws_json1_1UpdateContainerInstancesStateCommand = async ( input: UpdateContainerInstancesStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.UpdateContainerInstancesState", - }; + const headers: __HeaderBag = sharedHeaders("UpdateContainerInstancesState"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateContainerInstancesStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1081,10 +925,7 @@ export const serializeAws_json1_1UpdateServiceCommand = async ( input: UpdateServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.UpdateService", - }; + const headers: __HeaderBag = sharedHeaders("UpdateService"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1094,10 +935,7 @@ export const serializeAws_json1_1UpdateServicePrimaryTaskSetCommand = async ( input: UpdateServicePrimaryTaskSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.UpdateServicePrimaryTaskSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServicePrimaryTaskSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateServicePrimaryTaskSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1107,10 +945,7 @@ export const serializeAws_json1_1UpdateTaskProtectionCommand = async ( input: UpdateTaskProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.UpdateTaskProtection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTaskProtection"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTaskProtectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1120,10 +955,7 @@ export const serializeAws_json1_1UpdateTaskSetCommand = async ( input: UpdateTaskSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonEC2ContainerServiceV20141113.UpdateTaskSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTaskSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTaskSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -9018,6 +8850,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonEC2ContainerServiceV20141113.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts index 7b49c9983456b..1070f2a90c288 100644 --- a/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts +++ b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts @@ -341,9 +341,7 @@ export const serializeAws_queryAbortEnvironmentUpdateCommand = async ( input: AbortEnvironmentUpdateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAbortEnvironmentUpdateMessage(input, context), @@ -357,9 +355,7 @@ export const serializeAws_queryApplyEnvironmentManagedActionCommand = async ( input: ApplyEnvironmentManagedActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryApplyEnvironmentManagedActionRequest(input, context), @@ -373,9 +369,7 @@ export const serializeAws_queryAssociateEnvironmentOperationsRoleCommand = async input: AssociateEnvironmentOperationsRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAssociateEnvironmentOperationsRoleMessage(input, context), @@ -389,9 +383,7 @@ export const serializeAws_queryCheckDNSAvailabilityCommand = async ( input: CheckDNSAvailabilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCheckDNSAvailabilityMessage(input, context), @@ -405,9 +397,7 @@ export const serializeAws_queryComposeEnvironmentsCommand = async ( input: ComposeEnvironmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryComposeEnvironmentsMessage(input, context), @@ -421,9 +411,7 @@ export const serializeAws_queryCreateApplicationCommand = async ( input: CreateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateApplicationMessage(input, context), @@ -437,9 +425,7 @@ export const serializeAws_queryCreateApplicationVersionCommand = async ( input: CreateApplicationVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateApplicationVersionMessage(input, context), @@ -453,9 +439,7 @@ export const serializeAws_queryCreateConfigurationTemplateCommand = async ( input: CreateConfigurationTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateConfigurationTemplateMessage(input, context), @@ -469,9 +453,7 @@ export const serializeAws_queryCreateEnvironmentCommand = async ( input: CreateEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateEnvironmentMessage(input, context), @@ -485,9 +467,7 @@ export const serializeAws_queryCreatePlatformVersionCommand = async ( input: CreatePlatformVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreatePlatformVersionRequest(input, context), @@ -501,9 +481,7 @@ export const serializeAws_queryCreateStorageLocationCommand = async ( input: CreateStorageLocationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "CreateStorageLocation", Version: "2010-12-01", @@ -515,9 +493,7 @@ export const serializeAws_queryDeleteApplicationCommand = async ( input: DeleteApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteApplicationMessage(input, context), @@ -531,9 +507,7 @@ export const serializeAws_queryDeleteApplicationVersionCommand = async ( input: DeleteApplicationVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteApplicationVersionMessage(input, context), @@ -547,9 +521,7 @@ export const serializeAws_queryDeleteConfigurationTemplateCommand = async ( input: DeleteConfigurationTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteConfigurationTemplateMessage(input, context), @@ -563,9 +535,7 @@ export const serializeAws_queryDeleteEnvironmentConfigurationCommand = async ( input: DeleteEnvironmentConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteEnvironmentConfigurationMessage(input, context), @@ -579,9 +549,7 @@ export const serializeAws_queryDeletePlatformVersionCommand = async ( input: DeletePlatformVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeletePlatformVersionRequest(input, context), @@ -595,9 +563,7 @@ export const serializeAws_queryDescribeAccountAttributesCommand = async ( input: DescribeAccountAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DescribeAccountAttributes", Version: "2010-12-01", @@ -609,9 +575,7 @@ export const serializeAws_queryDescribeApplicationsCommand = async ( input: DescribeApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeApplicationsMessage(input, context), @@ -625,9 +589,7 @@ export const serializeAws_queryDescribeApplicationVersionsCommand = async ( input: DescribeApplicationVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeApplicationVersionsMessage(input, context), @@ -641,9 +603,7 @@ export const serializeAws_queryDescribeConfigurationOptionsCommand = async ( input: DescribeConfigurationOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeConfigurationOptionsMessage(input, context), @@ -657,9 +617,7 @@ export const serializeAws_queryDescribeConfigurationSettingsCommand = async ( input: DescribeConfigurationSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeConfigurationSettingsMessage(input, context), @@ -673,9 +631,7 @@ export const serializeAws_queryDescribeEnvironmentHealthCommand = async ( input: DescribeEnvironmentHealthCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEnvironmentHealthRequest(input, context), @@ -689,9 +645,7 @@ export const serializeAws_queryDescribeEnvironmentManagedActionHistoryCommand = input: DescribeEnvironmentManagedActionHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEnvironmentManagedActionHistoryRequest(input, context), @@ -705,9 +659,7 @@ export const serializeAws_queryDescribeEnvironmentManagedActionsCommand = async input: DescribeEnvironmentManagedActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEnvironmentManagedActionsRequest(input, context), @@ -721,9 +673,7 @@ export const serializeAws_queryDescribeEnvironmentResourcesCommand = async ( input: DescribeEnvironmentResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEnvironmentResourcesMessage(input, context), @@ -737,9 +687,7 @@ export const serializeAws_queryDescribeEnvironmentsCommand = async ( input: DescribeEnvironmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEnvironmentsMessage(input, context), @@ -753,9 +701,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventsMessage(input, context), @@ -769,9 +715,7 @@ export const serializeAws_queryDescribeInstancesHealthCommand = async ( input: DescribeInstancesHealthCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeInstancesHealthRequest(input, context), @@ -785,9 +729,7 @@ export const serializeAws_queryDescribePlatformVersionCommand = async ( input: DescribePlatformVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribePlatformVersionRequest(input, context), @@ -801,9 +743,7 @@ export const serializeAws_queryDisassociateEnvironmentOperationsRoleCommand = as input: DisassociateEnvironmentOperationsRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDisassociateEnvironmentOperationsRoleMessage(input, context), @@ -817,9 +757,7 @@ export const serializeAws_queryListAvailableSolutionStacksCommand = async ( input: ListAvailableSolutionStacksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "ListAvailableSolutionStacks", Version: "2010-12-01", @@ -831,9 +769,7 @@ export const serializeAws_queryListPlatformBranchesCommand = async ( input: ListPlatformBranchesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListPlatformBranchesRequest(input, context), @@ -847,9 +783,7 @@ export const serializeAws_queryListPlatformVersionsCommand = async ( input: ListPlatformVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListPlatformVersionsRequest(input, context), @@ -863,9 +797,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTagsForResourceMessage(input, context), @@ -879,9 +811,7 @@ export const serializeAws_queryRebuildEnvironmentCommand = async ( input: RebuildEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRebuildEnvironmentMessage(input, context), @@ -895,9 +825,7 @@ export const serializeAws_queryRequestEnvironmentInfoCommand = async ( input: RequestEnvironmentInfoCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRequestEnvironmentInfoMessage(input, context), @@ -911,9 +839,7 @@ export const serializeAws_queryRestartAppServerCommand = async ( input: RestartAppServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestartAppServerMessage(input, context), @@ -927,9 +853,7 @@ export const serializeAws_queryRetrieveEnvironmentInfoCommand = async ( input: RetrieveEnvironmentInfoCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRetrieveEnvironmentInfoMessage(input, context), @@ -943,9 +867,7 @@ export const serializeAws_querySwapEnvironmentCNAMEsCommand = async ( input: SwapEnvironmentCNAMEsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySwapEnvironmentCNAMEsMessage(input, context), @@ -959,9 +881,7 @@ export const serializeAws_queryTerminateEnvironmentCommand = async ( input: TerminateEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTerminateEnvironmentMessage(input, context), @@ -975,9 +895,7 @@ export const serializeAws_queryUpdateApplicationCommand = async ( input: UpdateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateApplicationMessage(input, context), @@ -991,9 +909,7 @@ export const serializeAws_queryUpdateApplicationResourceLifecycleCommand = async input: UpdateApplicationResourceLifecycleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateApplicationResourceLifecycleMessage(input, context), @@ -1007,9 +923,7 @@ export const serializeAws_queryUpdateApplicationVersionCommand = async ( input: UpdateApplicationVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateApplicationVersionMessage(input, context), @@ -1023,9 +937,7 @@ export const serializeAws_queryUpdateConfigurationTemplateCommand = async ( input: UpdateConfigurationTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateConfigurationTemplateMessage(input, context), @@ -1039,9 +951,7 @@ export const serializeAws_queryUpdateEnvironmentCommand = async ( input: UpdateEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateEnvironmentMessage(input, context), @@ -1055,9 +965,7 @@ export const serializeAws_queryUpdateTagsForResourceCommand = async ( input: UpdateTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateTagsForResourceMessage(input, context), @@ -1071,9 +979,7 @@ export const serializeAws_queryValidateConfigurationSettingsCommand = async ( input: ValidateConfigurationSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryValidateConfigurationSettingsMessage(input, context), @@ -6950,6 +6856,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts index 1ee8b6561b75b..7d867c826d6f1 100644 --- a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts @@ -241,9 +241,7 @@ export const serializeAws_queryAddListenerCertificatesCommand = async ( input: AddListenerCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddListenerCertificatesInput(input, context), @@ -257,9 +255,7 @@ export const serializeAws_queryAddTagsCommand = async ( input: AddTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddTagsInput(input, context), @@ -273,9 +269,7 @@ export const serializeAws_queryCreateListenerCommand = async ( input: CreateListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateListenerInput(input, context), @@ -289,9 +283,7 @@ export const serializeAws_queryCreateLoadBalancerCommand = async ( input: CreateLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateLoadBalancerInput(input, context), @@ -305,9 +297,7 @@ export const serializeAws_queryCreateRuleCommand = async ( input: CreateRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateRuleInput(input, context), @@ -321,9 +311,7 @@ export const serializeAws_queryCreateTargetGroupCommand = async ( input: CreateTargetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateTargetGroupInput(input, context), @@ -337,9 +325,7 @@ export const serializeAws_queryDeleteListenerCommand = async ( input: DeleteListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteListenerInput(input, context), @@ -353,9 +339,7 @@ export const serializeAws_queryDeleteLoadBalancerCommand = async ( input: DeleteLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteLoadBalancerInput(input, context), @@ -369,9 +353,7 @@ export const serializeAws_queryDeleteRuleCommand = async ( input: DeleteRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteRuleInput(input, context), @@ -385,9 +367,7 @@ export const serializeAws_queryDeleteTargetGroupCommand = async ( input: DeleteTargetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteTargetGroupInput(input, context), @@ -401,9 +381,7 @@ export const serializeAws_queryDeregisterTargetsCommand = async ( input: DeregisterTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeregisterTargetsInput(input, context), @@ -417,9 +395,7 @@ export const serializeAws_queryDescribeAccountLimitsCommand = async ( input: DescribeAccountLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAccountLimitsInput(input, context), @@ -433,9 +409,7 @@ export const serializeAws_queryDescribeListenerCertificatesCommand = async ( input: DescribeListenerCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeListenerCertificatesInput(input, context), @@ -449,9 +423,7 @@ export const serializeAws_queryDescribeListenersCommand = async ( input: DescribeListenersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeListenersInput(input, context), @@ -465,9 +437,7 @@ export const serializeAws_queryDescribeLoadBalancerAttributesCommand = async ( input: DescribeLoadBalancerAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeLoadBalancerAttributesInput(input, context), @@ -481,9 +451,7 @@ export const serializeAws_queryDescribeLoadBalancersCommand = async ( input: DescribeLoadBalancersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeLoadBalancersInput(input, context), @@ -497,9 +465,7 @@ export const serializeAws_queryDescribeRulesCommand = async ( input: DescribeRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeRulesInput(input, context), @@ -513,9 +479,7 @@ export const serializeAws_queryDescribeSSLPoliciesCommand = async ( input: DescribeSSLPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeSSLPoliciesInput(input, context), @@ -529,9 +493,7 @@ export const serializeAws_queryDescribeTagsCommand = async ( input: DescribeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTagsInput(input, context), @@ -545,9 +507,7 @@ export const serializeAws_queryDescribeTargetGroupAttributesCommand = async ( input: DescribeTargetGroupAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTargetGroupAttributesInput(input, context), @@ -561,9 +521,7 @@ export const serializeAws_queryDescribeTargetGroupsCommand = async ( input: DescribeTargetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTargetGroupsInput(input, context), @@ -577,9 +535,7 @@ export const serializeAws_queryDescribeTargetHealthCommand = async ( input: DescribeTargetHealthCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTargetHealthInput(input, context), @@ -593,9 +549,7 @@ export const serializeAws_queryModifyListenerCommand = async ( input: ModifyListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyListenerInput(input, context), @@ -609,9 +563,7 @@ export const serializeAws_queryModifyLoadBalancerAttributesCommand = async ( input: ModifyLoadBalancerAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyLoadBalancerAttributesInput(input, context), @@ -625,9 +577,7 @@ export const serializeAws_queryModifyRuleCommand = async ( input: ModifyRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyRuleInput(input, context), @@ -641,9 +591,7 @@ export const serializeAws_queryModifyTargetGroupCommand = async ( input: ModifyTargetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyTargetGroupInput(input, context), @@ -657,9 +605,7 @@ export const serializeAws_queryModifyTargetGroupAttributesCommand = async ( input: ModifyTargetGroupAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyTargetGroupAttributesInput(input, context), @@ -673,9 +619,7 @@ export const serializeAws_queryRegisterTargetsCommand = async ( input: RegisterTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRegisterTargetsInput(input, context), @@ -689,9 +633,7 @@ export const serializeAws_queryRemoveListenerCertificatesCommand = async ( input: RemoveListenerCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveListenerCertificatesInput(input, context), @@ -705,9 +647,7 @@ export const serializeAws_queryRemoveTagsCommand = async ( input: RemoveTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveTagsInput(input, context), @@ -721,9 +661,7 @@ export const serializeAws_querySetIpAddressTypeCommand = async ( input: SetIpAddressTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetIpAddressTypeInput(input, context), @@ -737,9 +675,7 @@ export const serializeAws_querySetRulePrioritiesCommand = async ( input: SetRulePrioritiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetRulePrioritiesInput(input, context), @@ -753,9 +689,7 @@ export const serializeAws_querySetSecurityGroupsCommand = async ( input: SetSecurityGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetSecurityGroupsInput(input, context), @@ -769,9 +703,7 @@ export const serializeAws_querySetSubnetsCommand = async ( input: SetSubnetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetSubnetsInput(input, context), @@ -6528,6 +6460,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts index e085efc25c8e5..55069af71defe 100644 --- a/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts @@ -236,9 +236,7 @@ export const serializeAws_queryAddTagsCommand = async ( input: AddTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddTagsInput(input, context), @@ -252,9 +250,7 @@ export const serializeAws_queryApplySecurityGroupsToLoadBalancerCommand = async input: ApplySecurityGroupsToLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryApplySecurityGroupsToLoadBalancerInput(input, context), @@ -268,9 +264,7 @@ export const serializeAws_queryAttachLoadBalancerToSubnetsCommand = async ( input: AttachLoadBalancerToSubnetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAttachLoadBalancerToSubnetsInput(input, context), @@ -284,9 +278,7 @@ export const serializeAws_queryConfigureHealthCheckCommand = async ( input: ConfigureHealthCheckCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryConfigureHealthCheckInput(input, context), @@ -300,9 +292,7 @@ export const serializeAws_queryCreateAppCookieStickinessPolicyCommand = async ( input: CreateAppCookieStickinessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateAppCookieStickinessPolicyInput(input, context), @@ -316,9 +306,7 @@ export const serializeAws_queryCreateLBCookieStickinessPolicyCommand = async ( input: CreateLBCookieStickinessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateLBCookieStickinessPolicyInput(input, context), @@ -332,9 +320,7 @@ export const serializeAws_queryCreateLoadBalancerCommand = async ( input: CreateLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateAccessPointInput(input, context), @@ -348,9 +334,7 @@ export const serializeAws_queryCreateLoadBalancerListenersCommand = async ( input: CreateLoadBalancerListenersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateLoadBalancerListenerInput(input, context), @@ -364,9 +348,7 @@ export const serializeAws_queryCreateLoadBalancerPolicyCommand = async ( input: CreateLoadBalancerPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateLoadBalancerPolicyInput(input, context), @@ -380,9 +362,7 @@ export const serializeAws_queryDeleteLoadBalancerCommand = async ( input: DeleteLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteAccessPointInput(input, context), @@ -396,9 +376,7 @@ export const serializeAws_queryDeleteLoadBalancerListenersCommand = async ( input: DeleteLoadBalancerListenersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteLoadBalancerListenerInput(input, context), @@ -412,9 +390,7 @@ export const serializeAws_queryDeleteLoadBalancerPolicyCommand = async ( input: DeleteLoadBalancerPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteLoadBalancerPolicyInput(input, context), @@ -428,9 +404,7 @@ export const serializeAws_queryDeregisterInstancesFromLoadBalancerCommand = asyn input: DeregisterInstancesFromLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeregisterEndPointsInput(input, context), @@ -444,9 +418,7 @@ export const serializeAws_queryDescribeAccountLimitsCommand = async ( input: DescribeAccountLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAccountLimitsInput(input, context), @@ -460,9 +432,7 @@ export const serializeAws_queryDescribeInstanceHealthCommand = async ( input: DescribeInstanceHealthCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEndPointStateInput(input, context), @@ -476,9 +446,7 @@ export const serializeAws_queryDescribeLoadBalancerAttributesCommand = async ( input: DescribeLoadBalancerAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeLoadBalancerAttributesInput(input, context), @@ -492,9 +460,7 @@ export const serializeAws_queryDescribeLoadBalancerPoliciesCommand = async ( input: DescribeLoadBalancerPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeLoadBalancerPoliciesInput(input, context), @@ -508,9 +474,7 @@ export const serializeAws_queryDescribeLoadBalancerPolicyTypesCommand = async ( input: DescribeLoadBalancerPolicyTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeLoadBalancerPolicyTypesInput(input, context), @@ -524,9 +488,7 @@ export const serializeAws_queryDescribeLoadBalancersCommand = async ( input: DescribeLoadBalancersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAccessPointsInput(input, context), @@ -540,9 +502,7 @@ export const serializeAws_queryDescribeTagsCommand = async ( input: DescribeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTagsInput(input, context), @@ -556,9 +516,7 @@ export const serializeAws_queryDetachLoadBalancerFromSubnetsCommand = async ( input: DetachLoadBalancerFromSubnetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetachLoadBalancerFromSubnetsInput(input, context), @@ -572,9 +530,7 @@ export const serializeAws_queryDisableAvailabilityZonesForLoadBalancerCommand = input: DisableAvailabilityZonesForLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveAvailabilityZonesInput(input, context), @@ -588,9 +544,7 @@ export const serializeAws_queryEnableAvailabilityZonesForLoadBalancerCommand = a input: EnableAvailabilityZonesForLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddAvailabilityZonesInput(input, context), @@ -604,9 +558,7 @@ export const serializeAws_queryModifyLoadBalancerAttributesCommand = async ( input: ModifyLoadBalancerAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyLoadBalancerAttributesInput(input, context), @@ -620,9 +572,7 @@ export const serializeAws_queryRegisterInstancesWithLoadBalancerCommand = async input: RegisterInstancesWithLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRegisterEndPointsInput(input, context), @@ -636,9 +586,7 @@ export const serializeAws_queryRemoveTagsCommand = async ( input: RemoveTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveTagsInput(input, context), @@ -652,9 +600,7 @@ export const serializeAws_querySetLoadBalancerListenerSSLCertificateCommand = as input: SetLoadBalancerListenerSSLCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetLoadBalancerListenerSSLCertificateInput(input, context), @@ -668,9 +614,7 @@ export const serializeAws_querySetLoadBalancerPoliciesForBackendServerCommand = input: SetLoadBalancerPoliciesForBackendServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetLoadBalancerPoliciesForBackendServerInput(input, context), @@ -684,9 +628,7 @@ export const serializeAws_querySetLoadBalancerPoliciesOfListenerCommand = async input: SetLoadBalancerPoliciesOfListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetLoadBalancerPoliciesOfListenerInput(input, context), @@ -4550,6 +4492,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-elasticache/src/protocols/Aws_query.ts b/clients/client-elasticache/src/protocols/Aws_query.ts index 5f9cf9cf13b87..c841aee41b02d 100644 --- a/clients/client-elasticache/src/protocols/Aws_query.ts +++ b/clients/client-elasticache/src/protocols/Aws_query.ts @@ -477,9 +477,7 @@ export const serializeAws_queryAddTagsToResourceCommand = async ( input: AddTagsToResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddTagsToResourceMessage(input, context), @@ -493,9 +491,7 @@ export const serializeAws_queryAuthorizeCacheSecurityGroupIngressCommand = async input: AuthorizeCacheSecurityGroupIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAuthorizeCacheSecurityGroupIngressMessage(input, context), @@ -509,9 +505,7 @@ export const serializeAws_queryBatchApplyUpdateActionCommand = async ( input: BatchApplyUpdateActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryBatchApplyUpdateActionMessage(input, context), @@ -525,9 +519,7 @@ export const serializeAws_queryBatchStopUpdateActionCommand = async ( input: BatchStopUpdateActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryBatchStopUpdateActionMessage(input, context), @@ -541,9 +533,7 @@ export const serializeAws_queryCompleteMigrationCommand = async ( input: CompleteMigrationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCompleteMigrationMessage(input, context), @@ -557,9 +547,7 @@ export const serializeAws_queryCopySnapshotCommand = async ( input: CopySnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopySnapshotMessage(input, context), @@ -573,9 +561,7 @@ export const serializeAws_queryCreateCacheClusterCommand = async ( input: CreateCacheClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateCacheClusterMessage(input, context), @@ -589,9 +575,7 @@ export const serializeAws_queryCreateCacheParameterGroupCommand = async ( input: CreateCacheParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateCacheParameterGroupMessage(input, context), @@ -605,9 +589,7 @@ export const serializeAws_queryCreateCacheSecurityGroupCommand = async ( input: CreateCacheSecurityGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateCacheSecurityGroupMessage(input, context), @@ -621,9 +603,7 @@ export const serializeAws_queryCreateCacheSubnetGroupCommand = async ( input: CreateCacheSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateCacheSubnetGroupMessage(input, context), @@ -637,9 +617,7 @@ export const serializeAws_queryCreateGlobalReplicationGroupCommand = async ( input: CreateGlobalReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateGlobalReplicationGroupMessage(input, context), @@ -653,9 +631,7 @@ export const serializeAws_queryCreateReplicationGroupCommand = async ( input: CreateReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateReplicationGroupMessage(input, context), @@ -669,9 +645,7 @@ export const serializeAws_queryCreateSnapshotCommand = async ( input: CreateSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateSnapshotMessage(input, context), @@ -685,9 +659,7 @@ export const serializeAws_queryCreateUserCommand = async ( input: CreateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateUserMessage(input, context), @@ -701,9 +673,7 @@ export const serializeAws_queryCreateUserGroupCommand = async ( input: CreateUserGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateUserGroupMessage(input, context), @@ -717,9 +687,7 @@ export const serializeAws_queryDecreaseNodeGroupsInGlobalReplicationGroupCommand input: DecreaseNodeGroupsInGlobalReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDecreaseNodeGroupsInGlobalReplicationGroupMessage(input, context), @@ -733,9 +701,7 @@ export const serializeAws_queryDecreaseReplicaCountCommand = async ( input: DecreaseReplicaCountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDecreaseReplicaCountMessage(input, context), @@ -749,9 +715,7 @@ export const serializeAws_queryDeleteCacheClusterCommand = async ( input: DeleteCacheClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteCacheClusterMessage(input, context), @@ -765,9 +729,7 @@ export const serializeAws_queryDeleteCacheParameterGroupCommand = async ( input: DeleteCacheParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteCacheParameterGroupMessage(input, context), @@ -781,9 +743,7 @@ export const serializeAws_queryDeleteCacheSecurityGroupCommand = async ( input: DeleteCacheSecurityGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteCacheSecurityGroupMessage(input, context), @@ -797,9 +757,7 @@ export const serializeAws_queryDeleteCacheSubnetGroupCommand = async ( input: DeleteCacheSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteCacheSubnetGroupMessage(input, context), @@ -813,9 +771,7 @@ export const serializeAws_queryDeleteGlobalReplicationGroupCommand = async ( input: DeleteGlobalReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteGlobalReplicationGroupMessage(input, context), @@ -829,9 +785,7 @@ export const serializeAws_queryDeleteReplicationGroupCommand = async ( input: DeleteReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteReplicationGroupMessage(input, context), @@ -845,9 +799,7 @@ export const serializeAws_queryDeleteSnapshotCommand = async ( input: DeleteSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteSnapshotMessage(input, context), @@ -861,9 +813,7 @@ export const serializeAws_queryDeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteUserMessage(input, context), @@ -877,9 +827,7 @@ export const serializeAws_queryDeleteUserGroupCommand = async ( input: DeleteUserGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteUserGroupMessage(input, context), @@ -893,9 +841,7 @@ export const serializeAws_queryDescribeCacheClustersCommand = async ( input: DescribeCacheClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeCacheClustersMessage(input, context), @@ -909,9 +855,7 @@ export const serializeAws_queryDescribeCacheEngineVersionsCommand = async ( input: DescribeCacheEngineVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeCacheEngineVersionsMessage(input, context), @@ -925,9 +869,7 @@ export const serializeAws_queryDescribeCacheParameterGroupsCommand = async ( input: DescribeCacheParameterGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeCacheParameterGroupsMessage(input, context), @@ -941,9 +883,7 @@ export const serializeAws_queryDescribeCacheParametersCommand = async ( input: DescribeCacheParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeCacheParametersMessage(input, context), @@ -957,9 +897,7 @@ export const serializeAws_queryDescribeCacheSecurityGroupsCommand = async ( input: DescribeCacheSecurityGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeCacheSecurityGroupsMessage(input, context), @@ -973,9 +911,7 @@ export const serializeAws_queryDescribeCacheSubnetGroupsCommand = async ( input: DescribeCacheSubnetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeCacheSubnetGroupsMessage(input, context), @@ -989,9 +925,7 @@ export const serializeAws_queryDescribeEngineDefaultParametersCommand = async ( input: DescribeEngineDefaultParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEngineDefaultParametersMessage(input, context), @@ -1005,9 +939,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventsMessage(input, context), @@ -1021,9 +953,7 @@ export const serializeAws_queryDescribeGlobalReplicationGroupsCommand = async ( input: DescribeGlobalReplicationGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeGlobalReplicationGroupsMessage(input, context), @@ -1037,9 +967,7 @@ export const serializeAws_queryDescribeReplicationGroupsCommand = async ( input: DescribeReplicationGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeReplicationGroupsMessage(input, context), @@ -1053,9 +981,7 @@ export const serializeAws_queryDescribeReservedCacheNodesCommand = async ( input: DescribeReservedCacheNodesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeReservedCacheNodesMessage(input, context), @@ -1069,9 +995,7 @@ export const serializeAws_queryDescribeReservedCacheNodesOfferingsCommand = asyn input: DescribeReservedCacheNodesOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeReservedCacheNodesOfferingsMessage(input, context), @@ -1085,9 +1009,7 @@ export const serializeAws_queryDescribeServiceUpdatesCommand = async ( input: DescribeServiceUpdatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeServiceUpdatesMessage(input, context), @@ -1101,9 +1023,7 @@ export const serializeAws_queryDescribeSnapshotsCommand = async ( input: DescribeSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeSnapshotsMessage(input, context), @@ -1117,9 +1037,7 @@ export const serializeAws_queryDescribeUpdateActionsCommand = async ( input: DescribeUpdateActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeUpdateActionsMessage(input, context), @@ -1133,9 +1051,7 @@ export const serializeAws_queryDescribeUserGroupsCommand = async ( input: DescribeUserGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeUserGroupsMessage(input, context), @@ -1149,9 +1065,7 @@ export const serializeAws_queryDescribeUsersCommand = async ( input: DescribeUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeUsersMessage(input, context), @@ -1165,9 +1079,7 @@ export const serializeAws_queryDisassociateGlobalReplicationGroupCommand = async input: DisassociateGlobalReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDisassociateGlobalReplicationGroupMessage(input, context), @@ -1181,9 +1093,7 @@ export const serializeAws_queryFailoverGlobalReplicationGroupCommand = async ( input: FailoverGlobalReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryFailoverGlobalReplicationGroupMessage(input, context), @@ -1197,9 +1107,7 @@ export const serializeAws_queryIncreaseNodeGroupsInGlobalReplicationGroupCommand input: IncreaseNodeGroupsInGlobalReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryIncreaseNodeGroupsInGlobalReplicationGroupMessage(input, context), @@ -1213,9 +1121,7 @@ export const serializeAws_queryIncreaseReplicaCountCommand = async ( input: IncreaseReplicaCountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryIncreaseReplicaCountMessage(input, context), @@ -1229,9 +1135,7 @@ export const serializeAws_queryListAllowedNodeTypeModificationsCommand = async ( input: ListAllowedNodeTypeModificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListAllowedNodeTypeModificationsMessage(input, context), @@ -1245,9 +1149,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTagsForResourceMessage(input, context), @@ -1261,9 +1163,7 @@ export const serializeAws_queryModifyCacheClusterCommand = async ( input: ModifyCacheClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyCacheClusterMessage(input, context), @@ -1277,9 +1177,7 @@ export const serializeAws_queryModifyCacheParameterGroupCommand = async ( input: ModifyCacheParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyCacheParameterGroupMessage(input, context), @@ -1293,9 +1191,7 @@ export const serializeAws_queryModifyCacheSubnetGroupCommand = async ( input: ModifyCacheSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyCacheSubnetGroupMessage(input, context), @@ -1309,9 +1205,7 @@ export const serializeAws_queryModifyGlobalReplicationGroupCommand = async ( input: ModifyGlobalReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyGlobalReplicationGroupMessage(input, context), @@ -1325,9 +1219,7 @@ export const serializeAws_queryModifyReplicationGroupCommand = async ( input: ModifyReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyReplicationGroupMessage(input, context), @@ -1341,9 +1233,7 @@ export const serializeAws_queryModifyReplicationGroupShardConfigurationCommand = input: ModifyReplicationGroupShardConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyReplicationGroupShardConfigurationMessage(input, context), @@ -1357,9 +1247,7 @@ export const serializeAws_queryModifyUserCommand = async ( input: ModifyUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyUserMessage(input, context), @@ -1373,9 +1261,7 @@ export const serializeAws_queryModifyUserGroupCommand = async ( input: ModifyUserGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyUserGroupMessage(input, context), @@ -1389,9 +1275,7 @@ export const serializeAws_queryPurchaseReservedCacheNodesOfferingCommand = async input: PurchaseReservedCacheNodesOfferingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPurchaseReservedCacheNodesOfferingMessage(input, context), @@ -1405,9 +1289,7 @@ export const serializeAws_queryRebalanceSlotsInGlobalReplicationGroupCommand = a input: RebalanceSlotsInGlobalReplicationGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRebalanceSlotsInGlobalReplicationGroupMessage(input, context), @@ -1421,9 +1303,7 @@ export const serializeAws_queryRebootCacheClusterCommand = async ( input: RebootCacheClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRebootCacheClusterMessage(input, context), @@ -1437,9 +1317,7 @@ export const serializeAws_queryRemoveTagsFromResourceCommand = async ( input: RemoveTagsFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveTagsFromResourceMessage(input, context), @@ -1453,9 +1331,7 @@ export const serializeAws_queryResetCacheParameterGroupCommand = async ( input: ResetCacheParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResetCacheParameterGroupMessage(input, context), @@ -1469,9 +1345,7 @@ export const serializeAws_queryRevokeCacheSecurityGroupIngressCommand = async ( input: RevokeCacheSecurityGroupIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRevokeCacheSecurityGroupIngressMessage(input, context), @@ -1485,9 +1359,7 @@ export const serializeAws_queryStartMigrationCommand = async ( input: StartMigrationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStartMigrationMessage(input, context), @@ -1501,9 +1373,7 @@ export const serializeAws_queryTestFailoverCommand = async ( input: TestFailoverCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTestFailoverMessage(input, context), @@ -12191,6 +12061,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-emr/src/protocols/Aws_json1_1.ts b/clients/client-emr/src/protocols/Aws_json1_1.ts index 34d40bc769df7..5322731a24ad6 100644 --- a/clients/client-emr/src/protocols/Aws_json1_1.ts +++ b/clients/client-emr/src/protocols/Aws_json1_1.ts @@ -372,10 +372,7 @@ export const serializeAws_json1_1AddInstanceFleetCommand = async ( input: AddInstanceFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.AddInstanceFleet", - }; + const headers: __HeaderBag = sharedHeaders("AddInstanceFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1AddInstanceFleetInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -385,10 +382,7 @@ export const serializeAws_json1_1AddInstanceGroupsCommand = async ( input: AddInstanceGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.AddInstanceGroups", - }; + const headers: __HeaderBag = sharedHeaders("AddInstanceGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1AddInstanceGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -398,10 +392,7 @@ export const serializeAws_json1_1AddJobFlowStepsCommand = async ( input: AddJobFlowStepsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.AddJobFlowSteps", - }; + const headers: __HeaderBag = sharedHeaders("AddJobFlowSteps"); let body: any; body = JSON.stringify(serializeAws_json1_1AddJobFlowStepsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -411,10 +402,7 @@ export const serializeAws_json1_1AddTagsCommand = async ( input: AddTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.AddTags", - }; + const headers: __HeaderBag = sharedHeaders("AddTags"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -424,10 +412,7 @@ export const serializeAws_json1_1CancelStepsCommand = async ( input: CancelStepsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.CancelSteps", - }; + const headers: __HeaderBag = sharedHeaders("CancelSteps"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelStepsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -437,10 +422,7 @@ export const serializeAws_json1_1CreateSecurityConfigurationCommand = async ( input: CreateSecurityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.CreateSecurityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("CreateSecurityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSecurityConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -450,10 +432,7 @@ export const serializeAws_json1_1CreateStudioCommand = async ( input: CreateStudioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.CreateStudio", - }; + const headers: __HeaderBag = sharedHeaders("CreateStudio"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStudioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -463,10 +442,7 @@ export const serializeAws_json1_1CreateStudioSessionMappingCommand = async ( input: CreateStudioSessionMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.CreateStudioSessionMapping", - }; + const headers: __HeaderBag = sharedHeaders("CreateStudioSessionMapping"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStudioSessionMappingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -476,10 +452,7 @@ export const serializeAws_json1_1DeleteSecurityConfigurationCommand = async ( input: DeleteSecurityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.DeleteSecurityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSecurityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSecurityConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -489,10 +462,7 @@ export const serializeAws_json1_1DeleteStudioCommand = async ( input: DeleteStudioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.DeleteStudio", - }; + const headers: __HeaderBag = sharedHeaders("DeleteStudio"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteStudioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -502,10 +472,7 @@ export const serializeAws_json1_1DeleteStudioSessionMappingCommand = async ( input: DeleteStudioSessionMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.DeleteStudioSessionMapping", - }; + const headers: __HeaderBag = sharedHeaders("DeleteStudioSessionMapping"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteStudioSessionMappingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -515,10 +482,7 @@ export const serializeAws_json1_1DescribeClusterCommand = async ( input: DescribeClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.DescribeCluster", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeClusterInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -528,10 +492,7 @@ export const serializeAws_json1_1DescribeJobFlowsCommand = async ( input: DescribeJobFlowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.DescribeJobFlows", - }; + const headers: __HeaderBag = sharedHeaders("DescribeJobFlows"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeJobFlowsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -541,10 +502,7 @@ export const serializeAws_json1_1DescribeNotebookExecutionCommand = async ( input: DescribeNotebookExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.DescribeNotebookExecution", - }; + const headers: __HeaderBag = sharedHeaders("DescribeNotebookExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeNotebookExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -554,10 +512,7 @@ export const serializeAws_json1_1DescribeReleaseLabelCommand = async ( input: DescribeReleaseLabelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.DescribeReleaseLabel", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReleaseLabel"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReleaseLabelInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -567,10 +522,7 @@ export const serializeAws_json1_1DescribeSecurityConfigurationCommand = async ( input: DescribeSecurityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.DescribeSecurityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSecurityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSecurityConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -580,10 +532,7 @@ export const serializeAws_json1_1DescribeStepCommand = async ( input: DescribeStepCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.DescribeStep", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStep"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStepInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -593,10 +542,7 @@ export const serializeAws_json1_1DescribeStudioCommand = async ( input: DescribeStudioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.DescribeStudio", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStudio"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStudioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -606,10 +552,7 @@ export const serializeAws_json1_1GetAutoTerminationPolicyCommand = async ( input: GetAutoTerminationPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.GetAutoTerminationPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetAutoTerminationPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAutoTerminationPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -619,10 +562,7 @@ export const serializeAws_json1_1GetBlockPublicAccessConfigurationCommand = asyn input: GetBlockPublicAccessConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.GetBlockPublicAccessConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetBlockPublicAccessConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBlockPublicAccessConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -632,10 +572,7 @@ export const serializeAws_json1_1GetClusterSessionCredentialsCommand = async ( input: GetClusterSessionCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.GetClusterSessionCredentials", - }; + const headers: __HeaderBag = sharedHeaders("GetClusterSessionCredentials"); let body: any; body = JSON.stringify(serializeAws_json1_1GetClusterSessionCredentialsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -645,10 +582,7 @@ export const serializeAws_json1_1GetManagedScalingPolicyCommand = async ( input: GetManagedScalingPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.GetManagedScalingPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetManagedScalingPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetManagedScalingPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -658,10 +592,7 @@ export const serializeAws_json1_1GetStudioSessionMappingCommand = async ( input: GetStudioSessionMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.GetStudioSessionMapping", - }; + const headers: __HeaderBag = sharedHeaders("GetStudioSessionMapping"); let body: any; body = JSON.stringify(serializeAws_json1_1GetStudioSessionMappingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -671,10 +602,7 @@ export const serializeAws_json1_1ListBootstrapActionsCommand = async ( input: ListBootstrapActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListBootstrapActions", - }; + const headers: __HeaderBag = sharedHeaders("ListBootstrapActions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBootstrapActionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -684,10 +612,7 @@ export const serializeAws_json1_1ListClustersCommand = async ( input: ListClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListClusters", - }; + const headers: __HeaderBag = sharedHeaders("ListClusters"); let body: any; body = JSON.stringify(serializeAws_json1_1ListClustersInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -697,10 +622,7 @@ export const serializeAws_json1_1ListInstanceFleetsCommand = async ( input: ListInstanceFleetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListInstanceFleets", - }; + const headers: __HeaderBag = sharedHeaders("ListInstanceFleets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListInstanceFleetsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -710,10 +632,7 @@ export const serializeAws_json1_1ListInstanceGroupsCommand = async ( input: ListInstanceGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListInstanceGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListInstanceGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListInstanceGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -723,10 +642,7 @@ export const serializeAws_json1_1ListInstancesCommand = async ( input: ListInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListInstances", - }; + const headers: __HeaderBag = sharedHeaders("ListInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1ListInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -736,10 +652,7 @@ export const serializeAws_json1_1ListNotebookExecutionsCommand = async ( input: ListNotebookExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListNotebookExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListNotebookExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListNotebookExecutionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -749,10 +662,7 @@ export const serializeAws_json1_1ListReleaseLabelsCommand = async ( input: ListReleaseLabelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListReleaseLabels", - }; + const headers: __HeaderBag = sharedHeaders("ListReleaseLabels"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReleaseLabelsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -762,10 +672,7 @@ export const serializeAws_json1_1ListSecurityConfigurationsCommand = async ( input: ListSecurityConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListSecurityConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListSecurityConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSecurityConfigurationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -775,10 +682,7 @@ export const serializeAws_json1_1ListStepsCommand = async ( input: ListStepsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListSteps", - }; + const headers: __HeaderBag = sharedHeaders("ListSteps"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStepsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -788,10 +692,7 @@ export const serializeAws_json1_1ListStudiosCommand = async ( input: ListStudiosCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListStudios", - }; + const headers: __HeaderBag = sharedHeaders("ListStudios"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStudiosInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -801,10 +702,7 @@ export const serializeAws_json1_1ListStudioSessionMappingsCommand = async ( input: ListStudioSessionMappingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ListStudioSessionMappings", - }; + const headers: __HeaderBag = sharedHeaders("ListStudioSessionMappings"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStudioSessionMappingsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -814,10 +712,7 @@ export const serializeAws_json1_1ModifyClusterCommand = async ( input: ModifyClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ModifyCluster", - }; + const headers: __HeaderBag = sharedHeaders("ModifyCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyClusterInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -827,10 +722,7 @@ export const serializeAws_json1_1ModifyInstanceFleetCommand = async ( input: ModifyInstanceFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ModifyInstanceFleet", - }; + const headers: __HeaderBag = sharedHeaders("ModifyInstanceFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyInstanceFleetInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -840,10 +732,7 @@ export const serializeAws_json1_1ModifyInstanceGroupsCommand = async ( input: ModifyInstanceGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.ModifyInstanceGroups", - }; + const headers: __HeaderBag = sharedHeaders("ModifyInstanceGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyInstanceGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -853,10 +742,7 @@ export const serializeAws_json1_1PutAutoScalingPolicyCommand = async ( input: PutAutoScalingPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.PutAutoScalingPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutAutoScalingPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAutoScalingPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -866,10 +752,7 @@ export const serializeAws_json1_1PutAutoTerminationPolicyCommand = async ( input: PutAutoTerminationPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.PutAutoTerminationPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutAutoTerminationPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAutoTerminationPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -879,10 +762,7 @@ export const serializeAws_json1_1PutBlockPublicAccessConfigurationCommand = asyn input: PutBlockPublicAccessConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.PutBlockPublicAccessConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutBlockPublicAccessConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutBlockPublicAccessConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -892,10 +772,7 @@ export const serializeAws_json1_1PutManagedScalingPolicyCommand = async ( input: PutManagedScalingPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.PutManagedScalingPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutManagedScalingPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutManagedScalingPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -905,10 +782,7 @@ export const serializeAws_json1_1RemoveAutoScalingPolicyCommand = async ( input: RemoveAutoScalingPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.RemoveAutoScalingPolicy", - }; + const headers: __HeaderBag = sharedHeaders("RemoveAutoScalingPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveAutoScalingPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -918,10 +792,7 @@ export const serializeAws_json1_1RemoveAutoTerminationPolicyCommand = async ( input: RemoveAutoTerminationPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.RemoveAutoTerminationPolicy", - }; + const headers: __HeaderBag = sharedHeaders("RemoveAutoTerminationPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveAutoTerminationPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -931,10 +802,7 @@ export const serializeAws_json1_1RemoveManagedScalingPolicyCommand = async ( input: RemoveManagedScalingPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.RemoveManagedScalingPolicy", - }; + const headers: __HeaderBag = sharedHeaders("RemoveManagedScalingPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveManagedScalingPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -944,10 +812,7 @@ export const serializeAws_json1_1RemoveTagsCommand = async ( input: RemoveTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.RemoveTags", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTags"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -957,10 +822,7 @@ export const serializeAws_json1_1RunJobFlowCommand = async ( input: RunJobFlowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.RunJobFlow", - }; + const headers: __HeaderBag = sharedHeaders("RunJobFlow"); let body: any; body = JSON.stringify(serializeAws_json1_1RunJobFlowInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -970,10 +832,7 @@ export const serializeAws_json1_1SetTerminationProtectionCommand = async ( input: SetTerminationProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.SetTerminationProtection", - }; + const headers: __HeaderBag = sharedHeaders("SetTerminationProtection"); let body: any; body = JSON.stringify(serializeAws_json1_1SetTerminationProtectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -983,10 +842,7 @@ export const serializeAws_json1_1SetVisibleToAllUsersCommand = async ( input: SetVisibleToAllUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.SetVisibleToAllUsers", - }; + const headers: __HeaderBag = sharedHeaders("SetVisibleToAllUsers"); let body: any; body = JSON.stringify(serializeAws_json1_1SetVisibleToAllUsersInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -996,10 +852,7 @@ export const serializeAws_json1_1StartNotebookExecutionCommand = async ( input: StartNotebookExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.StartNotebookExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartNotebookExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StartNotebookExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1009,10 +862,7 @@ export const serializeAws_json1_1StopNotebookExecutionCommand = async ( input: StopNotebookExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.StopNotebookExecution", - }; + const headers: __HeaderBag = sharedHeaders("StopNotebookExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StopNotebookExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1022,10 +872,7 @@ export const serializeAws_json1_1TerminateJobFlowsCommand = async ( input: TerminateJobFlowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.TerminateJobFlows", - }; + const headers: __HeaderBag = sharedHeaders("TerminateJobFlows"); let body: any; body = JSON.stringify(serializeAws_json1_1TerminateJobFlowsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1035,10 +882,7 @@ export const serializeAws_json1_1UpdateStudioCommand = async ( input: UpdateStudioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.UpdateStudio", - }; + const headers: __HeaderBag = sharedHeaders("UpdateStudio"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateStudioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1048,10 +892,7 @@ export const serializeAws_json1_1UpdateStudioSessionMappingCommand = async ( input: UpdateStudioSessionMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ElasticMapReduce.UpdateStudioSessionMapping", - }; + const headers: __HeaderBag = sharedHeaders("UpdateStudioSessionMapping"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateStudioSessionMappingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6766,6 +6607,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `ElasticMapReduce.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-eventbridge/src/protocols/Aws_json1_1.ts b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts index 805d13e7c6e34..469da0ae25b14 100644 --- a/clients/client-eventbridge/src/protocols/Aws_json1_1.ts +++ b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts @@ -309,10 +309,7 @@ export const serializeAws_json1_1ActivateEventSourceCommand = async ( input: ActivateEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ActivateEventSource", - }; + const headers: __HeaderBag = sharedHeaders("ActivateEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1ActivateEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -322,10 +319,7 @@ export const serializeAws_json1_1CancelReplayCommand = async ( input: CancelReplayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CancelReplay", - }; + const headers: __HeaderBag = sharedHeaders("CancelReplay"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelReplayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -335,10 +329,7 @@ export const serializeAws_json1_1CreateApiDestinationCommand = async ( input: CreateApiDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreateApiDestination", - }; + const headers: __HeaderBag = sharedHeaders("CreateApiDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApiDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -348,10 +339,7 @@ export const serializeAws_json1_1CreateArchiveCommand = async ( input: CreateArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreateArchive", - }; + const headers: __HeaderBag = sharedHeaders("CreateArchive"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateArchiveRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -361,10 +349,7 @@ export const serializeAws_json1_1CreateConnectionCommand = async ( input: CreateConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreateConnection", - }; + const headers: __HeaderBag = sharedHeaders("CreateConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -374,10 +359,7 @@ export const serializeAws_json1_1CreateEndpointCommand = async ( input: CreateEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreateEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("CreateEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -387,10 +369,7 @@ export const serializeAws_json1_1CreateEventBusCommand = async ( input: CreateEventBusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreateEventBus", - }; + const headers: __HeaderBag = sharedHeaders("CreateEventBus"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEventBusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -400,10 +379,7 @@ export const serializeAws_json1_1CreatePartnerEventSourceCommand = async ( input: CreatePartnerEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.CreatePartnerEventSource", - }; + const headers: __HeaderBag = sharedHeaders("CreatePartnerEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePartnerEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -413,10 +389,7 @@ export const serializeAws_json1_1DeactivateEventSourceCommand = async ( input: DeactivateEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeactivateEventSource", - }; + const headers: __HeaderBag = sharedHeaders("DeactivateEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DeactivateEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -426,10 +399,7 @@ export const serializeAws_json1_1DeauthorizeConnectionCommand = async ( input: DeauthorizeConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeauthorizeConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeauthorizeConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1DeauthorizeConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -439,10 +409,7 @@ export const serializeAws_json1_1DeleteApiDestinationCommand = async ( input: DeleteApiDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteApiDestination", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApiDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApiDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -452,10 +419,7 @@ export const serializeAws_json1_1DeleteArchiveCommand = async ( input: DeleteArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteArchive", - }; + const headers: __HeaderBag = sharedHeaders("DeleteArchive"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteArchiveRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -465,10 +429,7 @@ export const serializeAws_json1_1DeleteConnectionCommand = async ( input: DeleteConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -478,10 +439,7 @@ export const serializeAws_json1_1DeleteEndpointCommand = async ( input: DeleteEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -491,10 +449,7 @@ export const serializeAws_json1_1DeleteEventBusCommand = async ( input: DeleteEventBusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteEventBus", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEventBus"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEventBusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -504,10 +459,7 @@ export const serializeAws_json1_1DeletePartnerEventSourceCommand = async ( input: DeletePartnerEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeletePartnerEventSource", - }; + const headers: __HeaderBag = sharedHeaders("DeletePartnerEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePartnerEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -517,10 +469,7 @@ export const serializeAws_json1_1DeleteRuleCommand = async ( input: DeleteRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DeleteRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -530,10 +479,7 @@ export const serializeAws_json1_1DescribeApiDestinationCommand = async ( input: DescribeApiDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeApiDestination", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApiDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApiDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -543,10 +489,7 @@ export const serializeAws_json1_1DescribeArchiveCommand = async ( input: DescribeArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeArchive", - }; + const headers: __HeaderBag = sharedHeaders("DescribeArchive"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeArchiveRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -556,10 +499,7 @@ export const serializeAws_json1_1DescribeConnectionCommand = async ( input: DescribeConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeConnection", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -569,10 +509,7 @@ export const serializeAws_json1_1DescribeEndpointCommand = async ( input: DescribeEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -582,10 +519,7 @@ export const serializeAws_json1_1DescribeEventBusCommand = async ( input: DescribeEventBusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeEventBus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventBus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventBusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -595,10 +529,7 @@ export const serializeAws_json1_1DescribeEventSourceCommand = async ( input: DescribeEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeEventSource", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -608,10 +539,7 @@ export const serializeAws_json1_1DescribePartnerEventSourceCommand = async ( input: DescribePartnerEventSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribePartnerEventSource", - }; + const headers: __HeaderBag = sharedHeaders("DescribePartnerEventSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePartnerEventSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -621,10 +549,7 @@ export const serializeAws_json1_1DescribeReplayCommand = async ( input: DescribeReplayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeReplay", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReplay"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReplayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -634,10 +559,7 @@ export const serializeAws_json1_1DescribeRuleCommand = async ( input: DescribeRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DescribeRule", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -647,10 +569,7 @@ export const serializeAws_json1_1DisableRuleCommand = async ( input: DisableRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.DisableRule", - }; + const headers: __HeaderBag = sharedHeaders("DisableRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -660,10 +579,7 @@ export const serializeAws_json1_1EnableRuleCommand = async ( input: EnableRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.EnableRule", - }; + const headers: __HeaderBag = sharedHeaders("EnableRule"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -673,10 +589,7 @@ export const serializeAws_json1_1ListApiDestinationsCommand = async ( input: ListApiDestinationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListApiDestinations", - }; + const headers: __HeaderBag = sharedHeaders("ListApiDestinations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApiDestinationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -686,10 +599,7 @@ export const serializeAws_json1_1ListArchivesCommand = async ( input: ListArchivesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListArchives", - }; + const headers: __HeaderBag = sharedHeaders("ListArchives"); let body: any; body = JSON.stringify(serializeAws_json1_1ListArchivesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -699,10 +609,7 @@ export const serializeAws_json1_1ListConnectionsCommand = async ( input: ListConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListConnections", - }; + const headers: __HeaderBag = sharedHeaders("ListConnections"); let body: any; body = JSON.stringify(serializeAws_json1_1ListConnectionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -712,10 +619,7 @@ export const serializeAws_json1_1ListEndpointsCommand = async ( input: ListEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("ListEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -725,10 +629,7 @@ export const serializeAws_json1_1ListEventBusesCommand = async ( input: ListEventBusesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListEventBuses", - }; + const headers: __HeaderBag = sharedHeaders("ListEventBuses"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEventBusesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -738,10 +639,7 @@ export const serializeAws_json1_1ListEventSourcesCommand = async ( input: ListEventSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListEventSources", - }; + const headers: __HeaderBag = sharedHeaders("ListEventSources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEventSourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -751,10 +649,7 @@ export const serializeAws_json1_1ListPartnerEventSourceAccountsCommand = async ( input: ListPartnerEventSourceAccountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListPartnerEventSourceAccounts", - }; + const headers: __HeaderBag = sharedHeaders("ListPartnerEventSourceAccounts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPartnerEventSourceAccountsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -764,10 +659,7 @@ export const serializeAws_json1_1ListPartnerEventSourcesCommand = async ( input: ListPartnerEventSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListPartnerEventSources", - }; + const headers: __HeaderBag = sharedHeaders("ListPartnerEventSources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPartnerEventSourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -777,10 +669,7 @@ export const serializeAws_json1_1ListReplaysCommand = async ( input: ListReplaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListReplays", - }; + const headers: __HeaderBag = sharedHeaders("ListReplays"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReplaysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -790,10 +679,7 @@ export const serializeAws_json1_1ListRuleNamesByTargetCommand = async ( input: ListRuleNamesByTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListRuleNamesByTarget", - }; + const headers: __HeaderBag = sharedHeaders("ListRuleNamesByTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRuleNamesByTargetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -803,10 +689,7 @@ export const serializeAws_json1_1ListRulesCommand = async ( input: ListRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListRules", - }; + const headers: __HeaderBag = sharedHeaders("ListRules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -816,10 +699,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -829,10 +709,7 @@ export const serializeAws_json1_1ListTargetsByRuleCommand = async ( input: ListTargetsByRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.ListTargetsByRule", - }; + const headers: __HeaderBag = sharedHeaders("ListTargetsByRule"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTargetsByRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -842,10 +719,7 @@ export const serializeAws_json1_1PutEventsCommand = async ( input: PutEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.PutEvents", - }; + const headers: __HeaderBag = sharedHeaders("PutEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1PutEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -855,10 +729,7 @@ export const serializeAws_json1_1PutPartnerEventsCommand = async ( input: PutPartnerEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.PutPartnerEvents", - }; + const headers: __HeaderBag = sharedHeaders("PutPartnerEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPartnerEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -868,10 +739,7 @@ export const serializeAws_json1_1PutPermissionCommand = async ( input: PutPermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.PutPermission", - }; + const headers: __HeaderBag = sharedHeaders("PutPermission"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -881,10 +749,7 @@ export const serializeAws_json1_1PutRuleCommand = async ( input: PutRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.PutRule", - }; + const headers: __HeaderBag = sharedHeaders("PutRule"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -894,10 +759,7 @@ export const serializeAws_json1_1PutTargetsCommand = async ( input: PutTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.PutTargets", - }; + const headers: __HeaderBag = sharedHeaders("PutTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1PutTargetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -907,10 +769,7 @@ export const serializeAws_json1_1RemovePermissionCommand = async ( input: RemovePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.RemovePermission", - }; + const headers: __HeaderBag = sharedHeaders("RemovePermission"); let body: any; body = JSON.stringify(serializeAws_json1_1RemovePermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -920,10 +779,7 @@ export const serializeAws_json1_1RemoveTargetsCommand = async ( input: RemoveTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.RemoveTargets", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTargetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -933,10 +789,7 @@ export const serializeAws_json1_1StartReplayCommand = async ( input: StartReplayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.StartReplay", - }; + const headers: __HeaderBag = sharedHeaders("StartReplay"); let body: any; body = JSON.stringify(serializeAws_json1_1StartReplayRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -946,10 +799,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -959,10 +809,7 @@ export const serializeAws_json1_1TestEventPatternCommand = async ( input: TestEventPatternCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.TestEventPattern", - }; + const headers: __HeaderBag = sharedHeaders("TestEventPattern"); let body: any; body = JSON.stringify(serializeAws_json1_1TestEventPatternRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -972,10 +819,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -985,10 +829,7 @@ export const serializeAws_json1_1UpdateApiDestinationCommand = async ( input: UpdateApiDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.UpdateApiDestination", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApiDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApiDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -998,10 +839,7 @@ export const serializeAws_json1_1UpdateArchiveCommand = async ( input: UpdateArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.UpdateArchive", - }; + const headers: __HeaderBag = sharedHeaders("UpdateArchive"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateArchiveRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1011,10 +849,7 @@ export const serializeAws_json1_1UpdateConnectionCommand = async ( input: UpdateConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.UpdateConnection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1024,10 +859,7 @@ export const serializeAws_json1_1UpdateEndpointCommand = async ( input: UpdateEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSEvents.UpdateEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6865,6 +6697,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSEvents.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-firehose/src/protocols/Aws_json1_1.ts b/clients/client-firehose/src/protocols/Aws_json1_1.ts index 75e29504476e3..78ddae2790ceb 100644 --- a/clients/client-firehose/src/protocols/Aws_json1_1.ts +++ b/clients/client-firehose/src/protocols/Aws_json1_1.ts @@ -165,10 +165,7 @@ export const serializeAws_json1_1CreateDeliveryStreamCommand = async ( input: CreateDeliveryStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.CreateDeliveryStream", - }; + const headers: __HeaderBag = sharedHeaders("CreateDeliveryStream"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDeliveryStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -178,10 +175,7 @@ export const serializeAws_json1_1DeleteDeliveryStreamCommand = async ( input: DeleteDeliveryStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.DeleteDeliveryStream", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDeliveryStream"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDeliveryStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -191,10 +185,7 @@ export const serializeAws_json1_1DescribeDeliveryStreamCommand = async ( input: DescribeDeliveryStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.DescribeDeliveryStream", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDeliveryStream"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDeliveryStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -204,10 +195,7 @@ export const serializeAws_json1_1ListDeliveryStreamsCommand = async ( input: ListDeliveryStreamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.ListDeliveryStreams", - }; + const headers: __HeaderBag = sharedHeaders("ListDeliveryStreams"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDeliveryStreamsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -217,10 +205,7 @@ export const serializeAws_json1_1ListTagsForDeliveryStreamCommand = async ( input: ListTagsForDeliveryStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.ListTagsForDeliveryStream", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForDeliveryStream"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForDeliveryStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -230,10 +215,7 @@ export const serializeAws_json1_1PutRecordCommand = async ( input: PutRecordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.PutRecord", - }; + const headers: __HeaderBag = sharedHeaders("PutRecord"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRecordInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -243,10 +225,7 @@ export const serializeAws_json1_1PutRecordBatchCommand = async ( input: PutRecordBatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.PutRecordBatch", - }; + const headers: __HeaderBag = sharedHeaders("PutRecordBatch"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRecordBatchInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -256,10 +235,7 @@ export const serializeAws_json1_1StartDeliveryStreamEncryptionCommand = async ( input: StartDeliveryStreamEncryptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.StartDeliveryStreamEncryption", - }; + const headers: __HeaderBag = sharedHeaders("StartDeliveryStreamEncryption"); let body: any; body = JSON.stringify(serializeAws_json1_1StartDeliveryStreamEncryptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -269,10 +245,7 @@ export const serializeAws_json1_1StopDeliveryStreamEncryptionCommand = async ( input: StopDeliveryStreamEncryptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.StopDeliveryStreamEncryption", - }; + const headers: __HeaderBag = sharedHeaders("StopDeliveryStreamEncryption"); let body: any; body = JSON.stringify(serializeAws_json1_1StopDeliveryStreamEncryptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -282,10 +255,7 @@ export const serializeAws_json1_1TagDeliveryStreamCommand = async ( input: TagDeliveryStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.TagDeliveryStream", - }; + const headers: __HeaderBag = sharedHeaders("TagDeliveryStream"); let body: any; body = JSON.stringify(serializeAws_json1_1TagDeliveryStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -295,10 +265,7 @@ export const serializeAws_json1_1UntagDeliveryStreamCommand = async ( input: UntagDeliveryStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.UntagDeliveryStream", - }; + const headers: __HeaderBag = sharedHeaders("UntagDeliveryStream"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagDeliveryStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -308,10 +275,7 @@ export const serializeAws_json1_1UpdateDestinationCommand = async ( input: UpdateDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Firehose_20150804.UpdateDestination", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDestinationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3255,6 +3219,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `Firehose_20150804.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-fms/src/protocols/Aws_json1_1.ts b/clients/client-fms/src/protocols/Aws_json1_1.ts index e0f98e8009a28..6595908790bb0 100644 --- a/clients/client-fms/src/protocols/Aws_json1_1.ts +++ b/clients/client-fms/src/protocols/Aws_json1_1.ts @@ -267,10 +267,7 @@ export const serializeAws_json1_1AssociateAdminAccountCommand = async ( input: AssociateAdminAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.AssociateAdminAccount", - }; + const headers: __HeaderBag = sharedHeaders("AssociateAdminAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateAdminAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -280,10 +277,7 @@ export const serializeAws_json1_1AssociateThirdPartyFirewallCommand = async ( input: AssociateThirdPartyFirewallCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.AssociateThirdPartyFirewall", - }; + const headers: __HeaderBag = sharedHeaders("AssociateThirdPartyFirewall"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateThirdPartyFirewallRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -293,10 +287,7 @@ export const serializeAws_json1_1BatchAssociateResourceCommand = async ( input: BatchAssociateResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.BatchAssociateResource", - }; + const headers: __HeaderBag = sharedHeaders("BatchAssociateResource"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchAssociateResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -306,10 +297,7 @@ export const serializeAws_json1_1BatchDisassociateResourceCommand = async ( input: BatchDisassociateResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.BatchDisassociateResource", - }; + const headers: __HeaderBag = sharedHeaders("BatchDisassociateResource"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDisassociateResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -319,10 +307,7 @@ export const serializeAws_json1_1DeleteAppsListCommand = async ( input: DeleteAppsListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.DeleteAppsList", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAppsList"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAppsListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -332,10 +317,7 @@ export const serializeAws_json1_1DeleteNotificationChannelCommand = async ( input: DeleteNotificationChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.DeleteNotificationChannel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNotificationChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNotificationChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -345,10 +327,7 @@ export const serializeAws_json1_1DeletePolicyCommand = async ( input: DeletePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.DeletePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeletePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -358,10 +337,7 @@ export const serializeAws_json1_1DeleteProtocolsListCommand = async ( input: DeleteProtocolsListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.DeleteProtocolsList", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProtocolsList"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProtocolsListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -371,10 +347,7 @@ export const serializeAws_json1_1DeleteResourceSetCommand = async ( input: DeleteResourceSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.DeleteResourceSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourceSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourceSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -384,10 +357,7 @@ export const serializeAws_json1_1DisassociateAdminAccountCommand = async ( input: DisassociateAdminAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.DisassociateAdminAccount", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateAdminAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateAdminAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -397,10 +367,7 @@ export const serializeAws_json1_1DisassociateThirdPartyFirewallCommand = async ( input: DisassociateThirdPartyFirewallCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.DisassociateThirdPartyFirewall", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateThirdPartyFirewall"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateThirdPartyFirewallRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -410,10 +377,7 @@ export const serializeAws_json1_1GetAdminAccountCommand = async ( input: GetAdminAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.GetAdminAccount", - }; + const headers: __HeaderBag = sharedHeaders("GetAdminAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAdminAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -423,10 +387,7 @@ export const serializeAws_json1_1GetAppsListCommand = async ( input: GetAppsListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.GetAppsList", - }; + const headers: __HeaderBag = sharedHeaders("GetAppsList"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAppsListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -436,10 +397,7 @@ export const serializeAws_json1_1GetComplianceDetailCommand = async ( input: GetComplianceDetailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.GetComplianceDetail", - }; + const headers: __HeaderBag = sharedHeaders("GetComplianceDetail"); let body: any; body = JSON.stringify(serializeAws_json1_1GetComplianceDetailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -449,10 +407,7 @@ export const serializeAws_json1_1GetNotificationChannelCommand = async ( input: GetNotificationChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.GetNotificationChannel", - }; + const headers: __HeaderBag = sharedHeaders("GetNotificationChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1GetNotificationChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -462,10 +417,7 @@ export const serializeAws_json1_1GetPolicyCommand = async ( input: GetPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.GetPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -475,10 +427,7 @@ export const serializeAws_json1_1GetProtectionStatusCommand = async ( input: GetProtectionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.GetProtectionStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetProtectionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetProtectionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -488,10 +437,7 @@ export const serializeAws_json1_1GetProtocolsListCommand = async ( input: GetProtocolsListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.GetProtocolsList", - }; + const headers: __HeaderBag = sharedHeaders("GetProtocolsList"); let body: any; body = JSON.stringify(serializeAws_json1_1GetProtocolsListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -501,10 +447,7 @@ export const serializeAws_json1_1GetResourceSetCommand = async ( input: GetResourceSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.GetResourceSet", - }; + const headers: __HeaderBag = sharedHeaders("GetResourceSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourceSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -514,10 +457,7 @@ export const serializeAws_json1_1GetThirdPartyFirewallAssociationStatusCommand = input: GetThirdPartyFirewallAssociationStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.GetThirdPartyFirewallAssociationStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetThirdPartyFirewallAssociationStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetThirdPartyFirewallAssociationStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -527,10 +467,7 @@ export const serializeAws_json1_1GetViolationDetailsCommand = async ( input: GetViolationDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.GetViolationDetails", - }; + const headers: __HeaderBag = sharedHeaders("GetViolationDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1GetViolationDetailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -540,10 +477,7 @@ export const serializeAws_json1_1ListAppsListsCommand = async ( input: ListAppsListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.ListAppsLists", - }; + const headers: __HeaderBag = sharedHeaders("ListAppsLists"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAppsListsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -553,10 +487,7 @@ export const serializeAws_json1_1ListComplianceStatusCommand = async ( input: ListComplianceStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.ListComplianceStatus", - }; + const headers: __HeaderBag = sharedHeaders("ListComplianceStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1ListComplianceStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -566,10 +497,7 @@ export const serializeAws_json1_1ListDiscoveredResourcesCommand = async ( input: ListDiscoveredResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.ListDiscoveredResources", - }; + const headers: __HeaderBag = sharedHeaders("ListDiscoveredResources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDiscoveredResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -579,10 +507,7 @@ export const serializeAws_json1_1ListMemberAccountsCommand = async ( input: ListMemberAccountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.ListMemberAccounts", - }; + const headers: __HeaderBag = sharedHeaders("ListMemberAccounts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMemberAccountsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -592,10 +517,7 @@ export const serializeAws_json1_1ListPoliciesCommand = async ( input: ListPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.ListPolicies", - }; + const headers: __HeaderBag = sharedHeaders("ListPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -605,10 +527,7 @@ export const serializeAws_json1_1ListProtocolsListsCommand = async ( input: ListProtocolsListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.ListProtocolsLists", - }; + const headers: __HeaderBag = sharedHeaders("ListProtocolsLists"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProtocolsListsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -618,10 +537,7 @@ export const serializeAws_json1_1ListResourceSetResourcesCommand = async ( input: ListResourceSetResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.ListResourceSetResources", - }; + const headers: __HeaderBag = sharedHeaders("ListResourceSetResources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourceSetResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -631,10 +547,7 @@ export const serializeAws_json1_1ListResourceSetsCommand = async ( input: ListResourceSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.ListResourceSets", - }; + const headers: __HeaderBag = sharedHeaders("ListResourceSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourceSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -644,10 +557,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -657,10 +567,7 @@ export const serializeAws_json1_1ListThirdPartyFirewallFirewallPoliciesCommand = input: ListThirdPartyFirewallFirewallPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.ListThirdPartyFirewallFirewallPolicies", - }; + const headers: __HeaderBag = sharedHeaders("ListThirdPartyFirewallFirewallPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListThirdPartyFirewallFirewallPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -670,10 +577,7 @@ export const serializeAws_json1_1PutAppsListCommand = async ( input: PutAppsListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.PutAppsList", - }; + const headers: __HeaderBag = sharedHeaders("PutAppsList"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAppsListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -683,10 +587,7 @@ export const serializeAws_json1_1PutNotificationChannelCommand = async ( input: PutNotificationChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.PutNotificationChannel", - }; + const headers: __HeaderBag = sharedHeaders("PutNotificationChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1PutNotificationChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -696,10 +597,7 @@ export const serializeAws_json1_1PutPolicyCommand = async ( input: PutPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.PutPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -709,10 +607,7 @@ export const serializeAws_json1_1PutProtocolsListCommand = async ( input: PutProtocolsListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.PutProtocolsList", - }; + const headers: __HeaderBag = sharedHeaders("PutProtocolsList"); let body: any; body = JSON.stringify(serializeAws_json1_1PutProtocolsListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -722,10 +617,7 @@ export const serializeAws_json1_1PutResourceSetCommand = async ( input: PutResourceSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.PutResourceSet", - }; + const headers: __HeaderBag = sharedHeaders("PutResourceSet"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourceSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -735,10 +627,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -748,10 +637,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSFMS_20180101.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5226,6 +5112,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSFMS_20180101.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-forecast/src/protocols/Aws_json1_1.ts b/clients/client-forecast/src/protocols/Aws_json1_1.ts index 5e7869bb4f9a0..8e7bac5856a44 100644 --- a/clients/client-forecast/src/protocols/Aws_json1_1.ts +++ b/clients/client-forecast/src/protocols/Aws_json1_1.ts @@ -378,10 +378,7 @@ export const serializeAws_json1_1CreateAutoPredictorCommand = async ( input: CreateAutoPredictorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateAutoPredictor", - }; + const headers: __HeaderBag = sharedHeaders("CreateAutoPredictor"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAutoPredictorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -391,10 +388,7 @@ export const serializeAws_json1_1CreateDatasetCommand = async ( input: CreateDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateDataset", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -404,10 +398,7 @@ export const serializeAws_json1_1CreateDatasetGroupCommand = async ( input: CreateDatasetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateDatasetGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateDatasetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDatasetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -417,10 +408,7 @@ export const serializeAws_json1_1CreateDatasetImportJobCommand = async ( input: CreateDatasetImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateDatasetImportJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateDatasetImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDatasetImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -430,10 +418,7 @@ export const serializeAws_json1_1CreateExplainabilityCommand = async ( input: CreateExplainabilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateExplainability", - }; + const headers: __HeaderBag = sharedHeaders("CreateExplainability"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateExplainabilityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -443,10 +428,7 @@ export const serializeAws_json1_1CreateExplainabilityExportCommand = async ( input: CreateExplainabilityExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateExplainabilityExport", - }; + const headers: __HeaderBag = sharedHeaders("CreateExplainabilityExport"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateExplainabilityExportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -456,10 +438,7 @@ export const serializeAws_json1_1CreateForecastCommand = async ( input: CreateForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateForecast", - }; + const headers: __HeaderBag = sharedHeaders("CreateForecast"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateForecastRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -469,10 +448,7 @@ export const serializeAws_json1_1CreateForecastExportJobCommand = async ( input: CreateForecastExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateForecastExportJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateForecastExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateForecastExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -482,10 +458,7 @@ export const serializeAws_json1_1CreateMonitorCommand = async ( input: CreateMonitorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateMonitor", - }; + const headers: __HeaderBag = sharedHeaders("CreateMonitor"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMonitorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -495,10 +468,7 @@ export const serializeAws_json1_1CreatePredictorCommand = async ( input: CreatePredictorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreatePredictor", - }; + const headers: __HeaderBag = sharedHeaders("CreatePredictor"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePredictorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -508,10 +478,7 @@ export const serializeAws_json1_1CreatePredictorBacktestExportJobCommand = async input: CreatePredictorBacktestExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreatePredictorBacktestExportJob", - }; + const headers: __HeaderBag = sharedHeaders("CreatePredictorBacktestExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePredictorBacktestExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -521,10 +488,7 @@ export const serializeAws_json1_1CreateWhatIfAnalysisCommand = async ( input: CreateWhatIfAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateWhatIfAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("CreateWhatIfAnalysis"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWhatIfAnalysisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -534,10 +498,7 @@ export const serializeAws_json1_1CreateWhatIfForecastCommand = async ( input: CreateWhatIfForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateWhatIfForecast", - }; + const headers: __HeaderBag = sharedHeaders("CreateWhatIfForecast"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWhatIfForecastRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -547,10 +508,7 @@ export const serializeAws_json1_1CreateWhatIfForecastExportCommand = async ( input: CreateWhatIfForecastExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.CreateWhatIfForecastExport", - }; + const headers: __HeaderBag = sharedHeaders("CreateWhatIfForecastExport"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWhatIfForecastExportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -560,10 +518,7 @@ export const serializeAws_json1_1DeleteDatasetCommand = async ( input: DeleteDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteDataset", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -573,10 +528,7 @@ export const serializeAws_json1_1DeleteDatasetGroupCommand = async ( input: DeleteDatasetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteDatasetGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDatasetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDatasetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -586,10 +538,7 @@ export const serializeAws_json1_1DeleteDatasetImportJobCommand = async ( input: DeleteDatasetImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteDatasetImportJob", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDatasetImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDatasetImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -599,10 +548,7 @@ export const serializeAws_json1_1DeleteExplainabilityCommand = async ( input: DeleteExplainabilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteExplainability", - }; + const headers: __HeaderBag = sharedHeaders("DeleteExplainability"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteExplainabilityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -612,10 +558,7 @@ export const serializeAws_json1_1DeleteExplainabilityExportCommand = async ( input: DeleteExplainabilityExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteExplainabilityExport", - }; + const headers: __HeaderBag = sharedHeaders("DeleteExplainabilityExport"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteExplainabilityExportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -625,10 +568,7 @@ export const serializeAws_json1_1DeleteForecastCommand = async ( input: DeleteForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteForecast", - }; + const headers: __HeaderBag = sharedHeaders("DeleteForecast"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteForecastRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -638,10 +578,7 @@ export const serializeAws_json1_1DeleteForecastExportJobCommand = async ( input: DeleteForecastExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteForecastExportJob", - }; + const headers: __HeaderBag = sharedHeaders("DeleteForecastExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteForecastExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -651,10 +588,7 @@ export const serializeAws_json1_1DeleteMonitorCommand = async ( input: DeleteMonitorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteMonitor", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMonitor"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMonitorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -664,10 +598,7 @@ export const serializeAws_json1_1DeletePredictorCommand = async ( input: DeletePredictorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeletePredictor", - }; + const headers: __HeaderBag = sharedHeaders("DeletePredictor"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePredictorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -677,10 +608,7 @@ export const serializeAws_json1_1DeletePredictorBacktestExportJobCommand = async input: DeletePredictorBacktestExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeletePredictorBacktestExportJob", - }; + const headers: __HeaderBag = sharedHeaders("DeletePredictorBacktestExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePredictorBacktestExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -690,10 +618,7 @@ export const serializeAws_json1_1DeleteResourceTreeCommand = async ( input: DeleteResourceTreeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteResourceTree", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourceTree"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourceTreeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -703,10 +628,7 @@ export const serializeAws_json1_1DeleteWhatIfAnalysisCommand = async ( input: DeleteWhatIfAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteWhatIfAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWhatIfAnalysis"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWhatIfAnalysisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -716,10 +638,7 @@ export const serializeAws_json1_1DeleteWhatIfForecastCommand = async ( input: DeleteWhatIfForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteWhatIfForecast", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWhatIfForecast"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWhatIfForecastRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -729,10 +648,7 @@ export const serializeAws_json1_1DeleteWhatIfForecastExportCommand = async ( input: DeleteWhatIfForecastExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DeleteWhatIfForecastExport", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWhatIfForecastExport"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWhatIfForecastExportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -742,10 +658,7 @@ export const serializeAws_json1_1DescribeAutoPredictorCommand = async ( input: DescribeAutoPredictorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeAutoPredictor", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAutoPredictor"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAutoPredictorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -755,10 +668,7 @@ export const serializeAws_json1_1DescribeDatasetCommand = async ( input: DescribeDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeDataset", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -768,10 +678,7 @@ export const serializeAws_json1_1DescribeDatasetGroupCommand = async ( input: DescribeDatasetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeDatasetGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDatasetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDatasetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -781,10 +688,7 @@ export const serializeAws_json1_1DescribeDatasetImportJobCommand = async ( input: DescribeDatasetImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeDatasetImportJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDatasetImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDatasetImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -794,10 +698,7 @@ export const serializeAws_json1_1DescribeExplainabilityCommand = async ( input: DescribeExplainabilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeExplainability", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExplainability"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeExplainabilityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -807,10 +708,7 @@ export const serializeAws_json1_1DescribeExplainabilityExportCommand = async ( input: DescribeExplainabilityExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeExplainabilityExport", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExplainabilityExport"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeExplainabilityExportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -820,10 +718,7 @@ export const serializeAws_json1_1DescribeForecastCommand = async ( input: DescribeForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeForecast", - }; + const headers: __HeaderBag = sharedHeaders("DescribeForecast"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeForecastRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -833,10 +728,7 @@ export const serializeAws_json1_1DescribeForecastExportJobCommand = async ( input: DescribeForecastExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeForecastExportJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeForecastExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeForecastExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -846,10 +738,7 @@ export const serializeAws_json1_1DescribeMonitorCommand = async ( input: DescribeMonitorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeMonitor", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMonitor"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMonitorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -859,10 +748,7 @@ export const serializeAws_json1_1DescribePredictorCommand = async ( input: DescribePredictorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribePredictor", - }; + const headers: __HeaderBag = sharedHeaders("DescribePredictor"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePredictorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -872,10 +758,7 @@ export const serializeAws_json1_1DescribePredictorBacktestExportJobCommand = asy input: DescribePredictorBacktestExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribePredictorBacktestExportJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribePredictorBacktestExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePredictorBacktestExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -885,10 +768,7 @@ export const serializeAws_json1_1DescribeWhatIfAnalysisCommand = async ( input: DescribeWhatIfAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeWhatIfAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWhatIfAnalysis"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWhatIfAnalysisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -898,10 +778,7 @@ export const serializeAws_json1_1DescribeWhatIfForecastCommand = async ( input: DescribeWhatIfForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeWhatIfForecast", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWhatIfForecast"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWhatIfForecastRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -911,10 +788,7 @@ export const serializeAws_json1_1DescribeWhatIfForecastExportCommand = async ( input: DescribeWhatIfForecastExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.DescribeWhatIfForecastExport", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWhatIfForecastExport"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWhatIfForecastExportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -924,10 +798,7 @@ export const serializeAws_json1_1GetAccuracyMetricsCommand = async ( input: GetAccuracyMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.GetAccuracyMetrics", - }; + const headers: __HeaderBag = sharedHeaders("GetAccuracyMetrics"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAccuracyMetricsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -937,10 +808,7 @@ export const serializeAws_json1_1ListDatasetGroupsCommand = async ( input: ListDatasetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListDatasetGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasetGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatasetGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -950,10 +818,7 @@ export const serializeAws_json1_1ListDatasetImportJobsCommand = async ( input: ListDatasetImportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListDatasetImportJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasetImportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatasetImportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -963,10 +828,7 @@ export const serializeAws_json1_1ListDatasetsCommand = async ( input: ListDatasetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListDatasets", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatasetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -976,10 +838,7 @@ export const serializeAws_json1_1ListExplainabilitiesCommand = async ( input: ListExplainabilitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListExplainabilities", - }; + const headers: __HeaderBag = sharedHeaders("ListExplainabilities"); let body: any; body = JSON.stringify(serializeAws_json1_1ListExplainabilitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -989,10 +848,7 @@ export const serializeAws_json1_1ListExplainabilityExportsCommand = async ( input: ListExplainabilityExportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListExplainabilityExports", - }; + const headers: __HeaderBag = sharedHeaders("ListExplainabilityExports"); let body: any; body = JSON.stringify(serializeAws_json1_1ListExplainabilityExportsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1002,10 +858,7 @@ export const serializeAws_json1_1ListForecastExportJobsCommand = async ( input: ListForecastExportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListForecastExportJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListForecastExportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListForecastExportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1015,10 +868,7 @@ export const serializeAws_json1_1ListForecastsCommand = async ( input: ListForecastsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListForecasts", - }; + const headers: __HeaderBag = sharedHeaders("ListForecasts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListForecastsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1028,10 +878,7 @@ export const serializeAws_json1_1ListMonitorEvaluationsCommand = async ( input: ListMonitorEvaluationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListMonitorEvaluations", - }; + const headers: __HeaderBag = sharedHeaders("ListMonitorEvaluations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMonitorEvaluationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1041,10 +888,7 @@ export const serializeAws_json1_1ListMonitorsCommand = async ( input: ListMonitorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListMonitors", - }; + const headers: __HeaderBag = sharedHeaders("ListMonitors"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMonitorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1054,10 +898,7 @@ export const serializeAws_json1_1ListPredictorBacktestExportJobsCommand = async input: ListPredictorBacktestExportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListPredictorBacktestExportJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListPredictorBacktestExportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPredictorBacktestExportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1067,10 +908,7 @@ export const serializeAws_json1_1ListPredictorsCommand = async ( input: ListPredictorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListPredictors", - }; + const headers: __HeaderBag = sharedHeaders("ListPredictors"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPredictorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1080,10 +918,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1093,10 +928,7 @@ export const serializeAws_json1_1ListWhatIfAnalysesCommand = async ( input: ListWhatIfAnalysesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListWhatIfAnalyses", - }; + const headers: __HeaderBag = sharedHeaders("ListWhatIfAnalyses"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWhatIfAnalysesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1106,10 +938,7 @@ export const serializeAws_json1_1ListWhatIfForecastExportsCommand = async ( input: ListWhatIfForecastExportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListWhatIfForecastExports", - }; + const headers: __HeaderBag = sharedHeaders("ListWhatIfForecastExports"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWhatIfForecastExportsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1119,10 +948,7 @@ export const serializeAws_json1_1ListWhatIfForecastsCommand = async ( input: ListWhatIfForecastsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ListWhatIfForecasts", - }; + const headers: __HeaderBag = sharedHeaders("ListWhatIfForecasts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWhatIfForecastsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1132,10 +958,7 @@ export const serializeAws_json1_1ResumeResourceCommand = async ( input: ResumeResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.ResumeResource", - }; + const headers: __HeaderBag = sharedHeaders("ResumeResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ResumeResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1145,10 +968,7 @@ export const serializeAws_json1_1StopResourceCommand = async ( input: StopResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.StopResource", - }; + const headers: __HeaderBag = sharedHeaders("StopResource"); let body: any; body = JSON.stringify(serializeAws_json1_1StopResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1158,10 +978,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1171,10 +988,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1184,10 +998,7 @@ export const serializeAws_json1_1UpdateDatasetGroupCommand = async ( input: UpdateDatasetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecast.UpdateDatasetGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDatasetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDatasetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -7478,6 +7289,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonForecast.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-forecastquery/src/protocols/Aws_json1_1.ts b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts index b94e622486185..eeefc6d70add3 100644 --- a/clients/client-forecastquery/src/protocols/Aws_json1_1.ts +++ b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts @@ -37,10 +37,7 @@ export const serializeAws_json1_1QueryForecastCommand = async ( input: QueryForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecastRuntime.QueryForecast", - }; + const headers: __HeaderBag = sharedHeaders("QueryForecast"); let body: any; body = JSON.stringify(serializeAws_json1_1QueryForecastRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -50,10 +47,7 @@ export const serializeAws_json1_1QueryWhatIfForecastCommand = async ( input: QueryWhatIfForecastCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonForecastRuntime.QueryWhatIfForecast", - }; + const headers: __HeaderBag = sharedHeaders("QueryWhatIfForecast"); let body: any; body = JSON.stringify(serializeAws_json1_1QueryWhatIfForecastRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -394,6 +388,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonForecastRuntime.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-frauddetector/src/protocols/Aws_json1_1.ts b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts index e7c5b621228ce..026de96e276ca 100644 --- a/clients/client-frauddetector/src/protocols/Aws_json1_1.ts +++ b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts @@ -387,10 +387,7 @@ export const serializeAws_json1_1BatchCreateVariableCommand = async ( input: BatchCreateVariableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.BatchCreateVariable", - }; + const headers: __HeaderBag = sharedHeaders("BatchCreateVariable"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchCreateVariableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -400,10 +397,7 @@ export const serializeAws_json1_1BatchGetVariableCommand = async ( input: BatchGetVariableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.BatchGetVariable", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetVariable"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetVariableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -413,10 +407,7 @@ export const serializeAws_json1_1CancelBatchImportJobCommand = async ( input: CancelBatchImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.CancelBatchImportJob", - }; + const headers: __HeaderBag = sharedHeaders("CancelBatchImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelBatchImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -426,10 +417,7 @@ export const serializeAws_json1_1CancelBatchPredictionJobCommand = async ( input: CancelBatchPredictionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.CancelBatchPredictionJob", - }; + const headers: __HeaderBag = sharedHeaders("CancelBatchPredictionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelBatchPredictionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -439,10 +427,7 @@ export const serializeAws_json1_1CreateBatchImportJobCommand = async ( input: CreateBatchImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.CreateBatchImportJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateBatchImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBatchImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -452,10 +437,7 @@ export const serializeAws_json1_1CreateBatchPredictionJobCommand = async ( input: CreateBatchPredictionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.CreateBatchPredictionJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateBatchPredictionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBatchPredictionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -465,10 +447,7 @@ export const serializeAws_json1_1CreateDetectorVersionCommand = async ( input: CreateDetectorVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.CreateDetectorVersion", - }; + const headers: __HeaderBag = sharedHeaders("CreateDetectorVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDetectorVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -478,10 +457,7 @@ export const serializeAws_json1_1CreateListCommand = async ( input: CreateListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.CreateList", - }; + const headers: __HeaderBag = sharedHeaders("CreateList"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -491,10 +467,7 @@ export const serializeAws_json1_1CreateModelCommand = async ( input: CreateModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.CreateModel", - }; + const headers: __HeaderBag = sharedHeaders("CreateModel"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -504,10 +477,7 @@ export const serializeAws_json1_1CreateModelVersionCommand = async ( input: CreateModelVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.CreateModelVersion", - }; + const headers: __HeaderBag = sharedHeaders("CreateModelVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateModelVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -517,10 +487,7 @@ export const serializeAws_json1_1CreateRuleCommand = async ( input: CreateRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.CreateRule", - }; + const headers: __HeaderBag = sharedHeaders("CreateRule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -530,10 +497,7 @@ export const serializeAws_json1_1CreateVariableCommand = async ( input: CreateVariableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.CreateVariable", - }; + const headers: __HeaderBag = sharedHeaders("CreateVariable"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateVariableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -543,10 +507,7 @@ export const serializeAws_json1_1DeleteBatchImportJobCommand = async ( input: DeleteBatchImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteBatchImportJob", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBatchImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBatchImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -556,10 +517,7 @@ export const serializeAws_json1_1DeleteBatchPredictionJobCommand = async ( input: DeleteBatchPredictionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteBatchPredictionJob", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBatchPredictionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBatchPredictionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -569,10 +527,7 @@ export const serializeAws_json1_1DeleteDetectorCommand = async ( input: DeleteDetectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteDetector", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDetector"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDetectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -582,10 +537,7 @@ export const serializeAws_json1_1DeleteDetectorVersionCommand = async ( input: DeleteDetectorVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteDetectorVersion", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDetectorVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDetectorVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -595,10 +547,7 @@ export const serializeAws_json1_1DeleteEntityTypeCommand = async ( input: DeleteEntityTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteEntityType", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEntityType"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEntityTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -608,10 +557,7 @@ export const serializeAws_json1_1DeleteEventCommand = async ( input: DeleteEventCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteEvent", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEvent"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEventRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -621,10 +567,7 @@ export const serializeAws_json1_1DeleteEventsByEventTypeCommand = async ( input: DeleteEventsByEventTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteEventsByEventType", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEventsByEventType"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEventsByEventTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -634,10 +577,7 @@ export const serializeAws_json1_1DeleteEventTypeCommand = async ( input: DeleteEventTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteEventType", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEventType"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEventTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -647,10 +587,7 @@ export const serializeAws_json1_1DeleteExternalModelCommand = async ( input: DeleteExternalModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteExternalModel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteExternalModel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteExternalModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -660,10 +597,7 @@ export const serializeAws_json1_1DeleteLabelCommand = async ( input: DeleteLabelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteLabel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLabel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLabelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -673,10 +607,7 @@ export const serializeAws_json1_1DeleteListCommand = async ( input: DeleteListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteList", - }; + const headers: __HeaderBag = sharedHeaders("DeleteList"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -686,10 +617,7 @@ export const serializeAws_json1_1DeleteModelCommand = async ( input: DeleteModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteModel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -699,10 +627,7 @@ export const serializeAws_json1_1DeleteModelVersionCommand = async ( input: DeleteModelVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteModelVersion", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModelVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteModelVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -712,10 +637,7 @@ export const serializeAws_json1_1DeleteOutcomeCommand = async ( input: DeleteOutcomeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteOutcome", - }; + const headers: __HeaderBag = sharedHeaders("DeleteOutcome"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteOutcomeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -725,10 +647,7 @@ export const serializeAws_json1_1DeleteRuleCommand = async ( input: DeleteRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -738,10 +657,7 @@ export const serializeAws_json1_1DeleteVariableCommand = async ( input: DeleteVariableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DeleteVariable", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVariable"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteVariableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -751,10 +667,7 @@ export const serializeAws_json1_1DescribeDetectorCommand = async ( input: DescribeDetectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DescribeDetector", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDetector"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDetectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -764,10 +677,7 @@ export const serializeAws_json1_1DescribeModelVersionsCommand = async ( input: DescribeModelVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.DescribeModelVersions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeModelVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeModelVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -777,10 +687,7 @@ export const serializeAws_json1_1GetBatchImportJobsCommand = async ( input: GetBatchImportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetBatchImportJobs", - }; + const headers: __HeaderBag = sharedHeaders("GetBatchImportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBatchImportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -790,10 +697,7 @@ export const serializeAws_json1_1GetBatchPredictionJobsCommand = async ( input: GetBatchPredictionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetBatchPredictionJobs", - }; + const headers: __HeaderBag = sharedHeaders("GetBatchPredictionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBatchPredictionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -803,10 +707,7 @@ export const serializeAws_json1_1GetDeleteEventsByEventTypeStatusCommand = async input: GetDeleteEventsByEventTypeStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetDeleteEventsByEventTypeStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetDeleteEventsByEventTypeStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeleteEventsByEventTypeStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -816,10 +717,7 @@ export const serializeAws_json1_1GetDetectorsCommand = async ( input: GetDetectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetDetectors", - }; + const headers: __HeaderBag = sharedHeaders("GetDetectors"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDetectorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -829,10 +727,7 @@ export const serializeAws_json1_1GetDetectorVersionCommand = async ( input: GetDetectorVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetDetectorVersion", - }; + const headers: __HeaderBag = sharedHeaders("GetDetectorVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDetectorVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -842,10 +737,7 @@ export const serializeAws_json1_1GetEntityTypesCommand = async ( input: GetEntityTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetEntityTypes", - }; + const headers: __HeaderBag = sharedHeaders("GetEntityTypes"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEntityTypesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -855,10 +747,7 @@ export const serializeAws_json1_1GetEventCommand = async ( input: GetEventCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetEvent", - }; + const headers: __HeaderBag = sharedHeaders("GetEvent"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEventRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -868,10 +757,7 @@ export const serializeAws_json1_1GetEventPredictionCommand = async ( input: GetEventPredictionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetEventPrediction", - }; + const headers: __HeaderBag = sharedHeaders("GetEventPrediction"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEventPredictionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -881,10 +767,7 @@ export const serializeAws_json1_1GetEventPredictionMetadataCommand = async ( input: GetEventPredictionMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetEventPredictionMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetEventPredictionMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEventPredictionMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -894,10 +777,7 @@ export const serializeAws_json1_1GetEventTypesCommand = async ( input: GetEventTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetEventTypes", - }; + const headers: __HeaderBag = sharedHeaders("GetEventTypes"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEventTypesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -907,10 +787,7 @@ export const serializeAws_json1_1GetExternalModelsCommand = async ( input: GetExternalModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetExternalModels", - }; + const headers: __HeaderBag = sharedHeaders("GetExternalModels"); let body: any; body = JSON.stringify(serializeAws_json1_1GetExternalModelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -920,10 +797,7 @@ export const serializeAws_json1_1GetKMSEncryptionKeyCommand = async ( input: GetKMSEncryptionKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetKMSEncryptionKey", - }; + const headers: __HeaderBag = sharedHeaders("GetKMSEncryptionKey"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -932,10 +806,7 @@ export const serializeAws_json1_1GetLabelsCommand = async ( input: GetLabelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetLabels", - }; + const headers: __HeaderBag = sharedHeaders("GetLabels"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLabelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -945,10 +816,7 @@ export const serializeAws_json1_1GetListElementsCommand = async ( input: GetListElementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetListElements", - }; + const headers: __HeaderBag = sharedHeaders("GetListElements"); let body: any; body = JSON.stringify(serializeAws_json1_1GetListElementsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -958,10 +826,7 @@ export const serializeAws_json1_1GetListsMetadataCommand = async ( input: GetListsMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetListsMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetListsMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetListsMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -971,10 +836,7 @@ export const serializeAws_json1_1GetModelsCommand = async ( input: GetModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetModels", - }; + const headers: __HeaderBag = sharedHeaders("GetModels"); let body: any; body = JSON.stringify(serializeAws_json1_1GetModelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -984,10 +846,7 @@ export const serializeAws_json1_1GetModelVersionCommand = async ( input: GetModelVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetModelVersion", - }; + const headers: __HeaderBag = sharedHeaders("GetModelVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1GetModelVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -997,10 +856,7 @@ export const serializeAws_json1_1GetOutcomesCommand = async ( input: GetOutcomesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetOutcomes", - }; + const headers: __HeaderBag = sharedHeaders("GetOutcomes"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOutcomesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1010,10 +866,7 @@ export const serializeAws_json1_1GetRulesCommand = async ( input: GetRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetRules", - }; + const headers: __HeaderBag = sharedHeaders("GetRules"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1023,10 +876,7 @@ export const serializeAws_json1_1GetVariablesCommand = async ( input: GetVariablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.GetVariables", - }; + const headers: __HeaderBag = sharedHeaders("GetVariables"); let body: any; body = JSON.stringify(serializeAws_json1_1GetVariablesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1036,10 +886,7 @@ export const serializeAws_json1_1ListEventPredictionsCommand = async ( input: ListEventPredictionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.ListEventPredictions", - }; + const headers: __HeaderBag = sharedHeaders("ListEventPredictions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEventPredictionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1049,10 +896,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1062,10 +906,7 @@ export const serializeAws_json1_1PutDetectorCommand = async ( input: PutDetectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.PutDetector", - }; + const headers: __HeaderBag = sharedHeaders("PutDetector"); let body: any; body = JSON.stringify(serializeAws_json1_1PutDetectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1075,10 +916,7 @@ export const serializeAws_json1_1PutEntityTypeCommand = async ( input: PutEntityTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.PutEntityType", - }; + const headers: __HeaderBag = sharedHeaders("PutEntityType"); let body: any; body = JSON.stringify(serializeAws_json1_1PutEntityTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1088,10 +926,7 @@ export const serializeAws_json1_1PutEventTypeCommand = async ( input: PutEventTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.PutEventType", - }; + const headers: __HeaderBag = sharedHeaders("PutEventType"); let body: any; body = JSON.stringify(serializeAws_json1_1PutEventTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1101,10 +936,7 @@ export const serializeAws_json1_1PutExternalModelCommand = async ( input: PutExternalModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.PutExternalModel", - }; + const headers: __HeaderBag = sharedHeaders("PutExternalModel"); let body: any; body = JSON.stringify(serializeAws_json1_1PutExternalModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1114,10 +946,7 @@ export const serializeAws_json1_1PutKMSEncryptionKeyCommand = async ( input: PutKMSEncryptionKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.PutKMSEncryptionKey", - }; + const headers: __HeaderBag = sharedHeaders("PutKMSEncryptionKey"); let body: any; body = JSON.stringify(serializeAws_json1_1PutKMSEncryptionKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1127,10 +956,7 @@ export const serializeAws_json1_1PutLabelCommand = async ( input: PutLabelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.PutLabel", - }; + const headers: __HeaderBag = sharedHeaders("PutLabel"); let body: any; body = JSON.stringify(serializeAws_json1_1PutLabelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1140,10 +966,7 @@ export const serializeAws_json1_1PutOutcomeCommand = async ( input: PutOutcomeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.PutOutcome", - }; + const headers: __HeaderBag = sharedHeaders("PutOutcome"); let body: any; body = JSON.stringify(serializeAws_json1_1PutOutcomeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1153,10 +976,7 @@ export const serializeAws_json1_1SendEventCommand = async ( input: SendEventCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.SendEvent", - }; + const headers: __HeaderBag = sharedHeaders("SendEvent"); let body: any; body = JSON.stringify(serializeAws_json1_1SendEventRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1166,10 +986,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1179,10 +996,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1192,10 +1006,7 @@ export const serializeAws_json1_1UpdateDetectorVersionCommand = async ( input: UpdateDetectorVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateDetectorVersion", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDetectorVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDetectorVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1205,10 +1016,7 @@ export const serializeAws_json1_1UpdateDetectorVersionMetadataCommand = async ( input: UpdateDetectorVersionMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateDetectorVersionMetadata", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDetectorVersionMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDetectorVersionMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1218,10 +1026,7 @@ export const serializeAws_json1_1UpdateDetectorVersionStatusCommand = async ( input: UpdateDetectorVersionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateDetectorVersionStatus", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDetectorVersionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDetectorVersionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1231,10 +1036,7 @@ export const serializeAws_json1_1UpdateEventLabelCommand = async ( input: UpdateEventLabelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateEventLabel", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEventLabel"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEventLabelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1244,10 +1046,7 @@ export const serializeAws_json1_1UpdateListCommand = async ( input: UpdateListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateList", - }; + const headers: __HeaderBag = sharedHeaders("UpdateList"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1257,10 +1056,7 @@ export const serializeAws_json1_1UpdateModelCommand = async ( input: UpdateModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateModel", - }; + const headers: __HeaderBag = sharedHeaders("UpdateModel"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1270,10 +1066,7 @@ export const serializeAws_json1_1UpdateModelVersionCommand = async ( input: UpdateModelVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateModelVersion", - }; + const headers: __HeaderBag = sharedHeaders("UpdateModelVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateModelVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1283,10 +1076,7 @@ export const serializeAws_json1_1UpdateModelVersionStatusCommand = async ( input: UpdateModelVersionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateModelVersionStatus", - }; + const headers: __HeaderBag = sharedHeaders("UpdateModelVersionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateModelVersionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1296,10 +1086,7 @@ export const serializeAws_json1_1UpdateRuleMetadataCommand = async ( input: UpdateRuleMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateRuleMetadata", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRuleMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRuleMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1309,10 +1096,7 @@ export const serializeAws_json1_1UpdateRuleVersionCommand = async ( input: UpdateRuleVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateRuleVersion", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRuleVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRuleVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1322,10 +1106,7 @@ export const serializeAws_json1_1UpdateVariableCommand = async ( input: UpdateVariableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHawksNestServiceFacade.UpdateVariable", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVariable"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateVariableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -8331,6 +8112,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSHawksNestServiceFacade.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-fsx/src/protocols/Aws_json1_1.ts b/clients/client-fsx/src/protocols/Aws_json1_1.ts index 8b96a97f22008..ad358db3bdd2c 100644 --- a/clients/client-fsx/src/protocols/Aws_json1_1.ts +++ b/clients/client-fsx/src/protocols/Aws_json1_1.ts @@ -338,10 +338,7 @@ export const serializeAws_json1_1AssociateFileSystemAliasesCommand = async ( input: AssociateFileSystemAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.AssociateFileSystemAliases", - }; + const headers: __HeaderBag = sharedHeaders("AssociateFileSystemAliases"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateFileSystemAliasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -351,10 +348,7 @@ export const serializeAws_json1_1CancelDataRepositoryTaskCommand = async ( input: CancelDataRepositoryTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CancelDataRepositoryTask", - }; + const headers: __HeaderBag = sharedHeaders("CancelDataRepositoryTask"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelDataRepositoryTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -364,10 +358,7 @@ export const serializeAws_json1_1CopyBackupCommand = async ( input: CopyBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CopyBackup", - }; + const headers: __HeaderBag = sharedHeaders("CopyBackup"); let body: any; body = JSON.stringify(serializeAws_json1_1CopyBackupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -377,10 +368,7 @@ export const serializeAws_json1_1CreateBackupCommand = async ( input: CreateBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CreateBackup", - }; + const headers: __HeaderBag = sharedHeaders("CreateBackup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBackupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -390,10 +378,7 @@ export const serializeAws_json1_1CreateDataRepositoryAssociationCommand = async input: CreateDataRepositoryAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CreateDataRepositoryAssociation", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataRepositoryAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDataRepositoryAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -403,10 +388,7 @@ export const serializeAws_json1_1CreateDataRepositoryTaskCommand = async ( input: CreateDataRepositoryTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CreateDataRepositoryTask", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataRepositoryTask"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDataRepositoryTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -416,10 +398,7 @@ export const serializeAws_json1_1CreateFileCacheCommand = async ( input: CreateFileCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CreateFileCache", - }; + const headers: __HeaderBag = sharedHeaders("CreateFileCache"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFileCacheRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -429,10 +408,7 @@ export const serializeAws_json1_1CreateFileSystemCommand = async ( input: CreateFileSystemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CreateFileSystem", - }; + const headers: __HeaderBag = sharedHeaders("CreateFileSystem"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFileSystemRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -442,10 +418,7 @@ export const serializeAws_json1_1CreateFileSystemFromBackupCommand = async ( input: CreateFileSystemFromBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CreateFileSystemFromBackup", - }; + const headers: __HeaderBag = sharedHeaders("CreateFileSystemFromBackup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFileSystemFromBackupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -455,10 +428,7 @@ export const serializeAws_json1_1CreateSnapshotCommand = async ( input: CreateSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CreateSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -468,10 +438,7 @@ export const serializeAws_json1_1CreateStorageVirtualMachineCommand = async ( input: CreateStorageVirtualMachineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CreateStorageVirtualMachine", - }; + const headers: __HeaderBag = sharedHeaders("CreateStorageVirtualMachine"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStorageVirtualMachineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -481,10 +448,7 @@ export const serializeAws_json1_1CreateVolumeCommand = async ( input: CreateVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CreateVolume", - }; + const headers: __HeaderBag = sharedHeaders("CreateVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateVolumeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -494,10 +458,7 @@ export const serializeAws_json1_1CreateVolumeFromBackupCommand = async ( input: CreateVolumeFromBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.CreateVolumeFromBackup", - }; + const headers: __HeaderBag = sharedHeaders("CreateVolumeFromBackup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateVolumeFromBackupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -507,10 +468,7 @@ export const serializeAws_json1_1DeleteBackupCommand = async ( input: DeleteBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DeleteBackup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBackup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBackupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -520,10 +478,7 @@ export const serializeAws_json1_1DeleteDataRepositoryAssociationCommand = async input: DeleteDataRepositoryAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DeleteDataRepositoryAssociation", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataRepositoryAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDataRepositoryAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -533,10 +488,7 @@ export const serializeAws_json1_1DeleteFileCacheCommand = async ( input: DeleteFileCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DeleteFileCache", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFileCache"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFileCacheRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -546,10 +498,7 @@ export const serializeAws_json1_1DeleteFileSystemCommand = async ( input: DeleteFileSystemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DeleteFileSystem", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFileSystem"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFileSystemRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -559,10 +508,7 @@ export const serializeAws_json1_1DeleteSnapshotCommand = async ( input: DeleteSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DeleteSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -572,10 +518,7 @@ export const serializeAws_json1_1DeleteStorageVirtualMachineCommand = async ( input: DeleteStorageVirtualMachineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DeleteStorageVirtualMachine", - }; + const headers: __HeaderBag = sharedHeaders("DeleteStorageVirtualMachine"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteStorageVirtualMachineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -585,10 +528,7 @@ export const serializeAws_json1_1DeleteVolumeCommand = async ( input: DeleteVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DeleteVolume", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteVolumeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -598,10 +538,7 @@ export const serializeAws_json1_1DescribeBackupsCommand = async ( input: DescribeBackupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DescribeBackups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBackups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBackupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -611,10 +548,7 @@ export const serializeAws_json1_1DescribeDataRepositoryAssociationsCommand = asy input: DescribeDataRepositoryAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DescribeDataRepositoryAssociations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataRepositoryAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDataRepositoryAssociationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -624,10 +558,7 @@ export const serializeAws_json1_1DescribeDataRepositoryTasksCommand = async ( input: DescribeDataRepositoryTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DescribeDataRepositoryTasks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataRepositoryTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDataRepositoryTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -637,10 +568,7 @@ export const serializeAws_json1_1DescribeFileCachesCommand = async ( input: DescribeFileCachesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DescribeFileCaches", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFileCaches"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFileCachesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -650,10 +578,7 @@ export const serializeAws_json1_1DescribeFileSystemAliasesCommand = async ( input: DescribeFileSystemAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DescribeFileSystemAliases", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFileSystemAliases"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFileSystemAliasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -663,10 +588,7 @@ export const serializeAws_json1_1DescribeFileSystemsCommand = async ( input: DescribeFileSystemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DescribeFileSystems", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFileSystems"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFileSystemsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -676,10 +598,7 @@ export const serializeAws_json1_1DescribeSnapshotsCommand = async ( input: DescribeSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DescribeSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -689,10 +608,7 @@ export const serializeAws_json1_1DescribeStorageVirtualMachinesCommand = async ( input: DescribeStorageVirtualMachinesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DescribeStorageVirtualMachines", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStorageVirtualMachines"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStorageVirtualMachinesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -702,10 +618,7 @@ export const serializeAws_json1_1DescribeVolumesCommand = async ( input: DescribeVolumesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DescribeVolumes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeVolumes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeVolumesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -715,10 +628,7 @@ export const serializeAws_json1_1DisassociateFileSystemAliasesCommand = async ( input: DisassociateFileSystemAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.DisassociateFileSystemAliases", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateFileSystemAliases"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateFileSystemAliasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -728,10 +638,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -741,10 +648,7 @@ export const serializeAws_json1_1ReleaseFileSystemNfsV3LocksCommand = async ( input: ReleaseFileSystemNfsV3LocksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.ReleaseFileSystemNfsV3Locks", - }; + const headers: __HeaderBag = sharedHeaders("ReleaseFileSystemNfsV3Locks"); let body: any; body = JSON.stringify(serializeAws_json1_1ReleaseFileSystemNfsV3LocksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -754,10 +658,7 @@ export const serializeAws_json1_1RestoreVolumeFromSnapshotCommand = async ( input: RestoreVolumeFromSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.RestoreVolumeFromSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("RestoreVolumeFromSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreVolumeFromSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -767,10 +668,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -780,10 +678,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -793,10 +688,7 @@ export const serializeAws_json1_1UpdateDataRepositoryAssociationCommand = async input: UpdateDataRepositoryAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.UpdateDataRepositoryAssociation", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDataRepositoryAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDataRepositoryAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -806,10 +698,7 @@ export const serializeAws_json1_1UpdateFileCacheCommand = async ( input: UpdateFileCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.UpdateFileCache", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFileCache"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFileCacheRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -819,10 +708,7 @@ export const serializeAws_json1_1UpdateFileSystemCommand = async ( input: UpdateFileSystemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.UpdateFileSystem", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFileSystem"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFileSystemRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -832,10 +718,7 @@ export const serializeAws_json1_1UpdateSnapshotCommand = async ( input: UpdateSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.UpdateSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -845,10 +728,7 @@ export const serializeAws_json1_1UpdateStorageVirtualMachineCommand = async ( input: UpdateStorageVirtualMachineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.UpdateStorageVirtualMachine", - }; + const headers: __HeaderBag = sharedHeaders("UpdateStorageVirtualMachine"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateStorageVirtualMachineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -858,10 +738,7 @@ export const serializeAws_json1_1UpdateVolumeCommand = async ( input: UpdateVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSimbaAPIService_v20180301.UpdateVolume", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateVolumeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6996,6 +6873,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSSimbaAPIService_v20180301.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-gamelift/src/protocols/Aws_json1_1.ts b/clients/client-gamelift/src/protocols/Aws_json1_1.ts index f3629f08af36a..a001c15e72e11 100644 --- a/clients/client-gamelift/src/protocols/Aws_json1_1.ts +++ b/clients/client-gamelift/src/protocols/Aws_json1_1.ts @@ -589,10 +589,7 @@ export const serializeAws_json1_1AcceptMatchCommand = async ( input: AcceptMatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.AcceptMatch", - }; + const headers: __HeaderBag = sharedHeaders("AcceptMatch"); let body: any; body = JSON.stringify(serializeAws_json1_1AcceptMatchInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -602,10 +599,7 @@ export const serializeAws_json1_1ClaimGameServerCommand = async ( input: ClaimGameServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ClaimGameServer", - }; + const headers: __HeaderBag = sharedHeaders("ClaimGameServer"); let body: any; body = JSON.stringify(serializeAws_json1_1ClaimGameServerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -615,10 +609,7 @@ export const serializeAws_json1_1CreateAliasCommand = async ( input: CreateAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateAlias", - }; + const headers: __HeaderBag = sharedHeaders("CreateAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAliasInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -628,10 +619,7 @@ export const serializeAws_json1_1CreateBuildCommand = async ( input: CreateBuildCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateBuild", - }; + const headers: __HeaderBag = sharedHeaders("CreateBuild"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBuildInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -641,10 +629,7 @@ export const serializeAws_json1_1CreateFleetCommand = async ( input: CreateFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateFleet", - }; + const headers: __HeaderBag = sharedHeaders("CreateFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFleetInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -654,10 +639,7 @@ export const serializeAws_json1_1CreateFleetLocationsCommand = async ( input: CreateFleetLocationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateFleetLocations", - }; + const headers: __HeaderBag = sharedHeaders("CreateFleetLocations"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFleetLocationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -667,10 +649,7 @@ export const serializeAws_json1_1CreateGameServerGroupCommand = async ( input: CreateGameServerGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateGameServerGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateGameServerGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGameServerGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -680,10 +659,7 @@ export const serializeAws_json1_1CreateGameSessionCommand = async ( input: CreateGameSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateGameSession", - }; + const headers: __HeaderBag = sharedHeaders("CreateGameSession"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGameSessionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -693,10 +669,7 @@ export const serializeAws_json1_1CreateGameSessionQueueCommand = async ( input: CreateGameSessionQueueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateGameSessionQueue", - }; + const headers: __HeaderBag = sharedHeaders("CreateGameSessionQueue"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGameSessionQueueInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -706,10 +679,7 @@ export const serializeAws_json1_1CreateLocationCommand = async ( input: CreateLocationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateLocation", - }; + const headers: __HeaderBag = sharedHeaders("CreateLocation"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLocationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -719,10 +689,7 @@ export const serializeAws_json1_1CreateMatchmakingConfigurationCommand = async ( input: CreateMatchmakingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateMatchmakingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("CreateMatchmakingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMatchmakingConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -732,10 +699,7 @@ export const serializeAws_json1_1CreateMatchmakingRuleSetCommand = async ( input: CreateMatchmakingRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateMatchmakingRuleSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateMatchmakingRuleSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMatchmakingRuleSetInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -745,10 +709,7 @@ export const serializeAws_json1_1CreatePlayerSessionCommand = async ( input: CreatePlayerSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreatePlayerSession", - }; + const headers: __HeaderBag = sharedHeaders("CreatePlayerSession"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePlayerSessionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -758,10 +719,7 @@ export const serializeAws_json1_1CreatePlayerSessionsCommand = async ( input: CreatePlayerSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreatePlayerSessions", - }; + const headers: __HeaderBag = sharedHeaders("CreatePlayerSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePlayerSessionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -771,10 +729,7 @@ export const serializeAws_json1_1CreateScriptCommand = async ( input: CreateScriptCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateScript", - }; + const headers: __HeaderBag = sharedHeaders("CreateScript"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateScriptInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -784,10 +739,7 @@ export const serializeAws_json1_1CreateVpcPeeringAuthorizationCommand = async ( input: CreateVpcPeeringAuthorizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateVpcPeeringAuthorization", - }; + const headers: __HeaderBag = sharedHeaders("CreateVpcPeeringAuthorization"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateVpcPeeringAuthorizationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -797,10 +749,7 @@ export const serializeAws_json1_1CreateVpcPeeringConnectionCommand = async ( input: CreateVpcPeeringConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.CreateVpcPeeringConnection", - }; + const headers: __HeaderBag = sharedHeaders("CreateVpcPeeringConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateVpcPeeringConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -810,10 +759,7 @@ export const serializeAws_json1_1DeleteAliasCommand = async ( input: DeleteAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteAlias", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAliasInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -823,10 +769,7 @@ export const serializeAws_json1_1DeleteBuildCommand = async ( input: DeleteBuildCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteBuild", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBuild"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBuildInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -836,10 +779,7 @@ export const serializeAws_json1_1DeleteFleetCommand = async ( input: DeleteFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteFleet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFleetInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -849,10 +789,7 @@ export const serializeAws_json1_1DeleteFleetLocationsCommand = async ( input: DeleteFleetLocationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteFleetLocations", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFleetLocations"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFleetLocationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -862,10 +799,7 @@ export const serializeAws_json1_1DeleteGameServerGroupCommand = async ( input: DeleteGameServerGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteGameServerGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGameServerGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGameServerGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -875,10 +809,7 @@ export const serializeAws_json1_1DeleteGameSessionQueueCommand = async ( input: DeleteGameSessionQueueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteGameSessionQueue", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGameSessionQueue"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGameSessionQueueInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -888,10 +819,7 @@ export const serializeAws_json1_1DeleteLocationCommand = async ( input: DeleteLocationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteLocation", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLocation"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLocationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -901,10 +829,7 @@ export const serializeAws_json1_1DeleteMatchmakingConfigurationCommand = async ( input: DeleteMatchmakingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteMatchmakingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMatchmakingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMatchmakingConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -914,10 +839,7 @@ export const serializeAws_json1_1DeleteMatchmakingRuleSetCommand = async ( input: DeleteMatchmakingRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteMatchmakingRuleSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMatchmakingRuleSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMatchmakingRuleSetInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -927,10 +849,7 @@ export const serializeAws_json1_1DeleteScalingPolicyCommand = async ( input: DeleteScalingPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteScalingPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteScalingPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteScalingPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -940,10 +859,7 @@ export const serializeAws_json1_1DeleteScriptCommand = async ( input: DeleteScriptCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteScript", - }; + const headers: __HeaderBag = sharedHeaders("DeleteScript"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteScriptInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -953,10 +869,7 @@ export const serializeAws_json1_1DeleteVpcPeeringAuthorizationCommand = async ( input: DeleteVpcPeeringAuthorizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteVpcPeeringAuthorization", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVpcPeeringAuthorization"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteVpcPeeringAuthorizationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -966,10 +879,7 @@ export const serializeAws_json1_1DeleteVpcPeeringConnectionCommand = async ( input: DeleteVpcPeeringConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeleteVpcPeeringConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVpcPeeringConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteVpcPeeringConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -979,10 +889,7 @@ export const serializeAws_json1_1DeregisterComputeCommand = async ( input: DeregisterComputeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeregisterCompute", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterCompute"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterComputeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -992,10 +899,7 @@ export const serializeAws_json1_1DeregisterGameServerCommand = async ( input: DeregisterGameServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DeregisterGameServer", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterGameServer"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterGameServerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1005,10 +909,7 @@ export const serializeAws_json1_1DescribeAliasCommand = async ( input: DescribeAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeAlias", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAliasInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1018,10 +919,7 @@ export const serializeAws_json1_1DescribeBuildCommand = async ( input: DescribeBuildCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeBuild", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBuild"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBuildInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1031,10 +929,7 @@ export const serializeAws_json1_1DescribeComputeCommand = async ( input: DescribeComputeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeCompute", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCompute"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeComputeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1044,10 +939,7 @@ export const serializeAws_json1_1DescribeEC2InstanceLimitsCommand = async ( input: DescribeEC2InstanceLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeEC2InstanceLimits", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEC2InstanceLimits"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEC2InstanceLimitsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1057,10 +949,7 @@ export const serializeAws_json1_1DescribeFleetAttributesCommand = async ( input: DescribeFleetAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeFleetAttributes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetAttributesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1070,10 +959,7 @@ export const serializeAws_json1_1DescribeFleetCapacityCommand = async ( input: DescribeFleetCapacityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeFleetCapacity", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetCapacity"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetCapacityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1083,10 +969,7 @@ export const serializeAws_json1_1DescribeFleetEventsCommand = async ( input: DescribeFleetEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeFleetEvents", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetEventsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1096,10 +979,7 @@ export const serializeAws_json1_1DescribeFleetLocationAttributesCommand = async input: DescribeFleetLocationAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeFleetLocationAttributes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetLocationAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetLocationAttributesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1109,10 +989,7 @@ export const serializeAws_json1_1DescribeFleetLocationCapacityCommand = async ( input: DescribeFleetLocationCapacityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeFleetLocationCapacity", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetLocationCapacity"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetLocationCapacityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1122,10 +999,7 @@ export const serializeAws_json1_1DescribeFleetLocationUtilizationCommand = async input: DescribeFleetLocationUtilizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeFleetLocationUtilization", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetLocationUtilization"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetLocationUtilizationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1135,10 +1009,7 @@ export const serializeAws_json1_1DescribeFleetPortSettingsCommand = async ( input: DescribeFleetPortSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeFleetPortSettings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetPortSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetPortSettingsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1148,10 +1019,7 @@ export const serializeAws_json1_1DescribeFleetUtilizationCommand = async ( input: DescribeFleetUtilizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeFleetUtilization", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFleetUtilization"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFleetUtilizationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1161,10 +1029,7 @@ export const serializeAws_json1_1DescribeGameServerCommand = async ( input: DescribeGameServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeGameServer", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGameServer"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGameServerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1174,10 +1039,7 @@ export const serializeAws_json1_1DescribeGameServerGroupCommand = async ( input: DescribeGameServerGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeGameServerGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGameServerGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGameServerGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1187,10 +1049,7 @@ export const serializeAws_json1_1DescribeGameServerInstancesCommand = async ( input: DescribeGameServerInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeGameServerInstances", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGameServerInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGameServerInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1200,10 +1059,7 @@ export const serializeAws_json1_1DescribeGameSessionDetailsCommand = async ( input: DescribeGameSessionDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeGameSessionDetails", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGameSessionDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGameSessionDetailsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1213,10 +1069,7 @@ export const serializeAws_json1_1DescribeGameSessionPlacementCommand = async ( input: DescribeGameSessionPlacementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeGameSessionPlacement", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGameSessionPlacement"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGameSessionPlacementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1226,10 +1079,7 @@ export const serializeAws_json1_1DescribeGameSessionQueuesCommand = async ( input: DescribeGameSessionQueuesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeGameSessionQueues", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGameSessionQueues"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGameSessionQueuesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1239,10 +1089,7 @@ export const serializeAws_json1_1DescribeGameSessionsCommand = async ( input: DescribeGameSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeGameSessions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGameSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGameSessionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1252,10 +1099,7 @@ export const serializeAws_json1_1DescribeInstancesCommand = async ( input: DescribeInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeInstances", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1265,10 +1109,7 @@ export const serializeAws_json1_1DescribeMatchmakingCommand = async ( input: DescribeMatchmakingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeMatchmaking", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMatchmaking"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMatchmakingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1278,10 +1119,7 @@ export const serializeAws_json1_1DescribeMatchmakingConfigurationsCommand = asyn input: DescribeMatchmakingConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeMatchmakingConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMatchmakingConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMatchmakingConfigurationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1291,10 +1129,7 @@ export const serializeAws_json1_1DescribeMatchmakingRuleSetsCommand = async ( input: DescribeMatchmakingRuleSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeMatchmakingRuleSets", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMatchmakingRuleSets"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMatchmakingRuleSetsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1304,10 +1139,7 @@ export const serializeAws_json1_1DescribePlayerSessionsCommand = async ( input: DescribePlayerSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribePlayerSessions", - }; + const headers: __HeaderBag = sharedHeaders("DescribePlayerSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePlayerSessionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1317,10 +1149,7 @@ export const serializeAws_json1_1DescribeRuntimeConfigurationCommand = async ( input: DescribeRuntimeConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeRuntimeConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRuntimeConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRuntimeConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1330,10 +1159,7 @@ export const serializeAws_json1_1DescribeScalingPoliciesCommand = async ( input: DescribeScalingPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeScalingPolicies", - }; + const headers: __HeaderBag = sharedHeaders("DescribeScalingPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeScalingPoliciesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1343,10 +1169,7 @@ export const serializeAws_json1_1DescribeScriptCommand = async ( input: DescribeScriptCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeScript", - }; + const headers: __HeaderBag = sharedHeaders("DescribeScript"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeScriptInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1356,10 +1179,7 @@ export const serializeAws_json1_1DescribeVpcPeeringAuthorizationsCommand = async input: DescribeVpcPeeringAuthorizationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeVpcPeeringAuthorizations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeVpcPeeringAuthorizations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeVpcPeeringAuthorizationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1369,10 +1189,7 @@ export const serializeAws_json1_1DescribeVpcPeeringConnectionsCommand = async ( input: DescribeVpcPeeringConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.DescribeVpcPeeringConnections", - }; + const headers: __HeaderBag = sharedHeaders("DescribeVpcPeeringConnections"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeVpcPeeringConnectionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1382,10 +1199,7 @@ export const serializeAws_json1_1GetComputeAccessCommand = async ( input: GetComputeAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.GetComputeAccess", - }; + const headers: __HeaderBag = sharedHeaders("GetComputeAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1GetComputeAccessInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1395,10 +1209,7 @@ export const serializeAws_json1_1GetComputeAuthTokenCommand = async ( input: GetComputeAuthTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.GetComputeAuthToken", - }; + const headers: __HeaderBag = sharedHeaders("GetComputeAuthToken"); let body: any; body = JSON.stringify(serializeAws_json1_1GetComputeAuthTokenInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1408,10 +1219,7 @@ export const serializeAws_json1_1GetGameSessionLogUrlCommand = async ( input: GetGameSessionLogUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.GetGameSessionLogUrl", - }; + const headers: __HeaderBag = sharedHeaders("GetGameSessionLogUrl"); let body: any; body = JSON.stringify(serializeAws_json1_1GetGameSessionLogUrlInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1421,10 +1229,7 @@ export const serializeAws_json1_1GetInstanceAccessCommand = async ( input: GetInstanceAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.GetInstanceAccess", - }; + const headers: __HeaderBag = sharedHeaders("GetInstanceAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstanceAccessInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1434,10 +1239,7 @@ export const serializeAws_json1_1ListAliasesCommand = async ( input: ListAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ListAliases", - }; + const headers: __HeaderBag = sharedHeaders("ListAliases"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAliasesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1447,10 +1249,7 @@ export const serializeAws_json1_1ListBuildsCommand = async ( input: ListBuildsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ListBuilds", - }; + const headers: __HeaderBag = sharedHeaders("ListBuilds"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBuildsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1460,10 +1259,7 @@ export const serializeAws_json1_1ListComputeCommand = async ( input: ListComputeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ListCompute", - }; + const headers: __HeaderBag = sharedHeaders("ListCompute"); let body: any; body = JSON.stringify(serializeAws_json1_1ListComputeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1473,10 +1269,7 @@ export const serializeAws_json1_1ListFleetsCommand = async ( input: ListFleetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ListFleets", - }; + const headers: __HeaderBag = sharedHeaders("ListFleets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFleetsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1486,10 +1279,7 @@ export const serializeAws_json1_1ListGameServerGroupsCommand = async ( input: ListGameServerGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ListGameServerGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListGameServerGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGameServerGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1499,10 +1289,7 @@ export const serializeAws_json1_1ListGameServersCommand = async ( input: ListGameServersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ListGameServers", - }; + const headers: __HeaderBag = sharedHeaders("ListGameServers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGameServersInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1512,10 +1299,7 @@ export const serializeAws_json1_1ListLocationsCommand = async ( input: ListLocationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ListLocations", - }; + const headers: __HeaderBag = sharedHeaders("ListLocations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLocationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1525,10 +1309,7 @@ export const serializeAws_json1_1ListScriptsCommand = async ( input: ListScriptsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ListScripts", - }; + const headers: __HeaderBag = sharedHeaders("ListScripts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListScriptsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1538,10 +1319,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1551,10 +1329,7 @@ export const serializeAws_json1_1PutScalingPolicyCommand = async ( input: PutScalingPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.PutScalingPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutScalingPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutScalingPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1564,10 +1339,7 @@ export const serializeAws_json1_1RegisterComputeCommand = async ( input: RegisterComputeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.RegisterCompute", - }; + const headers: __HeaderBag = sharedHeaders("RegisterCompute"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterComputeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1577,10 +1349,7 @@ export const serializeAws_json1_1RegisterGameServerCommand = async ( input: RegisterGameServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.RegisterGameServer", - }; + const headers: __HeaderBag = sharedHeaders("RegisterGameServer"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterGameServerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1590,10 +1359,7 @@ export const serializeAws_json1_1RequestUploadCredentialsCommand = async ( input: RequestUploadCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.RequestUploadCredentials", - }; + const headers: __HeaderBag = sharedHeaders("RequestUploadCredentials"); let body: any; body = JSON.stringify(serializeAws_json1_1RequestUploadCredentialsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1603,10 +1369,7 @@ export const serializeAws_json1_1ResolveAliasCommand = async ( input: ResolveAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ResolveAlias", - }; + const headers: __HeaderBag = sharedHeaders("ResolveAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1ResolveAliasInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1616,10 +1379,7 @@ export const serializeAws_json1_1ResumeGameServerGroupCommand = async ( input: ResumeGameServerGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ResumeGameServerGroup", - }; + const headers: __HeaderBag = sharedHeaders("ResumeGameServerGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1ResumeGameServerGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1629,10 +1389,7 @@ export const serializeAws_json1_1SearchGameSessionsCommand = async ( input: SearchGameSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.SearchGameSessions", - }; + const headers: __HeaderBag = sharedHeaders("SearchGameSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchGameSessionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1642,10 +1399,7 @@ export const serializeAws_json1_1StartFleetActionsCommand = async ( input: StartFleetActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.StartFleetActions", - }; + const headers: __HeaderBag = sharedHeaders("StartFleetActions"); let body: any; body = JSON.stringify(serializeAws_json1_1StartFleetActionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1655,10 +1409,7 @@ export const serializeAws_json1_1StartGameSessionPlacementCommand = async ( input: StartGameSessionPlacementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.StartGameSessionPlacement", - }; + const headers: __HeaderBag = sharedHeaders("StartGameSessionPlacement"); let body: any; body = JSON.stringify(serializeAws_json1_1StartGameSessionPlacementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1668,10 +1419,7 @@ export const serializeAws_json1_1StartMatchBackfillCommand = async ( input: StartMatchBackfillCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.StartMatchBackfill", - }; + const headers: __HeaderBag = sharedHeaders("StartMatchBackfill"); let body: any; body = JSON.stringify(serializeAws_json1_1StartMatchBackfillInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1681,10 +1429,7 @@ export const serializeAws_json1_1StartMatchmakingCommand = async ( input: StartMatchmakingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.StartMatchmaking", - }; + const headers: __HeaderBag = sharedHeaders("StartMatchmaking"); let body: any; body = JSON.stringify(serializeAws_json1_1StartMatchmakingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1694,10 +1439,7 @@ export const serializeAws_json1_1StopFleetActionsCommand = async ( input: StopFleetActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.StopFleetActions", - }; + const headers: __HeaderBag = sharedHeaders("StopFleetActions"); let body: any; body = JSON.stringify(serializeAws_json1_1StopFleetActionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1707,10 +1449,7 @@ export const serializeAws_json1_1StopGameSessionPlacementCommand = async ( input: StopGameSessionPlacementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.StopGameSessionPlacement", - }; + const headers: __HeaderBag = sharedHeaders("StopGameSessionPlacement"); let body: any; body = JSON.stringify(serializeAws_json1_1StopGameSessionPlacementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1720,10 +1459,7 @@ export const serializeAws_json1_1StopMatchmakingCommand = async ( input: StopMatchmakingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.StopMatchmaking", - }; + const headers: __HeaderBag = sharedHeaders("StopMatchmaking"); let body: any; body = JSON.stringify(serializeAws_json1_1StopMatchmakingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1733,10 +1469,7 @@ export const serializeAws_json1_1SuspendGameServerGroupCommand = async ( input: SuspendGameServerGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.SuspendGameServerGroup", - }; + const headers: __HeaderBag = sharedHeaders("SuspendGameServerGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1SuspendGameServerGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1746,10 +1479,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1759,10 +1489,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1772,10 +1499,7 @@ export const serializeAws_json1_1UpdateAliasCommand = async ( input: UpdateAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateAlias", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAliasInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1785,10 +1509,7 @@ export const serializeAws_json1_1UpdateBuildCommand = async ( input: UpdateBuildCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateBuild", - }; + const headers: __HeaderBag = sharedHeaders("UpdateBuild"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateBuildInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1798,10 +1519,7 @@ export const serializeAws_json1_1UpdateFleetAttributesCommand = async ( input: UpdateFleetAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateFleetAttributes", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFleetAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFleetAttributesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1811,10 +1529,7 @@ export const serializeAws_json1_1UpdateFleetCapacityCommand = async ( input: UpdateFleetCapacityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateFleetCapacity", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFleetCapacity"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFleetCapacityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1824,10 +1539,7 @@ export const serializeAws_json1_1UpdateFleetPortSettingsCommand = async ( input: UpdateFleetPortSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateFleetPortSettings", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFleetPortSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFleetPortSettingsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1837,10 +1549,7 @@ export const serializeAws_json1_1UpdateGameServerCommand = async ( input: UpdateGameServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateGameServer", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGameServer"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGameServerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1850,10 +1559,7 @@ export const serializeAws_json1_1UpdateGameServerGroupCommand = async ( input: UpdateGameServerGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateGameServerGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGameServerGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGameServerGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1863,10 +1569,7 @@ export const serializeAws_json1_1UpdateGameSessionCommand = async ( input: UpdateGameSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateGameSession", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGameSession"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGameSessionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1876,10 +1579,7 @@ export const serializeAws_json1_1UpdateGameSessionQueueCommand = async ( input: UpdateGameSessionQueueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateGameSessionQueue", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGameSessionQueue"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGameSessionQueueInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1889,10 +1589,7 @@ export const serializeAws_json1_1UpdateMatchmakingConfigurationCommand = async ( input: UpdateMatchmakingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateMatchmakingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMatchmakingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMatchmakingConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1902,10 +1599,7 @@ export const serializeAws_json1_1UpdateRuntimeConfigurationCommand = async ( input: UpdateRuntimeConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateRuntimeConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRuntimeConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRuntimeConfigurationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1915,10 +1609,7 @@ export const serializeAws_json1_1UpdateScriptCommand = async ( input: UpdateScriptCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.UpdateScript", - }; + const headers: __HeaderBag = sharedHeaders("UpdateScript"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateScriptInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1928,10 +1619,7 @@ export const serializeAws_json1_1ValidateMatchmakingRuleSetCommand = async ( input: ValidateMatchmakingRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GameLift.ValidateMatchmakingRuleSet", - }; + const headers: __HeaderBag = sharedHeaders("ValidateMatchmakingRuleSet"); let body: any; body = JSON.stringify(serializeAws_json1_1ValidateMatchmakingRuleSetInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -11643,6 +11331,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `GameLift.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts index 82c9dad5118d0..31537e17e353e 100644 --- a/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts +++ b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts @@ -305,10 +305,7 @@ export const serializeAws_json1_1AddCustomRoutingEndpointsCommand = async ( input: AddCustomRoutingEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.AddCustomRoutingEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("AddCustomRoutingEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1AddCustomRoutingEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -318,10 +315,7 @@ export const serializeAws_json1_1AddEndpointsCommand = async ( input: AddEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.AddEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("AddEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1AddEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -331,10 +325,7 @@ export const serializeAws_json1_1AdvertiseByoipCidrCommand = async ( input: AdvertiseByoipCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.AdvertiseByoipCidr", - }; + const headers: __HeaderBag = sharedHeaders("AdvertiseByoipCidr"); let body: any; body = JSON.stringify(serializeAws_json1_1AdvertiseByoipCidrRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -344,10 +335,7 @@ export const serializeAws_json1_1AllowCustomRoutingTrafficCommand = async ( input: AllowCustomRoutingTrafficCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.AllowCustomRoutingTraffic", - }; + const headers: __HeaderBag = sharedHeaders("AllowCustomRoutingTraffic"); let body: any; body = JSON.stringify(serializeAws_json1_1AllowCustomRoutingTrafficRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -357,10 +345,7 @@ export const serializeAws_json1_1CreateAcceleratorCommand = async ( input: CreateAcceleratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.CreateAccelerator", - }; + const headers: __HeaderBag = sharedHeaders("CreateAccelerator"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAcceleratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -370,10 +355,7 @@ export const serializeAws_json1_1CreateCustomRoutingAcceleratorCommand = async ( input: CreateCustomRoutingAcceleratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator", - }; + const headers: __HeaderBag = sharedHeaders("CreateCustomRoutingAccelerator"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCustomRoutingAcceleratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -383,10 +365,7 @@ export const serializeAws_json1_1CreateCustomRoutingEndpointGroupCommand = async input: CreateCustomRoutingEndpointGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateCustomRoutingEndpointGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCustomRoutingEndpointGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -396,10 +375,7 @@ export const serializeAws_json1_1CreateCustomRoutingListenerCommand = async ( input: CreateCustomRoutingListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.CreateCustomRoutingListener", - }; + const headers: __HeaderBag = sharedHeaders("CreateCustomRoutingListener"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCustomRoutingListenerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -409,10 +385,7 @@ export const serializeAws_json1_1CreateEndpointGroupCommand = async ( input: CreateEndpointGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.CreateEndpointGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateEndpointGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEndpointGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -422,10 +395,7 @@ export const serializeAws_json1_1CreateListenerCommand = async ( input: CreateListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.CreateListener", - }; + const headers: __HeaderBag = sharedHeaders("CreateListener"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateListenerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -435,10 +405,7 @@ export const serializeAws_json1_1DeleteAcceleratorCommand = async ( input: DeleteAcceleratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DeleteAccelerator", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAccelerator"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAcceleratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -448,10 +415,7 @@ export const serializeAws_json1_1DeleteCustomRoutingAcceleratorCommand = async ( input: DeleteCustomRoutingAcceleratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCustomRoutingAccelerator"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCustomRoutingAcceleratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -461,10 +425,7 @@ export const serializeAws_json1_1DeleteCustomRoutingEndpointGroupCommand = async input: DeleteCustomRoutingEndpointGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCustomRoutingEndpointGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCustomRoutingEndpointGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -474,10 +435,7 @@ export const serializeAws_json1_1DeleteCustomRoutingListenerCommand = async ( input: DeleteCustomRoutingListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DeleteCustomRoutingListener", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCustomRoutingListener"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCustomRoutingListenerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -487,10 +445,7 @@ export const serializeAws_json1_1DeleteEndpointGroupCommand = async ( input: DeleteEndpointGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DeleteEndpointGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEndpointGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEndpointGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -500,10 +455,7 @@ export const serializeAws_json1_1DeleteListenerCommand = async ( input: DeleteListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DeleteListener", - }; + const headers: __HeaderBag = sharedHeaders("DeleteListener"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteListenerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -513,10 +465,7 @@ export const serializeAws_json1_1DenyCustomRoutingTrafficCommand = async ( input: DenyCustomRoutingTrafficCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DenyCustomRoutingTraffic", - }; + const headers: __HeaderBag = sharedHeaders("DenyCustomRoutingTraffic"); let body: any; body = JSON.stringify(serializeAws_json1_1DenyCustomRoutingTrafficRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -526,10 +475,7 @@ export const serializeAws_json1_1DeprovisionByoipCidrCommand = async ( input: DeprovisionByoipCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DeprovisionByoipCidr", - }; + const headers: __HeaderBag = sharedHeaders("DeprovisionByoipCidr"); let body: any; body = JSON.stringify(serializeAws_json1_1DeprovisionByoipCidrRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -539,10 +485,7 @@ export const serializeAws_json1_1DescribeAcceleratorCommand = async ( input: DescribeAcceleratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DescribeAccelerator", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccelerator"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAcceleratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -552,10 +495,7 @@ export const serializeAws_json1_1DescribeAcceleratorAttributesCommand = async ( input: DescribeAcceleratorAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DescribeAcceleratorAttributes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAcceleratorAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAcceleratorAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -565,10 +505,7 @@ export const serializeAws_json1_1DescribeCustomRoutingAcceleratorCommand = async input: DescribeCustomRoutingAcceleratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCustomRoutingAccelerator"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCustomRoutingAcceleratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -578,10 +515,7 @@ export const serializeAws_json1_1DescribeCustomRoutingAcceleratorAttributesComma input: DescribeCustomRoutingAcceleratorAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCustomRoutingAcceleratorAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCustomRoutingAcceleratorAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -591,10 +525,7 @@ export const serializeAws_json1_1DescribeCustomRoutingEndpointGroupCommand = asy input: DescribeCustomRoutingEndpointGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCustomRoutingEndpointGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCustomRoutingEndpointGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -604,10 +535,7 @@ export const serializeAws_json1_1DescribeCustomRoutingListenerCommand = async ( input: DescribeCustomRoutingListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DescribeCustomRoutingListener", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCustomRoutingListener"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCustomRoutingListenerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -617,10 +545,7 @@ export const serializeAws_json1_1DescribeEndpointGroupCommand = async ( input: DescribeEndpointGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DescribeEndpointGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpointGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEndpointGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -630,10 +555,7 @@ export const serializeAws_json1_1DescribeListenerCommand = async ( input: DescribeListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.DescribeListener", - }; + const headers: __HeaderBag = sharedHeaders("DescribeListener"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeListenerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -643,10 +565,7 @@ export const serializeAws_json1_1ListAcceleratorsCommand = async ( input: ListAcceleratorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ListAccelerators", - }; + const headers: __HeaderBag = sharedHeaders("ListAccelerators"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAcceleratorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -656,10 +575,7 @@ export const serializeAws_json1_1ListByoipCidrsCommand = async ( input: ListByoipCidrsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ListByoipCidrs", - }; + const headers: __HeaderBag = sharedHeaders("ListByoipCidrs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListByoipCidrsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -669,10 +585,7 @@ export const serializeAws_json1_1ListCustomRoutingAcceleratorsCommand = async ( input: ListCustomRoutingAcceleratorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ListCustomRoutingAccelerators", - }; + const headers: __HeaderBag = sharedHeaders("ListCustomRoutingAccelerators"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCustomRoutingAcceleratorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -682,10 +595,7 @@ export const serializeAws_json1_1ListCustomRoutingEndpointGroupsCommand = async input: ListCustomRoutingEndpointGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListCustomRoutingEndpointGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCustomRoutingEndpointGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -695,10 +605,7 @@ export const serializeAws_json1_1ListCustomRoutingListenersCommand = async ( input: ListCustomRoutingListenersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ListCustomRoutingListeners", - }; + const headers: __HeaderBag = sharedHeaders("ListCustomRoutingListeners"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCustomRoutingListenersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -708,10 +615,7 @@ export const serializeAws_json1_1ListCustomRoutingPortMappingsCommand = async ( input: ListCustomRoutingPortMappingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ListCustomRoutingPortMappings", - }; + const headers: __HeaderBag = sharedHeaders("ListCustomRoutingPortMappings"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCustomRoutingPortMappingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -721,10 +625,7 @@ export const serializeAws_json1_1ListCustomRoutingPortMappingsByDestinationComma input: ListCustomRoutingPortMappingsByDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination", - }; + const headers: __HeaderBag = sharedHeaders("ListCustomRoutingPortMappingsByDestination"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCustomRoutingPortMappingsByDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -734,10 +635,7 @@ export const serializeAws_json1_1ListEndpointGroupsCommand = async ( input: ListEndpointGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ListEndpointGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListEndpointGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEndpointGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -747,10 +645,7 @@ export const serializeAws_json1_1ListListenersCommand = async ( input: ListListenersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ListListeners", - }; + const headers: __HeaderBag = sharedHeaders("ListListeners"); let body: any; body = JSON.stringify(serializeAws_json1_1ListListenersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -760,10 +655,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -773,10 +665,7 @@ export const serializeAws_json1_1ProvisionByoipCidrCommand = async ( input: ProvisionByoipCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.ProvisionByoipCidr", - }; + const headers: __HeaderBag = sharedHeaders("ProvisionByoipCidr"); let body: any; body = JSON.stringify(serializeAws_json1_1ProvisionByoipCidrRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -786,10 +675,7 @@ export const serializeAws_json1_1RemoveCustomRoutingEndpointsCommand = async ( input: RemoveCustomRoutingEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("RemoveCustomRoutingEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveCustomRoutingEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -799,10 +685,7 @@ export const serializeAws_json1_1RemoveEndpointsCommand = async ( input: RemoveEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.RemoveEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("RemoveEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -812,10 +695,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -825,10 +705,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -838,10 +715,7 @@ export const serializeAws_json1_1UpdateAcceleratorCommand = async ( input: UpdateAcceleratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.UpdateAccelerator", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAccelerator"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAcceleratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -851,10 +725,7 @@ export const serializeAws_json1_1UpdateAcceleratorAttributesCommand = async ( input: UpdateAcceleratorAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.UpdateAcceleratorAttributes", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAcceleratorAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAcceleratorAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -864,10 +735,7 @@ export const serializeAws_json1_1UpdateCustomRoutingAcceleratorCommand = async ( input: UpdateCustomRoutingAcceleratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCustomRoutingAccelerator"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCustomRoutingAcceleratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -877,10 +745,7 @@ export const serializeAws_json1_1UpdateCustomRoutingAcceleratorAttributesCommand input: UpdateCustomRoutingAcceleratorAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCustomRoutingAcceleratorAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCustomRoutingAcceleratorAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -890,10 +755,7 @@ export const serializeAws_json1_1UpdateCustomRoutingListenerCommand = async ( input: UpdateCustomRoutingListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.UpdateCustomRoutingListener", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCustomRoutingListener"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCustomRoutingListenerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -903,10 +765,7 @@ export const serializeAws_json1_1UpdateEndpointGroupCommand = async ( input: UpdateEndpointGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.UpdateEndpointGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEndpointGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEndpointGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -916,10 +775,7 @@ export const serializeAws_json1_1UpdateListenerCommand = async ( input: UpdateListenerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.UpdateListener", - }; + const headers: __HeaderBag = sharedHeaders("UpdateListener"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateListenerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -929,10 +785,7 @@ export const serializeAws_json1_1WithdrawByoipCidrCommand = async ( input: WithdrawByoipCidrCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "GlobalAccelerator_V20180706.WithdrawByoipCidr", - }; + const headers: __HeaderBag = sharedHeaders("WithdrawByoipCidr"); let body: any; body = JSON.stringify(serializeAws_json1_1WithdrawByoipCidrRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5466,6 +5319,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `GlobalAccelerator_V20180706.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-glue/src/protocols/Aws_json1_1.ts b/clients/client-glue/src/protocols/Aws_json1_1.ts index 9517126a0a695..9e5f4567b4efd 100644 --- a/clients/client-glue/src/protocols/Aws_json1_1.ts +++ b/clients/client-glue/src/protocols/Aws_json1_1.ts @@ -1164,10 +1164,7 @@ export const serializeAws_json1_1BatchCreatePartitionCommand = async ( input: BatchCreatePartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchCreatePartition", - }; + const headers: __HeaderBag = sharedHeaders("BatchCreatePartition"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchCreatePartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1177,10 +1174,7 @@ export const serializeAws_json1_1BatchDeleteConnectionCommand = async ( input: BatchDeleteConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchDeleteConnection", - }; + const headers: __HeaderBag = sharedHeaders("BatchDeleteConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDeleteConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1190,10 +1184,7 @@ export const serializeAws_json1_1BatchDeletePartitionCommand = async ( input: BatchDeletePartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchDeletePartition", - }; + const headers: __HeaderBag = sharedHeaders("BatchDeletePartition"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDeletePartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1203,10 +1194,7 @@ export const serializeAws_json1_1BatchDeleteTableCommand = async ( input: BatchDeleteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchDeleteTable", - }; + const headers: __HeaderBag = sharedHeaders("BatchDeleteTable"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDeleteTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1216,10 +1204,7 @@ export const serializeAws_json1_1BatchDeleteTableVersionCommand = async ( input: BatchDeleteTableVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchDeleteTableVersion", - }; + const headers: __HeaderBag = sharedHeaders("BatchDeleteTableVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDeleteTableVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1229,10 +1214,7 @@ export const serializeAws_json1_1BatchGetBlueprintsCommand = async ( input: BatchGetBlueprintsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchGetBlueprints", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetBlueprints"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetBlueprintsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1242,10 +1224,7 @@ export const serializeAws_json1_1BatchGetCrawlersCommand = async ( input: BatchGetCrawlersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchGetCrawlers", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetCrawlers"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetCrawlersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1255,10 +1234,7 @@ export const serializeAws_json1_1BatchGetCustomEntityTypesCommand = async ( input: BatchGetCustomEntityTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchGetCustomEntityTypes", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetCustomEntityTypes"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetCustomEntityTypesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1268,10 +1244,7 @@ export const serializeAws_json1_1BatchGetDataQualityResultCommand = async ( input: BatchGetDataQualityResultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchGetDataQualityResult", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetDataQualityResult"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetDataQualityResultRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1281,10 +1254,7 @@ export const serializeAws_json1_1BatchGetDevEndpointsCommand = async ( input: BatchGetDevEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchGetDevEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetDevEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetDevEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1294,10 +1264,7 @@ export const serializeAws_json1_1BatchGetJobsCommand = async ( input: BatchGetJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchGetJobs", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1307,10 +1274,7 @@ export const serializeAws_json1_1BatchGetPartitionCommand = async ( input: BatchGetPartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchGetPartition", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetPartition"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetPartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1320,10 +1284,7 @@ export const serializeAws_json1_1BatchGetTriggersCommand = async ( input: BatchGetTriggersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchGetTriggers", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetTriggers"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetTriggersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1333,10 +1294,7 @@ export const serializeAws_json1_1BatchGetWorkflowsCommand = async ( input: BatchGetWorkflowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchGetWorkflows", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetWorkflows"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetWorkflowsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1346,10 +1304,7 @@ export const serializeAws_json1_1BatchStopJobRunCommand = async ( input: BatchStopJobRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchStopJobRun", - }; + const headers: __HeaderBag = sharedHeaders("BatchStopJobRun"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchStopJobRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1359,10 +1314,7 @@ export const serializeAws_json1_1BatchUpdatePartitionCommand = async ( input: BatchUpdatePartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.BatchUpdatePartition", - }; + const headers: __HeaderBag = sharedHeaders("BatchUpdatePartition"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchUpdatePartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1372,10 +1324,7 @@ export const serializeAws_json1_1CancelDataQualityRuleRecommendationRunCommand = input: CancelDataQualityRuleRecommendationRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CancelDataQualityRuleRecommendationRun", - }; + const headers: __HeaderBag = sharedHeaders("CancelDataQualityRuleRecommendationRun"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelDataQualityRuleRecommendationRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1385,10 +1334,7 @@ export const serializeAws_json1_1CancelDataQualityRulesetEvaluationRunCommand = input: CancelDataQualityRulesetEvaluationRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CancelDataQualityRulesetEvaluationRun", - }; + const headers: __HeaderBag = sharedHeaders("CancelDataQualityRulesetEvaluationRun"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelDataQualityRulesetEvaluationRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1398,10 +1344,7 @@ export const serializeAws_json1_1CancelMLTaskRunCommand = async ( input: CancelMLTaskRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CancelMLTaskRun", - }; + const headers: __HeaderBag = sharedHeaders("CancelMLTaskRun"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelMLTaskRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1411,10 +1354,7 @@ export const serializeAws_json1_1CancelStatementCommand = async ( input: CancelStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CancelStatement", - }; + const headers: __HeaderBag = sharedHeaders("CancelStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelStatementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1424,10 +1364,7 @@ export const serializeAws_json1_1CheckSchemaVersionValidityCommand = async ( input: CheckSchemaVersionValidityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CheckSchemaVersionValidity", - }; + const headers: __HeaderBag = sharedHeaders("CheckSchemaVersionValidity"); let body: any; body = JSON.stringify(serializeAws_json1_1CheckSchemaVersionValidityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1437,10 +1374,7 @@ export const serializeAws_json1_1CreateBlueprintCommand = async ( input: CreateBlueprintCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateBlueprint", - }; + const headers: __HeaderBag = sharedHeaders("CreateBlueprint"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBlueprintRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1450,10 +1384,7 @@ export const serializeAws_json1_1CreateClassifierCommand = async ( input: CreateClassifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateClassifier", - }; + const headers: __HeaderBag = sharedHeaders("CreateClassifier"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateClassifierRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1463,10 +1394,7 @@ export const serializeAws_json1_1CreateConnectionCommand = async ( input: CreateConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateConnection", - }; + const headers: __HeaderBag = sharedHeaders("CreateConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1476,10 +1404,7 @@ export const serializeAws_json1_1CreateCrawlerCommand = async ( input: CreateCrawlerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateCrawler", - }; + const headers: __HeaderBag = sharedHeaders("CreateCrawler"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCrawlerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1489,10 +1414,7 @@ export const serializeAws_json1_1CreateCustomEntityTypeCommand = async ( input: CreateCustomEntityTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateCustomEntityType", - }; + const headers: __HeaderBag = sharedHeaders("CreateCustomEntityType"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCustomEntityTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1502,10 +1424,7 @@ export const serializeAws_json1_1CreateDatabaseCommand = async ( input: CreateDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateDatabase", - }; + const headers: __HeaderBag = sharedHeaders("CreateDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1515,10 +1434,7 @@ export const serializeAws_json1_1CreateDataQualityRulesetCommand = async ( input: CreateDataQualityRulesetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateDataQualityRuleset", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataQualityRuleset"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDataQualityRulesetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1528,10 +1444,7 @@ export const serializeAws_json1_1CreateDevEndpointCommand = async ( input: CreateDevEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateDevEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("CreateDevEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDevEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1541,10 +1454,7 @@ export const serializeAws_json1_1CreateJobCommand = async ( input: CreateJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1554,10 +1464,7 @@ export const serializeAws_json1_1CreateMLTransformCommand = async ( input: CreateMLTransformCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateMLTransform", - }; + const headers: __HeaderBag = sharedHeaders("CreateMLTransform"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMLTransformRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1567,10 +1474,7 @@ export const serializeAws_json1_1CreatePartitionCommand = async ( input: CreatePartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreatePartition", - }; + const headers: __HeaderBag = sharedHeaders("CreatePartition"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1580,10 +1484,7 @@ export const serializeAws_json1_1CreatePartitionIndexCommand = async ( input: CreatePartitionIndexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreatePartitionIndex", - }; + const headers: __HeaderBag = sharedHeaders("CreatePartitionIndex"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePartitionIndexRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1593,10 +1494,7 @@ export const serializeAws_json1_1CreateRegistryCommand = async ( input: CreateRegistryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateRegistry", - }; + const headers: __HeaderBag = sharedHeaders("CreateRegistry"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRegistryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1606,10 +1504,7 @@ export const serializeAws_json1_1CreateSchemaCommand = async ( input: CreateSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateSchema", - }; + const headers: __HeaderBag = sharedHeaders("CreateSchema"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSchemaInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1619,10 +1514,7 @@ export const serializeAws_json1_1CreateScriptCommand = async ( input: CreateScriptCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateScript", - }; + const headers: __HeaderBag = sharedHeaders("CreateScript"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateScriptRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1632,10 +1524,7 @@ export const serializeAws_json1_1CreateSecurityConfigurationCommand = async ( input: CreateSecurityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateSecurityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("CreateSecurityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSecurityConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1645,10 +1534,7 @@ export const serializeAws_json1_1CreateSessionCommand = async ( input: CreateSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateSession", - }; + const headers: __HeaderBag = sharedHeaders("CreateSession"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1658,10 +1544,7 @@ export const serializeAws_json1_1CreateTableCommand = async ( input: CreateTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateTable", - }; + const headers: __HeaderBag = sharedHeaders("CreateTable"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1671,10 +1554,7 @@ export const serializeAws_json1_1CreateTriggerCommand = async ( input: CreateTriggerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateTrigger", - }; + const headers: __HeaderBag = sharedHeaders("CreateTrigger"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTriggerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1684,10 +1564,7 @@ export const serializeAws_json1_1CreateUserDefinedFunctionCommand = async ( input: CreateUserDefinedFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateUserDefinedFunction", - }; + const headers: __HeaderBag = sharedHeaders("CreateUserDefinedFunction"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserDefinedFunctionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1697,10 +1574,7 @@ export const serializeAws_json1_1CreateWorkflowCommand = async ( input: CreateWorkflowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.CreateWorkflow", - }; + const headers: __HeaderBag = sharedHeaders("CreateWorkflow"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWorkflowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1710,10 +1584,7 @@ export const serializeAws_json1_1DeleteBlueprintCommand = async ( input: DeleteBlueprintCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteBlueprint", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBlueprint"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBlueprintRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1723,10 +1594,7 @@ export const serializeAws_json1_1DeleteClassifierCommand = async ( input: DeleteClassifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteClassifier", - }; + const headers: __HeaderBag = sharedHeaders("DeleteClassifier"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteClassifierRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1736,10 +1604,7 @@ export const serializeAws_json1_1DeleteColumnStatisticsForPartitionCommand = asy input: DeleteColumnStatisticsForPartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteColumnStatisticsForPartition", - }; + const headers: __HeaderBag = sharedHeaders("DeleteColumnStatisticsForPartition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteColumnStatisticsForPartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1749,10 +1614,7 @@ export const serializeAws_json1_1DeleteColumnStatisticsForTableCommand = async ( input: DeleteColumnStatisticsForTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteColumnStatisticsForTable", - }; + const headers: __HeaderBag = sharedHeaders("DeleteColumnStatisticsForTable"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteColumnStatisticsForTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1762,10 +1624,7 @@ export const serializeAws_json1_1DeleteConnectionCommand = async ( input: DeleteConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1775,10 +1634,7 @@ export const serializeAws_json1_1DeleteCrawlerCommand = async ( input: DeleteCrawlerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteCrawler", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCrawler"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCrawlerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1788,10 +1644,7 @@ export const serializeAws_json1_1DeleteCustomEntityTypeCommand = async ( input: DeleteCustomEntityTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteCustomEntityType", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCustomEntityType"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCustomEntityTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1801,10 +1654,7 @@ export const serializeAws_json1_1DeleteDatabaseCommand = async ( input: DeleteDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteDatabase", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1814,10 +1664,7 @@ export const serializeAws_json1_1DeleteDataQualityRulesetCommand = async ( input: DeleteDataQualityRulesetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteDataQualityRuleset", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataQualityRuleset"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDataQualityRulesetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1827,10 +1674,7 @@ export const serializeAws_json1_1DeleteDevEndpointCommand = async ( input: DeleteDevEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteDevEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDevEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDevEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1840,10 +1684,7 @@ export const serializeAws_json1_1DeleteJobCommand = async ( input: DeleteJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteJob", - }; + const headers: __HeaderBag = sharedHeaders("DeleteJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1853,10 +1694,7 @@ export const serializeAws_json1_1DeleteMLTransformCommand = async ( input: DeleteMLTransformCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteMLTransform", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMLTransform"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMLTransformRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1866,10 +1704,7 @@ export const serializeAws_json1_1DeletePartitionCommand = async ( input: DeletePartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeletePartition", - }; + const headers: __HeaderBag = sharedHeaders("DeletePartition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1879,10 +1714,7 @@ export const serializeAws_json1_1DeletePartitionIndexCommand = async ( input: DeletePartitionIndexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeletePartitionIndex", - }; + const headers: __HeaderBag = sharedHeaders("DeletePartitionIndex"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePartitionIndexRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1892,10 +1724,7 @@ export const serializeAws_json1_1DeleteRegistryCommand = async ( input: DeleteRegistryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteRegistry", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRegistry"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRegistryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1905,10 +1734,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1918,10 +1744,7 @@ export const serializeAws_json1_1DeleteSchemaCommand = async ( input: DeleteSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteSchema", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSchema"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSchemaInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1931,10 +1754,7 @@ export const serializeAws_json1_1DeleteSchemaVersionsCommand = async ( input: DeleteSchemaVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteSchemaVersions", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSchemaVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSchemaVersionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1944,10 +1764,7 @@ export const serializeAws_json1_1DeleteSecurityConfigurationCommand = async ( input: DeleteSecurityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteSecurityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSecurityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSecurityConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1957,10 +1774,7 @@ export const serializeAws_json1_1DeleteSessionCommand = async ( input: DeleteSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteSession", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSession"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1970,10 +1784,7 @@ export const serializeAws_json1_1DeleteTableCommand = async ( input: DeleteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteTable", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTable"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1983,10 +1794,7 @@ export const serializeAws_json1_1DeleteTableVersionCommand = async ( input: DeleteTableVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteTableVersion", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTableVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTableVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1996,10 +1804,7 @@ export const serializeAws_json1_1DeleteTriggerCommand = async ( input: DeleteTriggerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteTrigger", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTrigger"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTriggerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2009,10 +1814,7 @@ export const serializeAws_json1_1DeleteUserDefinedFunctionCommand = async ( input: DeleteUserDefinedFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteUserDefinedFunction", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUserDefinedFunction"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserDefinedFunctionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2022,10 +1824,7 @@ export const serializeAws_json1_1DeleteWorkflowCommand = async ( input: DeleteWorkflowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.DeleteWorkflow", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWorkflow"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWorkflowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2035,10 +1834,7 @@ export const serializeAws_json1_1GetBlueprintCommand = async ( input: GetBlueprintCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetBlueprint", - }; + const headers: __HeaderBag = sharedHeaders("GetBlueprint"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBlueprintRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2048,10 +1844,7 @@ export const serializeAws_json1_1GetBlueprintRunCommand = async ( input: GetBlueprintRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetBlueprintRun", - }; + const headers: __HeaderBag = sharedHeaders("GetBlueprintRun"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBlueprintRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2061,10 +1854,7 @@ export const serializeAws_json1_1GetBlueprintRunsCommand = async ( input: GetBlueprintRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetBlueprintRuns", - }; + const headers: __HeaderBag = sharedHeaders("GetBlueprintRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBlueprintRunsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2074,10 +1864,7 @@ export const serializeAws_json1_1GetCatalogImportStatusCommand = async ( input: GetCatalogImportStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetCatalogImportStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetCatalogImportStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCatalogImportStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2087,10 +1874,7 @@ export const serializeAws_json1_1GetClassifierCommand = async ( input: GetClassifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetClassifier", - }; + const headers: __HeaderBag = sharedHeaders("GetClassifier"); let body: any; body = JSON.stringify(serializeAws_json1_1GetClassifierRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2100,10 +1884,7 @@ export const serializeAws_json1_1GetClassifiersCommand = async ( input: GetClassifiersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetClassifiers", - }; + const headers: __HeaderBag = sharedHeaders("GetClassifiers"); let body: any; body = JSON.stringify(serializeAws_json1_1GetClassifiersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2113,10 +1894,7 @@ export const serializeAws_json1_1GetColumnStatisticsForPartitionCommand = async input: GetColumnStatisticsForPartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetColumnStatisticsForPartition", - }; + const headers: __HeaderBag = sharedHeaders("GetColumnStatisticsForPartition"); let body: any; body = JSON.stringify(serializeAws_json1_1GetColumnStatisticsForPartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2126,10 +1904,7 @@ export const serializeAws_json1_1GetColumnStatisticsForTableCommand = async ( input: GetColumnStatisticsForTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetColumnStatisticsForTable", - }; + const headers: __HeaderBag = sharedHeaders("GetColumnStatisticsForTable"); let body: any; body = JSON.stringify(serializeAws_json1_1GetColumnStatisticsForTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2139,10 +1914,7 @@ export const serializeAws_json1_1GetConnectionCommand = async ( input: GetConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetConnection", - }; + const headers: __HeaderBag = sharedHeaders("GetConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1GetConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2152,10 +1924,7 @@ export const serializeAws_json1_1GetConnectionsCommand = async ( input: GetConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetConnections", - }; + const headers: __HeaderBag = sharedHeaders("GetConnections"); let body: any; body = JSON.stringify(serializeAws_json1_1GetConnectionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2165,10 +1934,7 @@ export const serializeAws_json1_1GetCrawlerCommand = async ( input: GetCrawlerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetCrawler", - }; + const headers: __HeaderBag = sharedHeaders("GetCrawler"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCrawlerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2178,10 +1944,7 @@ export const serializeAws_json1_1GetCrawlerMetricsCommand = async ( input: GetCrawlerMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetCrawlerMetrics", - }; + const headers: __HeaderBag = sharedHeaders("GetCrawlerMetrics"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCrawlerMetricsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2191,10 +1954,7 @@ export const serializeAws_json1_1GetCrawlersCommand = async ( input: GetCrawlersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetCrawlers", - }; + const headers: __HeaderBag = sharedHeaders("GetCrawlers"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCrawlersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2204,10 +1964,7 @@ export const serializeAws_json1_1GetCustomEntityTypeCommand = async ( input: GetCustomEntityTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetCustomEntityType", - }; + const headers: __HeaderBag = sharedHeaders("GetCustomEntityType"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCustomEntityTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2217,10 +1974,7 @@ export const serializeAws_json1_1GetDatabaseCommand = async ( input: GetDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetDatabase", - }; + const headers: __HeaderBag = sharedHeaders("GetDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2230,10 +1984,7 @@ export const serializeAws_json1_1GetDatabasesCommand = async ( input: GetDatabasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetDatabases", - }; + const headers: __HeaderBag = sharedHeaders("GetDatabases"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDatabasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2243,10 +1994,7 @@ export const serializeAws_json1_1GetDataCatalogEncryptionSettingsCommand = async input: GetDataCatalogEncryptionSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetDataCatalogEncryptionSettings", - }; + const headers: __HeaderBag = sharedHeaders("GetDataCatalogEncryptionSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDataCatalogEncryptionSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2256,10 +2004,7 @@ export const serializeAws_json1_1GetDataflowGraphCommand = async ( input: GetDataflowGraphCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetDataflowGraph", - }; + const headers: __HeaderBag = sharedHeaders("GetDataflowGraph"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDataflowGraphRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2269,10 +2014,7 @@ export const serializeAws_json1_1GetDataQualityResultCommand = async ( input: GetDataQualityResultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetDataQualityResult", - }; + const headers: __HeaderBag = sharedHeaders("GetDataQualityResult"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDataQualityResultRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2282,10 +2024,7 @@ export const serializeAws_json1_1GetDataQualityRuleRecommendationRunCommand = as input: GetDataQualityRuleRecommendationRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetDataQualityRuleRecommendationRun", - }; + const headers: __HeaderBag = sharedHeaders("GetDataQualityRuleRecommendationRun"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDataQualityRuleRecommendationRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2295,10 +2034,7 @@ export const serializeAws_json1_1GetDataQualityRulesetCommand = async ( input: GetDataQualityRulesetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetDataQualityRuleset", - }; + const headers: __HeaderBag = sharedHeaders("GetDataQualityRuleset"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDataQualityRulesetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2308,10 +2044,7 @@ export const serializeAws_json1_1GetDataQualityRulesetEvaluationRunCommand = asy input: GetDataQualityRulesetEvaluationRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetDataQualityRulesetEvaluationRun", - }; + const headers: __HeaderBag = sharedHeaders("GetDataQualityRulesetEvaluationRun"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDataQualityRulesetEvaluationRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2321,10 +2054,7 @@ export const serializeAws_json1_1GetDevEndpointCommand = async ( input: GetDevEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetDevEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("GetDevEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDevEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2334,10 +2064,7 @@ export const serializeAws_json1_1GetDevEndpointsCommand = async ( input: GetDevEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetDevEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("GetDevEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDevEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2347,10 +2074,7 @@ export const serializeAws_json1_1GetJobCommand = async ( input: GetJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetJob", - }; + const headers: __HeaderBag = sharedHeaders("GetJob"); let body: any; body = JSON.stringify(serializeAws_json1_1GetJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2360,10 +2084,7 @@ export const serializeAws_json1_1GetJobBookmarkCommand = async ( input: GetJobBookmarkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetJobBookmark", - }; + const headers: __HeaderBag = sharedHeaders("GetJobBookmark"); let body: any; body = JSON.stringify(serializeAws_json1_1GetJobBookmarkRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2373,10 +2094,7 @@ export const serializeAws_json1_1GetJobRunCommand = async ( input: GetJobRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetJobRun", - }; + const headers: __HeaderBag = sharedHeaders("GetJobRun"); let body: any; body = JSON.stringify(serializeAws_json1_1GetJobRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2386,10 +2104,7 @@ export const serializeAws_json1_1GetJobRunsCommand = async ( input: GetJobRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetJobRuns", - }; + const headers: __HeaderBag = sharedHeaders("GetJobRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1GetJobRunsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2399,10 +2114,7 @@ export const serializeAws_json1_1GetJobsCommand = async ( input: GetJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetJobs", - }; + const headers: __HeaderBag = sharedHeaders("GetJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1GetJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2412,10 +2124,7 @@ export const serializeAws_json1_1GetMappingCommand = async ( input: GetMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetMapping", - }; + const headers: __HeaderBag = sharedHeaders("GetMapping"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMappingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2425,10 +2134,7 @@ export const serializeAws_json1_1GetMLTaskRunCommand = async ( input: GetMLTaskRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetMLTaskRun", - }; + const headers: __HeaderBag = sharedHeaders("GetMLTaskRun"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMLTaskRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2438,10 +2144,7 @@ export const serializeAws_json1_1GetMLTaskRunsCommand = async ( input: GetMLTaskRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetMLTaskRuns", - }; + const headers: __HeaderBag = sharedHeaders("GetMLTaskRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMLTaskRunsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2451,10 +2154,7 @@ export const serializeAws_json1_1GetMLTransformCommand = async ( input: GetMLTransformCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetMLTransform", - }; + const headers: __HeaderBag = sharedHeaders("GetMLTransform"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMLTransformRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2464,10 +2164,7 @@ export const serializeAws_json1_1GetMLTransformsCommand = async ( input: GetMLTransformsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetMLTransforms", - }; + const headers: __HeaderBag = sharedHeaders("GetMLTransforms"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMLTransformsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2477,10 +2174,7 @@ export const serializeAws_json1_1GetPartitionCommand = async ( input: GetPartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetPartition", - }; + const headers: __HeaderBag = sharedHeaders("GetPartition"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2490,10 +2184,7 @@ export const serializeAws_json1_1GetPartitionIndexesCommand = async ( input: GetPartitionIndexesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetPartitionIndexes", - }; + const headers: __HeaderBag = sharedHeaders("GetPartitionIndexes"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPartitionIndexesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2503,10 +2194,7 @@ export const serializeAws_json1_1GetPartitionsCommand = async ( input: GetPartitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetPartitions", - }; + const headers: __HeaderBag = sharedHeaders("GetPartitions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPartitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2516,10 +2204,7 @@ export const serializeAws_json1_1GetPlanCommand = async ( input: GetPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetPlan", - }; + const headers: __HeaderBag = sharedHeaders("GetPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2529,10 +2214,7 @@ export const serializeAws_json1_1GetRegistryCommand = async ( input: GetRegistryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetRegistry", - }; + const headers: __HeaderBag = sharedHeaders("GetRegistry"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRegistryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2542,10 +2224,7 @@ export const serializeAws_json1_1GetResourcePoliciesCommand = async ( input: GetResourcePoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetResourcePolicies", - }; + const headers: __HeaderBag = sharedHeaders("GetResourcePolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourcePoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2555,10 +2234,7 @@ export const serializeAws_json1_1GetResourcePolicyCommand = async ( input: GetResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2568,10 +2244,7 @@ export const serializeAws_json1_1GetSchemaCommand = async ( input: GetSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetSchema", - }; + const headers: __HeaderBag = sharedHeaders("GetSchema"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSchemaInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2581,10 +2254,7 @@ export const serializeAws_json1_1GetSchemaByDefinitionCommand = async ( input: GetSchemaByDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetSchemaByDefinition", - }; + const headers: __HeaderBag = sharedHeaders("GetSchemaByDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSchemaByDefinitionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2594,10 +2264,7 @@ export const serializeAws_json1_1GetSchemaVersionCommand = async ( input: GetSchemaVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetSchemaVersion", - }; + const headers: __HeaderBag = sharedHeaders("GetSchemaVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSchemaVersionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2607,10 +2274,7 @@ export const serializeAws_json1_1GetSchemaVersionsDiffCommand = async ( input: GetSchemaVersionsDiffCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetSchemaVersionsDiff", - }; + const headers: __HeaderBag = sharedHeaders("GetSchemaVersionsDiff"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSchemaVersionsDiffInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2620,10 +2284,7 @@ export const serializeAws_json1_1GetSecurityConfigurationCommand = async ( input: GetSecurityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetSecurityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetSecurityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSecurityConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2633,10 +2294,7 @@ export const serializeAws_json1_1GetSecurityConfigurationsCommand = async ( input: GetSecurityConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetSecurityConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("GetSecurityConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSecurityConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2646,10 +2304,7 @@ export const serializeAws_json1_1GetSessionCommand = async ( input: GetSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetSession", - }; + const headers: __HeaderBag = sharedHeaders("GetSession"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2659,10 +2314,7 @@ export const serializeAws_json1_1GetStatementCommand = async ( input: GetStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetStatement", - }; + const headers: __HeaderBag = sharedHeaders("GetStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1GetStatementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2672,10 +2324,7 @@ export const serializeAws_json1_1GetTableCommand = async ( input: GetTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetTable", - }; + const headers: __HeaderBag = sharedHeaders("GetTable"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2685,10 +2334,7 @@ export const serializeAws_json1_1GetTablesCommand = async ( input: GetTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetTables", - }; + const headers: __HeaderBag = sharedHeaders("GetTables"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTablesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2698,10 +2344,7 @@ export const serializeAws_json1_1GetTableVersionCommand = async ( input: GetTableVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetTableVersion", - }; + const headers: __HeaderBag = sharedHeaders("GetTableVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTableVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2711,10 +2354,7 @@ export const serializeAws_json1_1GetTableVersionsCommand = async ( input: GetTableVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetTableVersions", - }; + const headers: __HeaderBag = sharedHeaders("GetTableVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTableVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2724,10 +2364,7 @@ export const serializeAws_json1_1GetTagsCommand = async ( input: GetTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetTags", - }; + const headers: __HeaderBag = sharedHeaders("GetTags"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2737,10 +2374,7 @@ export const serializeAws_json1_1GetTriggerCommand = async ( input: GetTriggerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetTrigger", - }; + const headers: __HeaderBag = sharedHeaders("GetTrigger"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTriggerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2750,10 +2384,7 @@ export const serializeAws_json1_1GetTriggersCommand = async ( input: GetTriggersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetTriggers", - }; + const headers: __HeaderBag = sharedHeaders("GetTriggers"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTriggersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2763,10 +2394,7 @@ export const serializeAws_json1_1GetUnfilteredPartitionMetadataCommand = async ( input: GetUnfilteredPartitionMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetUnfilteredPartitionMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetUnfilteredPartitionMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUnfilteredPartitionMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2776,10 +2404,7 @@ export const serializeAws_json1_1GetUnfilteredPartitionsMetadataCommand = async input: GetUnfilteredPartitionsMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetUnfilteredPartitionsMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetUnfilteredPartitionsMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUnfilteredPartitionsMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2789,10 +2414,7 @@ export const serializeAws_json1_1GetUnfilteredTableMetadataCommand = async ( input: GetUnfilteredTableMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetUnfilteredTableMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetUnfilteredTableMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUnfilteredTableMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2802,10 +2424,7 @@ export const serializeAws_json1_1GetUserDefinedFunctionCommand = async ( input: GetUserDefinedFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetUserDefinedFunction", - }; + const headers: __HeaderBag = sharedHeaders("GetUserDefinedFunction"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUserDefinedFunctionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2815,10 +2434,7 @@ export const serializeAws_json1_1GetUserDefinedFunctionsCommand = async ( input: GetUserDefinedFunctionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetUserDefinedFunctions", - }; + const headers: __HeaderBag = sharedHeaders("GetUserDefinedFunctions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUserDefinedFunctionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2828,10 +2444,7 @@ export const serializeAws_json1_1GetWorkflowCommand = async ( input: GetWorkflowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetWorkflow", - }; + const headers: __HeaderBag = sharedHeaders("GetWorkflow"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWorkflowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2841,10 +2454,7 @@ export const serializeAws_json1_1GetWorkflowRunCommand = async ( input: GetWorkflowRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetWorkflowRun", - }; + const headers: __HeaderBag = sharedHeaders("GetWorkflowRun"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWorkflowRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2854,10 +2464,7 @@ export const serializeAws_json1_1GetWorkflowRunPropertiesCommand = async ( input: GetWorkflowRunPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetWorkflowRunProperties", - }; + const headers: __HeaderBag = sharedHeaders("GetWorkflowRunProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWorkflowRunPropertiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2867,10 +2474,7 @@ export const serializeAws_json1_1GetWorkflowRunsCommand = async ( input: GetWorkflowRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.GetWorkflowRuns", - }; + const headers: __HeaderBag = sharedHeaders("GetWorkflowRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWorkflowRunsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2880,10 +2484,7 @@ export const serializeAws_json1_1ImportCatalogToGlueCommand = async ( input: ImportCatalogToGlueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ImportCatalogToGlue", - }; + const headers: __HeaderBag = sharedHeaders("ImportCatalogToGlue"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportCatalogToGlueRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2893,10 +2494,7 @@ export const serializeAws_json1_1ListBlueprintsCommand = async ( input: ListBlueprintsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListBlueprints", - }; + const headers: __HeaderBag = sharedHeaders("ListBlueprints"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBlueprintsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2906,10 +2504,7 @@ export const serializeAws_json1_1ListCrawlersCommand = async ( input: ListCrawlersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListCrawlers", - }; + const headers: __HeaderBag = sharedHeaders("ListCrawlers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCrawlersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2919,10 +2514,7 @@ export const serializeAws_json1_1ListCrawlsCommand = async ( input: ListCrawlsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListCrawls", - }; + const headers: __HeaderBag = sharedHeaders("ListCrawls"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCrawlsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2932,10 +2524,7 @@ export const serializeAws_json1_1ListCustomEntityTypesCommand = async ( input: ListCustomEntityTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListCustomEntityTypes", - }; + const headers: __HeaderBag = sharedHeaders("ListCustomEntityTypes"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCustomEntityTypesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2945,10 +2534,7 @@ export const serializeAws_json1_1ListDataQualityResultsCommand = async ( input: ListDataQualityResultsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListDataQualityResults", - }; + const headers: __HeaderBag = sharedHeaders("ListDataQualityResults"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDataQualityResultsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2958,10 +2544,7 @@ export const serializeAws_json1_1ListDataQualityRuleRecommendationRunsCommand = input: ListDataQualityRuleRecommendationRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListDataQualityRuleRecommendationRuns", - }; + const headers: __HeaderBag = sharedHeaders("ListDataQualityRuleRecommendationRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDataQualityRuleRecommendationRunsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2971,10 +2554,7 @@ export const serializeAws_json1_1ListDataQualityRulesetEvaluationRunsCommand = a input: ListDataQualityRulesetEvaluationRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListDataQualityRulesetEvaluationRuns", - }; + const headers: __HeaderBag = sharedHeaders("ListDataQualityRulesetEvaluationRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDataQualityRulesetEvaluationRunsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2984,10 +2564,7 @@ export const serializeAws_json1_1ListDataQualityRulesetsCommand = async ( input: ListDataQualityRulesetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListDataQualityRulesets", - }; + const headers: __HeaderBag = sharedHeaders("ListDataQualityRulesets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDataQualityRulesetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2997,10 +2574,7 @@ export const serializeAws_json1_1ListDevEndpointsCommand = async ( input: ListDevEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListDevEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("ListDevEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDevEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3010,10 +2584,7 @@ export const serializeAws_json1_1ListJobsCommand = async ( input: ListJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3023,10 +2594,7 @@ export const serializeAws_json1_1ListMLTransformsCommand = async ( input: ListMLTransformsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListMLTransforms", - }; + const headers: __HeaderBag = sharedHeaders("ListMLTransforms"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMLTransformsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3036,10 +2604,7 @@ export const serializeAws_json1_1ListRegistriesCommand = async ( input: ListRegistriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListRegistries", - }; + const headers: __HeaderBag = sharedHeaders("ListRegistries"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRegistriesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3049,10 +2614,7 @@ export const serializeAws_json1_1ListSchemasCommand = async ( input: ListSchemasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListSchemas", - }; + const headers: __HeaderBag = sharedHeaders("ListSchemas"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSchemasInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3062,10 +2624,7 @@ export const serializeAws_json1_1ListSchemaVersionsCommand = async ( input: ListSchemaVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListSchemaVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListSchemaVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSchemaVersionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3075,10 +2634,7 @@ export const serializeAws_json1_1ListSessionsCommand = async ( input: ListSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListSessions", - }; + const headers: __HeaderBag = sharedHeaders("ListSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSessionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3088,10 +2644,7 @@ export const serializeAws_json1_1ListStatementsCommand = async ( input: ListStatementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListStatements", - }; + const headers: __HeaderBag = sharedHeaders("ListStatements"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStatementsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3101,10 +2654,7 @@ export const serializeAws_json1_1ListTriggersCommand = async ( input: ListTriggersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListTriggers", - }; + const headers: __HeaderBag = sharedHeaders("ListTriggers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTriggersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3114,10 +2664,7 @@ export const serializeAws_json1_1ListWorkflowsCommand = async ( input: ListWorkflowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ListWorkflows", - }; + const headers: __HeaderBag = sharedHeaders("ListWorkflows"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWorkflowsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3127,10 +2674,7 @@ export const serializeAws_json1_1PutDataCatalogEncryptionSettingsCommand = async input: PutDataCatalogEncryptionSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.PutDataCatalogEncryptionSettings", - }; + const headers: __HeaderBag = sharedHeaders("PutDataCatalogEncryptionSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1PutDataCatalogEncryptionSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3140,10 +2684,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( input: PutResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.PutResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3153,10 +2694,7 @@ export const serializeAws_json1_1PutSchemaVersionMetadataCommand = async ( input: PutSchemaVersionMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.PutSchemaVersionMetadata", - }; + const headers: __HeaderBag = sharedHeaders("PutSchemaVersionMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1PutSchemaVersionMetadataInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3166,10 +2704,7 @@ export const serializeAws_json1_1PutWorkflowRunPropertiesCommand = async ( input: PutWorkflowRunPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.PutWorkflowRunProperties", - }; + const headers: __HeaderBag = sharedHeaders("PutWorkflowRunProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1PutWorkflowRunPropertiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3179,10 +2714,7 @@ export const serializeAws_json1_1QuerySchemaVersionMetadataCommand = async ( input: QuerySchemaVersionMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.QuerySchemaVersionMetadata", - }; + const headers: __HeaderBag = sharedHeaders("QuerySchemaVersionMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1QuerySchemaVersionMetadataInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3192,10 +2724,7 @@ export const serializeAws_json1_1RegisterSchemaVersionCommand = async ( input: RegisterSchemaVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.RegisterSchemaVersion", - }; + const headers: __HeaderBag = sharedHeaders("RegisterSchemaVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterSchemaVersionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3205,10 +2734,7 @@ export const serializeAws_json1_1RemoveSchemaVersionMetadataCommand = async ( input: RemoveSchemaVersionMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.RemoveSchemaVersionMetadata", - }; + const headers: __HeaderBag = sharedHeaders("RemoveSchemaVersionMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveSchemaVersionMetadataInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3218,10 +2744,7 @@ export const serializeAws_json1_1ResetJobBookmarkCommand = async ( input: ResetJobBookmarkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ResetJobBookmark", - }; + const headers: __HeaderBag = sharedHeaders("ResetJobBookmark"); let body: any; body = JSON.stringify(serializeAws_json1_1ResetJobBookmarkRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3231,10 +2754,7 @@ export const serializeAws_json1_1ResumeWorkflowRunCommand = async ( input: ResumeWorkflowRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.ResumeWorkflowRun", - }; + const headers: __HeaderBag = sharedHeaders("ResumeWorkflowRun"); let body: any; body = JSON.stringify(serializeAws_json1_1ResumeWorkflowRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3244,10 +2764,7 @@ export const serializeAws_json1_1RunStatementCommand = async ( input: RunStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.RunStatement", - }; + const headers: __HeaderBag = sharedHeaders("RunStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1RunStatementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3257,10 +2774,7 @@ export const serializeAws_json1_1SearchTablesCommand = async ( input: SearchTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.SearchTables", - }; + const headers: __HeaderBag = sharedHeaders("SearchTables"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchTablesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3270,10 +2784,7 @@ export const serializeAws_json1_1StartBlueprintRunCommand = async ( input: StartBlueprintRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartBlueprintRun", - }; + const headers: __HeaderBag = sharedHeaders("StartBlueprintRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartBlueprintRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3283,10 +2794,7 @@ export const serializeAws_json1_1StartCrawlerCommand = async ( input: StartCrawlerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartCrawler", - }; + const headers: __HeaderBag = sharedHeaders("StartCrawler"); let body: any; body = JSON.stringify(serializeAws_json1_1StartCrawlerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3296,10 +2804,7 @@ export const serializeAws_json1_1StartCrawlerScheduleCommand = async ( input: StartCrawlerScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartCrawlerSchedule", - }; + const headers: __HeaderBag = sharedHeaders("StartCrawlerSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1StartCrawlerScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3309,10 +2814,7 @@ export const serializeAws_json1_1StartDataQualityRuleRecommendationRunCommand = input: StartDataQualityRuleRecommendationRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartDataQualityRuleRecommendationRun", - }; + const headers: __HeaderBag = sharedHeaders("StartDataQualityRuleRecommendationRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartDataQualityRuleRecommendationRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3322,10 +2824,7 @@ export const serializeAws_json1_1StartDataQualityRulesetEvaluationRunCommand = a input: StartDataQualityRulesetEvaluationRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartDataQualityRulesetEvaluationRun", - }; + const headers: __HeaderBag = sharedHeaders("StartDataQualityRulesetEvaluationRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartDataQualityRulesetEvaluationRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3335,10 +2834,7 @@ export const serializeAws_json1_1StartExportLabelsTaskRunCommand = async ( input: StartExportLabelsTaskRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartExportLabelsTaskRun", - }; + const headers: __HeaderBag = sharedHeaders("StartExportLabelsTaskRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartExportLabelsTaskRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3348,10 +2844,7 @@ export const serializeAws_json1_1StartImportLabelsTaskRunCommand = async ( input: StartImportLabelsTaskRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartImportLabelsTaskRun", - }; + const headers: __HeaderBag = sharedHeaders("StartImportLabelsTaskRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartImportLabelsTaskRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3361,10 +2854,7 @@ export const serializeAws_json1_1StartJobRunCommand = async ( input: StartJobRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartJobRun", - }; + const headers: __HeaderBag = sharedHeaders("StartJobRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartJobRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3374,10 +2864,7 @@ export const serializeAws_json1_1StartMLEvaluationTaskRunCommand = async ( input: StartMLEvaluationTaskRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartMLEvaluationTaskRun", - }; + const headers: __HeaderBag = sharedHeaders("StartMLEvaluationTaskRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartMLEvaluationTaskRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3387,10 +2874,7 @@ export const serializeAws_json1_1StartMLLabelingSetGenerationTaskRunCommand = as input: StartMLLabelingSetGenerationTaskRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartMLLabelingSetGenerationTaskRun", - }; + const headers: __HeaderBag = sharedHeaders("StartMLLabelingSetGenerationTaskRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartMLLabelingSetGenerationTaskRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3400,10 +2884,7 @@ export const serializeAws_json1_1StartTriggerCommand = async ( input: StartTriggerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartTrigger", - }; + const headers: __HeaderBag = sharedHeaders("StartTrigger"); let body: any; body = JSON.stringify(serializeAws_json1_1StartTriggerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3413,10 +2894,7 @@ export const serializeAws_json1_1StartWorkflowRunCommand = async ( input: StartWorkflowRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StartWorkflowRun", - }; + const headers: __HeaderBag = sharedHeaders("StartWorkflowRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartWorkflowRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3426,10 +2904,7 @@ export const serializeAws_json1_1StopCrawlerCommand = async ( input: StopCrawlerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StopCrawler", - }; + const headers: __HeaderBag = sharedHeaders("StopCrawler"); let body: any; body = JSON.stringify(serializeAws_json1_1StopCrawlerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3439,10 +2914,7 @@ export const serializeAws_json1_1StopCrawlerScheduleCommand = async ( input: StopCrawlerScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StopCrawlerSchedule", - }; + const headers: __HeaderBag = sharedHeaders("StopCrawlerSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1StopCrawlerScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3452,10 +2924,7 @@ export const serializeAws_json1_1StopSessionCommand = async ( input: StopSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StopSession", - }; + const headers: __HeaderBag = sharedHeaders("StopSession"); let body: any; body = JSON.stringify(serializeAws_json1_1StopSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3465,10 +2934,7 @@ export const serializeAws_json1_1StopTriggerCommand = async ( input: StopTriggerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StopTrigger", - }; + const headers: __HeaderBag = sharedHeaders("StopTrigger"); let body: any; body = JSON.stringify(serializeAws_json1_1StopTriggerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3478,10 +2944,7 @@ export const serializeAws_json1_1StopWorkflowRunCommand = async ( input: StopWorkflowRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.StopWorkflowRun", - }; + const headers: __HeaderBag = sharedHeaders("StopWorkflowRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StopWorkflowRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3491,10 +2954,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3504,10 +2964,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3517,10 +2974,7 @@ export const serializeAws_json1_1UpdateBlueprintCommand = async ( input: UpdateBlueprintCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateBlueprint", - }; + const headers: __HeaderBag = sharedHeaders("UpdateBlueprint"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateBlueprintRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3530,10 +2984,7 @@ export const serializeAws_json1_1UpdateClassifierCommand = async ( input: UpdateClassifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateClassifier", - }; + const headers: __HeaderBag = sharedHeaders("UpdateClassifier"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateClassifierRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3543,10 +2994,7 @@ export const serializeAws_json1_1UpdateColumnStatisticsForPartitionCommand = asy input: UpdateColumnStatisticsForPartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateColumnStatisticsForPartition", - }; + const headers: __HeaderBag = sharedHeaders("UpdateColumnStatisticsForPartition"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateColumnStatisticsForPartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3556,10 +3004,7 @@ export const serializeAws_json1_1UpdateColumnStatisticsForTableCommand = async ( input: UpdateColumnStatisticsForTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateColumnStatisticsForTable", - }; + const headers: __HeaderBag = sharedHeaders("UpdateColumnStatisticsForTable"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateColumnStatisticsForTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3569,10 +3014,7 @@ export const serializeAws_json1_1UpdateConnectionCommand = async ( input: UpdateConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateConnection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateConnection"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateConnectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3582,10 +3024,7 @@ export const serializeAws_json1_1UpdateCrawlerCommand = async ( input: UpdateCrawlerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateCrawler", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCrawler"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCrawlerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3595,10 +3034,7 @@ export const serializeAws_json1_1UpdateCrawlerScheduleCommand = async ( input: UpdateCrawlerScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateCrawlerSchedule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCrawlerSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCrawlerScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3608,10 +3044,7 @@ export const serializeAws_json1_1UpdateDatabaseCommand = async ( input: UpdateDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateDatabase", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3621,10 +3054,7 @@ export const serializeAws_json1_1UpdateDataQualityRulesetCommand = async ( input: UpdateDataQualityRulesetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateDataQualityRuleset", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDataQualityRuleset"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDataQualityRulesetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3634,10 +3064,7 @@ export const serializeAws_json1_1UpdateDevEndpointCommand = async ( input: UpdateDevEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateDevEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDevEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDevEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3647,10 +3074,7 @@ export const serializeAws_json1_1UpdateJobCommand = async ( input: UpdateJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateJob", - }; + const headers: __HeaderBag = sharedHeaders("UpdateJob"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3660,10 +3084,7 @@ export const serializeAws_json1_1UpdateJobFromSourceControlCommand = async ( input: UpdateJobFromSourceControlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateJobFromSourceControl", - }; + const headers: __HeaderBag = sharedHeaders("UpdateJobFromSourceControl"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateJobFromSourceControlRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3673,10 +3094,7 @@ export const serializeAws_json1_1UpdateMLTransformCommand = async ( input: UpdateMLTransformCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateMLTransform", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMLTransform"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMLTransformRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3686,10 +3104,7 @@ export const serializeAws_json1_1UpdatePartitionCommand = async ( input: UpdatePartitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdatePartition", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePartition"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePartitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3699,10 +3114,7 @@ export const serializeAws_json1_1UpdateRegistryCommand = async ( input: UpdateRegistryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateRegistry", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRegistry"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRegistryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3712,10 +3124,7 @@ export const serializeAws_json1_1UpdateSchemaCommand = async ( input: UpdateSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateSchema", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSchema"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSchemaInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3725,10 +3134,7 @@ export const serializeAws_json1_1UpdateSourceControlFromJobCommand = async ( input: UpdateSourceControlFromJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateSourceControlFromJob", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSourceControlFromJob"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSourceControlFromJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3738,10 +3144,7 @@ export const serializeAws_json1_1UpdateTableCommand = async ( input: UpdateTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateTable", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTable"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3751,10 +3154,7 @@ export const serializeAws_json1_1UpdateTriggerCommand = async ( input: UpdateTriggerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateTrigger", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTrigger"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTriggerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3764,10 +3164,7 @@ export const serializeAws_json1_1UpdateUserDefinedFunctionCommand = async ( input: UpdateUserDefinedFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateUserDefinedFunction", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUserDefinedFunction"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserDefinedFunctionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3777,10 +3174,7 @@ export const serializeAws_json1_1UpdateWorkflowCommand = async ( input: UpdateWorkflowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSGlue.UpdateWorkflow", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWorkflow"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWorkflowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -27062,6 +26456,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSGlue.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-health/src/protocols/Aws_json1_1.ts b/clients/client-health/src/protocols/Aws_json1_1.ts index e96880c097f68..f899437761f7f 100644 --- a/clients/client-health/src/protocols/Aws_json1_1.ts +++ b/clients/client-health/src/protocols/Aws_json1_1.ts @@ -115,10 +115,7 @@ export const serializeAws_json1_1DescribeAffectedAccountsForOrganizationCommand input: DescribeAffectedAccountsForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeAffectedAccountsForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAffectedAccountsForOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAffectedAccountsForOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -128,10 +125,7 @@ export const serializeAws_json1_1DescribeAffectedEntitiesCommand = async ( input: DescribeAffectedEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeAffectedEntities", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAffectedEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAffectedEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -141,10 +135,7 @@ export const serializeAws_json1_1DescribeAffectedEntitiesForOrganizationCommand input: DescribeAffectedEntitiesForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeAffectedEntitiesForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAffectedEntitiesForOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAffectedEntitiesForOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -154,10 +145,7 @@ export const serializeAws_json1_1DescribeEntityAggregatesCommand = async ( input: DescribeEntityAggregatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeEntityAggregates", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEntityAggregates"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEntityAggregatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -167,10 +155,7 @@ export const serializeAws_json1_1DescribeEventAggregatesCommand = async ( input: DescribeEventAggregatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeEventAggregates", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventAggregates"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventAggregatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -180,10 +165,7 @@ export const serializeAws_json1_1DescribeEventDetailsCommand = async ( input: DescribeEventDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeEventDetails", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventDetailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -193,10 +175,7 @@ export const serializeAws_json1_1DescribeEventDetailsForOrganizationCommand = as input: DescribeEventDetailsForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeEventDetailsForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventDetailsForOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventDetailsForOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -206,10 +185,7 @@ export const serializeAws_json1_1DescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeEvents", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -219,10 +195,7 @@ export const serializeAws_json1_1DescribeEventsForOrganizationCommand = async ( input: DescribeEventsForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeEventsForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventsForOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventsForOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -232,10 +205,7 @@ export const serializeAws_json1_1DescribeEventTypesCommand = async ( input: DescribeEventTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeEventTypes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventTypes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventTypesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -245,10 +215,7 @@ export const serializeAws_json1_1DescribeHealthServiceStatusForOrganizationComma input: DescribeHealthServiceStatusForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DescribeHealthServiceStatusForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHealthServiceStatusForOrganization"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -257,10 +224,7 @@ export const serializeAws_json1_1DisableHealthServiceAccessForOrganizationComman input: DisableHealthServiceAccessForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.DisableHealthServiceAccessForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("DisableHealthServiceAccessForOrganization"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -269,10 +233,7 @@ export const serializeAws_json1_1EnableHealthServiceAccessForOrganizationCommand input: EnableHealthServiceAccessForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSHealth_20160804.EnableHealthServiceAccessForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("EnableHealthServiceAccessForOrganization"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -1755,6 +1716,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSHealth_20160804.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-healthlake/src/protocols/Aws_json1_0.ts b/clients/client-healthlake/src/protocols/Aws_json1_0.ts index 09802f1211de5..de85cd551d49e 100644 --- a/clients/client-healthlake/src/protocols/Aws_json1_0.ts +++ b/clients/client-healthlake/src/protocols/Aws_json1_0.ts @@ -99,10 +99,7 @@ export const serializeAws_json1_0CreateFHIRDatastoreCommand = async ( input: CreateFHIRDatastoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.CreateFHIRDatastore", - }; + const headers: __HeaderBag = sharedHeaders("CreateFHIRDatastore"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateFHIRDatastoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -112,10 +109,7 @@ export const serializeAws_json1_0DeleteFHIRDatastoreCommand = async ( input: DeleteFHIRDatastoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.DeleteFHIRDatastore", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFHIRDatastore"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteFHIRDatastoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -125,10 +119,7 @@ export const serializeAws_json1_0DescribeFHIRDatastoreCommand = async ( input: DescribeFHIRDatastoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.DescribeFHIRDatastore", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFHIRDatastore"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeFHIRDatastoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -138,10 +129,7 @@ export const serializeAws_json1_0DescribeFHIRExportJobCommand = async ( input: DescribeFHIRExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.DescribeFHIRExportJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFHIRExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeFHIRExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -151,10 +139,7 @@ export const serializeAws_json1_0DescribeFHIRImportJobCommand = async ( input: DescribeFHIRImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.DescribeFHIRImportJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFHIRImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeFHIRImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -164,10 +149,7 @@ export const serializeAws_json1_0ListFHIRDatastoresCommand = async ( input: ListFHIRDatastoresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.ListFHIRDatastores", - }; + const headers: __HeaderBag = sharedHeaders("ListFHIRDatastores"); let body: any; body = JSON.stringify(serializeAws_json1_0ListFHIRDatastoresRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -177,10 +159,7 @@ export const serializeAws_json1_0ListFHIRExportJobsCommand = async ( input: ListFHIRExportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.ListFHIRExportJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListFHIRExportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListFHIRExportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -190,10 +169,7 @@ export const serializeAws_json1_0ListFHIRImportJobsCommand = async ( input: ListFHIRImportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.ListFHIRImportJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListFHIRImportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListFHIRImportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -203,10 +179,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -216,10 +189,7 @@ export const serializeAws_json1_0StartFHIRExportJobCommand = async ( input: StartFHIRExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.StartFHIRExportJob", - }; + const headers: __HeaderBag = sharedHeaders("StartFHIRExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_0StartFHIRExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -229,10 +199,7 @@ export const serializeAws_json1_0StartFHIRImportJobCommand = async ( input: StartFHIRImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.StartFHIRImportJob", - }; + const headers: __HeaderBag = sharedHeaders("StartFHIRImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_0StartFHIRImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -242,10 +209,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -255,10 +219,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "HealthLake.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1603,6 +1564,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `HealthLake.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-iam/src/protocols/Aws_query.ts b/clients/client-iam/src/protocols/Aws_query.ts index 1c830962cd8bd..f70babbf7f2c2 100644 --- a/clients/client-iam/src/protocols/Aws_query.ts +++ b/clients/client-iam/src/protocols/Aws_query.ts @@ -729,9 +729,7 @@ export const serializeAws_queryAddClientIDToOpenIDConnectProviderCommand = async input: AddClientIDToOpenIDConnectProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddClientIDToOpenIDConnectProviderRequest(input, context), @@ -745,9 +743,7 @@ export const serializeAws_queryAddRoleToInstanceProfileCommand = async ( input: AddRoleToInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddRoleToInstanceProfileRequest(input, context), @@ -761,9 +757,7 @@ export const serializeAws_queryAddUserToGroupCommand = async ( input: AddUserToGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddUserToGroupRequest(input, context), @@ -777,9 +771,7 @@ export const serializeAws_queryAttachGroupPolicyCommand = async ( input: AttachGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAttachGroupPolicyRequest(input, context), @@ -793,9 +785,7 @@ export const serializeAws_queryAttachRolePolicyCommand = async ( input: AttachRolePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAttachRolePolicyRequest(input, context), @@ -809,9 +799,7 @@ export const serializeAws_queryAttachUserPolicyCommand = async ( input: AttachUserPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAttachUserPolicyRequest(input, context), @@ -825,9 +813,7 @@ export const serializeAws_queryChangePasswordCommand = async ( input: ChangePasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryChangePasswordRequest(input, context), @@ -841,9 +827,7 @@ export const serializeAws_queryCreateAccessKeyCommand = async ( input: CreateAccessKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateAccessKeyRequest(input, context), @@ -857,9 +841,7 @@ export const serializeAws_queryCreateAccountAliasCommand = async ( input: CreateAccountAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateAccountAliasRequest(input, context), @@ -873,9 +855,7 @@ export const serializeAws_queryCreateGroupCommand = async ( input: CreateGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateGroupRequest(input, context), @@ -889,9 +869,7 @@ export const serializeAws_queryCreateInstanceProfileCommand = async ( input: CreateInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateInstanceProfileRequest(input, context), @@ -905,9 +883,7 @@ export const serializeAws_queryCreateLoginProfileCommand = async ( input: CreateLoginProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateLoginProfileRequest(input, context), @@ -921,9 +897,7 @@ export const serializeAws_queryCreateOpenIDConnectProviderCommand = async ( input: CreateOpenIDConnectProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateOpenIDConnectProviderRequest(input, context), @@ -937,9 +911,7 @@ export const serializeAws_queryCreatePolicyCommand = async ( input: CreatePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreatePolicyRequest(input, context), @@ -953,9 +925,7 @@ export const serializeAws_queryCreatePolicyVersionCommand = async ( input: CreatePolicyVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreatePolicyVersionRequest(input, context), @@ -969,9 +939,7 @@ export const serializeAws_queryCreateRoleCommand = async ( input: CreateRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateRoleRequest(input, context), @@ -985,9 +953,7 @@ export const serializeAws_queryCreateSAMLProviderCommand = async ( input: CreateSAMLProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateSAMLProviderRequest(input, context), @@ -1001,9 +967,7 @@ export const serializeAws_queryCreateServiceLinkedRoleCommand = async ( input: CreateServiceLinkedRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateServiceLinkedRoleRequest(input, context), @@ -1017,9 +981,7 @@ export const serializeAws_queryCreateServiceSpecificCredentialCommand = async ( input: CreateServiceSpecificCredentialCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateServiceSpecificCredentialRequest(input, context), @@ -1033,9 +995,7 @@ export const serializeAws_queryCreateUserCommand = async ( input: CreateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateUserRequest(input, context), @@ -1049,9 +1009,7 @@ export const serializeAws_queryCreateVirtualMFADeviceCommand = async ( input: CreateVirtualMFADeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateVirtualMFADeviceRequest(input, context), @@ -1065,9 +1023,7 @@ export const serializeAws_queryDeactivateMFADeviceCommand = async ( input: DeactivateMFADeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeactivateMFADeviceRequest(input, context), @@ -1081,9 +1037,7 @@ export const serializeAws_queryDeleteAccessKeyCommand = async ( input: DeleteAccessKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteAccessKeyRequest(input, context), @@ -1097,9 +1051,7 @@ export const serializeAws_queryDeleteAccountAliasCommand = async ( input: DeleteAccountAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteAccountAliasRequest(input, context), @@ -1113,9 +1065,7 @@ export const serializeAws_queryDeleteAccountPasswordPolicyCommand = async ( input: DeleteAccountPasswordPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DeleteAccountPasswordPolicy", Version: "2010-05-08", @@ -1127,9 +1077,7 @@ export const serializeAws_queryDeleteGroupCommand = async ( input: DeleteGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteGroupRequest(input, context), @@ -1143,9 +1091,7 @@ export const serializeAws_queryDeleteGroupPolicyCommand = async ( input: DeleteGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteGroupPolicyRequest(input, context), @@ -1159,9 +1105,7 @@ export const serializeAws_queryDeleteInstanceProfileCommand = async ( input: DeleteInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteInstanceProfileRequest(input, context), @@ -1175,9 +1119,7 @@ export const serializeAws_queryDeleteLoginProfileCommand = async ( input: DeleteLoginProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteLoginProfileRequest(input, context), @@ -1191,9 +1133,7 @@ export const serializeAws_queryDeleteOpenIDConnectProviderCommand = async ( input: DeleteOpenIDConnectProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteOpenIDConnectProviderRequest(input, context), @@ -1207,9 +1147,7 @@ export const serializeAws_queryDeletePolicyCommand = async ( input: DeletePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeletePolicyRequest(input, context), @@ -1223,9 +1161,7 @@ export const serializeAws_queryDeletePolicyVersionCommand = async ( input: DeletePolicyVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeletePolicyVersionRequest(input, context), @@ -1239,9 +1175,7 @@ export const serializeAws_queryDeleteRoleCommand = async ( input: DeleteRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteRoleRequest(input, context), @@ -1255,9 +1189,7 @@ export const serializeAws_queryDeleteRolePermissionsBoundaryCommand = async ( input: DeleteRolePermissionsBoundaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteRolePermissionsBoundaryRequest(input, context), @@ -1271,9 +1203,7 @@ export const serializeAws_queryDeleteRolePolicyCommand = async ( input: DeleteRolePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteRolePolicyRequest(input, context), @@ -1287,9 +1217,7 @@ export const serializeAws_queryDeleteSAMLProviderCommand = async ( input: DeleteSAMLProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteSAMLProviderRequest(input, context), @@ -1303,9 +1231,7 @@ export const serializeAws_queryDeleteServerCertificateCommand = async ( input: DeleteServerCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteServerCertificateRequest(input, context), @@ -1319,9 +1245,7 @@ export const serializeAws_queryDeleteServiceLinkedRoleCommand = async ( input: DeleteServiceLinkedRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteServiceLinkedRoleRequest(input, context), @@ -1335,9 +1259,7 @@ export const serializeAws_queryDeleteServiceSpecificCredentialCommand = async ( input: DeleteServiceSpecificCredentialCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteServiceSpecificCredentialRequest(input, context), @@ -1351,9 +1273,7 @@ export const serializeAws_queryDeleteSigningCertificateCommand = async ( input: DeleteSigningCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteSigningCertificateRequest(input, context), @@ -1367,9 +1287,7 @@ export const serializeAws_queryDeleteSSHPublicKeyCommand = async ( input: DeleteSSHPublicKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteSSHPublicKeyRequest(input, context), @@ -1383,9 +1301,7 @@ export const serializeAws_queryDeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteUserRequest(input, context), @@ -1399,9 +1315,7 @@ export const serializeAws_queryDeleteUserPermissionsBoundaryCommand = async ( input: DeleteUserPermissionsBoundaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteUserPermissionsBoundaryRequest(input, context), @@ -1415,9 +1329,7 @@ export const serializeAws_queryDeleteUserPolicyCommand = async ( input: DeleteUserPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteUserPolicyRequest(input, context), @@ -1431,9 +1343,7 @@ export const serializeAws_queryDeleteVirtualMFADeviceCommand = async ( input: DeleteVirtualMFADeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteVirtualMFADeviceRequest(input, context), @@ -1447,9 +1357,7 @@ export const serializeAws_queryDetachGroupPolicyCommand = async ( input: DetachGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetachGroupPolicyRequest(input, context), @@ -1463,9 +1371,7 @@ export const serializeAws_queryDetachRolePolicyCommand = async ( input: DetachRolePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetachRolePolicyRequest(input, context), @@ -1479,9 +1385,7 @@ export const serializeAws_queryDetachUserPolicyCommand = async ( input: DetachUserPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDetachUserPolicyRequest(input, context), @@ -1495,9 +1399,7 @@ export const serializeAws_queryEnableMFADeviceCommand = async ( input: EnableMFADeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryEnableMFADeviceRequest(input, context), @@ -1511,9 +1413,7 @@ export const serializeAws_queryGenerateCredentialReportCommand = async ( input: GenerateCredentialReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "GenerateCredentialReport", Version: "2010-05-08", @@ -1525,9 +1425,7 @@ export const serializeAws_queryGenerateOrganizationsAccessReportCommand = async input: GenerateOrganizationsAccessReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGenerateOrganizationsAccessReportRequest(input, context), @@ -1541,9 +1439,7 @@ export const serializeAws_queryGenerateServiceLastAccessedDetailsCommand = async input: GenerateServiceLastAccessedDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGenerateServiceLastAccessedDetailsRequest(input, context), @@ -1557,9 +1453,7 @@ export const serializeAws_queryGetAccessKeyLastUsedCommand = async ( input: GetAccessKeyLastUsedCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetAccessKeyLastUsedRequest(input, context), @@ -1573,9 +1467,7 @@ export const serializeAws_queryGetAccountAuthorizationDetailsCommand = async ( input: GetAccountAuthorizationDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetAccountAuthorizationDetailsRequest(input, context), @@ -1589,9 +1481,7 @@ export const serializeAws_queryGetAccountPasswordPolicyCommand = async ( input: GetAccountPasswordPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "GetAccountPasswordPolicy", Version: "2010-05-08", @@ -1603,9 +1493,7 @@ export const serializeAws_queryGetAccountSummaryCommand = async ( input: GetAccountSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "GetAccountSummary", Version: "2010-05-08", @@ -1617,9 +1505,7 @@ export const serializeAws_queryGetContextKeysForCustomPolicyCommand = async ( input: GetContextKeysForCustomPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetContextKeysForCustomPolicyRequest(input, context), @@ -1633,9 +1519,7 @@ export const serializeAws_queryGetContextKeysForPrincipalPolicyCommand = async ( input: GetContextKeysForPrincipalPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetContextKeysForPrincipalPolicyRequest(input, context), @@ -1649,9 +1533,7 @@ export const serializeAws_queryGetCredentialReportCommand = async ( input: GetCredentialReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "GetCredentialReport", Version: "2010-05-08", @@ -1663,9 +1545,7 @@ export const serializeAws_queryGetGroupCommand = async ( input: GetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetGroupRequest(input, context), @@ -1679,9 +1559,7 @@ export const serializeAws_queryGetGroupPolicyCommand = async ( input: GetGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetGroupPolicyRequest(input, context), @@ -1695,9 +1573,7 @@ export const serializeAws_queryGetInstanceProfileCommand = async ( input: GetInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetInstanceProfileRequest(input, context), @@ -1711,9 +1587,7 @@ export const serializeAws_queryGetLoginProfileCommand = async ( input: GetLoginProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetLoginProfileRequest(input, context), @@ -1727,9 +1601,7 @@ export const serializeAws_queryGetOpenIDConnectProviderCommand = async ( input: GetOpenIDConnectProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetOpenIDConnectProviderRequest(input, context), @@ -1743,9 +1615,7 @@ export const serializeAws_queryGetOrganizationsAccessReportCommand = async ( input: GetOrganizationsAccessReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetOrganizationsAccessReportRequest(input, context), @@ -1759,9 +1629,7 @@ export const serializeAws_queryGetPolicyCommand = async ( input: GetPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetPolicyRequest(input, context), @@ -1775,9 +1643,7 @@ export const serializeAws_queryGetPolicyVersionCommand = async ( input: GetPolicyVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetPolicyVersionRequest(input, context), @@ -1791,9 +1657,7 @@ export const serializeAws_queryGetRoleCommand = async ( input: GetRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetRoleRequest(input, context), @@ -1807,9 +1671,7 @@ export const serializeAws_queryGetRolePolicyCommand = async ( input: GetRolePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetRolePolicyRequest(input, context), @@ -1823,9 +1685,7 @@ export const serializeAws_queryGetSAMLProviderCommand = async ( input: GetSAMLProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetSAMLProviderRequest(input, context), @@ -1839,9 +1699,7 @@ export const serializeAws_queryGetServerCertificateCommand = async ( input: GetServerCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetServerCertificateRequest(input, context), @@ -1855,9 +1713,7 @@ export const serializeAws_queryGetServiceLastAccessedDetailsCommand = async ( input: GetServiceLastAccessedDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetServiceLastAccessedDetailsRequest(input, context), @@ -1871,9 +1727,7 @@ export const serializeAws_queryGetServiceLastAccessedDetailsWithEntitiesCommand input: GetServiceLastAccessedDetailsWithEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetServiceLastAccessedDetailsWithEntitiesRequest(input, context), @@ -1887,9 +1741,7 @@ export const serializeAws_queryGetServiceLinkedRoleDeletionStatusCommand = async input: GetServiceLinkedRoleDeletionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetServiceLinkedRoleDeletionStatusRequest(input, context), @@ -1903,9 +1755,7 @@ export const serializeAws_queryGetSSHPublicKeyCommand = async ( input: GetSSHPublicKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetSSHPublicKeyRequest(input, context), @@ -1919,9 +1769,7 @@ export const serializeAws_queryGetUserCommand = async ( input: GetUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetUserRequest(input, context), @@ -1935,9 +1783,7 @@ export const serializeAws_queryGetUserPolicyCommand = async ( input: GetUserPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetUserPolicyRequest(input, context), @@ -1951,9 +1797,7 @@ export const serializeAws_queryListAccessKeysCommand = async ( input: ListAccessKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListAccessKeysRequest(input, context), @@ -1967,9 +1811,7 @@ export const serializeAws_queryListAccountAliasesCommand = async ( input: ListAccountAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListAccountAliasesRequest(input, context), @@ -1983,9 +1825,7 @@ export const serializeAws_queryListAttachedGroupPoliciesCommand = async ( input: ListAttachedGroupPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListAttachedGroupPoliciesRequest(input, context), @@ -1999,9 +1839,7 @@ export const serializeAws_queryListAttachedRolePoliciesCommand = async ( input: ListAttachedRolePoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListAttachedRolePoliciesRequest(input, context), @@ -2015,9 +1853,7 @@ export const serializeAws_queryListAttachedUserPoliciesCommand = async ( input: ListAttachedUserPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListAttachedUserPoliciesRequest(input, context), @@ -2031,9 +1867,7 @@ export const serializeAws_queryListEntitiesForPolicyCommand = async ( input: ListEntitiesForPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListEntitiesForPolicyRequest(input, context), @@ -2047,9 +1881,7 @@ export const serializeAws_queryListGroupPoliciesCommand = async ( input: ListGroupPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListGroupPoliciesRequest(input, context), @@ -2063,9 +1895,7 @@ export const serializeAws_queryListGroupsCommand = async ( input: ListGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListGroupsRequest(input, context), @@ -2079,9 +1909,7 @@ export const serializeAws_queryListGroupsForUserCommand = async ( input: ListGroupsForUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListGroupsForUserRequest(input, context), @@ -2095,9 +1923,7 @@ export const serializeAws_queryListInstanceProfilesCommand = async ( input: ListInstanceProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListInstanceProfilesRequest(input, context), @@ -2111,9 +1937,7 @@ export const serializeAws_queryListInstanceProfilesForRoleCommand = async ( input: ListInstanceProfilesForRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListInstanceProfilesForRoleRequest(input, context), @@ -2127,9 +1951,7 @@ export const serializeAws_queryListInstanceProfileTagsCommand = async ( input: ListInstanceProfileTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListInstanceProfileTagsRequest(input, context), @@ -2143,9 +1965,7 @@ export const serializeAws_queryListMFADevicesCommand = async ( input: ListMFADevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListMFADevicesRequest(input, context), @@ -2159,9 +1979,7 @@ export const serializeAws_queryListMFADeviceTagsCommand = async ( input: ListMFADeviceTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListMFADeviceTagsRequest(input, context), @@ -2175,9 +1993,7 @@ export const serializeAws_queryListOpenIDConnectProvidersCommand = async ( input: ListOpenIDConnectProvidersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListOpenIDConnectProvidersRequest(input, context), @@ -2191,9 +2007,7 @@ export const serializeAws_queryListOpenIDConnectProviderTagsCommand = async ( input: ListOpenIDConnectProviderTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListOpenIDConnectProviderTagsRequest(input, context), @@ -2207,9 +2021,7 @@ export const serializeAws_queryListPoliciesCommand = async ( input: ListPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListPoliciesRequest(input, context), @@ -2223,9 +2035,7 @@ export const serializeAws_queryListPoliciesGrantingServiceAccessCommand = async input: ListPoliciesGrantingServiceAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListPoliciesGrantingServiceAccessRequest(input, context), @@ -2239,9 +2049,7 @@ export const serializeAws_queryListPolicyTagsCommand = async ( input: ListPolicyTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListPolicyTagsRequest(input, context), @@ -2255,9 +2063,7 @@ export const serializeAws_queryListPolicyVersionsCommand = async ( input: ListPolicyVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListPolicyVersionsRequest(input, context), @@ -2271,9 +2077,7 @@ export const serializeAws_queryListRolePoliciesCommand = async ( input: ListRolePoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListRolePoliciesRequest(input, context), @@ -2287,9 +2091,7 @@ export const serializeAws_queryListRolesCommand = async ( input: ListRolesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListRolesRequest(input, context), @@ -2303,9 +2105,7 @@ export const serializeAws_queryListRoleTagsCommand = async ( input: ListRoleTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListRoleTagsRequest(input, context), @@ -2319,9 +2119,7 @@ export const serializeAws_queryListSAMLProvidersCommand = async ( input: ListSAMLProvidersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListSAMLProvidersRequest(input, context), @@ -2335,9 +2133,7 @@ export const serializeAws_queryListSAMLProviderTagsCommand = async ( input: ListSAMLProviderTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListSAMLProviderTagsRequest(input, context), @@ -2351,9 +2147,7 @@ export const serializeAws_queryListServerCertificatesCommand = async ( input: ListServerCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListServerCertificatesRequest(input, context), @@ -2367,9 +2161,7 @@ export const serializeAws_queryListServerCertificateTagsCommand = async ( input: ListServerCertificateTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListServerCertificateTagsRequest(input, context), @@ -2383,9 +2175,7 @@ export const serializeAws_queryListServiceSpecificCredentialsCommand = async ( input: ListServiceSpecificCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListServiceSpecificCredentialsRequest(input, context), @@ -2399,9 +2189,7 @@ export const serializeAws_queryListSigningCertificatesCommand = async ( input: ListSigningCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListSigningCertificatesRequest(input, context), @@ -2415,9 +2203,7 @@ export const serializeAws_queryListSSHPublicKeysCommand = async ( input: ListSSHPublicKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListSSHPublicKeysRequest(input, context), @@ -2431,9 +2217,7 @@ export const serializeAws_queryListUserPoliciesCommand = async ( input: ListUserPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListUserPoliciesRequest(input, context), @@ -2447,9 +2231,7 @@ export const serializeAws_queryListUsersCommand = async ( input: ListUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListUsersRequest(input, context), @@ -2463,9 +2245,7 @@ export const serializeAws_queryListUserTagsCommand = async ( input: ListUserTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListUserTagsRequest(input, context), @@ -2479,9 +2259,7 @@ export const serializeAws_queryListVirtualMFADevicesCommand = async ( input: ListVirtualMFADevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListVirtualMFADevicesRequest(input, context), @@ -2495,9 +2273,7 @@ export const serializeAws_queryPutGroupPolicyCommand = async ( input: PutGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutGroupPolicyRequest(input, context), @@ -2511,9 +2287,7 @@ export const serializeAws_queryPutRolePermissionsBoundaryCommand = async ( input: PutRolePermissionsBoundaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutRolePermissionsBoundaryRequest(input, context), @@ -2527,9 +2301,7 @@ export const serializeAws_queryPutRolePolicyCommand = async ( input: PutRolePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutRolePolicyRequest(input, context), @@ -2543,9 +2315,7 @@ export const serializeAws_queryPutUserPermissionsBoundaryCommand = async ( input: PutUserPermissionsBoundaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutUserPermissionsBoundaryRequest(input, context), @@ -2559,9 +2329,7 @@ export const serializeAws_queryPutUserPolicyCommand = async ( input: PutUserPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutUserPolicyRequest(input, context), @@ -2575,9 +2343,7 @@ export const serializeAws_queryRemoveClientIDFromOpenIDConnectProviderCommand = input: RemoveClientIDFromOpenIDConnectProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveClientIDFromOpenIDConnectProviderRequest(input, context), @@ -2591,9 +2357,7 @@ export const serializeAws_queryRemoveRoleFromInstanceProfileCommand = async ( input: RemoveRoleFromInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveRoleFromInstanceProfileRequest(input, context), @@ -2607,9 +2371,7 @@ export const serializeAws_queryRemoveUserFromGroupCommand = async ( input: RemoveUserFromGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveUserFromGroupRequest(input, context), @@ -2623,9 +2385,7 @@ export const serializeAws_queryResetServiceSpecificCredentialCommand = async ( input: ResetServiceSpecificCredentialCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResetServiceSpecificCredentialRequest(input, context), @@ -2639,9 +2399,7 @@ export const serializeAws_queryResyncMFADeviceCommand = async ( input: ResyncMFADeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResyncMFADeviceRequest(input, context), @@ -2655,9 +2413,7 @@ export const serializeAws_querySetDefaultPolicyVersionCommand = async ( input: SetDefaultPolicyVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetDefaultPolicyVersionRequest(input, context), @@ -2671,9 +2427,7 @@ export const serializeAws_querySetSecurityTokenServicePreferencesCommand = async input: SetSecurityTokenServicePreferencesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetSecurityTokenServicePreferencesRequest(input, context), @@ -2687,9 +2441,7 @@ export const serializeAws_querySimulateCustomPolicyCommand = async ( input: SimulateCustomPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySimulateCustomPolicyRequest(input, context), @@ -2703,9 +2455,7 @@ export const serializeAws_querySimulatePrincipalPolicyCommand = async ( input: SimulatePrincipalPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySimulatePrincipalPolicyRequest(input, context), @@ -2719,9 +2469,7 @@ export const serializeAws_queryTagInstanceProfileCommand = async ( input: TagInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagInstanceProfileRequest(input, context), @@ -2735,9 +2483,7 @@ export const serializeAws_queryTagMFADeviceCommand = async ( input: TagMFADeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagMFADeviceRequest(input, context), @@ -2751,9 +2497,7 @@ export const serializeAws_queryTagOpenIDConnectProviderCommand = async ( input: TagOpenIDConnectProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagOpenIDConnectProviderRequest(input, context), @@ -2767,9 +2511,7 @@ export const serializeAws_queryTagPolicyCommand = async ( input: TagPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagPolicyRequest(input, context), @@ -2783,9 +2525,7 @@ export const serializeAws_queryTagRoleCommand = async ( input: TagRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagRoleRequest(input, context), @@ -2799,9 +2539,7 @@ export const serializeAws_queryTagSAMLProviderCommand = async ( input: TagSAMLProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagSAMLProviderRequest(input, context), @@ -2815,9 +2553,7 @@ export const serializeAws_queryTagServerCertificateCommand = async ( input: TagServerCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagServerCertificateRequest(input, context), @@ -2831,9 +2567,7 @@ export const serializeAws_queryTagUserCommand = async ( input: TagUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagUserRequest(input, context), @@ -2847,9 +2581,7 @@ export const serializeAws_queryUntagInstanceProfileCommand = async ( input: UntagInstanceProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagInstanceProfileRequest(input, context), @@ -2863,9 +2595,7 @@ export const serializeAws_queryUntagMFADeviceCommand = async ( input: UntagMFADeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagMFADeviceRequest(input, context), @@ -2879,9 +2609,7 @@ export const serializeAws_queryUntagOpenIDConnectProviderCommand = async ( input: UntagOpenIDConnectProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagOpenIDConnectProviderRequest(input, context), @@ -2895,9 +2623,7 @@ export const serializeAws_queryUntagPolicyCommand = async ( input: UntagPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagPolicyRequest(input, context), @@ -2911,9 +2637,7 @@ export const serializeAws_queryUntagRoleCommand = async ( input: UntagRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagRoleRequest(input, context), @@ -2927,9 +2651,7 @@ export const serializeAws_queryUntagSAMLProviderCommand = async ( input: UntagSAMLProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagSAMLProviderRequest(input, context), @@ -2943,9 +2665,7 @@ export const serializeAws_queryUntagServerCertificateCommand = async ( input: UntagServerCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagServerCertificateRequest(input, context), @@ -2959,9 +2679,7 @@ export const serializeAws_queryUntagUserCommand = async ( input: UntagUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagUserRequest(input, context), @@ -2975,9 +2693,7 @@ export const serializeAws_queryUpdateAccessKeyCommand = async ( input: UpdateAccessKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateAccessKeyRequest(input, context), @@ -2991,9 +2707,7 @@ export const serializeAws_queryUpdateAccountPasswordPolicyCommand = async ( input: UpdateAccountPasswordPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateAccountPasswordPolicyRequest(input, context), @@ -3007,9 +2721,7 @@ export const serializeAws_queryUpdateAssumeRolePolicyCommand = async ( input: UpdateAssumeRolePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateAssumeRolePolicyRequest(input, context), @@ -3023,9 +2735,7 @@ export const serializeAws_queryUpdateGroupCommand = async ( input: UpdateGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateGroupRequest(input, context), @@ -3039,9 +2749,7 @@ export const serializeAws_queryUpdateLoginProfileCommand = async ( input: UpdateLoginProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateLoginProfileRequest(input, context), @@ -3055,9 +2763,7 @@ export const serializeAws_queryUpdateOpenIDConnectProviderThumbprintCommand = as input: UpdateOpenIDConnectProviderThumbprintCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateOpenIDConnectProviderThumbprintRequest(input, context), @@ -3071,9 +2777,7 @@ export const serializeAws_queryUpdateRoleCommand = async ( input: UpdateRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateRoleRequest(input, context), @@ -3087,9 +2791,7 @@ export const serializeAws_queryUpdateRoleDescriptionCommand = async ( input: UpdateRoleDescriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateRoleDescriptionRequest(input, context), @@ -3103,9 +2805,7 @@ export const serializeAws_queryUpdateSAMLProviderCommand = async ( input: UpdateSAMLProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateSAMLProviderRequest(input, context), @@ -3119,9 +2819,7 @@ export const serializeAws_queryUpdateServerCertificateCommand = async ( input: UpdateServerCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateServerCertificateRequest(input, context), @@ -3135,9 +2833,7 @@ export const serializeAws_queryUpdateServiceSpecificCredentialCommand = async ( input: UpdateServiceSpecificCredentialCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateServiceSpecificCredentialRequest(input, context), @@ -3151,9 +2847,7 @@ export const serializeAws_queryUpdateSigningCertificateCommand = async ( input: UpdateSigningCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateSigningCertificateRequest(input, context), @@ -3167,9 +2861,7 @@ export const serializeAws_queryUpdateSSHPublicKeyCommand = async ( input: UpdateSSHPublicKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateSSHPublicKeyRequest(input, context), @@ -3183,9 +2875,7 @@ export const serializeAws_queryUpdateUserCommand = async ( input: UpdateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateUserRequest(input, context), @@ -3199,9 +2889,7 @@ export const serializeAws_queryUploadServerCertificateCommand = async ( input: UploadServerCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUploadServerCertificateRequest(input, context), @@ -3215,9 +2903,7 @@ export const serializeAws_queryUploadSigningCertificateCommand = async ( input: UploadSigningCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUploadSigningCertificateRequest(input, context), @@ -3231,9 +2917,7 @@ export const serializeAws_queryUploadSSHPublicKeyCommand = async ( input: UploadSSHPublicKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUploadSSHPublicKeyRequest(input, context), @@ -16868,6 +16552,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-identitystore/src/protocols/Aws_json1_1.ts b/clients/client-identitystore/src/protocols/Aws_json1_1.ts index d2eacd85b2bb6..95d5c512c4307 100644 --- a/clients/client-identitystore/src/protocols/Aws_json1_1.ts +++ b/clients/client-identitystore/src/protocols/Aws_json1_1.ts @@ -120,10 +120,7 @@ export const serializeAws_json1_1CreateGroupCommand = async ( input: CreateGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.CreateGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -133,10 +130,7 @@ export const serializeAws_json1_1CreateGroupMembershipCommand = async ( input: CreateGroupMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.CreateGroupMembership", - }; + const headers: __HeaderBag = sharedHeaders("CreateGroupMembership"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGroupMembershipRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -146,10 +140,7 @@ export const serializeAws_json1_1CreateUserCommand = async ( input: CreateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.CreateUser", - }; + const headers: __HeaderBag = sharedHeaders("CreateUser"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -159,10 +150,7 @@ export const serializeAws_json1_1DeleteGroupCommand = async ( input: DeleteGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.DeleteGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -172,10 +160,7 @@ export const serializeAws_json1_1DeleteGroupMembershipCommand = async ( input: DeleteGroupMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.DeleteGroupMembership", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGroupMembership"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGroupMembershipRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -185,10 +170,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.DeleteUser", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -198,10 +180,7 @@ export const serializeAws_json1_1DescribeGroupCommand = async ( input: DescribeGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.DescribeGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -211,10 +190,7 @@ export const serializeAws_json1_1DescribeGroupMembershipCommand = async ( input: DescribeGroupMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.DescribeGroupMembership", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGroupMembership"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGroupMembershipRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -224,10 +200,7 @@ export const serializeAws_json1_1DescribeUserCommand = async ( input: DescribeUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.DescribeUser", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -237,10 +210,7 @@ export const serializeAws_json1_1GetGroupIdCommand = async ( input: GetGroupIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.GetGroupId", - }; + const headers: __HeaderBag = sharedHeaders("GetGroupId"); let body: any; body = JSON.stringify(serializeAws_json1_1GetGroupIdRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -250,10 +220,7 @@ export const serializeAws_json1_1GetGroupMembershipIdCommand = async ( input: GetGroupMembershipIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.GetGroupMembershipId", - }; + const headers: __HeaderBag = sharedHeaders("GetGroupMembershipId"); let body: any; body = JSON.stringify(serializeAws_json1_1GetGroupMembershipIdRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -263,10 +230,7 @@ export const serializeAws_json1_1GetUserIdCommand = async ( input: GetUserIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.GetUserId", - }; + const headers: __HeaderBag = sharedHeaders("GetUserId"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUserIdRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -276,10 +240,7 @@ export const serializeAws_json1_1IsMemberInGroupsCommand = async ( input: IsMemberInGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.IsMemberInGroups", - }; + const headers: __HeaderBag = sharedHeaders("IsMemberInGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1IsMemberInGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -289,10 +250,7 @@ export const serializeAws_json1_1ListGroupMembershipsCommand = async ( input: ListGroupMembershipsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.ListGroupMemberships", - }; + const headers: __HeaderBag = sharedHeaders("ListGroupMemberships"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGroupMembershipsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -302,10 +260,7 @@ export const serializeAws_json1_1ListGroupMembershipsForMemberCommand = async ( input: ListGroupMembershipsForMemberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.ListGroupMembershipsForMember", - }; + const headers: __HeaderBag = sharedHeaders("ListGroupMembershipsForMember"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGroupMembershipsForMemberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -315,10 +270,7 @@ export const serializeAws_json1_1ListGroupsCommand = async ( input: ListGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.ListGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -328,10 +280,7 @@ export const serializeAws_json1_1ListUsersCommand = async ( input: ListUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.ListUsers", - }; + const headers: __HeaderBag = sharedHeaders("ListUsers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUsersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -341,10 +290,7 @@ export const serializeAws_json1_1UpdateGroupCommand = async ( input: UpdateGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.UpdateGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -354,10 +300,7 @@ export const serializeAws_json1_1UpdateUserCommand = async ( input: UpdateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIdentityStore.UpdateUser", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUser"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2306,6 +2249,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSIdentityStore.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-inspector/src/protocols/Aws_json1_1.ts b/clients/client-inspector/src/protocols/Aws_json1_1.ts index 6942b82e6379b..31cdfe3f40e15 100644 --- a/clients/client-inspector/src/protocols/Aws_json1_1.ts +++ b/clients/client-inspector/src/protocols/Aws_json1_1.ts @@ -254,10 +254,7 @@ export const serializeAws_json1_1AddAttributesToFindingsCommand = async ( input: AddAttributesToFindingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.AddAttributesToFindings", - }; + const headers: __HeaderBag = sharedHeaders("AddAttributesToFindings"); let body: any; body = JSON.stringify(serializeAws_json1_1AddAttributesToFindingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -267,10 +264,7 @@ export const serializeAws_json1_1CreateAssessmentTargetCommand = async ( input: CreateAssessmentTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.CreateAssessmentTarget", - }; + const headers: __HeaderBag = sharedHeaders("CreateAssessmentTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAssessmentTargetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -280,10 +274,7 @@ export const serializeAws_json1_1CreateAssessmentTemplateCommand = async ( input: CreateAssessmentTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.CreateAssessmentTemplate", - }; + const headers: __HeaderBag = sharedHeaders("CreateAssessmentTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAssessmentTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -293,10 +284,7 @@ export const serializeAws_json1_1CreateExclusionsPreviewCommand = async ( input: CreateExclusionsPreviewCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.CreateExclusionsPreview", - }; + const headers: __HeaderBag = sharedHeaders("CreateExclusionsPreview"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateExclusionsPreviewRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -306,10 +294,7 @@ export const serializeAws_json1_1CreateResourceGroupCommand = async ( input: CreateResourceGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.CreateResourceGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateResourceGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateResourceGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -319,10 +304,7 @@ export const serializeAws_json1_1DeleteAssessmentRunCommand = async ( input: DeleteAssessmentRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DeleteAssessmentRun", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAssessmentRun"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAssessmentRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -332,10 +314,7 @@ export const serializeAws_json1_1DeleteAssessmentTargetCommand = async ( input: DeleteAssessmentTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DeleteAssessmentTarget", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAssessmentTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAssessmentTargetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -345,10 +324,7 @@ export const serializeAws_json1_1DeleteAssessmentTemplateCommand = async ( input: DeleteAssessmentTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DeleteAssessmentTemplate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAssessmentTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAssessmentTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -358,10 +334,7 @@ export const serializeAws_json1_1DescribeAssessmentRunsCommand = async ( input: DescribeAssessmentRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DescribeAssessmentRuns", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAssessmentRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAssessmentRunsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -371,10 +344,7 @@ export const serializeAws_json1_1DescribeAssessmentTargetsCommand = async ( input: DescribeAssessmentTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DescribeAssessmentTargets", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAssessmentTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAssessmentTargetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -384,10 +354,7 @@ export const serializeAws_json1_1DescribeAssessmentTemplatesCommand = async ( input: DescribeAssessmentTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DescribeAssessmentTemplates", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAssessmentTemplates"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAssessmentTemplatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -397,10 +364,7 @@ export const serializeAws_json1_1DescribeCrossAccountAccessRoleCommand = async ( input: DescribeCrossAccountAccessRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DescribeCrossAccountAccessRole", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCrossAccountAccessRole"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -409,10 +373,7 @@ export const serializeAws_json1_1DescribeExclusionsCommand = async ( input: DescribeExclusionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DescribeExclusions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExclusions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeExclusionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -422,10 +383,7 @@ export const serializeAws_json1_1DescribeFindingsCommand = async ( input: DescribeFindingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DescribeFindings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFindings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFindingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -435,10 +393,7 @@ export const serializeAws_json1_1DescribeResourceGroupsCommand = async ( input: DescribeResourceGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DescribeResourceGroups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeResourceGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeResourceGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -448,10 +403,7 @@ export const serializeAws_json1_1DescribeRulesPackagesCommand = async ( input: DescribeRulesPackagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.DescribeRulesPackages", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRulesPackages"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRulesPackagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -461,10 +413,7 @@ export const serializeAws_json1_1GetAssessmentReportCommand = async ( input: GetAssessmentReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.GetAssessmentReport", - }; + const headers: __HeaderBag = sharedHeaders("GetAssessmentReport"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAssessmentReportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -474,10 +423,7 @@ export const serializeAws_json1_1GetExclusionsPreviewCommand = async ( input: GetExclusionsPreviewCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.GetExclusionsPreview", - }; + const headers: __HeaderBag = sharedHeaders("GetExclusionsPreview"); let body: any; body = JSON.stringify(serializeAws_json1_1GetExclusionsPreviewRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -487,10 +433,7 @@ export const serializeAws_json1_1GetTelemetryMetadataCommand = async ( input: GetTelemetryMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.GetTelemetryMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetTelemetryMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTelemetryMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -500,10 +443,7 @@ export const serializeAws_json1_1ListAssessmentRunAgentsCommand = async ( input: ListAssessmentRunAgentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.ListAssessmentRunAgents", - }; + const headers: __HeaderBag = sharedHeaders("ListAssessmentRunAgents"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssessmentRunAgentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -513,10 +453,7 @@ export const serializeAws_json1_1ListAssessmentRunsCommand = async ( input: ListAssessmentRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.ListAssessmentRuns", - }; + const headers: __HeaderBag = sharedHeaders("ListAssessmentRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssessmentRunsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -526,10 +463,7 @@ export const serializeAws_json1_1ListAssessmentTargetsCommand = async ( input: ListAssessmentTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.ListAssessmentTargets", - }; + const headers: __HeaderBag = sharedHeaders("ListAssessmentTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssessmentTargetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -539,10 +473,7 @@ export const serializeAws_json1_1ListAssessmentTemplatesCommand = async ( input: ListAssessmentTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.ListAssessmentTemplates", - }; + const headers: __HeaderBag = sharedHeaders("ListAssessmentTemplates"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssessmentTemplatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -552,10 +483,7 @@ export const serializeAws_json1_1ListEventSubscriptionsCommand = async ( input: ListEventSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.ListEventSubscriptions", - }; + const headers: __HeaderBag = sharedHeaders("ListEventSubscriptions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEventSubscriptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -565,10 +493,7 @@ export const serializeAws_json1_1ListExclusionsCommand = async ( input: ListExclusionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.ListExclusions", - }; + const headers: __HeaderBag = sharedHeaders("ListExclusions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListExclusionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -578,10 +503,7 @@ export const serializeAws_json1_1ListFindingsCommand = async ( input: ListFindingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.ListFindings", - }; + const headers: __HeaderBag = sharedHeaders("ListFindings"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFindingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -591,10 +513,7 @@ export const serializeAws_json1_1ListRulesPackagesCommand = async ( input: ListRulesPackagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.ListRulesPackages", - }; + const headers: __HeaderBag = sharedHeaders("ListRulesPackages"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRulesPackagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -604,10 +523,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -617,10 +533,7 @@ export const serializeAws_json1_1PreviewAgentsCommand = async ( input: PreviewAgentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.PreviewAgents", - }; + const headers: __HeaderBag = sharedHeaders("PreviewAgents"); let body: any; body = JSON.stringify(serializeAws_json1_1PreviewAgentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -630,10 +543,7 @@ export const serializeAws_json1_1RegisterCrossAccountAccessRoleCommand = async ( input: RegisterCrossAccountAccessRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.RegisterCrossAccountAccessRole", - }; + const headers: __HeaderBag = sharedHeaders("RegisterCrossAccountAccessRole"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterCrossAccountAccessRoleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -643,10 +553,7 @@ export const serializeAws_json1_1RemoveAttributesFromFindingsCommand = async ( input: RemoveAttributesFromFindingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.RemoveAttributesFromFindings", - }; + const headers: __HeaderBag = sharedHeaders("RemoveAttributesFromFindings"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveAttributesFromFindingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -656,10 +563,7 @@ export const serializeAws_json1_1SetTagsForResourceCommand = async ( input: SetTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.SetTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("SetTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1SetTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -669,10 +573,7 @@ export const serializeAws_json1_1StartAssessmentRunCommand = async ( input: StartAssessmentRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.StartAssessmentRun", - }; + const headers: __HeaderBag = sharedHeaders("StartAssessmentRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartAssessmentRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -682,10 +583,7 @@ export const serializeAws_json1_1StopAssessmentRunCommand = async ( input: StopAssessmentRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.StopAssessmentRun", - }; + const headers: __HeaderBag = sharedHeaders("StopAssessmentRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StopAssessmentRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -695,10 +593,7 @@ export const serializeAws_json1_1SubscribeToEventCommand = async ( input: SubscribeToEventCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.SubscribeToEvent", - }; + const headers: __HeaderBag = sharedHeaders("SubscribeToEvent"); let body: any; body = JSON.stringify(serializeAws_json1_1SubscribeToEventRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -708,10 +603,7 @@ export const serializeAws_json1_1UnsubscribeFromEventCommand = async ( input: UnsubscribeFromEventCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.UnsubscribeFromEvent", - }; + const headers: __HeaderBag = sharedHeaders("UnsubscribeFromEvent"); let body: any; body = JSON.stringify(serializeAws_json1_1UnsubscribeFromEventRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -721,10 +613,7 @@ export const serializeAws_json1_1UpdateAssessmentTargetCommand = async ( input: UpdateAssessmentTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "InspectorService.UpdateAssessmentTarget", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAssessmentTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAssessmentTargetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4593,6 +4482,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `InspectorService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts b/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts index 7e807c6018ca7..55795e3a2fda0 100644 --- a/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts +++ b/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts @@ -297,10 +297,7 @@ export const serializeAws_json1_0AssociateVehicleFleetCommand = async ( input: AssociateVehicleFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.AssociateVehicleFleet", - }; + const headers: __HeaderBag = sharedHeaders("AssociateVehicleFleet"); let body: any; body = JSON.stringify(serializeAws_json1_0AssociateVehicleFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -310,10 +307,7 @@ export const serializeAws_json1_0BatchCreateVehicleCommand = async ( input: BatchCreateVehicleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.BatchCreateVehicle", - }; + const headers: __HeaderBag = sharedHeaders("BatchCreateVehicle"); let body: any; body = JSON.stringify(serializeAws_json1_0BatchCreateVehicleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -323,10 +317,7 @@ export const serializeAws_json1_0BatchUpdateVehicleCommand = async ( input: BatchUpdateVehicleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.BatchUpdateVehicle", - }; + const headers: __HeaderBag = sharedHeaders("BatchUpdateVehicle"); let body: any; body = JSON.stringify(serializeAws_json1_0BatchUpdateVehicleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -336,10 +327,7 @@ export const serializeAws_json1_0CreateCampaignCommand = async ( input: CreateCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.CreateCampaign", - }; + const headers: __HeaderBag = sharedHeaders("CreateCampaign"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateCampaignRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -349,10 +337,7 @@ export const serializeAws_json1_0CreateDecoderManifestCommand = async ( input: CreateDecoderManifestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.CreateDecoderManifest", - }; + const headers: __HeaderBag = sharedHeaders("CreateDecoderManifest"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateDecoderManifestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -362,10 +347,7 @@ export const serializeAws_json1_0CreateFleetCommand = async ( input: CreateFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.CreateFleet", - }; + const headers: __HeaderBag = sharedHeaders("CreateFleet"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -375,10 +357,7 @@ export const serializeAws_json1_0CreateModelManifestCommand = async ( input: CreateModelManifestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.CreateModelManifest", - }; + const headers: __HeaderBag = sharedHeaders("CreateModelManifest"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateModelManifestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -388,10 +367,7 @@ export const serializeAws_json1_0CreateSignalCatalogCommand = async ( input: CreateSignalCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.CreateSignalCatalog", - }; + const headers: __HeaderBag = sharedHeaders("CreateSignalCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateSignalCatalogRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -401,10 +377,7 @@ export const serializeAws_json1_0CreateVehicleCommand = async ( input: CreateVehicleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.CreateVehicle", - }; + const headers: __HeaderBag = sharedHeaders("CreateVehicle"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateVehicleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -414,10 +387,7 @@ export const serializeAws_json1_0DeleteCampaignCommand = async ( input: DeleteCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.DeleteCampaign", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCampaign"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteCampaignRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -427,10 +397,7 @@ export const serializeAws_json1_0DeleteDecoderManifestCommand = async ( input: DeleteDecoderManifestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.DeleteDecoderManifest", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDecoderManifest"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteDecoderManifestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -440,10 +407,7 @@ export const serializeAws_json1_0DeleteFleetCommand = async ( input: DeleteFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.DeleteFleet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFleet"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -453,10 +417,7 @@ export const serializeAws_json1_0DeleteModelManifestCommand = async ( input: DeleteModelManifestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.DeleteModelManifest", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModelManifest"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteModelManifestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -466,10 +427,7 @@ export const serializeAws_json1_0DeleteSignalCatalogCommand = async ( input: DeleteSignalCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.DeleteSignalCatalog", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSignalCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteSignalCatalogRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -479,10 +437,7 @@ export const serializeAws_json1_0DeleteVehicleCommand = async ( input: DeleteVehicleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.DeleteVehicle", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVehicle"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteVehicleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -492,10 +447,7 @@ export const serializeAws_json1_0DisassociateVehicleFleetCommand = async ( input: DisassociateVehicleFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.DisassociateVehicleFleet", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateVehicleFleet"); let body: any; body = JSON.stringify(serializeAws_json1_0DisassociateVehicleFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -505,10 +457,7 @@ export const serializeAws_json1_0GetCampaignCommand = async ( input: GetCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.GetCampaign", - }; + const headers: __HeaderBag = sharedHeaders("GetCampaign"); let body: any; body = JSON.stringify(serializeAws_json1_0GetCampaignRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -518,10 +467,7 @@ export const serializeAws_json1_0GetDecoderManifestCommand = async ( input: GetDecoderManifestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.GetDecoderManifest", - }; + const headers: __HeaderBag = sharedHeaders("GetDecoderManifest"); let body: any; body = JSON.stringify(serializeAws_json1_0GetDecoderManifestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -531,10 +477,7 @@ export const serializeAws_json1_0GetFleetCommand = async ( input: GetFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.GetFleet", - }; + const headers: __HeaderBag = sharedHeaders("GetFleet"); let body: any; body = JSON.stringify(serializeAws_json1_0GetFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -544,10 +487,7 @@ export const serializeAws_json1_0GetLoggingOptionsCommand = async ( input: GetLoggingOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.GetLoggingOptions", - }; + const headers: __HeaderBag = sharedHeaders("GetLoggingOptions"); let body: any; body = JSON.stringify(serializeAws_json1_0GetLoggingOptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -557,10 +497,7 @@ export const serializeAws_json1_0GetModelManifestCommand = async ( input: GetModelManifestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.GetModelManifest", - }; + const headers: __HeaderBag = sharedHeaders("GetModelManifest"); let body: any; body = JSON.stringify(serializeAws_json1_0GetModelManifestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -570,10 +507,7 @@ export const serializeAws_json1_0GetRegisterAccountStatusCommand = async ( input: GetRegisterAccountStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.GetRegisterAccountStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetRegisterAccountStatus"); let body: any; body = JSON.stringify(serializeAws_json1_0GetRegisterAccountStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -583,10 +517,7 @@ export const serializeAws_json1_0GetSignalCatalogCommand = async ( input: GetSignalCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.GetSignalCatalog", - }; + const headers: __HeaderBag = sharedHeaders("GetSignalCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_0GetSignalCatalogRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -596,10 +527,7 @@ export const serializeAws_json1_0GetVehicleCommand = async ( input: GetVehicleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.GetVehicle", - }; + const headers: __HeaderBag = sharedHeaders("GetVehicle"); let body: any; body = JSON.stringify(serializeAws_json1_0GetVehicleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -609,10 +537,7 @@ export const serializeAws_json1_0GetVehicleStatusCommand = async ( input: GetVehicleStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.GetVehicleStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetVehicleStatus"); let body: any; body = JSON.stringify(serializeAws_json1_0GetVehicleStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -622,10 +547,7 @@ export const serializeAws_json1_0ImportDecoderManifestCommand = async ( input: ImportDecoderManifestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ImportDecoderManifest", - }; + const headers: __HeaderBag = sharedHeaders("ImportDecoderManifest"); let body: any; body = JSON.stringify(serializeAws_json1_0ImportDecoderManifestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -635,10 +557,7 @@ export const serializeAws_json1_0ImportSignalCatalogCommand = async ( input: ImportSignalCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ImportSignalCatalog", - }; + const headers: __HeaderBag = sharedHeaders("ImportSignalCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_0ImportSignalCatalogRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -648,10 +567,7 @@ export const serializeAws_json1_0ListCampaignsCommand = async ( input: ListCampaignsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListCampaigns", - }; + const headers: __HeaderBag = sharedHeaders("ListCampaigns"); let body: any; body = JSON.stringify(serializeAws_json1_0ListCampaignsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -661,10 +577,7 @@ export const serializeAws_json1_0ListDecoderManifestNetworkInterfacesCommand = a input: ListDecoderManifestNetworkInterfacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListDecoderManifestNetworkInterfaces", - }; + const headers: __HeaderBag = sharedHeaders("ListDecoderManifestNetworkInterfaces"); let body: any; body = JSON.stringify(serializeAws_json1_0ListDecoderManifestNetworkInterfacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -674,10 +587,7 @@ export const serializeAws_json1_0ListDecoderManifestsCommand = async ( input: ListDecoderManifestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListDecoderManifests", - }; + const headers: __HeaderBag = sharedHeaders("ListDecoderManifests"); let body: any; body = JSON.stringify(serializeAws_json1_0ListDecoderManifestsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -687,10 +597,7 @@ export const serializeAws_json1_0ListDecoderManifestSignalsCommand = async ( input: ListDecoderManifestSignalsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListDecoderManifestSignals", - }; + const headers: __HeaderBag = sharedHeaders("ListDecoderManifestSignals"); let body: any; body = JSON.stringify(serializeAws_json1_0ListDecoderManifestSignalsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -700,10 +607,7 @@ export const serializeAws_json1_0ListFleetsCommand = async ( input: ListFleetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListFleets", - }; + const headers: __HeaderBag = sharedHeaders("ListFleets"); let body: any; body = JSON.stringify(serializeAws_json1_0ListFleetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -713,10 +617,7 @@ export const serializeAws_json1_0ListFleetsForVehicleCommand = async ( input: ListFleetsForVehicleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListFleetsForVehicle", - }; + const headers: __HeaderBag = sharedHeaders("ListFleetsForVehicle"); let body: any; body = JSON.stringify(serializeAws_json1_0ListFleetsForVehicleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -726,10 +627,7 @@ export const serializeAws_json1_0ListModelManifestNodesCommand = async ( input: ListModelManifestNodesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListModelManifestNodes", - }; + const headers: __HeaderBag = sharedHeaders("ListModelManifestNodes"); let body: any; body = JSON.stringify(serializeAws_json1_0ListModelManifestNodesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -739,10 +637,7 @@ export const serializeAws_json1_0ListModelManifestsCommand = async ( input: ListModelManifestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListModelManifests", - }; + const headers: __HeaderBag = sharedHeaders("ListModelManifests"); let body: any; body = JSON.stringify(serializeAws_json1_0ListModelManifestsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -752,10 +647,7 @@ export const serializeAws_json1_0ListSignalCatalogNodesCommand = async ( input: ListSignalCatalogNodesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListSignalCatalogNodes", - }; + const headers: __HeaderBag = sharedHeaders("ListSignalCatalogNodes"); let body: any; body = JSON.stringify(serializeAws_json1_0ListSignalCatalogNodesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -765,10 +657,7 @@ export const serializeAws_json1_0ListSignalCatalogsCommand = async ( input: ListSignalCatalogsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListSignalCatalogs", - }; + const headers: __HeaderBag = sharedHeaders("ListSignalCatalogs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListSignalCatalogsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -778,10 +667,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -791,10 +677,7 @@ export const serializeAws_json1_0ListVehiclesCommand = async ( input: ListVehiclesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListVehicles", - }; + const headers: __HeaderBag = sharedHeaders("ListVehicles"); let body: any; body = JSON.stringify(serializeAws_json1_0ListVehiclesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -804,10 +687,7 @@ export const serializeAws_json1_0ListVehiclesInFleetCommand = async ( input: ListVehiclesInFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.ListVehiclesInFleet", - }; + const headers: __HeaderBag = sharedHeaders("ListVehiclesInFleet"); let body: any; body = JSON.stringify(serializeAws_json1_0ListVehiclesInFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -817,10 +697,7 @@ export const serializeAws_json1_0PutLoggingOptionsCommand = async ( input: PutLoggingOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.PutLoggingOptions", - }; + const headers: __HeaderBag = sharedHeaders("PutLoggingOptions"); let body: any; body = JSON.stringify(serializeAws_json1_0PutLoggingOptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -830,10 +707,7 @@ export const serializeAws_json1_0RegisterAccountCommand = async ( input: RegisterAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.RegisterAccount", - }; + const headers: __HeaderBag = sharedHeaders("RegisterAccount"); let body: any; body = JSON.stringify(serializeAws_json1_0RegisterAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -843,10 +717,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -856,10 +727,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -869,10 +737,7 @@ export const serializeAws_json1_0UpdateCampaignCommand = async ( input: UpdateCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.UpdateCampaign", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCampaign"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateCampaignRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -882,10 +747,7 @@ export const serializeAws_json1_0UpdateDecoderManifestCommand = async ( input: UpdateDecoderManifestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.UpdateDecoderManifest", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDecoderManifest"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateDecoderManifestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -895,10 +757,7 @@ export const serializeAws_json1_0UpdateFleetCommand = async ( input: UpdateFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.UpdateFleet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFleet"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -908,10 +767,7 @@ export const serializeAws_json1_0UpdateModelManifestCommand = async ( input: UpdateModelManifestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.UpdateModelManifest", - }; + const headers: __HeaderBag = sharedHeaders("UpdateModelManifest"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateModelManifestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -921,10 +777,7 @@ export const serializeAws_json1_0UpdateSignalCatalogCommand = async ( input: UpdateSignalCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.UpdateSignalCatalog", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSignalCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateSignalCatalogRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -934,10 +787,7 @@ export const serializeAws_json1_0UpdateVehicleCommand = async ( input: UpdateVehicleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "IoTAutobahnControlPlane.UpdateVehicle", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVehicle"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateVehicleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6167,6 +6017,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `IoTAutobahnControlPlane.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts index bf3c424b46933..db7da4b5c09c2 100644 --- a/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts +++ b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts @@ -62,10 +62,7 @@ export const serializeAws_json1_1CloseTunnelCommand = async ( input: CloseTunnelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IoTSecuredTunneling.CloseTunnel", - }; + const headers: __HeaderBag = sharedHeaders("CloseTunnel"); let body: any; body = JSON.stringify(serializeAws_json1_1CloseTunnelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -75,10 +72,7 @@ export const serializeAws_json1_1DescribeTunnelCommand = async ( input: DescribeTunnelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IoTSecuredTunneling.DescribeTunnel", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTunnel"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTunnelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -88,10 +82,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IoTSecuredTunneling.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -101,10 +92,7 @@ export const serializeAws_json1_1ListTunnelsCommand = async ( input: ListTunnelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IoTSecuredTunneling.ListTunnels", - }; + const headers: __HeaderBag = sharedHeaders("ListTunnels"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTunnelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -114,10 +102,7 @@ export const serializeAws_json1_1OpenTunnelCommand = async ( input: OpenTunnelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IoTSecuredTunneling.OpenTunnel", - }; + const headers: __HeaderBag = sharedHeaders("OpenTunnel"); let body: any; body = JSON.stringify(serializeAws_json1_1OpenTunnelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -127,10 +112,7 @@ export const serializeAws_json1_1RotateTunnelAccessTokenCommand = async ( input: RotateTunnelAccessTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IoTSecuredTunneling.RotateTunnelAccessToken", - }; + const headers: __HeaderBag = sharedHeaders("RotateTunnelAccessToken"); let body: any; body = JSON.stringify(serializeAws_json1_1RotateTunnelAccessTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -140,10 +122,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IoTSecuredTunneling.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -153,10 +132,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IoTSecuredTunneling.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -851,6 +827,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `IoTSecuredTunneling.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts index 73f939f76f472..8b6f3d841c9d6 100644 --- a/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts +++ b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts @@ -219,10 +219,7 @@ export const serializeAws_json1_1AssociateEntityToThingCommand = async ( input: AssociateEntityToThingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.AssociateEntityToThing", - }; + const headers: __HeaderBag = sharedHeaders("AssociateEntityToThing"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateEntityToThingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -232,10 +229,7 @@ export const serializeAws_json1_1CreateFlowTemplateCommand = async ( input: CreateFlowTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.CreateFlowTemplate", - }; + const headers: __HeaderBag = sharedHeaders("CreateFlowTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFlowTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -245,10 +239,7 @@ export const serializeAws_json1_1CreateSystemInstanceCommand = async ( input: CreateSystemInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.CreateSystemInstance", - }; + const headers: __HeaderBag = sharedHeaders("CreateSystemInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSystemInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -258,10 +249,7 @@ export const serializeAws_json1_1CreateSystemTemplateCommand = async ( input: CreateSystemTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.CreateSystemTemplate", - }; + const headers: __HeaderBag = sharedHeaders("CreateSystemTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSystemTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -271,10 +259,7 @@ export const serializeAws_json1_1DeleteFlowTemplateCommand = async ( input: DeleteFlowTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.DeleteFlowTemplate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFlowTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFlowTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -284,10 +269,7 @@ export const serializeAws_json1_1DeleteNamespaceCommand = async ( input: DeleteNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.DeleteNamespace", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -297,10 +279,7 @@ export const serializeAws_json1_1DeleteSystemInstanceCommand = async ( input: DeleteSystemInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.DeleteSystemInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSystemInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSystemInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -310,10 +289,7 @@ export const serializeAws_json1_1DeleteSystemTemplateCommand = async ( input: DeleteSystemTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.DeleteSystemTemplate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSystemTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSystemTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -323,10 +299,7 @@ export const serializeAws_json1_1DeploySystemInstanceCommand = async ( input: DeploySystemInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.DeploySystemInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeploySystemInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeploySystemInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -336,10 +309,7 @@ export const serializeAws_json1_1DeprecateFlowTemplateCommand = async ( input: DeprecateFlowTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.DeprecateFlowTemplate", - }; + const headers: __HeaderBag = sharedHeaders("DeprecateFlowTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeprecateFlowTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -349,10 +319,7 @@ export const serializeAws_json1_1DeprecateSystemTemplateCommand = async ( input: DeprecateSystemTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.DeprecateSystemTemplate", - }; + const headers: __HeaderBag = sharedHeaders("DeprecateSystemTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeprecateSystemTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -362,10 +329,7 @@ export const serializeAws_json1_1DescribeNamespaceCommand = async ( input: DescribeNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.DescribeNamespace", - }; + const headers: __HeaderBag = sharedHeaders("DescribeNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -375,10 +339,7 @@ export const serializeAws_json1_1DissociateEntityFromThingCommand = async ( input: DissociateEntityFromThingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.DissociateEntityFromThing", - }; + const headers: __HeaderBag = sharedHeaders("DissociateEntityFromThing"); let body: any; body = JSON.stringify(serializeAws_json1_1DissociateEntityFromThingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -388,10 +349,7 @@ export const serializeAws_json1_1GetEntitiesCommand = async ( input: GetEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.GetEntities", - }; + const headers: __HeaderBag = sharedHeaders("GetEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -401,10 +359,7 @@ export const serializeAws_json1_1GetFlowTemplateCommand = async ( input: GetFlowTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.GetFlowTemplate", - }; + const headers: __HeaderBag = sharedHeaders("GetFlowTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFlowTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -414,10 +369,7 @@ export const serializeAws_json1_1GetFlowTemplateRevisionsCommand = async ( input: GetFlowTemplateRevisionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.GetFlowTemplateRevisions", - }; + const headers: __HeaderBag = sharedHeaders("GetFlowTemplateRevisions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFlowTemplateRevisionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -427,10 +379,7 @@ export const serializeAws_json1_1GetNamespaceDeletionStatusCommand = async ( input: GetNamespaceDeletionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.GetNamespaceDeletionStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetNamespaceDeletionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetNamespaceDeletionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -440,10 +389,7 @@ export const serializeAws_json1_1GetSystemInstanceCommand = async ( input: GetSystemInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.GetSystemInstance", - }; + const headers: __HeaderBag = sharedHeaders("GetSystemInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSystemInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -453,10 +399,7 @@ export const serializeAws_json1_1GetSystemTemplateCommand = async ( input: GetSystemTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.GetSystemTemplate", - }; + const headers: __HeaderBag = sharedHeaders("GetSystemTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSystemTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -466,10 +409,7 @@ export const serializeAws_json1_1GetSystemTemplateRevisionsCommand = async ( input: GetSystemTemplateRevisionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.GetSystemTemplateRevisions", - }; + const headers: __HeaderBag = sharedHeaders("GetSystemTemplateRevisions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSystemTemplateRevisionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -479,10 +419,7 @@ export const serializeAws_json1_1GetUploadStatusCommand = async ( input: GetUploadStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.GetUploadStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetUploadStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUploadStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -492,10 +429,7 @@ export const serializeAws_json1_1ListFlowExecutionMessagesCommand = async ( input: ListFlowExecutionMessagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.ListFlowExecutionMessages", - }; + const headers: __HeaderBag = sharedHeaders("ListFlowExecutionMessages"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFlowExecutionMessagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -505,10 +439,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -518,10 +449,7 @@ export const serializeAws_json1_1SearchEntitiesCommand = async ( input: SearchEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.SearchEntities", - }; + const headers: __HeaderBag = sharedHeaders("SearchEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -531,10 +459,7 @@ export const serializeAws_json1_1SearchFlowExecutionsCommand = async ( input: SearchFlowExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.SearchFlowExecutions", - }; + const headers: __HeaderBag = sharedHeaders("SearchFlowExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchFlowExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -544,10 +469,7 @@ export const serializeAws_json1_1SearchFlowTemplatesCommand = async ( input: SearchFlowTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.SearchFlowTemplates", - }; + const headers: __HeaderBag = sharedHeaders("SearchFlowTemplates"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchFlowTemplatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -557,10 +479,7 @@ export const serializeAws_json1_1SearchSystemInstancesCommand = async ( input: SearchSystemInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.SearchSystemInstances", - }; + const headers: __HeaderBag = sharedHeaders("SearchSystemInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchSystemInstancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -570,10 +489,7 @@ export const serializeAws_json1_1SearchSystemTemplatesCommand = async ( input: SearchSystemTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.SearchSystemTemplates", - }; + const headers: __HeaderBag = sharedHeaders("SearchSystemTemplates"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchSystemTemplatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -583,10 +499,7 @@ export const serializeAws_json1_1SearchThingsCommand = async ( input: SearchThingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.SearchThings", - }; + const headers: __HeaderBag = sharedHeaders("SearchThings"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchThingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -596,10 +509,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -609,10 +519,7 @@ export const serializeAws_json1_1UndeploySystemInstanceCommand = async ( input: UndeploySystemInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.UndeploySystemInstance", - }; + const headers: __HeaderBag = sharedHeaders("UndeploySystemInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1UndeploySystemInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -622,10 +529,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -635,10 +539,7 @@ export const serializeAws_json1_1UpdateFlowTemplateCommand = async ( input: UpdateFlowTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.UpdateFlowTemplate", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFlowTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFlowTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -648,10 +549,7 @@ export const serializeAws_json1_1UpdateSystemTemplateCommand = async ( input: UpdateSystemTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.UpdateSystemTemplate", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSystemTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSystemTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -661,10 +559,7 @@ export const serializeAws_json1_1UploadEntityDefinitionsCommand = async ( input: UploadEntityDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "IotThingsGraphFrontEndService.UploadEntityDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("UploadEntityDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1UploadEntityDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3687,6 +3582,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `IotThingsGraphFrontEndService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts b/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts index a821523e0d85d..0e23455c05609 100644 --- a/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts +++ b/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts @@ -83,10 +83,7 @@ export const serializeAws_json1_0CreateRescoreExecutionPlanCommand = async ( input: CreateRescoreExecutionPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSKendraRerankingFrontendService.CreateRescoreExecutionPlan", - }; + const headers: __HeaderBag = sharedHeaders("CreateRescoreExecutionPlan"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateRescoreExecutionPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -96,10 +93,7 @@ export const serializeAws_json1_0DeleteRescoreExecutionPlanCommand = async ( input: DeleteRescoreExecutionPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSKendraRerankingFrontendService.DeleteRescoreExecutionPlan", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRescoreExecutionPlan"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteRescoreExecutionPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -109,10 +103,7 @@ export const serializeAws_json1_0DescribeRescoreExecutionPlanCommand = async ( input: DescribeRescoreExecutionPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSKendraRerankingFrontendService.DescribeRescoreExecutionPlan", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRescoreExecutionPlan"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeRescoreExecutionPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -122,10 +113,7 @@ export const serializeAws_json1_0ListRescoreExecutionPlansCommand = async ( input: ListRescoreExecutionPlansCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSKendraRerankingFrontendService.ListRescoreExecutionPlans", - }; + const headers: __HeaderBag = sharedHeaders("ListRescoreExecutionPlans"); let body: any; body = JSON.stringify(serializeAws_json1_0ListRescoreExecutionPlansRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -135,10 +123,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSKendraRerankingFrontendService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -148,10 +133,7 @@ export const serializeAws_json1_0RescoreCommand = async ( input: RescoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSKendraRerankingFrontendService.Rescore", - }; + const headers: __HeaderBag = sharedHeaders("Rescore"); let body: any; body = JSON.stringify(serializeAws_json1_0RescoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -161,10 +143,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSKendraRerankingFrontendService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -174,10 +153,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSKendraRerankingFrontendService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -187,10 +163,7 @@ export const serializeAws_json1_0UpdateRescoreExecutionPlanCommand = async ( input: UpdateRescoreExecutionPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSKendraRerankingFrontendService.UpdateRescoreExecutionPlan", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRescoreExecutionPlan"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateRescoreExecutionPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1194,6 +1167,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `AWSKendraRerankingFrontendService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-kendra/src/protocols/Aws_json1_1.ts b/clients/client-kendra/src/protocols/Aws_json1_1.ts index a1a3099111932..266eca06ee04a 100644 --- a/clients/client-kendra/src/protocols/Aws_json1_1.ts +++ b/clients/client-kendra/src/protocols/Aws_json1_1.ts @@ -434,10 +434,7 @@ export const serializeAws_json1_1AssociateEntitiesToExperienceCommand = async ( input: AssociateEntitiesToExperienceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.AssociateEntitiesToExperience", - }; + const headers: __HeaderBag = sharedHeaders("AssociateEntitiesToExperience"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateEntitiesToExperienceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -447,10 +444,7 @@ export const serializeAws_json1_1AssociatePersonasToEntitiesCommand = async ( input: AssociatePersonasToEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.AssociatePersonasToEntities", - }; + const headers: __HeaderBag = sharedHeaders("AssociatePersonasToEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociatePersonasToEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -460,10 +454,7 @@ export const serializeAws_json1_1BatchDeleteDocumentCommand = async ( input: BatchDeleteDocumentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.BatchDeleteDocument", - }; + const headers: __HeaderBag = sharedHeaders("BatchDeleteDocument"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDeleteDocumentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -473,10 +464,7 @@ export const serializeAws_json1_1BatchGetDocumentStatusCommand = async ( input: BatchGetDocumentStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.BatchGetDocumentStatus", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetDocumentStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchGetDocumentStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -486,10 +474,7 @@ export const serializeAws_json1_1BatchPutDocumentCommand = async ( input: BatchPutDocumentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.BatchPutDocument", - }; + const headers: __HeaderBag = sharedHeaders("BatchPutDocument"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchPutDocumentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -499,10 +484,7 @@ export const serializeAws_json1_1ClearQuerySuggestionsCommand = async ( input: ClearQuerySuggestionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ClearQuerySuggestions", - }; + const headers: __HeaderBag = sharedHeaders("ClearQuerySuggestions"); let body: any; body = JSON.stringify(serializeAws_json1_1ClearQuerySuggestionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -512,10 +494,7 @@ export const serializeAws_json1_1CreateAccessControlConfigurationCommand = async input: CreateAccessControlConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.CreateAccessControlConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("CreateAccessControlConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAccessControlConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -525,10 +504,7 @@ export const serializeAws_json1_1CreateDataSourceCommand = async ( input: CreateDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.CreateDataSource", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDataSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -538,10 +514,7 @@ export const serializeAws_json1_1CreateExperienceCommand = async ( input: CreateExperienceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.CreateExperience", - }; + const headers: __HeaderBag = sharedHeaders("CreateExperience"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateExperienceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -551,10 +524,7 @@ export const serializeAws_json1_1CreateFaqCommand = async ( input: CreateFaqCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.CreateFaq", - }; + const headers: __HeaderBag = sharedHeaders("CreateFaq"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFaqRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -564,10 +534,7 @@ export const serializeAws_json1_1CreateIndexCommand = async ( input: CreateIndexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.CreateIndex", - }; + const headers: __HeaderBag = sharedHeaders("CreateIndex"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateIndexRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -577,10 +544,7 @@ export const serializeAws_json1_1CreateQuerySuggestionsBlockListCommand = async input: CreateQuerySuggestionsBlockListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.CreateQuerySuggestionsBlockList", - }; + const headers: __HeaderBag = sharedHeaders("CreateQuerySuggestionsBlockList"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateQuerySuggestionsBlockListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -590,10 +554,7 @@ export const serializeAws_json1_1CreateThesaurusCommand = async ( input: CreateThesaurusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.CreateThesaurus", - }; + const headers: __HeaderBag = sharedHeaders("CreateThesaurus"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateThesaurusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -603,10 +564,7 @@ export const serializeAws_json1_1DeleteAccessControlConfigurationCommand = async input: DeleteAccessControlConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DeleteAccessControlConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAccessControlConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAccessControlConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -616,10 +574,7 @@ export const serializeAws_json1_1DeleteDataSourceCommand = async ( input: DeleteDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DeleteDataSource", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDataSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -629,10 +584,7 @@ export const serializeAws_json1_1DeleteExperienceCommand = async ( input: DeleteExperienceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DeleteExperience", - }; + const headers: __HeaderBag = sharedHeaders("DeleteExperience"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteExperienceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -642,10 +594,7 @@ export const serializeAws_json1_1DeleteFaqCommand = async ( input: DeleteFaqCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DeleteFaq", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFaq"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFaqRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -655,10 +604,7 @@ export const serializeAws_json1_1DeleteIndexCommand = async ( input: DeleteIndexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DeleteIndex", - }; + const headers: __HeaderBag = sharedHeaders("DeleteIndex"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteIndexRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -668,10 +614,7 @@ export const serializeAws_json1_1DeletePrincipalMappingCommand = async ( input: DeletePrincipalMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DeletePrincipalMapping", - }; + const headers: __HeaderBag = sharedHeaders("DeletePrincipalMapping"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePrincipalMappingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -681,10 +624,7 @@ export const serializeAws_json1_1DeleteQuerySuggestionsBlockListCommand = async input: DeleteQuerySuggestionsBlockListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DeleteQuerySuggestionsBlockList", - }; + const headers: __HeaderBag = sharedHeaders("DeleteQuerySuggestionsBlockList"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteQuerySuggestionsBlockListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -694,10 +634,7 @@ export const serializeAws_json1_1DeleteThesaurusCommand = async ( input: DeleteThesaurusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DeleteThesaurus", - }; + const headers: __HeaderBag = sharedHeaders("DeleteThesaurus"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteThesaurusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -707,10 +644,7 @@ export const serializeAws_json1_1DescribeAccessControlConfigurationCommand = asy input: DescribeAccessControlConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DescribeAccessControlConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccessControlConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAccessControlConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -720,10 +654,7 @@ export const serializeAws_json1_1DescribeDataSourceCommand = async ( input: DescribeDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DescribeDataSource", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDataSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -733,10 +664,7 @@ export const serializeAws_json1_1DescribeExperienceCommand = async ( input: DescribeExperienceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DescribeExperience", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExperience"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeExperienceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -746,10 +674,7 @@ export const serializeAws_json1_1DescribeFaqCommand = async ( input: DescribeFaqCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DescribeFaq", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFaq"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFaqRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -759,10 +684,7 @@ export const serializeAws_json1_1DescribeIndexCommand = async ( input: DescribeIndexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DescribeIndex", - }; + const headers: __HeaderBag = sharedHeaders("DescribeIndex"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeIndexRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -772,10 +694,7 @@ export const serializeAws_json1_1DescribePrincipalMappingCommand = async ( input: DescribePrincipalMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DescribePrincipalMapping", - }; + const headers: __HeaderBag = sharedHeaders("DescribePrincipalMapping"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePrincipalMappingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -785,10 +704,7 @@ export const serializeAws_json1_1DescribeQuerySuggestionsBlockListCommand = asyn input: DescribeQuerySuggestionsBlockListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DescribeQuerySuggestionsBlockList", - }; + const headers: __HeaderBag = sharedHeaders("DescribeQuerySuggestionsBlockList"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeQuerySuggestionsBlockListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -798,10 +714,7 @@ export const serializeAws_json1_1DescribeQuerySuggestionsConfigCommand = async ( input: DescribeQuerySuggestionsConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DescribeQuerySuggestionsConfig", - }; + const headers: __HeaderBag = sharedHeaders("DescribeQuerySuggestionsConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeQuerySuggestionsConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -811,10 +724,7 @@ export const serializeAws_json1_1DescribeThesaurusCommand = async ( input: DescribeThesaurusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DescribeThesaurus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeThesaurus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeThesaurusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -824,10 +734,7 @@ export const serializeAws_json1_1DisassociateEntitiesFromExperienceCommand = asy input: DisassociateEntitiesFromExperienceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DisassociateEntitiesFromExperience", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateEntitiesFromExperience"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateEntitiesFromExperienceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -837,10 +744,7 @@ export const serializeAws_json1_1DisassociatePersonasFromEntitiesCommand = async input: DisassociatePersonasFromEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.DisassociatePersonasFromEntities", - }; + const headers: __HeaderBag = sharedHeaders("DisassociatePersonasFromEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociatePersonasFromEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -850,10 +754,7 @@ export const serializeAws_json1_1GetQuerySuggestionsCommand = async ( input: GetQuerySuggestionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.GetQuerySuggestions", - }; + const headers: __HeaderBag = sharedHeaders("GetQuerySuggestions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetQuerySuggestionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -863,10 +764,7 @@ export const serializeAws_json1_1GetSnapshotsCommand = async ( input: GetSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.GetSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("GetSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -876,10 +774,7 @@ export const serializeAws_json1_1ListAccessControlConfigurationsCommand = async input: ListAccessControlConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListAccessControlConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListAccessControlConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAccessControlConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -889,10 +784,7 @@ export const serializeAws_json1_1ListDataSourcesCommand = async ( input: ListDataSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListDataSources", - }; + const headers: __HeaderBag = sharedHeaders("ListDataSources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDataSourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -902,10 +794,7 @@ export const serializeAws_json1_1ListDataSourceSyncJobsCommand = async ( input: ListDataSourceSyncJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListDataSourceSyncJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListDataSourceSyncJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDataSourceSyncJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -915,10 +804,7 @@ export const serializeAws_json1_1ListEntityPersonasCommand = async ( input: ListEntityPersonasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListEntityPersonas", - }; + const headers: __HeaderBag = sharedHeaders("ListEntityPersonas"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEntityPersonasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -928,10 +814,7 @@ export const serializeAws_json1_1ListExperienceEntitiesCommand = async ( input: ListExperienceEntitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListExperienceEntities", - }; + const headers: __HeaderBag = sharedHeaders("ListExperienceEntities"); let body: any; body = JSON.stringify(serializeAws_json1_1ListExperienceEntitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -941,10 +824,7 @@ export const serializeAws_json1_1ListExperiencesCommand = async ( input: ListExperiencesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListExperiences", - }; + const headers: __HeaderBag = sharedHeaders("ListExperiences"); let body: any; body = JSON.stringify(serializeAws_json1_1ListExperiencesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -954,10 +834,7 @@ export const serializeAws_json1_1ListFaqsCommand = async ( input: ListFaqsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListFaqs", - }; + const headers: __HeaderBag = sharedHeaders("ListFaqs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFaqsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -967,10 +844,7 @@ export const serializeAws_json1_1ListGroupsOlderThanOrderingIdCommand = async ( input: ListGroupsOlderThanOrderingIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListGroupsOlderThanOrderingId", - }; + const headers: __HeaderBag = sharedHeaders("ListGroupsOlderThanOrderingId"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGroupsOlderThanOrderingIdRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -980,10 +854,7 @@ export const serializeAws_json1_1ListIndicesCommand = async ( input: ListIndicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListIndices", - }; + const headers: __HeaderBag = sharedHeaders("ListIndices"); let body: any; body = JSON.stringify(serializeAws_json1_1ListIndicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -993,10 +864,7 @@ export const serializeAws_json1_1ListQuerySuggestionsBlockListsCommand = async ( input: ListQuerySuggestionsBlockListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListQuerySuggestionsBlockLists", - }; + const headers: __HeaderBag = sharedHeaders("ListQuerySuggestionsBlockLists"); let body: any; body = JSON.stringify(serializeAws_json1_1ListQuerySuggestionsBlockListsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1006,10 +874,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1019,10 +884,7 @@ export const serializeAws_json1_1ListThesauriCommand = async ( input: ListThesauriCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.ListThesauri", - }; + const headers: __HeaderBag = sharedHeaders("ListThesauri"); let body: any; body = JSON.stringify(serializeAws_json1_1ListThesauriRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1032,10 +894,7 @@ export const serializeAws_json1_1PutPrincipalMappingCommand = async ( input: PutPrincipalMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.PutPrincipalMapping", - }; + const headers: __HeaderBag = sharedHeaders("PutPrincipalMapping"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPrincipalMappingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1045,10 +904,7 @@ export const serializeAws_json1_1QueryCommand = async ( input: QueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.Query", - }; + const headers: __HeaderBag = sharedHeaders("Query"); let body: any; body = JSON.stringify(serializeAws_json1_1QueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1058,10 +914,7 @@ export const serializeAws_json1_1StartDataSourceSyncJobCommand = async ( input: StartDataSourceSyncJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.StartDataSourceSyncJob", - }; + const headers: __HeaderBag = sharedHeaders("StartDataSourceSyncJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartDataSourceSyncJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1071,10 +924,7 @@ export const serializeAws_json1_1StopDataSourceSyncJobCommand = async ( input: StopDataSourceSyncJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.StopDataSourceSyncJob", - }; + const headers: __HeaderBag = sharedHeaders("StopDataSourceSyncJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopDataSourceSyncJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1084,10 +934,7 @@ export const serializeAws_json1_1SubmitFeedbackCommand = async ( input: SubmitFeedbackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.SubmitFeedback", - }; + const headers: __HeaderBag = sharedHeaders("SubmitFeedback"); let body: any; body = JSON.stringify(serializeAws_json1_1SubmitFeedbackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1097,10 +944,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1110,10 +954,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1123,10 +964,7 @@ export const serializeAws_json1_1UpdateAccessControlConfigurationCommand = async input: UpdateAccessControlConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.UpdateAccessControlConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAccessControlConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAccessControlConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1136,10 +974,7 @@ export const serializeAws_json1_1UpdateDataSourceCommand = async ( input: UpdateDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.UpdateDataSource", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDataSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1149,10 +984,7 @@ export const serializeAws_json1_1UpdateExperienceCommand = async ( input: UpdateExperienceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.UpdateExperience", - }; + const headers: __HeaderBag = sharedHeaders("UpdateExperience"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateExperienceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1162,10 +994,7 @@ export const serializeAws_json1_1UpdateIndexCommand = async ( input: UpdateIndexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.UpdateIndex", - }; + const headers: __HeaderBag = sharedHeaders("UpdateIndex"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateIndexRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1175,10 +1004,7 @@ export const serializeAws_json1_1UpdateQuerySuggestionsBlockListCommand = async input: UpdateQuerySuggestionsBlockListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.UpdateQuerySuggestionsBlockList", - }; + const headers: __HeaderBag = sharedHeaders("UpdateQuerySuggestionsBlockList"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateQuerySuggestionsBlockListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1188,10 +1014,7 @@ export const serializeAws_json1_1UpdateQuerySuggestionsConfigCommand = async ( input: UpdateQuerySuggestionsConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.UpdateQuerySuggestionsConfig", - }; + const headers: __HeaderBag = sharedHeaders("UpdateQuerySuggestionsConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateQuerySuggestionsConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1201,10 +1024,7 @@ export const serializeAws_json1_1UpdateThesaurusCommand = async ( input: UpdateThesaurusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSKendraFrontendService.UpdateThesaurus", - }; + const headers: __HeaderBag = sharedHeaders("UpdateThesaurus"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateThesaurusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -11053,6 +10873,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSKendraFrontendService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-keyspaces/src/protocols/Aws_json1_0.ts b/clients/client-keyspaces/src/protocols/Aws_json1_0.ts index 483846731ef73..66f51f4a629a2 100644 --- a/clients/client-keyspaces/src/protocols/Aws_json1_0.ts +++ b/clients/client-keyspaces/src/protocols/Aws_json1_0.ts @@ -89,10 +89,7 @@ export const serializeAws_json1_0CreateKeyspaceCommand = async ( input: CreateKeyspaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.CreateKeyspace", - }; + const headers: __HeaderBag = sharedHeaders("CreateKeyspace"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateKeyspaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -102,10 +99,7 @@ export const serializeAws_json1_0CreateTableCommand = async ( input: CreateTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.CreateTable", - }; + const headers: __HeaderBag = sharedHeaders("CreateTable"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -115,10 +109,7 @@ export const serializeAws_json1_0DeleteKeyspaceCommand = async ( input: DeleteKeyspaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.DeleteKeyspace", - }; + const headers: __HeaderBag = sharedHeaders("DeleteKeyspace"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteKeyspaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -128,10 +119,7 @@ export const serializeAws_json1_0DeleteTableCommand = async ( input: DeleteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.DeleteTable", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTable"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -141,10 +129,7 @@ export const serializeAws_json1_0GetKeyspaceCommand = async ( input: GetKeyspaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.GetKeyspace", - }; + const headers: __HeaderBag = sharedHeaders("GetKeyspace"); let body: any; body = JSON.stringify(serializeAws_json1_0GetKeyspaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -154,10 +139,7 @@ export const serializeAws_json1_0GetTableCommand = async ( input: GetTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.GetTable", - }; + const headers: __HeaderBag = sharedHeaders("GetTable"); let body: any; body = JSON.stringify(serializeAws_json1_0GetTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -167,10 +149,7 @@ export const serializeAws_json1_0ListKeyspacesCommand = async ( input: ListKeyspacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.ListKeyspaces", - }; + const headers: __HeaderBag = sharedHeaders("ListKeyspaces"); let body: any; body = JSON.stringify(serializeAws_json1_0ListKeyspacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -180,10 +159,7 @@ export const serializeAws_json1_0ListTablesCommand = async ( input: ListTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.ListTables", - }; + const headers: __HeaderBag = sharedHeaders("ListTables"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTablesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -193,10 +169,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -206,10 +179,7 @@ export const serializeAws_json1_0RestoreTableCommand = async ( input: RestoreTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.RestoreTable", - }; + const headers: __HeaderBag = sharedHeaders("RestoreTable"); let body: any; body = JSON.stringify(serializeAws_json1_0RestoreTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -219,10 +189,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -232,10 +199,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -245,10 +209,7 @@ export const serializeAws_json1_0UpdateTableCommand = async ( input: UpdateTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "KeyspacesService.UpdateTable", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTable"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1718,6 +1679,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `KeyspacesService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts index 3f08919b1c248..9bf8c5f0f4333 100644 --- a/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts @@ -320,10 +320,7 @@ export const serializeAws_json1_1AddApplicationCloudWatchLoggingOptionCommand = input: AddApplicationCloudWatchLoggingOptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.AddApplicationCloudWatchLoggingOption", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationCloudWatchLoggingOption"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationCloudWatchLoggingOptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -333,10 +330,7 @@ export const serializeAws_json1_1AddApplicationInputCommand = async ( input: AddApplicationInputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.AddApplicationInput", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationInput"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationInputRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -346,10 +340,7 @@ export const serializeAws_json1_1AddApplicationInputProcessingConfigurationComma input: AddApplicationInputProcessingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.AddApplicationInputProcessingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationInputProcessingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationInputProcessingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -359,10 +350,7 @@ export const serializeAws_json1_1AddApplicationOutputCommand = async ( input: AddApplicationOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.AddApplicationOutput", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationOutput"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationOutputRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -372,10 +360,7 @@ export const serializeAws_json1_1AddApplicationReferenceDataSourceCommand = asyn input: AddApplicationReferenceDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.AddApplicationReferenceDataSource", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationReferenceDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationReferenceDataSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -385,10 +370,7 @@ export const serializeAws_json1_1AddApplicationVpcConfigurationCommand = async ( input: AddApplicationVpcConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.AddApplicationVpcConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationVpcConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationVpcConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -398,10 +380,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( input: CreateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.CreateApplication", - }; + const headers: __HeaderBag = sharedHeaders("CreateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -411,10 +390,7 @@ export const serializeAws_json1_1CreateApplicationPresignedUrlCommand = async ( input: CreateApplicationPresignedUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.CreateApplicationPresignedUrl", - }; + const headers: __HeaderBag = sharedHeaders("CreateApplicationPresignedUrl"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApplicationPresignedUrlRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -424,10 +400,7 @@ export const serializeAws_json1_1CreateApplicationSnapshotCommand = async ( input: CreateApplicationSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.CreateApplicationSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateApplicationSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApplicationSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -437,10 +410,7 @@ export const serializeAws_json1_1DeleteApplicationCommand = async ( input: DeleteApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DeleteApplication", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -450,10 +420,7 @@ export const serializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommand input: DeleteApplicationCloudWatchLoggingOptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DeleteApplicationCloudWatchLoggingOption", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplicationCloudWatchLoggingOption"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -463,10 +430,7 @@ export const serializeAws_json1_1DeleteApplicationInputProcessingConfigurationCo input: DeleteApplicationInputProcessingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DeleteApplicationInputProcessingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplicationInputProcessingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationInputProcessingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -476,10 +440,7 @@ export const serializeAws_json1_1DeleteApplicationOutputCommand = async ( input: DeleteApplicationOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DeleteApplicationOutput", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplicationOutput"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationOutputRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -489,10 +450,7 @@ export const serializeAws_json1_1DeleteApplicationReferenceDataSourceCommand = a input: DeleteApplicationReferenceDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DeleteApplicationReferenceDataSource", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplicationReferenceDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationReferenceDataSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -502,10 +460,7 @@ export const serializeAws_json1_1DeleteApplicationSnapshotCommand = async ( input: DeleteApplicationSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DeleteApplicationSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplicationSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -515,10 +470,7 @@ export const serializeAws_json1_1DeleteApplicationVpcConfigurationCommand = asyn input: DeleteApplicationVpcConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DeleteApplicationVpcConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplicationVpcConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationVpcConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -528,10 +480,7 @@ export const serializeAws_json1_1DescribeApplicationCommand = async ( input: DescribeApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DescribeApplication", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -541,10 +490,7 @@ export const serializeAws_json1_1DescribeApplicationSnapshotCommand = async ( input: DescribeApplicationSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DescribeApplicationSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApplicationSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApplicationSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -554,10 +500,7 @@ export const serializeAws_json1_1DescribeApplicationVersionCommand = async ( input: DescribeApplicationVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DescribeApplicationVersion", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApplicationVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApplicationVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -567,10 +510,7 @@ export const serializeAws_json1_1DiscoverInputSchemaCommand = async ( input: DiscoverInputSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.DiscoverInputSchema", - }; + const headers: __HeaderBag = sharedHeaders("DiscoverInputSchema"); let body: any; body = JSON.stringify(serializeAws_json1_1DiscoverInputSchemaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -580,10 +520,7 @@ export const serializeAws_json1_1ListApplicationsCommand = async ( input: ListApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.ListApplications", - }; + const headers: __HeaderBag = sharedHeaders("ListApplications"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApplicationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -593,10 +530,7 @@ export const serializeAws_json1_1ListApplicationSnapshotsCommand = async ( input: ListApplicationSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.ListApplicationSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("ListApplicationSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApplicationSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -606,10 +540,7 @@ export const serializeAws_json1_1ListApplicationVersionsCommand = async ( input: ListApplicationVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.ListApplicationVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListApplicationVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApplicationVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -619,10 +550,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -632,10 +560,7 @@ export const serializeAws_json1_1RollbackApplicationCommand = async ( input: RollbackApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.RollbackApplication", - }; + const headers: __HeaderBag = sharedHeaders("RollbackApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1RollbackApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -645,10 +570,7 @@ export const serializeAws_json1_1StartApplicationCommand = async ( input: StartApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.StartApplication", - }; + const headers: __HeaderBag = sharedHeaders("StartApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1StartApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -658,10 +580,7 @@ export const serializeAws_json1_1StopApplicationCommand = async ( input: StopApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.StopApplication", - }; + const headers: __HeaderBag = sharedHeaders("StopApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1StopApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -671,10 +590,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -684,10 +600,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -697,10 +610,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( input: UpdateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.UpdateApplication", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -710,10 +620,7 @@ export const serializeAws_json1_1UpdateApplicationMaintenanceConfigurationComman input: UpdateApplicationMaintenanceConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20180523.UpdateApplicationMaintenanceConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApplicationMaintenanceConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApplicationMaintenanceConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5546,6 +5453,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `KinesisAnalytics_20180523.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts index 352d4a42fe2da..c0474928054f8 100644 --- a/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts @@ -187,10 +187,7 @@ export const serializeAws_json1_1AddApplicationCloudWatchLoggingOptionCommand = input: AddApplicationCloudWatchLoggingOptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.AddApplicationCloudWatchLoggingOption", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationCloudWatchLoggingOption"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationCloudWatchLoggingOptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -200,10 +197,7 @@ export const serializeAws_json1_1AddApplicationInputCommand = async ( input: AddApplicationInputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.AddApplicationInput", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationInput"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationInputRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -213,10 +207,7 @@ export const serializeAws_json1_1AddApplicationInputProcessingConfigurationComma input: AddApplicationInputProcessingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.AddApplicationInputProcessingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationInputProcessingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationInputProcessingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -226,10 +217,7 @@ export const serializeAws_json1_1AddApplicationOutputCommand = async ( input: AddApplicationOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.AddApplicationOutput", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationOutput"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationOutputRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -239,10 +227,7 @@ export const serializeAws_json1_1AddApplicationReferenceDataSourceCommand = asyn input: AddApplicationReferenceDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.AddApplicationReferenceDataSource", - }; + const headers: __HeaderBag = sharedHeaders("AddApplicationReferenceDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1AddApplicationReferenceDataSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -252,10 +237,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( input: CreateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.CreateApplication", - }; + const headers: __HeaderBag = sharedHeaders("CreateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -265,10 +247,7 @@ export const serializeAws_json1_1DeleteApplicationCommand = async ( input: DeleteApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.DeleteApplication", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -278,10 +257,7 @@ export const serializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommand input: DeleteApplicationCloudWatchLoggingOptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.DeleteApplicationCloudWatchLoggingOption", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplicationCloudWatchLoggingOption"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -291,10 +267,7 @@ export const serializeAws_json1_1DeleteApplicationInputProcessingConfigurationCo input: DeleteApplicationInputProcessingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.DeleteApplicationInputProcessingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplicationInputProcessingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationInputProcessingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -304,10 +277,7 @@ export const serializeAws_json1_1DeleteApplicationOutputCommand = async ( input: DeleteApplicationOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.DeleteApplicationOutput", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplicationOutput"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationOutputRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -317,10 +287,7 @@ export const serializeAws_json1_1DeleteApplicationReferenceDataSourceCommand = a input: DeleteApplicationReferenceDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.DeleteApplicationReferenceDataSource", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApplicationReferenceDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteApplicationReferenceDataSourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -330,10 +297,7 @@ export const serializeAws_json1_1DescribeApplicationCommand = async ( input: DescribeApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.DescribeApplication", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -343,10 +307,7 @@ export const serializeAws_json1_1DiscoverInputSchemaCommand = async ( input: DiscoverInputSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.DiscoverInputSchema", - }; + const headers: __HeaderBag = sharedHeaders("DiscoverInputSchema"); let body: any; body = JSON.stringify(serializeAws_json1_1DiscoverInputSchemaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -356,10 +317,7 @@ export const serializeAws_json1_1ListApplicationsCommand = async ( input: ListApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.ListApplications", - }; + const headers: __HeaderBag = sharedHeaders("ListApplications"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApplicationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -369,10 +327,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -382,10 +337,7 @@ export const serializeAws_json1_1StartApplicationCommand = async ( input: StartApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.StartApplication", - }; + const headers: __HeaderBag = sharedHeaders("StartApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1StartApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -395,10 +347,7 @@ export const serializeAws_json1_1StopApplicationCommand = async ( input: StopApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.StopApplication", - }; + const headers: __HeaderBag = sharedHeaders("StopApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1StopApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -408,10 +357,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -421,10 +367,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -434,10 +377,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( input: UpdateApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "KinesisAnalytics_20150814.UpdateApplication", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApplication"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3157,6 +3097,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `KinesisAnalytics_20150814.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-kinesis/src/protocols/Aws_json1_1.ts b/clients/client-kinesis/src/protocols/Aws_json1_1.ts index 84f8729600c77..cfed18d219441 100644 --- a/clients/client-kinesis/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis/src/protocols/Aws_json1_1.ts @@ -172,10 +172,7 @@ export const serializeAws_json1_1AddTagsToStreamCommand = async ( input: AddTagsToStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.AddTagsToStream", - }; + const headers: __HeaderBag = sharedHeaders("AddTagsToStream"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsToStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -185,10 +182,7 @@ export const serializeAws_json1_1CreateStreamCommand = async ( input: CreateStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.CreateStream", - }; + const headers: __HeaderBag = sharedHeaders("CreateStream"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -198,10 +192,7 @@ export const serializeAws_json1_1DecreaseStreamRetentionPeriodCommand = async ( input: DecreaseStreamRetentionPeriodCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.DecreaseStreamRetentionPeriod", - }; + const headers: __HeaderBag = sharedHeaders("DecreaseStreamRetentionPeriod"); let body: any; body = JSON.stringify(serializeAws_json1_1DecreaseStreamRetentionPeriodInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -211,10 +202,7 @@ export const serializeAws_json1_1DeleteStreamCommand = async ( input: DeleteStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.DeleteStream", - }; + const headers: __HeaderBag = sharedHeaders("DeleteStream"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -224,10 +212,7 @@ export const serializeAws_json1_1DeregisterStreamConsumerCommand = async ( input: DeregisterStreamConsumerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.DeregisterStreamConsumer", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterStreamConsumer"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterStreamConsumerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -237,10 +222,7 @@ export const serializeAws_json1_1DescribeLimitsCommand = async ( input: DescribeLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.DescribeLimits", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLimits"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLimitsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -250,10 +232,7 @@ export const serializeAws_json1_1DescribeStreamCommand = async ( input: DescribeStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.DescribeStream", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStream"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -263,10 +242,7 @@ export const serializeAws_json1_1DescribeStreamConsumerCommand = async ( input: DescribeStreamConsumerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.DescribeStreamConsumer", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStreamConsumer"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStreamConsumerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -276,10 +252,7 @@ export const serializeAws_json1_1DescribeStreamSummaryCommand = async ( input: DescribeStreamSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.DescribeStreamSummary", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStreamSummary"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStreamSummaryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -289,10 +262,7 @@ export const serializeAws_json1_1DisableEnhancedMonitoringCommand = async ( input: DisableEnhancedMonitoringCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.DisableEnhancedMonitoring", - }; + const headers: __HeaderBag = sharedHeaders("DisableEnhancedMonitoring"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableEnhancedMonitoringInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -302,10 +272,7 @@ export const serializeAws_json1_1EnableEnhancedMonitoringCommand = async ( input: EnableEnhancedMonitoringCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.EnableEnhancedMonitoring", - }; + const headers: __HeaderBag = sharedHeaders("EnableEnhancedMonitoring"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableEnhancedMonitoringInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -315,10 +282,7 @@ export const serializeAws_json1_1GetRecordsCommand = async ( input: GetRecordsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.GetRecords", - }; + const headers: __HeaderBag = sharedHeaders("GetRecords"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRecordsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -328,10 +292,7 @@ export const serializeAws_json1_1GetShardIteratorCommand = async ( input: GetShardIteratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.GetShardIterator", - }; + const headers: __HeaderBag = sharedHeaders("GetShardIterator"); let body: any; body = JSON.stringify(serializeAws_json1_1GetShardIteratorInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -341,10 +302,7 @@ export const serializeAws_json1_1IncreaseStreamRetentionPeriodCommand = async ( input: IncreaseStreamRetentionPeriodCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.IncreaseStreamRetentionPeriod", - }; + const headers: __HeaderBag = sharedHeaders("IncreaseStreamRetentionPeriod"); let body: any; body = JSON.stringify(serializeAws_json1_1IncreaseStreamRetentionPeriodInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -354,10 +312,7 @@ export const serializeAws_json1_1ListShardsCommand = async ( input: ListShardsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.ListShards", - }; + const headers: __HeaderBag = sharedHeaders("ListShards"); let body: any; body = JSON.stringify(serializeAws_json1_1ListShardsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -367,10 +322,7 @@ export const serializeAws_json1_1ListStreamConsumersCommand = async ( input: ListStreamConsumersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.ListStreamConsumers", - }; + const headers: __HeaderBag = sharedHeaders("ListStreamConsumers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStreamConsumersInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -380,10 +332,7 @@ export const serializeAws_json1_1ListStreamsCommand = async ( input: ListStreamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.ListStreams", - }; + const headers: __HeaderBag = sharedHeaders("ListStreams"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStreamsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -393,10 +342,7 @@ export const serializeAws_json1_1ListTagsForStreamCommand = async ( input: ListTagsForStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.ListTagsForStream", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForStream"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -406,10 +352,7 @@ export const serializeAws_json1_1MergeShardsCommand = async ( input: MergeShardsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.MergeShards", - }; + const headers: __HeaderBag = sharedHeaders("MergeShards"); let body: any; body = JSON.stringify(serializeAws_json1_1MergeShardsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -419,10 +362,7 @@ export const serializeAws_json1_1PutRecordCommand = async ( input: PutRecordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.PutRecord", - }; + const headers: __HeaderBag = sharedHeaders("PutRecord"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRecordInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -432,10 +372,7 @@ export const serializeAws_json1_1PutRecordsCommand = async ( input: PutRecordsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.PutRecords", - }; + const headers: __HeaderBag = sharedHeaders("PutRecords"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRecordsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -445,10 +382,7 @@ export const serializeAws_json1_1RegisterStreamConsumerCommand = async ( input: RegisterStreamConsumerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.RegisterStreamConsumer", - }; + const headers: __HeaderBag = sharedHeaders("RegisterStreamConsumer"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterStreamConsumerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -458,10 +392,7 @@ export const serializeAws_json1_1RemoveTagsFromStreamCommand = async ( input: RemoveTagsFromStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.RemoveTagsFromStream", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTagsFromStream"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsFromStreamInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -471,10 +402,7 @@ export const serializeAws_json1_1SplitShardCommand = async ( input: SplitShardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.SplitShard", - }; + const headers: __HeaderBag = sharedHeaders("SplitShard"); let body: any; body = JSON.stringify(serializeAws_json1_1SplitShardInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -484,10 +412,7 @@ export const serializeAws_json1_1StartStreamEncryptionCommand = async ( input: StartStreamEncryptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.StartStreamEncryption", - }; + const headers: __HeaderBag = sharedHeaders("StartStreamEncryption"); let body: any; body = JSON.stringify(serializeAws_json1_1StartStreamEncryptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -497,10 +422,7 @@ export const serializeAws_json1_1StopStreamEncryptionCommand = async ( input: StopStreamEncryptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.StopStreamEncryption", - }; + const headers: __HeaderBag = sharedHeaders("StopStreamEncryption"); let body: any; body = JSON.stringify(serializeAws_json1_1StopStreamEncryptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -510,10 +432,7 @@ export const serializeAws_json1_1SubscribeToShardCommand = async ( input: SubscribeToShardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.SubscribeToShard", - }; + const headers: __HeaderBag = sharedHeaders("SubscribeToShard"); let body: any; body = JSON.stringify(serializeAws_json1_1SubscribeToShardInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -523,10 +442,7 @@ export const serializeAws_json1_1UpdateShardCountCommand = async ( input: UpdateShardCountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.UpdateShardCount", - }; + const headers: __HeaderBag = sharedHeaders("UpdateShardCount"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateShardCountInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -536,10 +452,7 @@ export const serializeAws_json1_1UpdateStreamModeCommand = async ( input: UpdateStreamModeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Kinesis_20131202.UpdateStreamMode", - }; + const headers: __HeaderBag = sharedHeaders("UpdateStreamMode"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateStreamModeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3456,6 +3369,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `Kinesis_20131202.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-kms/src/protocols/Aws_json1_1.ts b/clients/client-kms/src/protocols/Aws_json1_1.ts index ab705aac9ef90..3cefd6ead4a39 100644 --- a/clients/client-kms/src/protocols/Aws_json1_1.ts +++ b/clients/client-kms/src/protocols/Aws_json1_1.ts @@ -269,10 +269,7 @@ export const serializeAws_json1_1CancelKeyDeletionCommand = async ( input: CancelKeyDeletionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.CancelKeyDeletion", - }; + const headers: __HeaderBag = sharedHeaders("CancelKeyDeletion"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelKeyDeletionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -282,10 +279,7 @@ export const serializeAws_json1_1ConnectCustomKeyStoreCommand = async ( input: ConnectCustomKeyStoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ConnectCustomKeyStore", - }; + const headers: __HeaderBag = sharedHeaders("ConnectCustomKeyStore"); let body: any; body = JSON.stringify(serializeAws_json1_1ConnectCustomKeyStoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -295,10 +289,7 @@ export const serializeAws_json1_1CreateAliasCommand = async ( input: CreateAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.CreateAlias", - }; + const headers: __HeaderBag = sharedHeaders("CreateAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAliasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -308,10 +299,7 @@ export const serializeAws_json1_1CreateCustomKeyStoreCommand = async ( input: CreateCustomKeyStoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.CreateCustomKeyStore", - }; + const headers: __HeaderBag = sharedHeaders("CreateCustomKeyStore"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCustomKeyStoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -321,10 +309,7 @@ export const serializeAws_json1_1CreateGrantCommand = async ( input: CreateGrantCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.CreateGrant", - }; + const headers: __HeaderBag = sharedHeaders("CreateGrant"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGrantRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -334,10 +319,7 @@ export const serializeAws_json1_1CreateKeyCommand = async ( input: CreateKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.CreateKey", - }; + const headers: __HeaderBag = sharedHeaders("CreateKey"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -347,10 +329,7 @@ export const serializeAws_json1_1DecryptCommand = async ( input: DecryptCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.Decrypt", - }; + const headers: __HeaderBag = sharedHeaders("Decrypt"); let body: any; body = JSON.stringify(serializeAws_json1_1DecryptRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -360,10 +339,7 @@ export const serializeAws_json1_1DeleteAliasCommand = async ( input: DeleteAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.DeleteAlias", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAliasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -373,10 +349,7 @@ export const serializeAws_json1_1DeleteCustomKeyStoreCommand = async ( input: DeleteCustomKeyStoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.DeleteCustomKeyStore", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCustomKeyStore"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCustomKeyStoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -386,10 +359,7 @@ export const serializeAws_json1_1DeleteImportedKeyMaterialCommand = async ( input: DeleteImportedKeyMaterialCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.DeleteImportedKeyMaterial", - }; + const headers: __HeaderBag = sharedHeaders("DeleteImportedKeyMaterial"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteImportedKeyMaterialRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -399,10 +369,7 @@ export const serializeAws_json1_1DescribeCustomKeyStoresCommand = async ( input: DescribeCustomKeyStoresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.DescribeCustomKeyStores", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCustomKeyStores"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCustomKeyStoresRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -412,10 +379,7 @@ export const serializeAws_json1_1DescribeKeyCommand = async ( input: DescribeKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.DescribeKey", - }; + const headers: __HeaderBag = sharedHeaders("DescribeKey"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -425,10 +389,7 @@ export const serializeAws_json1_1DisableKeyCommand = async ( input: DisableKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.DisableKey", - }; + const headers: __HeaderBag = sharedHeaders("DisableKey"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -438,10 +399,7 @@ export const serializeAws_json1_1DisableKeyRotationCommand = async ( input: DisableKeyRotationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.DisableKeyRotation", - }; + const headers: __HeaderBag = sharedHeaders("DisableKeyRotation"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableKeyRotationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -451,10 +409,7 @@ export const serializeAws_json1_1DisconnectCustomKeyStoreCommand = async ( input: DisconnectCustomKeyStoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.DisconnectCustomKeyStore", - }; + const headers: __HeaderBag = sharedHeaders("DisconnectCustomKeyStore"); let body: any; body = JSON.stringify(serializeAws_json1_1DisconnectCustomKeyStoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -464,10 +419,7 @@ export const serializeAws_json1_1EnableKeyCommand = async ( input: EnableKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.EnableKey", - }; + const headers: __HeaderBag = sharedHeaders("EnableKey"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -477,10 +429,7 @@ export const serializeAws_json1_1EnableKeyRotationCommand = async ( input: EnableKeyRotationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.EnableKeyRotation", - }; + const headers: __HeaderBag = sharedHeaders("EnableKeyRotation"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableKeyRotationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -490,10 +439,7 @@ export const serializeAws_json1_1EncryptCommand = async ( input: EncryptCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.Encrypt", - }; + const headers: __HeaderBag = sharedHeaders("Encrypt"); let body: any; body = JSON.stringify(serializeAws_json1_1EncryptRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -503,10 +449,7 @@ export const serializeAws_json1_1GenerateDataKeyCommand = async ( input: GenerateDataKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.GenerateDataKey", - }; + const headers: __HeaderBag = sharedHeaders("GenerateDataKey"); let body: any; body = JSON.stringify(serializeAws_json1_1GenerateDataKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -516,10 +459,7 @@ export const serializeAws_json1_1GenerateDataKeyPairCommand = async ( input: GenerateDataKeyPairCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.GenerateDataKeyPair", - }; + const headers: __HeaderBag = sharedHeaders("GenerateDataKeyPair"); let body: any; body = JSON.stringify(serializeAws_json1_1GenerateDataKeyPairRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -529,10 +469,7 @@ export const serializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommand = as input: GenerateDataKeyPairWithoutPlaintextCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.GenerateDataKeyPairWithoutPlaintext", - }; + const headers: __HeaderBag = sharedHeaders("GenerateDataKeyPairWithoutPlaintext"); let body: any; body = JSON.stringify(serializeAws_json1_1GenerateDataKeyPairWithoutPlaintextRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -542,10 +479,7 @@ export const serializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand = async input: GenerateDataKeyWithoutPlaintextCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.GenerateDataKeyWithoutPlaintext", - }; + const headers: __HeaderBag = sharedHeaders("GenerateDataKeyWithoutPlaintext"); let body: any; body = JSON.stringify(serializeAws_json1_1GenerateDataKeyWithoutPlaintextRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -555,10 +489,7 @@ export const serializeAws_json1_1GenerateMacCommand = async ( input: GenerateMacCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.GenerateMac", - }; + const headers: __HeaderBag = sharedHeaders("GenerateMac"); let body: any; body = JSON.stringify(serializeAws_json1_1GenerateMacRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -568,10 +499,7 @@ export const serializeAws_json1_1GenerateRandomCommand = async ( input: GenerateRandomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.GenerateRandom", - }; + const headers: __HeaderBag = sharedHeaders("GenerateRandom"); let body: any; body = JSON.stringify(serializeAws_json1_1GenerateRandomRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -581,10 +509,7 @@ export const serializeAws_json1_1GetKeyPolicyCommand = async ( input: GetKeyPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.GetKeyPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetKeyPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetKeyPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -594,10 +519,7 @@ export const serializeAws_json1_1GetKeyRotationStatusCommand = async ( input: GetKeyRotationStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.GetKeyRotationStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetKeyRotationStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetKeyRotationStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -607,10 +529,7 @@ export const serializeAws_json1_1GetParametersForImportCommand = async ( input: GetParametersForImportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.GetParametersForImport", - }; + const headers: __HeaderBag = sharedHeaders("GetParametersForImport"); let body: any; body = JSON.stringify(serializeAws_json1_1GetParametersForImportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -620,10 +539,7 @@ export const serializeAws_json1_1GetPublicKeyCommand = async ( input: GetPublicKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.GetPublicKey", - }; + const headers: __HeaderBag = sharedHeaders("GetPublicKey"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPublicKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -633,10 +549,7 @@ export const serializeAws_json1_1ImportKeyMaterialCommand = async ( input: ImportKeyMaterialCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ImportKeyMaterial", - }; + const headers: __HeaderBag = sharedHeaders("ImportKeyMaterial"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportKeyMaterialRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -646,10 +559,7 @@ export const serializeAws_json1_1ListAliasesCommand = async ( input: ListAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ListAliases", - }; + const headers: __HeaderBag = sharedHeaders("ListAliases"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAliasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -659,10 +569,7 @@ export const serializeAws_json1_1ListGrantsCommand = async ( input: ListGrantsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ListGrants", - }; + const headers: __HeaderBag = sharedHeaders("ListGrants"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGrantsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -672,10 +579,7 @@ export const serializeAws_json1_1ListKeyPoliciesCommand = async ( input: ListKeyPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ListKeyPolicies", - }; + const headers: __HeaderBag = sharedHeaders("ListKeyPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListKeyPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -685,10 +589,7 @@ export const serializeAws_json1_1ListKeysCommand = async ( input: ListKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ListKeys", - }; + const headers: __HeaderBag = sharedHeaders("ListKeys"); let body: any; body = JSON.stringify(serializeAws_json1_1ListKeysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -698,10 +599,7 @@ export const serializeAws_json1_1ListResourceTagsCommand = async ( input: ListResourceTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ListResourceTags", - }; + const headers: __HeaderBag = sharedHeaders("ListResourceTags"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourceTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -711,10 +609,7 @@ export const serializeAws_json1_1ListRetirableGrantsCommand = async ( input: ListRetirableGrantsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ListRetirableGrants", - }; + const headers: __HeaderBag = sharedHeaders("ListRetirableGrants"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRetirableGrantsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -724,10 +619,7 @@ export const serializeAws_json1_1PutKeyPolicyCommand = async ( input: PutKeyPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.PutKeyPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutKeyPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutKeyPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -737,10 +629,7 @@ export const serializeAws_json1_1ReEncryptCommand = async ( input: ReEncryptCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ReEncrypt", - }; + const headers: __HeaderBag = sharedHeaders("ReEncrypt"); let body: any; body = JSON.stringify(serializeAws_json1_1ReEncryptRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -750,10 +639,7 @@ export const serializeAws_json1_1ReplicateKeyCommand = async ( input: ReplicateKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ReplicateKey", - }; + const headers: __HeaderBag = sharedHeaders("ReplicateKey"); let body: any; body = JSON.stringify(serializeAws_json1_1ReplicateKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -763,10 +649,7 @@ export const serializeAws_json1_1RetireGrantCommand = async ( input: RetireGrantCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.RetireGrant", - }; + const headers: __HeaderBag = sharedHeaders("RetireGrant"); let body: any; body = JSON.stringify(serializeAws_json1_1RetireGrantRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -776,10 +659,7 @@ export const serializeAws_json1_1RevokeGrantCommand = async ( input: RevokeGrantCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.RevokeGrant", - }; + const headers: __HeaderBag = sharedHeaders("RevokeGrant"); let body: any; body = JSON.stringify(serializeAws_json1_1RevokeGrantRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -789,10 +669,7 @@ export const serializeAws_json1_1ScheduleKeyDeletionCommand = async ( input: ScheduleKeyDeletionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.ScheduleKeyDeletion", - }; + const headers: __HeaderBag = sharedHeaders("ScheduleKeyDeletion"); let body: any; body = JSON.stringify(serializeAws_json1_1ScheduleKeyDeletionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -802,10 +679,7 @@ export const serializeAws_json1_1SignCommand = async ( input: SignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.Sign", - }; + const headers: __HeaderBag = sharedHeaders("Sign"); let body: any; body = JSON.stringify(serializeAws_json1_1SignRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -815,10 +689,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -828,10 +699,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -841,10 +709,7 @@ export const serializeAws_json1_1UpdateAliasCommand = async ( input: UpdateAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.UpdateAlias", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAliasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -854,10 +719,7 @@ export const serializeAws_json1_1UpdateCustomKeyStoreCommand = async ( input: UpdateCustomKeyStoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.UpdateCustomKeyStore", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCustomKeyStore"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCustomKeyStoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -867,10 +729,7 @@ export const serializeAws_json1_1UpdateKeyDescriptionCommand = async ( input: UpdateKeyDescriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.UpdateKeyDescription", - }; + const headers: __HeaderBag = sharedHeaders("UpdateKeyDescription"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateKeyDescriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -880,10 +739,7 @@ export const serializeAws_json1_1UpdatePrimaryRegionCommand = async ( input: UpdatePrimaryRegionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.UpdatePrimaryRegion", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePrimaryRegion"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePrimaryRegionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -893,10 +749,7 @@ export const serializeAws_json1_1VerifyCommand = async ( input: VerifyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.Verify", - }; + const headers: __HeaderBag = sharedHeaders("Verify"); let body: any; body = JSON.stringify(serializeAws_json1_1VerifyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -906,10 +759,7 @@ export const serializeAws_json1_1VerifyMacCommand = async ( input: VerifyMacCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TrentService.VerifyMac", - }; + const headers: __HeaderBag = sharedHeaders("VerifyMac"); let body: any; body = JSON.stringify(serializeAws_json1_1VerifyMacRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6110,6 +5960,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `TrentService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-license-manager/src/protocols/Aws_json1_1.ts b/clients/client-license-manager/src/protocols/Aws_json1_1.ts index 162cf22a13fa7..48a50f1000003 100644 --- a/clients/client-license-manager/src/protocols/Aws_json1_1.ts +++ b/clients/client-license-manager/src/protocols/Aws_json1_1.ts @@ -319,10 +319,7 @@ export const serializeAws_json1_1AcceptGrantCommand = async ( input: AcceptGrantCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.AcceptGrant", - }; + const headers: __HeaderBag = sharedHeaders("AcceptGrant"); let body: any; body = JSON.stringify(serializeAws_json1_1AcceptGrantRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -332,10 +329,7 @@ export const serializeAws_json1_1CheckInLicenseCommand = async ( input: CheckInLicenseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CheckInLicense", - }; + const headers: __HeaderBag = sharedHeaders("CheckInLicense"); let body: any; body = JSON.stringify(serializeAws_json1_1CheckInLicenseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -345,10 +339,7 @@ export const serializeAws_json1_1CheckoutBorrowLicenseCommand = async ( input: CheckoutBorrowLicenseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CheckoutBorrowLicense", - }; + const headers: __HeaderBag = sharedHeaders("CheckoutBorrowLicense"); let body: any; body = JSON.stringify(serializeAws_json1_1CheckoutBorrowLicenseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -358,10 +349,7 @@ export const serializeAws_json1_1CheckoutLicenseCommand = async ( input: CheckoutLicenseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CheckoutLicense", - }; + const headers: __HeaderBag = sharedHeaders("CheckoutLicense"); let body: any; body = JSON.stringify(serializeAws_json1_1CheckoutLicenseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -371,10 +359,7 @@ export const serializeAws_json1_1CreateGrantCommand = async ( input: CreateGrantCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CreateGrant", - }; + const headers: __HeaderBag = sharedHeaders("CreateGrant"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGrantRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -384,10 +369,7 @@ export const serializeAws_json1_1CreateGrantVersionCommand = async ( input: CreateGrantVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CreateGrantVersion", - }; + const headers: __HeaderBag = sharedHeaders("CreateGrantVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGrantVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -397,10 +379,7 @@ export const serializeAws_json1_1CreateLicenseCommand = async ( input: CreateLicenseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CreateLicense", - }; + const headers: __HeaderBag = sharedHeaders("CreateLicense"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLicenseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -410,10 +389,7 @@ export const serializeAws_json1_1CreateLicenseConfigurationCommand = async ( input: CreateLicenseConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CreateLicenseConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("CreateLicenseConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLicenseConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -423,10 +399,7 @@ export const serializeAws_json1_1CreateLicenseConversionTaskForResourceCommand = input: CreateLicenseConversionTaskForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CreateLicenseConversionTaskForResource", - }; + const headers: __HeaderBag = sharedHeaders("CreateLicenseConversionTaskForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLicenseConversionTaskForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -436,10 +409,7 @@ export const serializeAws_json1_1CreateLicenseManagerReportGeneratorCommand = as input: CreateLicenseManagerReportGeneratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CreateLicenseManagerReportGenerator", - }; + const headers: __HeaderBag = sharedHeaders("CreateLicenseManagerReportGenerator"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLicenseManagerReportGeneratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -449,10 +419,7 @@ export const serializeAws_json1_1CreateLicenseVersionCommand = async ( input: CreateLicenseVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CreateLicenseVersion", - }; + const headers: __HeaderBag = sharedHeaders("CreateLicenseVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLicenseVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -462,10 +429,7 @@ export const serializeAws_json1_1CreateTokenCommand = async ( input: CreateTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.CreateToken", - }; + const headers: __HeaderBag = sharedHeaders("CreateToken"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -475,10 +439,7 @@ export const serializeAws_json1_1DeleteGrantCommand = async ( input: DeleteGrantCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.DeleteGrant", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGrant"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGrantRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -488,10 +449,7 @@ export const serializeAws_json1_1DeleteLicenseCommand = async ( input: DeleteLicenseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.DeleteLicense", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLicense"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLicenseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -501,10 +459,7 @@ export const serializeAws_json1_1DeleteLicenseConfigurationCommand = async ( input: DeleteLicenseConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.DeleteLicenseConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLicenseConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLicenseConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -514,10 +469,7 @@ export const serializeAws_json1_1DeleteLicenseManagerReportGeneratorCommand = as input: DeleteLicenseManagerReportGeneratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.DeleteLicenseManagerReportGenerator", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLicenseManagerReportGenerator"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLicenseManagerReportGeneratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -527,10 +479,7 @@ export const serializeAws_json1_1DeleteTokenCommand = async ( input: DeleteTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.DeleteToken", - }; + const headers: __HeaderBag = sharedHeaders("DeleteToken"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -540,10 +489,7 @@ export const serializeAws_json1_1ExtendLicenseConsumptionCommand = async ( input: ExtendLicenseConsumptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ExtendLicenseConsumption", - }; + const headers: __HeaderBag = sharedHeaders("ExtendLicenseConsumption"); let body: any; body = JSON.stringify(serializeAws_json1_1ExtendLicenseConsumptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -553,10 +499,7 @@ export const serializeAws_json1_1GetAccessTokenCommand = async ( input: GetAccessTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.GetAccessToken", - }; + const headers: __HeaderBag = sharedHeaders("GetAccessToken"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAccessTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -566,10 +509,7 @@ export const serializeAws_json1_1GetGrantCommand = async ( input: GetGrantCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.GetGrant", - }; + const headers: __HeaderBag = sharedHeaders("GetGrant"); let body: any; body = JSON.stringify(serializeAws_json1_1GetGrantRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -579,10 +519,7 @@ export const serializeAws_json1_1GetLicenseCommand = async ( input: GetLicenseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.GetLicense", - }; + const headers: __HeaderBag = sharedHeaders("GetLicense"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLicenseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -592,10 +529,7 @@ export const serializeAws_json1_1GetLicenseConfigurationCommand = async ( input: GetLicenseConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.GetLicenseConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetLicenseConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLicenseConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -605,10 +539,7 @@ export const serializeAws_json1_1GetLicenseConversionTaskCommand = async ( input: GetLicenseConversionTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.GetLicenseConversionTask", - }; + const headers: __HeaderBag = sharedHeaders("GetLicenseConversionTask"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLicenseConversionTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -618,10 +549,7 @@ export const serializeAws_json1_1GetLicenseManagerReportGeneratorCommand = async input: GetLicenseManagerReportGeneratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.GetLicenseManagerReportGenerator", - }; + const headers: __HeaderBag = sharedHeaders("GetLicenseManagerReportGenerator"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLicenseManagerReportGeneratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -631,10 +559,7 @@ export const serializeAws_json1_1GetLicenseUsageCommand = async ( input: GetLicenseUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.GetLicenseUsage", - }; + const headers: __HeaderBag = sharedHeaders("GetLicenseUsage"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLicenseUsageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -644,10 +569,7 @@ export const serializeAws_json1_1GetServiceSettingsCommand = async ( input: GetServiceSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.GetServiceSettings", - }; + const headers: __HeaderBag = sharedHeaders("GetServiceSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1GetServiceSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -657,10 +579,7 @@ export const serializeAws_json1_1ListAssociationsForLicenseConfigurationCommand input: ListAssociationsForLicenseConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListAssociationsForLicenseConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("ListAssociationsForLicenseConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssociationsForLicenseConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -670,10 +589,7 @@ export const serializeAws_json1_1ListDistributedGrantsCommand = async ( input: ListDistributedGrantsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListDistributedGrants", - }; + const headers: __HeaderBag = sharedHeaders("ListDistributedGrants"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDistributedGrantsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -683,10 +599,7 @@ export const serializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCo input: ListFailuresForLicenseConfigurationOperationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListFailuresForLicenseConfigurationOperations", - }; + const headers: __HeaderBag = sharedHeaders("ListFailuresForLicenseConfigurationOperations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFailuresForLicenseConfigurationOperationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -696,10 +609,7 @@ export const serializeAws_json1_1ListLicenseConfigurationsCommand = async ( input: ListLicenseConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListLicenseConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListLicenseConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLicenseConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -709,10 +619,7 @@ export const serializeAws_json1_1ListLicenseConversionTasksCommand = async ( input: ListLicenseConversionTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListLicenseConversionTasks", - }; + const headers: __HeaderBag = sharedHeaders("ListLicenseConversionTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLicenseConversionTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -722,10 +629,7 @@ export const serializeAws_json1_1ListLicenseManagerReportGeneratorsCommand = asy input: ListLicenseManagerReportGeneratorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListLicenseManagerReportGenerators", - }; + const headers: __HeaderBag = sharedHeaders("ListLicenseManagerReportGenerators"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLicenseManagerReportGeneratorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -735,10 +639,7 @@ export const serializeAws_json1_1ListLicensesCommand = async ( input: ListLicensesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListLicenses", - }; + const headers: __HeaderBag = sharedHeaders("ListLicenses"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLicensesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -748,10 +649,7 @@ export const serializeAws_json1_1ListLicenseSpecificationsForResourceCommand = a input: ListLicenseSpecificationsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListLicenseSpecificationsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListLicenseSpecificationsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLicenseSpecificationsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -761,10 +659,7 @@ export const serializeAws_json1_1ListLicenseVersionsCommand = async ( input: ListLicenseVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListLicenseVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListLicenseVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLicenseVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -774,10 +669,7 @@ export const serializeAws_json1_1ListReceivedGrantsCommand = async ( input: ListReceivedGrantsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListReceivedGrants", - }; + const headers: __HeaderBag = sharedHeaders("ListReceivedGrants"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReceivedGrantsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -787,10 +679,7 @@ export const serializeAws_json1_1ListReceivedGrantsForOrganizationCommand = asyn input: ListReceivedGrantsForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListReceivedGrantsForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("ListReceivedGrantsForOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReceivedGrantsForOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -800,10 +689,7 @@ export const serializeAws_json1_1ListReceivedLicensesCommand = async ( input: ListReceivedLicensesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListReceivedLicenses", - }; + const headers: __HeaderBag = sharedHeaders("ListReceivedLicenses"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReceivedLicensesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -813,10 +699,7 @@ export const serializeAws_json1_1ListReceivedLicensesForOrganizationCommand = as input: ListReceivedLicensesForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListReceivedLicensesForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("ListReceivedLicensesForOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReceivedLicensesForOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -826,10 +709,7 @@ export const serializeAws_json1_1ListResourceInventoryCommand = async ( input: ListResourceInventoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListResourceInventory", - }; + const headers: __HeaderBag = sharedHeaders("ListResourceInventory"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourceInventoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -839,10 +719,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -852,10 +729,7 @@ export const serializeAws_json1_1ListTokensCommand = async ( input: ListTokensCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListTokens", - }; + const headers: __HeaderBag = sharedHeaders("ListTokens"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTokensRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -865,10 +739,7 @@ export const serializeAws_json1_1ListUsageForLicenseConfigurationCommand = async input: ListUsageForLicenseConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.ListUsageForLicenseConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("ListUsageForLicenseConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUsageForLicenseConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -878,10 +749,7 @@ export const serializeAws_json1_1RejectGrantCommand = async ( input: RejectGrantCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.RejectGrant", - }; + const headers: __HeaderBag = sharedHeaders("RejectGrant"); let body: any; body = JSON.stringify(serializeAws_json1_1RejectGrantRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -891,10 +759,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -904,10 +769,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -917,10 +779,7 @@ export const serializeAws_json1_1UpdateLicenseConfigurationCommand = async ( input: UpdateLicenseConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.UpdateLicenseConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLicenseConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLicenseConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -930,10 +789,7 @@ export const serializeAws_json1_1UpdateLicenseManagerReportGeneratorCommand = as input: UpdateLicenseManagerReportGeneratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.UpdateLicenseManagerReportGenerator", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLicenseManagerReportGenerator"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLicenseManagerReportGeneratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -943,10 +799,7 @@ export const serializeAws_json1_1UpdateLicenseSpecificationsForResourceCommand = input: UpdateLicenseSpecificationsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.UpdateLicenseSpecificationsForResource", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLicenseSpecificationsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLicenseSpecificationsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -956,10 +809,7 @@ export const serializeAws_json1_1UpdateServiceSettingsCommand = async ( input: UpdateServiceSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSLicenseManager.UpdateServiceSettings", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServiceSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateServiceSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6450,6 +6300,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSLicenseManager.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-lightsail/src/protocols/Aws_json1_1.ts b/clients/client-lightsail/src/protocols/Aws_json1_1.ts index 6763252c1709c..05f2f8fc9824b 100644 --- a/clients/client-lightsail/src/protocols/Aws_json1_1.ts +++ b/clients/client-lightsail/src/protocols/Aws_json1_1.ts @@ -873,10 +873,7 @@ export const serializeAws_json1_1AllocateStaticIpCommand = async ( input: AllocateStaticIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.AllocateStaticIp", - }; + const headers: __HeaderBag = sharedHeaders("AllocateStaticIp"); let body: any; body = JSON.stringify(serializeAws_json1_1AllocateStaticIpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -886,10 +883,7 @@ export const serializeAws_json1_1AttachCertificateToDistributionCommand = async input: AttachCertificateToDistributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.AttachCertificateToDistribution", - }; + const headers: __HeaderBag = sharedHeaders("AttachCertificateToDistribution"); let body: any; body = JSON.stringify(serializeAws_json1_1AttachCertificateToDistributionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -899,10 +893,7 @@ export const serializeAws_json1_1AttachDiskCommand = async ( input: AttachDiskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.AttachDisk", - }; + const headers: __HeaderBag = sharedHeaders("AttachDisk"); let body: any; body = JSON.stringify(serializeAws_json1_1AttachDiskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -912,10 +903,7 @@ export const serializeAws_json1_1AttachInstancesToLoadBalancerCommand = async ( input: AttachInstancesToLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.AttachInstancesToLoadBalancer", - }; + const headers: __HeaderBag = sharedHeaders("AttachInstancesToLoadBalancer"); let body: any; body = JSON.stringify(serializeAws_json1_1AttachInstancesToLoadBalancerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -925,10 +913,7 @@ export const serializeAws_json1_1AttachLoadBalancerTlsCertificateCommand = async input: AttachLoadBalancerTlsCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.AttachLoadBalancerTlsCertificate", - }; + const headers: __HeaderBag = sharedHeaders("AttachLoadBalancerTlsCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1AttachLoadBalancerTlsCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -938,10 +923,7 @@ export const serializeAws_json1_1AttachStaticIpCommand = async ( input: AttachStaticIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.AttachStaticIp", - }; + const headers: __HeaderBag = sharedHeaders("AttachStaticIp"); let body: any; body = JSON.stringify(serializeAws_json1_1AttachStaticIpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -951,10 +933,7 @@ export const serializeAws_json1_1CloseInstancePublicPortsCommand = async ( input: CloseInstancePublicPortsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CloseInstancePublicPorts", - }; + const headers: __HeaderBag = sharedHeaders("CloseInstancePublicPorts"); let body: any; body = JSON.stringify(serializeAws_json1_1CloseInstancePublicPortsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -964,10 +943,7 @@ export const serializeAws_json1_1CopySnapshotCommand = async ( input: CopySnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CopySnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CopySnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CopySnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -977,10 +953,7 @@ export const serializeAws_json1_1CreateBucketCommand = async ( input: CreateBucketCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateBucket", - }; + const headers: __HeaderBag = sharedHeaders("CreateBucket"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBucketRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -990,10 +963,7 @@ export const serializeAws_json1_1CreateBucketAccessKeyCommand = async ( input: CreateBucketAccessKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateBucketAccessKey", - }; + const headers: __HeaderBag = sharedHeaders("CreateBucketAccessKey"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBucketAccessKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1003,10 +973,7 @@ export const serializeAws_json1_1CreateCertificateCommand = async ( input: CreateCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateCertificate", - }; + const headers: __HeaderBag = sharedHeaders("CreateCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1016,10 +983,7 @@ export const serializeAws_json1_1CreateCloudFormationStackCommand = async ( input: CreateCloudFormationStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateCloudFormationStack", - }; + const headers: __HeaderBag = sharedHeaders("CreateCloudFormationStack"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCloudFormationStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1029,10 +993,7 @@ export const serializeAws_json1_1CreateContactMethodCommand = async ( input: CreateContactMethodCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateContactMethod", - }; + const headers: __HeaderBag = sharedHeaders("CreateContactMethod"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateContactMethodRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1042,10 +1003,7 @@ export const serializeAws_json1_1CreateContainerServiceCommand = async ( input: CreateContainerServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateContainerService", - }; + const headers: __HeaderBag = sharedHeaders("CreateContainerService"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateContainerServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1055,10 +1013,7 @@ export const serializeAws_json1_1CreateContainerServiceDeploymentCommand = async input: CreateContainerServiceDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateContainerServiceDeployment", - }; + const headers: __HeaderBag = sharedHeaders("CreateContainerServiceDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateContainerServiceDeploymentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1068,10 +1023,7 @@ export const serializeAws_json1_1CreateContainerServiceRegistryLoginCommand = as input: CreateContainerServiceRegistryLoginCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateContainerServiceRegistryLogin", - }; + const headers: __HeaderBag = sharedHeaders("CreateContainerServiceRegistryLogin"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateContainerServiceRegistryLoginRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1081,10 +1033,7 @@ export const serializeAws_json1_1CreateDiskCommand = async ( input: CreateDiskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateDisk", - }; + const headers: __HeaderBag = sharedHeaders("CreateDisk"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDiskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1094,10 +1043,7 @@ export const serializeAws_json1_1CreateDiskFromSnapshotCommand = async ( input: CreateDiskFromSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateDiskFromSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateDiskFromSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDiskFromSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1107,10 +1053,7 @@ export const serializeAws_json1_1CreateDiskSnapshotCommand = async ( input: CreateDiskSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateDiskSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateDiskSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDiskSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1120,10 +1063,7 @@ export const serializeAws_json1_1CreateDistributionCommand = async ( input: CreateDistributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateDistribution", - }; + const headers: __HeaderBag = sharedHeaders("CreateDistribution"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDistributionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1133,10 +1073,7 @@ export const serializeAws_json1_1CreateDomainCommand = async ( input: CreateDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateDomain", - }; + const headers: __HeaderBag = sharedHeaders("CreateDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1146,10 +1083,7 @@ export const serializeAws_json1_1CreateDomainEntryCommand = async ( input: CreateDomainEntryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateDomainEntry", - }; + const headers: __HeaderBag = sharedHeaders("CreateDomainEntry"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDomainEntryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1159,10 +1093,7 @@ export const serializeAws_json1_1CreateGUISessionAccessDetailsCommand = async ( input: CreateGUISessionAccessDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateGUISessionAccessDetails", - }; + const headers: __HeaderBag = sharedHeaders("CreateGUISessionAccessDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGUISessionAccessDetailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1172,10 +1103,7 @@ export const serializeAws_json1_1CreateInstancesCommand = async ( input: CreateInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateInstances", - }; + const headers: __HeaderBag = sharedHeaders("CreateInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateInstancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1185,10 +1113,7 @@ export const serializeAws_json1_1CreateInstancesFromSnapshotCommand = async ( input: CreateInstancesFromSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateInstancesFromSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateInstancesFromSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateInstancesFromSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1198,10 +1123,7 @@ export const serializeAws_json1_1CreateInstanceSnapshotCommand = async ( input: CreateInstanceSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateInstanceSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateInstanceSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateInstanceSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1211,10 +1133,7 @@ export const serializeAws_json1_1CreateKeyPairCommand = async ( input: CreateKeyPairCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateKeyPair", - }; + const headers: __HeaderBag = sharedHeaders("CreateKeyPair"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateKeyPairRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1224,10 +1143,7 @@ export const serializeAws_json1_1CreateLoadBalancerCommand = async ( input: CreateLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateLoadBalancer", - }; + const headers: __HeaderBag = sharedHeaders("CreateLoadBalancer"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLoadBalancerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1237,10 +1153,7 @@ export const serializeAws_json1_1CreateLoadBalancerTlsCertificateCommand = async input: CreateLoadBalancerTlsCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateLoadBalancerTlsCertificate", - }; + const headers: __HeaderBag = sharedHeaders("CreateLoadBalancerTlsCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLoadBalancerTlsCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1250,10 +1163,7 @@ export const serializeAws_json1_1CreateRelationalDatabaseCommand = async ( input: CreateRelationalDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateRelationalDatabase", - }; + const headers: __HeaderBag = sharedHeaders("CreateRelationalDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRelationalDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1263,10 +1173,7 @@ export const serializeAws_json1_1CreateRelationalDatabaseFromSnapshotCommand = a input: CreateRelationalDatabaseFromSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateRelationalDatabaseFromSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateRelationalDatabaseFromSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRelationalDatabaseFromSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1276,10 +1183,7 @@ export const serializeAws_json1_1CreateRelationalDatabaseSnapshotCommand = async input: CreateRelationalDatabaseSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.CreateRelationalDatabaseSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateRelationalDatabaseSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRelationalDatabaseSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1289,10 +1193,7 @@ export const serializeAws_json1_1DeleteAlarmCommand = async ( input: DeleteAlarmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteAlarm", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAlarm"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAlarmRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1302,10 +1203,7 @@ export const serializeAws_json1_1DeleteAutoSnapshotCommand = async ( input: DeleteAutoSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteAutoSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAutoSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAutoSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1315,10 +1213,7 @@ export const serializeAws_json1_1DeleteBucketCommand = async ( input: DeleteBucketCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteBucket", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBucket"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBucketRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1328,10 +1223,7 @@ export const serializeAws_json1_1DeleteBucketAccessKeyCommand = async ( input: DeleteBucketAccessKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteBucketAccessKey", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBucketAccessKey"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBucketAccessKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1341,10 +1233,7 @@ export const serializeAws_json1_1DeleteCertificateCommand = async ( input: DeleteCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteCertificate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1354,10 +1243,7 @@ export const serializeAws_json1_1DeleteContactMethodCommand = async ( input: DeleteContactMethodCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteContactMethod", - }; + const headers: __HeaderBag = sharedHeaders("DeleteContactMethod"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteContactMethodRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1367,10 +1253,7 @@ export const serializeAws_json1_1DeleteContainerImageCommand = async ( input: DeleteContainerImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteContainerImage", - }; + const headers: __HeaderBag = sharedHeaders("DeleteContainerImage"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteContainerImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1380,10 +1263,7 @@ export const serializeAws_json1_1DeleteContainerServiceCommand = async ( input: DeleteContainerServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteContainerService", - }; + const headers: __HeaderBag = sharedHeaders("DeleteContainerService"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteContainerServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1393,10 +1273,7 @@ export const serializeAws_json1_1DeleteDiskCommand = async ( input: DeleteDiskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteDisk", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDisk"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDiskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1406,10 +1283,7 @@ export const serializeAws_json1_1DeleteDiskSnapshotCommand = async ( input: DeleteDiskSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteDiskSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDiskSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDiskSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1419,10 +1293,7 @@ export const serializeAws_json1_1DeleteDistributionCommand = async ( input: DeleteDistributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteDistribution", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDistribution"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDistributionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1432,10 +1303,7 @@ export const serializeAws_json1_1DeleteDomainCommand = async ( input: DeleteDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteDomain", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1445,10 +1313,7 @@ export const serializeAws_json1_1DeleteDomainEntryCommand = async ( input: DeleteDomainEntryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteDomainEntry", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDomainEntry"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDomainEntryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1458,10 +1323,7 @@ export const serializeAws_json1_1DeleteInstanceCommand = async ( input: DeleteInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeleteInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1471,10 +1333,7 @@ export const serializeAws_json1_1DeleteInstanceSnapshotCommand = async ( input: DeleteInstanceSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteInstanceSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DeleteInstanceSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteInstanceSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1484,10 +1343,7 @@ export const serializeAws_json1_1DeleteKeyPairCommand = async ( input: DeleteKeyPairCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteKeyPair", - }; + const headers: __HeaderBag = sharedHeaders("DeleteKeyPair"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteKeyPairRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1497,10 +1353,7 @@ export const serializeAws_json1_1DeleteKnownHostKeysCommand = async ( input: DeleteKnownHostKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteKnownHostKeys", - }; + const headers: __HeaderBag = sharedHeaders("DeleteKnownHostKeys"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteKnownHostKeysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1510,10 +1363,7 @@ export const serializeAws_json1_1DeleteLoadBalancerCommand = async ( input: DeleteLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteLoadBalancer", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLoadBalancer"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLoadBalancerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1523,10 +1373,7 @@ export const serializeAws_json1_1DeleteLoadBalancerTlsCertificateCommand = async input: DeleteLoadBalancerTlsCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteLoadBalancerTlsCertificate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLoadBalancerTlsCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLoadBalancerTlsCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1536,10 +1383,7 @@ export const serializeAws_json1_1DeleteRelationalDatabaseCommand = async ( input: DeleteRelationalDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteRelationalDatabase", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRelationalDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRelationalDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1549,10 +1393,7 @@ export const serializeAws_json1_1DeleteRelationalDatabaseSnapshotCommand = async input: DeleteRelationalDatabaseSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DeleteRelationalDatabaseSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRelationalDatabaseSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRelationalDatabaseSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1562,10 +1403,7 @@ export const serializeAws_json1_1DetachCertificateFromDistributionCommand = asyn input: DetachCertificateFromDistributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DetachCertificateFromDistribution", - }; + const headers: __HeaderBag = sharedHeaders("DetachCertificateFromDistribution"); let body: any; body = JSON.stringify(serializeAws_json1_1DetachCertificateFromDistributionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1575,10 +1413,7 @@ export const serializeAws_json1_1DetachDiskCommand = async ( input: DetachDiskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DetachDisk", - }; + const headers: __HeaderBag = sharedHeaders("DetachDisk"); let body: any; body = JSON.stringify(serializeAws_json1_1DetachDiskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1588,10 +1423,7 @@ export const serializeAws_json1_1DetachInstancesFromLoadBalancerCommand = async input: DetachInstancesFromLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DetachInstancesFromLoadBalancer", - }; + const headers: __HeaderBag = sharedHeaders("DetachInstancesFromLoadBalancer"); let body: any; body = JSON.stringify(serializeAws_json1_1DetachInstancesFromLoadBalancerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1601,10 +1433,7 @@ export const serializeAws_json1_1DetachStaticIpCommand = async ( input: DetachStaticIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DetachStaticIp", - }; + const headers: __HeaderBag = sharedHeaders("DetachStaticIp"); let body: any; body = JSON.stringify(serializeAws_json1_1DetachStaticIpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1614,10 +1443,7 @@ export const serializeAws_json1_1DisableAddOnCommand = async ( input: DisableAddOnCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DisableAddOn", - }; + const headers: __HeaderBag = sharedHeaders("DisableAddOn"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableAddOnRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1627,10 +1453,7 @@ export const serializeAws_json1_1DownloadDefaultKeyPairCommand = async ( input: DownloadDefaultKeyPairCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.DownloadDefaultKeyPair", - }; + const headers: __HeaderBag = sharedHeaders("DownloadDefaultKeyPair"); let body: any; body = JSON.stringify(serializeAws_json1_1DownloadDefaultKeyPairRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1640,10 +1463,7 @@ export const serializeAws_json1_1EnableAddOnCommand = async ( input: EnableAddOnCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.EnableAddOn", - }; + const headers: __HeaderBag = sharedHeaders("EnableAddOn"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableAddOnRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1653,10 +1473,7 @@ export const serializeAws_json1_1ExportSnapshotCommand = async ( input: ExportSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.ExportSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("ExportSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1ExportSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1666,10 +1483,7 @@ export const serializeAws_json1_1GetActiveNamesCommand = async ( input: GetActiveNamesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetActiveNames", - }; + const headers: __HeaderBag = sharedHeaders("GetActiveNames"); let body: any; body = JSON.stringify(serializeAws_json1_1GetActiveNamesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1679,10 +1493,7 @@ export const serializeAws_json1_1GetAlarmsCommand = async ( input: GetAlarmsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetAlarms", - }; + const headers: __HeaderBag = sharedHeaders("GetAlarms"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAlarmsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1692,10 +1503,7 @@ export const serializeAws_json1_1GetAutoSnapshotsCommand = async ( input: GetAutoSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetAutoSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("GetAutoSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAutoSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1705,10 +1513,7 @@ export const serializeAws_json1_1GetBlueprintsCommand = async ( input: GetBlueprintsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetBlueprints", - }; + const headers: __HeaderBag = sharedHeaders("GetBlueprints"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBlueprintsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1718,10 +1523,7 @@ export const serializeAws_json1_1GetBucketAccessKeysCommand = async ( input: GetBucketAccessKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetBucketAccessKeys", - }; + const headers: __HeaderBag = sharedHeaders("GetBucketAccessKeys"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBucketAccessKeysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1731,10 +1533,7 @@ export const serializeAws_json1_1GetBucketBundlesCommand = async ( input: GetBucketBundlesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetBucketBundles", - }; + const headers: __HeaderBag = sharedHeaders("GetBucketBundles"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBucketBundlesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1744,10 +1543,7 @@ export const serializeAws_json1_1GetBucketMetricDataCommand = async ( input: GetBucketMetricDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetBucketMetricData", - }; + const headers: __HeaderBag = sharedHeaders("GetBucketMetricData"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBucketMetricDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1757,10 +1553,7 @@ export const serializeAws_json1_1GetBucketsCommand = async ( input: GetBucketsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetBuckets", - }; + const headers: __HeaderBag = sharedHeaders("GetBuckets"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBucketsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1770,10 +1563,7 @@ export const serializeAws_json1_1GetBundlesCommand = async ( input: GetBundlesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetBundles", - }; + const headers: __HeaderBag = sharedHeaders("GetBundles"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBundlesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1783,10 +1573,7 @@ export const serializeAws_json1_1GetCertificatesCommand = async ( input: GetCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetCertificates", - }; + const headers: __HeaderBag = sharedHeaders("GetCertificates"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCertificatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1796,10 +1583,7 @@ export const serializeAws_json1_1GetCloudFormationStackRecordsCommand = async ( input: GetCloudFormationStackRecordsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetCloudFormationStackRecords", - }; + const headers: __HeaderBag = sharedHeaders("GetCloudFormationStackRecords"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCloudFormationStackRecordsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1809,10 +1593,7 @@ export const serializeAws_json1_1GetContactMethodsCommand = async ( input: GetContactMethodsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetContactMethods", - }; + const headers: __HeaderBag = sharedHeaders("GetContactMethods"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContactMethodsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1822,10 +1603,7 @@ export const serializeAws_json1_1GetContainerAPIMetadataCommand = async ( input: GetContainerAPIMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetContainerAPIMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetContainerAPIMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContainerAPIMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1835,10 +1613,7 @@ export const serializeAws_json1_1GetContainerImagesCommand = async ( input: GetContainerImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetContainerImages", - }; + const headers: __HeaderBag = sharedHeaders("GetContainerImages"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContainerImagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1848,10 +1623,7 @@ export const serializeAws_json1_1GetContainerLogCommand = async ( input: GetContainerLogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetContainerLog", - }; + const headers: __HeaderBag = sharedHeaders("GetContainerLog"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContainerLogRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1861,10 +1633,7 @@ export const serializeAws_json1_1GetContainerServiceDeploymentsCommand = async ( input: GetContainerServiceDeploymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetContainerServiceDeployments", - }; + const headers: __HeaderBag = sharedHeaders("GetContainerServiceDeployments"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContainerServiceDeploymentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1874,10 +1643,7 @@ export const serializeAws_json1_1GetContainerServiceMetricDataCommand = async ( input: GetContainerServiceMetricDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetContainerServiceMetricData", - }; + const headers: __HeaderBag = sharedHeaders("GetContainerServiceMetricData"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContainerServiceMetricDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1887,10 +1653,7 @@ export const serializeAws_json1_1GetContainerServicePowersCommand = async ( input: GetContainerServicePowersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetContainerServicePowers", - }; + const headers: __HeaderBag = sharedHeaders("GetContainerServicePowers"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContainerServicePowersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1900,10 +1663,7 @@ export const serializeAws_json1_1GetContainerServicesCommand = async ( input: GetContainerServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetContainerServices", - }; + const headers: __HeaderBag = sharedHeaders("GetContainerServices"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContainerServicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1913,10 +1673,7 @@ export const serializeAws_json1_1GetCostEstimateCommand = async ( input: GetCostEstimateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetCostEstimate", - }; + const headers: __HeaderBag = sharedHeaders("GetCostEstimate"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCostEstimateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1926,10 +1683,7 @@ export const serializeAws_json1_1GetDiskCommand = async ( input: GetDiskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetDisk", - }; + const headers: __HeaderBag = sharedHeaders("GetDisk"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDiskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1939,10 +1693,7 @@ export const serializeAws_json1_1GetDisksCommand = async ( input: GetDisksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetDisks", - }; + const headers: __HeaderBag = sharedHeaders("GetDisks"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDisksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1952,10 +1703,7 @@ export const serializeAws_json1_1GetDiskSnapshotCommand = async ( input: GetDiskSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetDiskSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("GetDiskSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDiskSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1965,10 +1713,7 @@ export const serializeAws_json1_1GetDiskSnapshotsCommand = async ( input: GetDiskSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetDiskSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("GetDiskSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDiskSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1978,10 +1723,7 @@ export const serializeAws_json1_1GetDistributionBundlesCommand = async ( input: GetDistributionBundlesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetDistributionBundles", - }; + const headers: __HeaderBag = sharedHeaders("GetDistributionBundles"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDistributionBundlesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1991,10 +1733,7 @@ export const serializeAws_json1_1GetDistributionLatestCacheResetCommand = async input: GetDistributionLatestCacheResetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetDistributionLatestCacheReset", - }; + const headers: __HeaderBag = sharedHeaders("GetDistributionLatestCacheReset"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDistributionLatestCacheResetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2004,10 +1743,7 @@ export const serializeAws_json1_1GetDistributionMetricDataCommand = async ( input: GetDistributionMetricDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetDistributionMetricData", - }; + const headers: __HeaderBag = sharedHeaders("GetDistributionMetricData"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDistributionMetricDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2017,10 +1753,7 @@ export const serializeAws_json1_1GetDistributionsCommand = async ( input: GetDistributionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetDistributions", - }; + const headers: __HeaderBag = sharedHeaders("GetDistributions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDistributionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2030,10 +1763,7 @@ export const serializeAws_json1_1GetDomainCommand = async ( input: GetDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetDomain", - }; + const headers: __HeaderBag = sharedHeaders("GetDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2043,10 +1773,7 @@ export const serializeAws_json1_1GetDomainsCommand = async ( input: GetDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetDomains", - }; + const headers: __HeaderBag = sharedHeaders("GetDomains"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDomainsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2056,10 +1783,7 @@ export const serializeAws_json1_1GetExportSnapshotRecordsCommand = async ( input: GetExportSnapshotRecordsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetExportSnapshotRecords", - }; + const headers: __HeaderBag = sharedHeaders("GetExportSnapshotRecords"); let body: any; body = JSON.stringify(serializeAws_json1_1GetExportSnapshotRecordsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2069,10 +1793,7 @@ export const serializeAws_json1_1GetInstanceCommand = async ( input: GetInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetInstance", - }; + const headers: __HeaderBag = sharedHeaders("GetInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2082,10 +1803,7 @@ export const serializeAws_json1_1GetInstanceAccessDetailsCommand = async ( input: GetInstanceAccessDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetInstanceAccessDetails", - }; + const headers: __HeaderBag = sharedHeaders("GetInstanceAccessDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstanceAccessDetailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2095,10 +1813,7 @@ export const serializeAws_json1_1GetInstanceMetricDataCommand = async ( input: GetInstanceMetricDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetInstanceMetricData", - }; + const headers: __HeaderBag = sharedHeaders("GetInstanceMetricData"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstanceMetricDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2108,10 +1823,7 @@ export const serializeAws_json1_1GetInstancePortStatesCommand = async ( input: GetInstancePortStatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetInstancePortStates", - }; + const headers: __HeaderBag = sharedHeaders("GetInstancePortStates"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstancePortStatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2121,10 +1833,7 @@ export const serializeAws_json1_1GetInstancesCommand = async ( input: GetInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetInstances", - }; + const headers: __HeaderBag = sharedHeaders("GetInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2134,10 +1843,7 @@ export const serializeAws_json1_1GetInstanceSnapshotCommand = async ( input: GetInstanceSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetInstanceSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("GetInstanceSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstanceSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2147,10 +1853,7 @@ export const serializeAws_json1_1GetInstanceSnapshotsCommand = async ( input: GetInstanceSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetInstanceSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("GetInstanceSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstanceSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2160,10 +1863,7 @@ export const serializeAws_json1_1GetInstanceStateCommand = async ( input: GetInstanceStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetInstanceState", - }; + const headers: __HeaderBag = sharedHeaders("GetInstanceState"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstanceStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2173,10 +1873,7 @@ export const serializeAws_json1_1GetKeyPairCommand = async ( input: GetKeyPairCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetKeyPair", - }; + const headers: __HeaderBag = sharedHeaders("GetKeyPair"); let body: any; body = JSON.stringify(serializeAws_json1_1GetKeyPairRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2186,10 +1883,7 @@ export const serializeAws_json1_1GetKeyPairsCommand = async ( input: GetKeyPairsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetKeyPairs", - }; + const headers: __HeaderBag = sharedHeaders("GetKeyPairs"); let body: any; body = JSON.stringify(serializeAws_json1_1GetKeyPairsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2199,10 +1893,7 @@ export const serializeAws_json1_1GetLoadBalancerCommand = async ( input: GetLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetLoadBalancer", - }; + const headers: __HeaderBag = sharedHeaders("GetLoadBalancer"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLoadBalancerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2212,10 +1903,7 @@ export const serializeAws_json1_1GetLoadBalancerMetricDataCommand = async ( input: GetLoadBalancerMetricDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetLoadBalancerMetricData", - }; + const headers: __HeaderBag = sharedHeaders("GetLoadBalancerMetricData"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLoadBalancerMetricDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2225,10 +1913,7 @@ export const serializeAws_json1_1GetLoadBalancersCommand = async ( input: GetLoadBalancersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetLoadBalancers", - }; + const headers: __HeaderBag = sharedHeaders("GetLoadBalancers"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLoadBalancersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2238,10 +1923,7 @@ export const serializeAws_json1_1GetLoadBalancerTlsCertificatesCommand = async ( input: GetLoadBalancerTlsCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetLoadBalancerTlsCertificates", - }; + const headers: __HeaderBag = sharedHeaders("GetLoadBalancerTlsCertificates"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLoadBalancerTlsCertificatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2251,10 +1933,7 @@ export const serializeAws_json1_1GetLoadBalancerTlsPoliciesCommand = async ( input: GetLoadBalancerTlsPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetLoadBalancerTlsPolicies", - }; + const headers: __HeaderBag = sharedHeaders("GetLoadBalancerTlsPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLoadBalancerTlsPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2264,10 +1943,7 @@ export const serializeAws_json1_1GetOperationCommand = async ( input: GetOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetOperation", - }; + const headers: __HeaderBag = sharedHeaders("GetOperation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOperationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2277,10 +1953,7 @@ export const serializeAws_json1_1GetOperationsCommand = async ( input: GetOperationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetOperations", - }; + const headers: __HeaderBag = sharedHeaders("GetOperations"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOperationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2290,10 +1963,7 @@ export const serializeAws_json1_1GetOperationsForResourceCommand = async ( input: GetOperationsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetOperationsForResource", - }; + const headers: __HeaderBag = sharedHeaders("GetOperationsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOperationsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2303,10 +1973,7 @@ export const serializeAws_json1_1GetRegionsCommand = async ( input: GetRegionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRegions", - }; + const headers: __HeaderBag = sharedHeaders("GetRegions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRegionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2316,10 +1983,7 @@ export const serializeAws_json1_1GetRelationalDatabaseCommand = async ( input: GetRelationalDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabase", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2329,10 +1993,7 @@ export const serializeAws_json1_1GetRelationalDatabaseBlueprintsCommand = async input: GetRelationalDatabaseBlueprintsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabaseBlueprints", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabaseBlueprints"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseBlueprintsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2342,10 +2003,7 @@ export const serializeAws_json1_1GetRelationalDatabaseBundlesCommand = async ( input: GetRelationalDatabaseBundlesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabaseBundles", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabaseBundles"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseBundlesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2355,10 +2013,7 @@ export const serializeAws_json1_1GetRelationalDatabaseEventsCommand = async ( input: GetRelationalDatabaseEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabaseEvents", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabaseEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2368,10 +2023,7 @@ export const serializeAws_json1_1GetRelationalDatabaseLogEventsCommand = async ( input: GetRelationalDatabaseLogEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabaseLogEvents", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabaseLogEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseLogEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2381,10 +2033,7 @@ export const serializeAws_json1_1GetRelationalDatabaseLogStreamsCommand = async input: GetRelationalDatabaseLogStreamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabaseLogStreams", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabaseLogStreams"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseLogStreamsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2394,10 +2043,7 @@ export const serializeAws_json1_1GetRelationalDatabaseMasterUserPasswordCommand input: GetRelationalDatabaseMasterUserPasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabaseMasterUserPassword", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabaseMasterUserPassword"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseMasterUserPasswordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2407,10 +2053,7 @@ export const serializeAws_json1_1GetRelationalDatabaseMetricDataCommand = async input: GetRelationalDatabaseMetricDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabaseMetricData", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabaseMetricData"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseMetricDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2420,10 +2063,7 @@ export const serializeAws_json1_1GetRelationalDatabaseParametersCommand = async input: GetRelationalDatabaseParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabaseParameters", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabaseParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseParametersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2433,10 +2073,7 @@ export const serializeAws_json1_1GetRelationalDatabasesCommand = async ( input: GetRelationalDatabasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabases", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabases"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2446,10 +2083,7 @@ export const serializeAws_json1_1GetRelationalDatabaseSnapshotCommand = async ( input: GetRelationalDatabaseSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabaseSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabaseSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2459,10 +2093,7 @@ export const serializeAws_json1_1GetRelationalDatabaseSnapshotsCommand = async ( input: GetRelationalDatabaseSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetRelationalDatabaseSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("GetRelationalDatabaseSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRelationalDatabaseSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2472,10 +2103,7 @@ export const serializeAws_json1_1GetStaticIpCommand = async ( input: GetStaticIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetStaticIp", - }; + const headers: __HeaderBag = sharedHeaders("GetStaticIp"); let body: any; body = JSON.stringify(serializeAws_json1_1GetStaticIpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2485,10 +2113,7 @@ export const serializeAws_json1_1GetStaticIpsCommand = async ( input: GetStaticIpsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.GetStaticIps", - }; + const headers: __HeaderBag = sharedHeaders("GetStaticIps"); let body: any; body = JSON.stringify(serializeAws_json1_1GetStaticIpsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2498,10 +2123,7 @@ export const serializeAws_json1_1ImportKeyPairCommand = async ( input: ImportKeyPairCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.ImportKeyPair", - }; + const headers: __HeaderBag = sharedHeaders("ImportKeyPair"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportKeyPairRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2511,10 +2133,7 @@ export const serializeAws_json1_1IsVpcPeeredCommand = async ( input: IsVpcPeeredCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.IsVpcPeered", - }; + const headers: __HeaderBag = sharedHeaders("IsVpcPeered"); let body: any; body = JSON.stringify(serializeAws_json1_1IsVpcPeeredRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2524,10 +2143,7 @@ export const serializeAws_json1_1OpenInstancePublicPortsCommand = async ( input: OpenInstancePublicPortsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.OpenInstancePublicPorts", - }; + const headers: __HeaderBag = sharedHeaders("OpenInstancePublicPorts"); let body: any; body = JSON.stringify(serializeAws_json1_1OpenInstancePublicPortsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2537,10 +2153,7 @@ export const serializeAws_json1_1PeerVpcCommand = async ( input: PeerVpcCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.PeerVpc", - }; + const headers: __HeaderBag = sharedHeaders("PeerVpc"); let body: any; body = JSON.stringify(serializeAws_json1_1PeerVpcRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2550,10 +2163,7 @@ export const serializeAws_json1_1PutAlarmCommand = async ( input: PutAlarmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.PutAlarm", - }; + const headers: __HeaderBag = sharedHeaders("PutAlarm"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAlarmRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2563,10 +2173,7 @@ export const serializeAws_json1_1PutInstancePublicPortsCommand = async ( input: PutInstancePublicPortsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.PutInstancePublicPorts", - }; + const headers: __HeaderBag = sharedHeaders("PutInstancePublicPorts"); let body: any; body = JSON.stringify(serializeAws_json1_1PutInstancePublicPortsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2576,10 +2183,7 @@ export const serializeAws_json1_1RebootInstanceCommand = async ( input: RebootInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.RebootInstance", - }; + const headers: __HeaderBag = sharedHeaders("RebootInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1RebootInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2589,10 +2193,7 @@ export const serializeAws_json1_1RebootRelationalDatabaseCommand = async ( input: RebootRelationalDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.RebootRelationalDatabase", - }; + const headers: __HeaderBag = sharedHeaders("RebootRelationalDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1RebootRelationalDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2602,10 +2203,7 @@ export const serializeAws_json1_1RegisterContainerImageCommand = async ( input: RegisterContainerImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.RegisterContainerImage", - }; + const headers: __HeaderBag = sharedHeaders("RegisterContainerImage"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterContainerImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2615,10 +2213,7 @@ export const serializeAws_json1_1ReleaseStaticIpCommand = async ( input: ReleaseStaticIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.ReleaseStaticIp", - }; + const headers: __HeaderBag = sharedHeaders("ReleaseStaticIp"); let body: any; body = JSON.stringify(serializeAws_json1_1ReleaseStaticIpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2628,10 +2223,7 @@ export const serializeAws_json1_1ResetDistributionCacheCommand = async ( input: ResetDistributionCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.ResetDistributionCache", - }; + const headers: __HeaderBag = sharedHeaders("ResetDistributionCache"); let body: any; body = JSON.stringify(serializeAws_json1_1ResetDistributionCacheRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2641,10 +2233,7 @@ export const serializeAws_json1_1SendContactMethodVerificationCommand = async ( input: SendContactMethodVerificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.SendContactMethodVerification", - }; + const headers: __HeaderBag = sharedHeaders("SendContactMethodVerification"); let body: any; body = JSON.stringify(serializeAws_json1_1SendContactMethodVerificationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2654,10 +2243,7 @@ export const serializeAws_json1_1SetIpAddressTypeCommand = async ( input: SetIpAddressTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.SetIpAddressType", - }; + const headers: __HeaderBag = sharedHeaders("SetIpAddressType"); let body: any; body = JSON.stringify(serializeAws_json1_1SetIpAddressTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2667,10 +2253,7 @@ export const serializeAws_json1_1SetResourceAccessForBucketCommand = async ( input: SetResourceAccessForBucketCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.SetResourceAccessForBucket", - }; + const headers: __HeaderBag = sharedHeaders("SetResourceAccessForBucket"); let body: any; body = JSON.stringify(serializeAws_json1_1SetResourceAccessForBucketRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2680,10 +2263,7 @@ export const serializeAws_json1_1StartGUISessionCommand = async ( input: StartGUISessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.StartGUISession", - }; + const headers: __HeaderBag = sharedHeaders("StartGUISession"); let body: any; body = JSON.stringify(serializeAws_json1_1StartGUISessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2693,10 +2273,7 @@ export const serializeAws_json1_1StartInstanceCommand = async ( input: StartInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.StartInstance", - }; + const headers: __HeaderBag = sharedHeaders("StartInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1StartInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2706,10 +2283,7 @@ export const serializeAws_json1_1StartRelationalDatabaseCommand = async ( input: StartRelationalDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.StartRelationalDatabase", - }; + const headers: __HeaderBag = sharedHeaders("StartRelationalDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1StartRelationalDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2719,10 +2293,7 @@ export const serializeAws_json1_1StopGUISessionCommand = async ( input: StopGUISessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.StopGUISession", - }; + const headers: __HeaderBag = sharedHeaders("StopGUISession"); let body: any; body = JSON.stringify(serializeAws_json1_1StopGUISessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2732,10 +2303,7 @@ export const serializeAws_json1_1StopInstanceCommand = async ( input: StopInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.StopInstance", - }; + const headers: __HeaderBag = sharedHeaders("StopInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1StopInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2745,10 +2313,7 @@ export const serializeAws_json1_1StopRelationalDatabaseCommand = async ( input: StopRelationalDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.StopRelationalDatabase", - }; + const headers: __HeaderBag = sharedHeaders("StopRelationalDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1StopRelationalDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2758,10 +2323,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2771,10 +2333,7 @@ export const serializeAws_json1_1TestAlarmCommand = async ( input: TestAlarmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.TestAlarm", - }; + const headers: __HeaderBag = sharedHeaders("TestAlarm"); let body: any; body = JSON.stringify(serializeAws_json1_1TestAlarmRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2784,10 +2343,7 @@ export const serializeAws_json1_1UnpeerVpcCommand = async ( input: UnpeerVpcCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UnpeerVpc", - }; + const headers: __HeaderBag = sharedHeaders("UnpeerVpc"); let body: any; body = JSON.stringify(serializeAws_json1_1UnpeerVpcRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2797,10 +2353,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2810,10 +2363,7 @@ export const serializeAws_json1_1UpdateBucketCommand = async ( input: UpdateBucketCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UpdateBucket", - }; + const headers: __HeaderBag = sharedHeaders("UpdateBucket"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateBucketRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2823,10 +2373,7 @@ export const serializeAws_json1_1UpdateBucketBundleCommand = async ( input: UpdateBucketBundleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UpdateBucketBundle", - }; + const headers: __HeaderBag = sharedHeaders("UpdateBucketBundle"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateBucketBundleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2836,10 +2383,7 @@ export const serializeAws_json1_1UpdateContainerServiceCommand = async ( input: UpdateContainerServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UpdateContainerService", - }; + const headers: __HeaderBag = sharedHeaders("UpdateContainerService"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateContainerServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2849,10 +2393,7 @@ export const serializeAws_json1_1UpdateDistributionCommand = async ( input: UpdateDistributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UpdateDistribution", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDistribution"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDistributionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2862,10 +2403,7 @@ export const serializeAws_json1_1UpdateDistributionBundleCommand = async ( input: UpdateDistributionBundleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UpdateDistributionBundle", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDistributionBundle"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDistributionBundleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2875,10 +2413,7 @@ export const serializeAws_json1_1UpdateDomainEntryCommand = async ( input: UpdateDomainEntryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UpdateDomainEntry", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDomainEntry"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDomainEntryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2888,10 +2423,7 @@ export const serializeAws_json1_1UpdateInstanceMetadataOptionsCommand = async ( input: UpdateInstanceMetadataOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UpdateInstanceMetadataOptions", - }; + const headers: __HeaderBag = sharedHeaders("UpdateInstanceMetadataOptions"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateInstanceMetadataOptionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2901,10 +2433,7 @@ export const serializeAws_json1_1UpdateLoadBalancerAttributeCommand = async ( input: UpdateLoadBalancerAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UpdateLoadBalancerAttribute", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLoadBalancerAttribute"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLoadBalancerAttributeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2914,10 +2443,7 @@ export const serializeAws_json1_1UpdateRelationalDatabaseCommand = async ( input: UpdateRelationalDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UpdateRelationalDatabase", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRelationalDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRelationalDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2927,10 +2453,7 @@ export const serializeAws_json1_1UpdateRelationalDatabaseParametersCommand = asy input: UpdateRelationalDatabaseParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Lightsail_20161128.UpdateRelationalDatabaseParameters", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRelationalDatabaseParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRelationalDatabaseParametersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -18187,6 +17710,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `Lightsail_20161128.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts index a19d9421d4f97..6d706dab745c0 100644 --- a/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts +++ b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts @@ -206,10 +206,7 @@ export const serializeAws_json1_0CreateDatasetCommand = async ( input: CreateDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.CreateDataset", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataset"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -219,10 +216,7 @@ export const serializeAws_json1_0CreateInferenceSchedulerCommand = async ( input: CreateInferenceSchedulerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.CreateInferenceScheduler", - }; + const headers: __HeaderBag = sharedHeaders("CreateInferenceScheduler"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateInferenceSchedulerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -232,10 +226,7 @@ export const serializeAws_json1_0CreateLabelCommand = async ( input: CreateLabelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.CreateLabel", - }; + const headers: __HeaderBag = sharedHeaders("CreateLabel"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateLabelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -245,10 +236,7 @@ export const serializeAws_json1_0CreateLabelGroupCommand = async ( input: CreateLabelGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.CreateLabelGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateLabelGroup"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateLabelGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -258,10 +246,7 @@ export const serializeAws_json1_0CreateModelCommand = async ( input: CreateModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.CreateModel", - }; + const headers: __HeaderBag = sharedHeaders("CreateModel"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -271,10 +256,7 @@ export const serializeAws_json1_0DeleteDatasetCommand = async ( input: DeleteDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DeleteDataset", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataset"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -284,10 +266,7 @@ export const serializeAws_json1_0DeleteInferenceSchedulerCommand = async ( input: DeleteInferenceSchedulerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DeleteInferenceScheduler", - }; + const headers: __HeaderBag = sharedHeaders("DeleteInferenceScheduler"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteInferenceSchedulerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -297,10 +276,7 @@ export const serializeAws_json1_0DeleteLabelCommand = async ( input: DeleteLabelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DeleteLabel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLabel"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteLabelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -310,10 +286,7 @@ export const serializeAws_json1_0DeleteLabelGroupCommand = async ( input: DeleteLabelGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DeleteLabelGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLabelGroup"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteLabelGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -323,10 +296,7 @@ export const serializeAws_json1_0DeleteModelCommand = async ( input: DeleteModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DeleteModel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModel"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -336,10 +306,7 @@ export const serializeAws_json1_0DescribeDataIngestionJobCommand = async ( input: DescribeDataIngestionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DescribeDataIngestionJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataIngestionJob"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeDataIngestionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -349,10 +316,7 @@ export const serializeAws_json1_0DescribeDatasetCommand = async ( input: DescribeDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DescribeDataset", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataset"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -362,10 +326,7 @@ export const serializeAws_json1_0DescribeInferenceSchedulerCommand = async ( input: DescribeInferenceSchedulerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DescribeInferenceScheduler", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInferenceScheduler"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeInferenceSchedulerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -375,10 +336,7 @@ export const serializeAws_json1_0DescribeLabelCommand = async ( input: DescribeLabelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DescribeLabel", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLabel"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeLabelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -388,10 +346,7 @@ export const serializeAws_json1_0DescribeLabelGroupCommand = async ( input: DescribeLabelGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DescribeLabelGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLabelGroup"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeLabelGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -401,10 +356,7 @@ export const serializeAws_json1_0DescribeModelCommand = async ( input: DescribeModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.DescribeModel", - }; + const headers: __HeaderBag = sharedHeaders("DescribeModel"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -414,10 +366,7 @@ export const serializeAws_json1_0ListDataIngestionJobsCommand = async ( input: ListDataIngestionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.ListDataIngestionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListDataIngestionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListDataIngestionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -427,10 +376,7 @@ export const serializeAws_json1_0ListDatasetsCommand = async ( input: ListDatasetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.ListDatasets", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasets"); let body: any; body = JSON.stringify(serializeAws_json1_0ListDatasetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -440,10 +386,7 @@ export const serializeAws_json1_0ListInferenceEventsCommand = async ( input: ListInferenceEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.ListInferenceEvents", - }; + const headers: __HeaderBag = sharedHeaders("ListInferenceEvents"); let body: any; body = JSON.stringify(serializeAws_json1_0ListInferenceEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -453,10 +396,7 @@ export const serializeAws_json1_0ListInferenceExecutionsCommand = async ( input: ListInferenceExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.ListInferenceExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListInferenceExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_0ListInferenceExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -466,10 +406,7 @@ export const serializeAws_json1_0ListInferenceSchedulersCommand = async ( input: ListInferenceSchedulersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.ListInferenceSchedulers", - }; + const headers: __HeaderBag = sharedHeaders("ListInferenceSchedulers"); let body: any; body = JSON.stringify(serializeAws_json1_0ListInferenceSchedulersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -479,10 +416,7 @@ export const serializeAws_json1_0ListLabelGroupsCommand = async ( input: ListLabelGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.ListLabelGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListLabelGroups"); let body: any; body = JSON.stringify(serializeAws_json1_0ListLabelGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -492,10 +426,7 @@ export const serializeAws_json1_0ListLabelsCommand = async ( input: ListLabelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.ListLabels", - }; + const headers: __HeaderBag = sharedHeaders("ListLabels"); let body: any; body = JSON.stringify(serializeAws_json1_0ListLabelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -505,10 +436,7 @@ export const serializeAws_json1_0ListModelsCommand = async ( input: ListModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.ListModels", - }; + const headers: __HeaderBag = sharedHeaders("ListModels"); let body: any; body = JSON.stringify(serializeAws_json1_0ListModelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -518,10 +446,7 @@ export const serializeAws_json1_0ListSensorStatisticsCommand = async ( input: ListSensorStatisticsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.ListSensorStatistics", - }; + const headers: __HeaderBag = sharedHeaders("ListSensorStatistics"); let body: any; body = JSON.stringify(serializeAws_json1_0ListSensorStatisticsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -531,10 +456,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -544,10 +466,7 @@ export const serializeAws_json1_0StartDataIngestionJobCommand = async ( input: StartDataIngestionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.StartDataIngestionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartDataIngestionJob"); let body: any; body = JSON.stringify(serializeAws_json1_0StartDataIngestionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -557,10 +476,7 @@ export const serializeAws_json1_0StartInferenceSchedulerCommand = async ( input: StartInferenceSchedulerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.StartInferenceScheduler", - }; + const headers: __HeaderBag = sharedHeaders("StartInferenceScheduler"); let body: any; body = JSON.stringify(serializeAws_json1_0StartInferenceSchedulerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -570,10 +486,7 @@ export const serializeAws_json1_0StopInferenceSchedulerCommand = async ( input: StopInferenceSchedulerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.StopInferenceScheduler", - }; + const headers: __HeaderBag = sharedHeaders("StopInferenceScheduler"); let body: any; body = JSON.stringify(serializeAws_json1_0StopInferenceSchedulerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -583,10 +496,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -596,10 +506,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -609,10 +516,7 @@ export const serializeAws_json1_0UpdateInferenceSchedulerCommand = async ( input: UpdateInferenceSchedulerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.UpdateInferenceScheduler", - }; + const headers: __HeaderBag = sharedHeaders("UpdateInferenceScheduler"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateInferenceSchedulerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -622,10 +526,7 @@ export const serializeAws_json1_0UpdateLabelGroupCommand = async ( input: UpdateLabelGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSLookoutEquipmentFrontendService.UpdateLabelGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLabelGroup"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateLabelGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4093,6 +3994,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `AWSLookoutEquipmentFrontendService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-machine-learning/src/protocols/Aws_json1_1.ts b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts index 369f8f1f4f5a2..c920d0bcbacbb 100644 --- a/clients/client-machine-learning/src/protocols/Aws_json1_1.ts +++ b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts @@ -171,10 +171,7 @@ export const serializeAws_json1_1AddTagsCommand = async ( input: AddTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.AddTags", - }; + const headers: __HeaderBag = sharedHeaders("AddTags"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -184,10 +181,7 @@ export const serializeAws_json1_1CreateBatchPredictionCommand = async ( input: CreateBatchPredictionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.CreateBatchPrediction", - }; + const headers: __HeaderBag = sharedHeaders("CreateBatchPrediction"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBatchPredictionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -197,10 +191,7 @@ export const serializeAws_json1_1CreateDataSourceFromRDSCommand = async ( input: CreateDataSourceFromRDSCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.CreateDataSourceFromRDS", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataSourceFromRDS"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDataSourceFromRDSInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -210,10 +201,7 @@ export const serializeAws_json1_1CreateDataSourceFromRedshiftCommand = async ( input: CreateDataSourceFromRedshiftCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.CreateDataSourceFromRedshift", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataSourceFromRedshift"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDataSourceFromRedshiftInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -223,10 +211,7 @@ export const serializeAws_json1_1CreateDataSourceFromS3Command = async ( input: CreateDataSourceFromS3CommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.CreateDataSourceFromS3", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataSourceFromS3"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDataSourceFromS3Input(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -236,10 +221,7 @@ export const serializeAws_json1_1CreateEvaluationCommand = async ( input: CreateEvaluationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.CreateEvaluation", - }; + const headers: __HeaderBag = sharedHeaders("CreateEvaluation"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEvaluationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -249,10 +231,7 @@ export const serializeAws_json1_1CreateMLModelCommand = async ( input: CreateMLModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.CreateMLModel", - }; + const headers: __HeaderBag = sharedHeaders("CreateMLModel"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMLModelInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -262,10 +241,7 @@ export const serializeAws_json1_1CreateRealtimeEndpointCommand = async ( input: CreateRealtimeEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.CreateRealtimeEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("CreateRealtimeEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRealtimeEndpointInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -275,10 +251,7 @@ export const serializeAws_json1_1DeleteBatchPredictionCommand = async ( input: DeleteBatchPredictionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DeleteBatchPrediction", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBatchPrediction"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBatchPredictionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -288,10 +261,7 @@ export const serializeAws_json1_1DeleteDataSourceCommand = async ( input: DeleteDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DeleteDataSource", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDataSourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -301,10 +271,7 @@ export const serializeAws_json1_1DeleteEvaluationCommand = async ( input: DeleteEvaluationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DeleteEvaluation", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEvaluation"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEvaluationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -314,10 +281,7 @@ export const serializeAws_json1_1DeleteMLModelCommand = async ( input: DeleteMLModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DeleteMLModel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMLModel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMLModelInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -327,10 +291,7 @@ export const serializeAws_json1_1DeleteRealtimeEndpointCommand = async ( input: DeleteRealtimeEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DeleteRealtimeEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRealtimeEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRealtimeEndpointInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -340,10 +301,7 @@ export const serializeAws_json1_1DeleteTagsCommand = async ( input: DeleteTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DeleteTags", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTags"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTagsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -353,10 +311,7 @@ export const serializeAws_json1_1DescribeBatchPredictionsCommand = async ( input: DescribeBatchPredictionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DescribeBatchPredictions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBatchPredictions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBatchPredictionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -366,10 +321,7 @@ export const serializeAws_json1_1DescribeDataSourcesCommand = async ( input: DescribeDataSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DescribeDataSources", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataSources"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDataSourcesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -379,10 +331,7 @@ export const serializeAws_json1_1DescribeEvaluationsCommand = async ( input: DescribeEvaluationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DescribeEvaluations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEvaluations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEvaluationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -392,10 +341,7 @@ export const serializeAws_json1_1DescribeMLModelsCommand = async ( input: DescribeMLModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DescribeMLModels", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMLModels"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMLModelsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -405,10 +351,7 @@ export const serializeAws_json1_1DescribeTagsCommand = async ( input: DescribeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.DescribeTags", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTags"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTagsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -418,10 +361,7 @@ export const serializeAws_json1_1GetBatchPredictionCommand = async ( input: GetBatchPredictionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.GetBatchPrediction", - }; + const headers: __HeaderBag = sharedHeaders("GetBatchPrediction"); let body: any; body = JSON.stringify(serializeAws_json1_1GetBatchPredictionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -431,10 +371,7 @@ export const serializeAws_json1_1GetDataSourceCommand = async ( input: GetDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.GetDataSource", - }; + const headers: __HeaderBag = sharedHeaders("GetDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDataSourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -444,10 +381,7 @@ export const serializeAws_json1_1GetEvaluationCommand = async ( input: GetEvaluationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.GetEvaluation", - }; + const headers: __HeaderBag = sharedHeaders("GetEvaluation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEvaluationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -457,10 +391,7 @@ export const serializeAws_json1_1GetMLModelCommand = async ( input: GetMLModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.GetMLModel", - }; + const headers: __HeaderBag = sharedHeaders("GetMLModel"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMLModelInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -470,10 +401,7 @@ export const serializeAws_json1_1PredictCommand = async ( input: PredictCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.Predict", - }; + const headers: __HeaderBag = sharedHeaders("Predict"); let body: any; body = JSON.stringify(serializeAws_json1_1PredictInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -483,10 +411,7 @@ export const serializeAws_json1_1UpdateBatchPredictionCommand = async ( input: UpdateBatchPredictionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.UpdateBatchPrediction", - }; + const headers: __HeaderBag = sharedHeaders("UpdateBatchPrediction"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateBatchPredictionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -496,10 +421,7 @@ export const serializeAws_json1_1UpdateDataSourceCommand = async ( input: UpdateDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.UpdateDataSource", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDataSource"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDataSourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -509,10 +431,7 @@ export const serializeAws_json1_1UpdateEvaluationCommand = async ( input: UpdateEvaluationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.UpdateEvaluation", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEvaluation"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEvaluationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -522,10 +441,7 @@ export const serializeAws_json1_1UpdateMLModelCommand = async ( input: UpdateMLModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonML_20141212.UpdateMLModel", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMLModel"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMLModelInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3112,6 +3028,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonML_20141212.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-macie/src/protocols/Aws_json1_1.ts b/clients/client-macie/src/protocols/Aws_json1_1.ts index 5d125b4ee771e..43dbdd3992d8d 100644 --- a/clients/client-macie/src/protocols/Aws_json1_1.ts +++ b/clients/client-macie/src/protocols/Aws_json1_1.ts @@ -62,10 +62,7 @@ export const serializeAws_json1_1AssociateMemberAccountCommand = async ( input: AssociateMemberAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MacieService.AssociateMemberAccount", - }; + const headers: __HeaderBag = sharedHeaders("AssociateMemberAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateMemberAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -75,10 +72,7 @@ export const serializeAws_json1_1AssociateS3ResourcesCommand = async ( input: AssociateS3ResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MacieService.AssociateS3Resources", - }; + const headers: __HeaderBag = sharedHeaders("AssociateS3Resources"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateS3ResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -88,10 +82,7 @@ export const serializeAws_json1_1DisassociateMemberAccountCommand = async ( input: DisassociateMemberAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MacieService.DisassociateMemberAccount", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateMemberAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateMemberAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -101,10 +92,7 @@ export const serializeAws_json1_1DisassociateS3ResourcesCommand = async ( input: DisassociateS3ResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MacieService.DisassociateS3Resources", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateS3Resources"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateS3ResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -114,10 +102,7 @@ export const serializeAws_json1_1ListMemberAccountsCommand = async ( input: ListMemberAccountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MacieService.ListMemberAccounts", - }; + const headers: __HeaderBag = sharedHeaders("ListMemberAccounts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMemberAccountsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -127,10 +112,7 @@ export const serializeAws_json1_1ListS3ResourcesCommand = async ( input: ListS3ResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MacieService.ListS3Resources", - }; + const headers: __HeaderBag = sharedHeaders("ListS3Resources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListS3ResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -140,10 +122,7 @@ export const serializeAws_json1_1UpdateS3ResourcesCommand = async ( input: UpdateS3ResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MacieService.UpdateS3Resources", - }; + const headers: __HeaderBag = sharedHeaders("UpdateS3Resources"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateS3ResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -885,6 +864,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `MacieService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts index c1d17d80a7142..750dfba54baf1 100644 --- a/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts @@ -30,10 +30,7 @@ export const serializeAws_json1_1GenerateDataSetCommand = async ( input: GenerateDataSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MarketplaceCommerceAnalytics20150701.GenerateDataSet", - }; + const headers: __HeaderBag = sharedHeaders("GenerateDataSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GenerateDataSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -43,10 +40,7 @@ export const serializeAws_json1_1StartSupportDataExportCommand = async ( input: StartSupportDataExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MarketplaceCommerceAnalytics20150701.StartSupportDataExport", - }; + const headers: __HeaderBag = sharedHeaders("StartSupportDataExport"); let body: any; body = JSON.stringify(serializeAws_json1_1StartSupportDataExportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -258,6 +252,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `MarketplaceCommerceAnalytics20150701.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts index c57be45093dc1..f2ff46fbd10fc 100644 --- a/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts @@ -35,10 +35,7 @@ export const serializeAws_json1_1GetEntitlementsCommand = async ( input: GetEntitlementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMPEntitlementService.GetEntitlements", - }; + const headers: __HeaderBag = sharedHeaders("GetEntitlements"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEntitlementsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -270,6 +267,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSMPEntitlementService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts index c8dfe7da96ec0..b536bf4588868 100644 --- a/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts @@ -57,10 +57,7 @@ export const serializeAws_json1_1BatchMeterUsageCommand = async ( input: BatchMeterUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMPMeteringService.BatchMeterUsage", - }; + const headers: __HeaderBag = sharedHeaders("BatchMeterUsage"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchMeterUsageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -70,10 +67,7 @@ export const serializeAws_json1_1MeterUsageCommand = async ( input: MeterUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMPMeteringService.MeterUsage", - }; + const headers: __HeaderBag = sharedHeaders("MeterUsage"); let body: any; body = JSON.stringify(serializeAws_json1_1MeterUsageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -83,10 +77,7 @@ export const serializeAws_json1_1RegisterUsageCommand = async ( input: RegisterUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMPMeteringService.RegisterUsage", - }; + const headers: __HeaderBag = sharedHeaders("RegisterUsage"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterUsageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -96,10 +87,7 @@ export const serializeAws_json1_1ResolveCustomerCommand = async ( input: ResolveCustomerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMPMeteringService.ResolveCustomer", - }; + const headers: __HeaderBag = sharedHeaders("ResolveCustomer"); let body: any; body = JSON.stringify(serializeAws_json1_1ResolveCustomerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -958,6 +946,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSMPMeteringService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-mediastore/src/protocols/Aws_json1_1.ts b/clients/client-mediastore/src/protocols/Aws_json1_1.ts index 7cb78e5192139..1e46f4b0e59fa 100644 --- a/clients/client-mediastore/src/protocols/Aws_json1_1.ts +++ b/clients/client-mediastore/src/protocols/Aws_json1_1.ts @@ -109,10 +109,7 @@ export const serializeAws_json1_1CreateContainerCommand = async ( input: CreateContainerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.CreateContainer", - }; + const headers: __HeaderBag = sharedHeaders("CreateContainer"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateContainerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -122,10 +119,7 @@ export const serializeAws_json1_1DeleteContainerCommand = async ( input: DeleteContainerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.DeleteContainer", - }; + const headers: __HeaderBag = sharedHeaders("DeleteContainer"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteContainerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -135,10 +129,7 @@ export const serializeAws_json1_1DeleteContainerPolicyCommand = async ( input: DeleteContainerPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.DeleteContainerPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteContainerPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteContainerPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -148,10 +139,7 @@ export const serializeAws_json1_1DeleteCorsPolicyCommand = async ( input: DeleteCorsPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.DeleteCorsPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCorsPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCorsPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -161,10 +149,7 @@ export const serializeAws_json1_1DeleteLifecyclePolicyCommand = async ( input: DeleteLifecyclePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.DeleteLifecyclePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLifecyclePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLifecyclePolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -174,10 +159,7 @@ export const serializeAws_json1_1DeleteMetricPolicyCommand = async ( input: DeleteMetricPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.DeleteMetricPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMetricPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMetricPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -187,10 +169,7 @@ export const serializeAws_json1_1DescribeContainerCommand = async ( input: DescribeContainerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.DescribeContainer", - }; + const headers: __HeaderBag = sharedHeaders("DescribeContainer"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeContainerInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -200,10 +179,7 @@ export const serializeAws_json1_1GetContainerPolicyCommand = async ( input: GetContainerPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.GetContainerPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetContainerPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContainerPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -213,10 +189,7 @@ export const serializeAws_json1_1GetCorsPolicyCommand = async ( input: GetCorsPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.GetCorsPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetCorsPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCorsPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -226,10 +199,7 @@ export const serializeAws_json1_1GetLifecyclePolicyCommand = async ( input: GetLifecyclePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.GetLifecyclePolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetLifecyclePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLifecyclePolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -239,10 +209,7 @@ export const serializeAws_json1_1GetMetricPolicyCommand = async ( input: GetMetricPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.GetMetricPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetMetricPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMetricPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -252,10 +219,7 @@ export const serializeAws_json1_1ListContainersCommand = async ( input: ListContainersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.ListContainers", - }; + const headers: __HeaderBag = sharedHeaders("ListContainers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListContainersInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -265,10 +229,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -278,10 +239,7 @@ export const serializeAws_json1_1PutContainerPolicyCommand = async ( input: PutContainerPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.PutContainerPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutContainerPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutContainerPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -291,10 +249,7 @@ export const serializeAws_json1_1PutCorsPolicyCommand = async ( input: PutCorsPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.PutCorsPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutCorsPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutCorsPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -304,10 +259,7 @@ export const serializeAws_json1_1PutLifecyclePolicyCommand = async ( input: PutLifecyclePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.PutLifecyclePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutLifecyclePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutLifecyclePolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -317,10 +269,7 @@ export const serializeAws_json1_1PutMetricPolicyCommand = async ( input: PutMetricPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.PutMetricPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutMetricPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutMetricPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -330,10 +279,7 @@ export const serializeAws_json1_1StartAccessLoggingCommand = async ( input: StartAccessLoggingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.StartAccessLogging", - }; + const headers: __HeaderBag = sharedHeaders("StartAccessLogging"); let body: any; body = JSON.stringify(serializeAws_json1_1StartAccessLoggingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -343,10 +289,7 @@ export const serializeAws_json1_1StopAccessLoggingCommand = async ( input: StopAccessLoggingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.StopAccessLogging", - }; + const headers: __HeaderBag = sharedHeaders("StopAccessLogging"); let body: any; body = JSON.stringify(serializeAws_json1_1StopAccessLoggingInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -356,10 +299,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -369,10 +309,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MediaStore_20170901.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2081,6 +2018,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `MediaStore_20170901.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-memorydb/src/protocols/Aws_json1_1.ts b/clients/client-memorydb/src/protocols/Aws_json1_1.ts index 9b5b278c25372..d7fac33fa233f 100644 --- a/clients/client-memorydb/src/protocols/Aws_json1_1.ts +++ b/clients/client-memorydb/src/protocols/Aws_json1_1.ts @@ -267,10 +267,7 @@ export const serializeAws_json1_1BatchUpdateClusterCommand = async ( input: BatchUpdateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.BatchUpdateCluster", - }; + const headers: __HeaderBag = sharedHeaders("BatchUpdateCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchUpdateClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -280,10 +277,7 @@ export const serializeAws_json1_1CopySnapshotCommand = async ( input: CopySnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.CopySnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CopySnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CopySnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -293,10 +287,7 @@ export const serializeAws_json1_1CreateACLCommand = async ( input: CreateACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.CreateACL", - }; + const headers: __HeaderBag = sharedHeaders("CreateACL"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -306,10 +297,7 @@ export const serializeAws_json1_1CreateClusterCommand = async ( input: CreateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.CreateCluster", - }; + const headers: __HeaderBag = sharedHeaders("CreateCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -319,10 +307,7 @@ export const serializeAws_json1_1CreateParameterGroupCommand = async ( input: CreateParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.CreateParameterGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateParameterGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateParameterGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -332,10 +317,7 @@ export const serializeAws_json1_1CreateSnapshotCommand = async ( input: CreateSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.CreateSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -345,10 +327,7 @@ export const serializeAws_json1_1CreateSubnetGroupCommand = async ( input: CreateSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.CreateSubnetGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateSubnetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSubnetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -358,10 +337,7 @@ export const serializeAws_json1_1CreateUserCommand = async ( input: CreateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.CreateUser", - }; + const headers: __HeaderBag = sharedHeaders("CreateUser"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -371,10 +347,7 @@ export const serializeAws_json1_1DeleteACLCommand = async ( input: DeleteACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DeleteACL", - }; + const headers: __HeaderBag = sharedHeaders("DeleteACL"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -384,10 +357,7 @@ export const serializeAws_json1_1DeleteClusterCommand = async ( input: DeleteClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DeleteCluster", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -397,10 +367,7 @@ export const serializeAws_json1_1DeleteParameterGroupCommand = async ( input: DeleteParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DeleteParameterGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteParameterGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteParameterGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -410,10 +377,7 @@ export const serializeAws_json1_1DeleteSnapshotCommand = async ( input: DeleteSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DeleteSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -423,10 +387,7 @@ export const serializeAws_json1_1DeleteSubnetGroupCommand = async ( input: DeleteSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DeleteSubnetGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSubnetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSubnetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -436,10 +397,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DeleteUser", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -449,10 +407,7 @@ export const serializeAws_json1_1DescribeACLsCommand = async ( input: DescribeACLsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeACLs", - }; + const headers: __HeaderBag = sharedHeaders("DescribeACLs"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeACLsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -462,10 +417,7 @@ export const serializeAws_json1_1DescribeClustersCommand = async ( input: DescribeClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeClusters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeClusters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeClustersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -475,10 +427,7 @@ export const serializeAws_json1_1DescribeEngineVersionsCommand = async ( input: DescribeEngineVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeEngineVersions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEngineVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEngineVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -488,10 +437,7 @@ export const serializeAws_json1_1DescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeEvents", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -501,10 +447,7 @@ export const serializeAws_json1_1DescribeParameterGroupsCommand = async ( input: DescribeParameterGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeParameterGroups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeParameterGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeParameterGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -514,10 +457,7 @@ export const serializeAws_json1_1DescribeParametersCommand = async ( input: DescribeParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeParameters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeParametersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -527,10 +467,7 @@ export const serializeAws_json1_1DescribeReservedNodesCommand = async ( input: DescribeReservedNodesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeReservedNodes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReservedNodes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReservedNodesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -540,10 +477,7 @@ export const serializeAws_json1_1DescribeReservedNodesOfferingsCommand = async ( input: DescribeReservedNodesOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeReservedNodesOfferings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReservedNodesOfferings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReservedNodesOfferingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -553,10 +487,7 @@ export const serializeAws_json1_1DescribeServiceUpdatesCommand = async ( input: DescribeServiceUpdatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeServiceUpdates", - }; + const headers: __HeaderBag = sharedHeaders("DescribeServiceUpdates"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeServiceUpdatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -566,10 +497,7 @@ export const serializeAws_json1_1DescribeSnapshotsCommand = async ( input: DescribeSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -579,10 +507,7 @@ export const serializeAws_json1_1DescribeSubnetGroupsCommand = async ( input: DescribeSubnetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeSubnetGroups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSubnetGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSubnetGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -592,10 +517,7 @@ export const serializeAws_json1_1DescribeUsersCommand = async ( input: DescribeUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.DescribeUsers", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUsers"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUsersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -605,10 +527,7 @@ export const serializeAws_json1_1FailoverShardCommand = async ( input: FailoverShardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.FailoverShard", - }; + const headers: __HeaderBag = sharedHeaders("FailoverShard"); let body: any; body = JSON.stringify(serializeAws_json1_1FailoverShardRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -618,10 +537,7 @@ export const serializeAws_json1_1ListAllowedNodeTypeUpdatesCommand = async ( input: ListAllowedNodeTypeUpdatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.ListAllowedNodeTypeUpdates", - }; + const headers: __HeaderBag = sharedHeaders("ListAllowedNodeTypeUpdates"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAllowedNodeTypeUpdatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -631,10 +547,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.ListTags", - }; + const headers: __HeaderBag = sharedHeaders("ListTags"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -644,10 +557,7 @@ export const serializeAws_json1_1PurchaseReservedNodesOfferingCommand = async ( input: PurchaseReservedNodesOfferingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.PurchaseReservedNodesOffering", - }; + const headers: __HeaderBag = sharedHeaders("PurchaseReservedNodesOffering"); let body: any; body = JSON.stringify(serializeAws_json1_1PurchaseReservedNodesOfferingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -657,10 +567,7 @@ export const serializeAws_json1_1ResetParameterGroupCommand = async ( input: ResetParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.ResetParameterGroup", - }; + const headers: __HeaderBag = sharedHeaders("ResetParameterGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1ResetParameterGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -670,10 +577,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -683,10 +587,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -696,10 +597,7 @@ export const serializeAws_json1_1UpdateACLCommand = async ( input: UpdateACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.UpdateACL", - }; + const headers: __HeaderBag = sharedHeaders("UpdateACL"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -709,10 +607,7 @@ export const serializeAws_json1_1UpdateClusterCommand = async ( input: UpdateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.UpdateCluster", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -722,10 +617,7 @@ export const serializeAws_json1_1UpdateParameterGroupCommand = async ( input: UpdateParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.UpdateParameterGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateParameterGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateParameterGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -735,10 +627,7 @@ export const serializeAws_json1_1UpdateSubnetGroupCommand = async ( input: UpdateSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.UpdateSubnetGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSubnetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSubnetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -748,10 +637,7 @@ export const serializeAws_json1_1UpdateUserCommand = async ( input: UpdateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonMemoryDB.UpdateUser", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUser"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5572,6 +5458,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonMemoryDB.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-migration-hub/src/protocols/Aws_json1_1.ts b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts index 78a508be680d7..c34fad5059855 100644 --- a/clients/client-migration-hub/src/protocols/Aws_json1_1.ts +++ b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts @@ -141,10 +141,7 @@ export const serializeAws_json1_1AssociateCreatedArtifactCommand = async ( input: AssociateCreatedArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.AssociateCreatedArtifact", - }; + const headers: __HeaderBag = sharedHeaders("AssociateCreatedArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateCreatedArtifactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -154,10 +151,7 @@ export const serializeAws_json1_1AssociateDiscoveredResourceCommand = async ( input: AssociateDiscoveredResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.AssociateDiscoveredResource", - }; + const headers: __HeaderBag = sharedHeaders("AssociateDiscoveredResource"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateDiscoveredResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -167,10 +161,7 @@ export const serializeAws_json1_1CreateProgressUpdateStreamCommand = async ( input: CreateProgressUpdateStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.CreateProgressUpdateStream", - }; + const headers: __HeaderBag = sharedHeaders("CreateProgressUpdateStream"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProgressUpdateStreamRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -180,10 +171,7 @@ export const serializeAws_json1_1DeleteProgressUpdateStreamCommand = async ( input: DeleteProgressUpdateStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.DeleteProgressUpdateStream", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProgressUpdateStream"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProgressUpdateStreamRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -193,10 +181,7 @@ export const serializeAws_json1_1DescribeApplicationStateCommand = async ( input: DescribeApplicationStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.DescribeApplicationState", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApplicationState"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeApplicationStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -206,10 +191,7 @@ export const serializeAws_json1_1DescribeMigrationTaskCommand = async ( input: DescribeMigrationTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.DescribeMigrationTask", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMigrationTask"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMigrationTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -219,10 +201,7 @@ export const serializeAws_json1_1DisassociateCreatedArtifactCommand = async ( input: DisassociateCreatedArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.DisassociateCreatedArtifact", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateCreatedArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateCreatedArtifactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -232,10 +211,7 @@ export const serializeAws_json1_1DisassociateDiscoveredResourceCommand = async ( input: DisassociateDiscoveredResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.DisassociateDiscoveredResource", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateDiscoveredResource"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateDiscoveredResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -245,10 +221,7 @@ export const serializeAws_json1_1ImportMigrationTaskCommand = async ( input: ImportMigrationTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.ImportMigrationTask", - }; + const headers: __HeaderBag = sharedHeaders("ImportMigrationTask"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportMigrationTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -258,10 +231,7 @@ export const serializeAws_json1_1ListApplicationStatesCommand = async ( input: ListApplicationStatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.ListApplicationStates", - }; + const headers: __HeaderBag = sharedHeaders("ListApplicationStates"); let body: any; body = JSON.stringify(serializeAws_json1_1ListApplicationStatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -271,10 +241,7 @@ export const serializeAws_json1_1ListCreatedArtifactsCommand = async ( input: ListCreatedArtifactsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.ListCreatedArtifacts", - }; + const headers: __HeaderBag = sharedHeaders("ListCreatedArtifacts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCreatedArtifactsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -284,10 +251,7 @@ export const serializeAws_json1_1ListDiscoveredResourcesCommand = async ( input: ListDiscoveredResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.ListDiscoveredResources", - }; + const headers: __HeaderBag = sharedHeaders("ListDiscoveredResources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDiscoveredResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -297,10 +261,7 @@ export const serializeAws_json1_1ListMigrationTasksCommand = async ( input: ListMigrationTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.ListMigrationTasks", - }; + const headers: __HeaderBag = sharedHeaders("ListMigrationTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMigrationTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -310,10 +271,7 @@ export const serializeAws_json1_1ListProgressUpdateStreamsCommand = async ( input: ListProgressUpdateStreamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.ListProgressUpdateStreams", - }; + const headers: __HeaderBag = sharedHeaders("ListProgressUpdateStreams"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProgressUpdateStreamsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -323,10 +281,7 @@ export const serializeAws_json1_1NotifyApplicationStateCommand = async ( input: NotifyApplicationStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.NotifyApplicationState", - }; + const headers: __HeaderBag = sharedHeaders("NotifyApplicationState"); let body: any; body = JSON.stringify(serializeAws_json1_1NotifyApplicationStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -336,10 +291,7 @@ export const serializeAws_json1_1NotifyMigrationTaskStateCommand = async ( input: NotifyMigrationTaskStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.NotifyMigrationTaskState", - }; + const headers: __HeaderBag = sharedHeaders("NotifyMigrationTaskState"); let body: any; body = JSON.stringify(serializeAws_json1_1NotifyMigrationTaskStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -349,10 +301,7 @@ export const serializeAws_json1_1PutResourceAttributesCommand = async ( input: PutResourceAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHub.PutResourceAttributes", - }; + const headers: __HeaderBag = sharedHeaders("PutResourceAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourceAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2231,6 +2180,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSMigrationHub.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts index 2660b63b14e4b..57d1986fb1062 100644 --- a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts +++ b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts @@ -47,10 +47,7 @@ export const serializeAws_json1_1CreateHomeRegionControlCommand = async ( input: CreateHomeRegionControlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHubMultiAccountService.CreateHomeRegionControl", - }; + const headers: __HeaderBag = sharedHeaders("CreateHomeRegionControl"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHomeRegionControlRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -60,10 +57,7 @@ export const serializeAws_json1_1DescribeHomeRegionControlsCommand = async ( input: DescribeHomeRegionControlsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHubMultiAccountService.DescribeHomeRegionControls", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHomeRegionControls"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeHomeRegionControlsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -73,10 +67,7 @@ export const serializeAws_json1_1GetHomeRegionCommand = async ( input: GetHomeRegionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSMigrationHubMultiAccountService.GetHomeRegion", - }; + const headers: __HeaderBag = sharedHeaders("GetHomeRegion"); let body: any; body = JSON.stringify(serializeAws_json1_1GetHomeRegionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -503,6 +494,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSMigrationHubMultiAccountService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-mturk/src/protocols/Aws_json1_1.ts b/clients/client-mturk/src/protocols/Aws_json1_1.ts index 39c8e1deb091c..44d80794220eb 100644 --- a/clients/client-mturk/src/protocols/Aws_json1_1.ts +++ b/clients/client-mturk/src/protocols/Aws_json1_1.ts @@ -229,10 +229,7 @@ export const serializeAws_json1_1AcceptQualificationRequestCommand = async ( input: AcceptQualificationRequestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.AcceptQualificationRequest", - }; + const headers: __HeaderBag = sharedHeaders("AcceptQualificationRequest"); let body: any; body = JSON.stringify(serializeAws_json1_1AcceptQualificationRequestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -242,10 +239,7 @@ export const serializeAws_json1_1ApproveAssignmentCommand = async ( input: ApproveAssignmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ApproveAssignment", - }; + const headers: __HeaderBag = sharedHeaders("ApproveAssignment"); let body: any; body = JSON.stringify(serializeAws_json1_1ApproveAssignmentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -255,10 +249,7 @@ export const serializeAws_json1_1AssociateQualificationWithWorkerCommand = async input: AssociateQualificationWithWorkerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.AssociateQualificationWithWorker", - }; + const headers: __HeaderBag = sharedHeaders("AssociateQualificationWithWorker"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateQualificationWithWorkerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -268,10 +259,7 @@ export const serializeAws_json1_1CreateAdditionalAssignmentsForHITCommand = asyn input: CreateAdditionalAssignmentsForHITCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.CreateAdditionalAssignmentsForHIT", - }; + const headers: __HeaderBag = sharedHeaders("CreateAdditionalAssignmentsForHIT"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAdditionalAssignmentsForHITRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -281,10 +269,7 @@ export const serializeAws_json1_1CreateHITCommand = async ( input: CreateHITCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.CreateHIT", - }; + const headers: __HeaderBag = sharedHeaders("CreateHIT"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHITRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -294,10 +279,7 @@ export const serializeAws_json1_1CreateHITTypeCommand = async ( input: CreateHITTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.CreateHITType", - }; + const headers: __HeaderBag = sharedHeaders("CreateHITType"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHITTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -307,10 +289,7 @@ export const serializeAws_json1_1CreateHITWithHITTypeCommand = async ( input: CreateHITWithHITTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.CreateHITWithHITType", - }; + const headers: __HeaderBag = sharedHeaders("CreateHITWithHITType"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHITWithHITTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -320,10 +299,7 @@ export const serializeAws_json1_1CreateQualificationTypeCommand = async ( input: CreateQualificationTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.CreateQualificationType", - }; + const headers: __HeaderBag = sharedHeaders("CreateQualificationType"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateQualificationTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -333,10 +309,7 @@ export const serializeAws_json1_1CreateWorkerBlockCommand = async ( input: CreateWorkerBlockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.CreateWorkerBlock", - }; + const headers: __HeaderBag = sharedHeaders("CreateWorkerBlock"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWorkerBlockRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -346,10 +319,7 @@ export const serializeAws_json1_1DeleteHITCommand = async ( input: DeleteHITCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.DeleteHIT", - }; + const headers: __HeaderBag = sharedHeaders("DeleteHIT"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteHITRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -359,10 +329,7 @@ export const serializeAws_json1_1DeleteQualificationTypeCommand = async ( input: DeleteQualificationTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.DeleteQualificationType", - }; + const headers: __HeaderBag = sharedHeaders("DeleteQualificationType"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteQualificationTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -372,10 +339,7 @@ export const serializeAws_json1_1DeleteWorkerBlockCommand = async ( input: DeleteWorkerBlockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.DeleteWorkerBlock", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWorkerBlock"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWorkerBlockRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -385,10 +349,7 @@ export const serializeAws_json1_1DisassociateQualificationFromWorkerCommand = as input: DisassociateQualificationFromWorkerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.DisassociateQualificationFromWorker", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateQualificationFromWorker"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateQualificationFromWorkerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -398,10 +359,7 @@ export const serializeAws_json1_1GetAccountBalanceCommand = async ( input: GetAccountBalanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.GetAccountBalance", - }; + const headers: __HeaderBag = sharedHeaders("GetAccountBalance"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAccountBalanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -411,10 +369,7 @@ export const serializeAws_json1_1GetAssignmentCommand = async ( input: GetAssignmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.GetAssignment", - }; + const headers: __HeaderBag = sharedHeaders("GetAssignment"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAssignmentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -424,10 +379,7 @@ export const serializeAws_json1_1GetFileUploadURLCommand = async ( input: GetFileUploadURLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.GetFileUploadURL", - }; + const headers: __HeaderBag = sharedHeaders("GetFileUploadURL"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFileUploadURLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -437,10 +389,7 @@ export const serializeAws_json1_1GetHITCommand = async ( input: GetHITCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.GetHIT", - }; + const headers: __HeaderBag = sharedHeaders("GetHIT"); let body: any; body = JSON.stringify(serializeAws_json1_1GetHITRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -450,10 +399,7 @@ export const serializeAws_json1_1GetQualificationScoreCommand = async ( input: GetQualificationScoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.GetQualificationScore", - }; + const headers: __HeaderBag = sharedHeaders("GetQualificationScore"); let body: any; body = JSON.stringify(serializeAws_json1_1GetQualificationScoreRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -463,10 +409,7 @@ export const serializeAws_json1_1GetQualificationTypeCommand = async ( input: GetQualificationTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.GetQualificationType", - }; + const headers: __HeaderBag = sharedHeaders("GetQualificationType"); let body: any; body = JSON.stringify(serializeAws_json1_1GetQualificationTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -476,10 +419,7 @@ export const serializeAws_json1_1ListAssignmentsForHITCommand = async ( input: ListAssignmentsForHITCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ListAssignmentsForHIT", - }; + const headers: __HeaderBag = sharedHeaders("ListAssignmentsForHIT"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssignmentsForHITRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -489,10 +429,7 @@ export const serializeAws_json1_1ListBonusPaymentsCommand = async ( input: ListBonusPaymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ListBonusPayments", - }; + const headers: __HeaderBag = sharedHeaders("ListBonusPayments"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBonusPaymentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -502,10 +439,7 @@ export const serializeAws_json1_1ListHITsCommand = async ( input: ListHITsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ListHITs", - }; + const headers: __HeaderBag = sharedHeaders("ListHITs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHITsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -515,10 +449,7 @@ export const serializeAws_json1_1ListHITsForQualificationTypeCommand = async ( input: ListHITsForQualificationTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ListHITsForQualificationType", - }; + const headers: __HeaderBag = sharedHeaders("ListHITsForQualificationType"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHITsForQualificationTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -528,10 +459,7 @@ export const serializeAws_json1_1ListQualificationRequestsCommand = async ( input: ListQualificationRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ListQualificationRequests", - }; + const headers: __HeaderBag = sharedHeaders("ListQualificationRequests"); let body: any; body = JSON.stringify(serializeAws_json1_1ListQualificationRequestsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -541,10 +469,7 @@ export const serializeAws_json1_1ListQualificationTypesCommand = async ( input: ListQualificationTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ListQualificationTypes", - }; + const headers: __HeaderBag = sharedHeaders("ListQualificationTypes"); let body: any; body = JSON.stringify(serializeAws_json1_1ListQualificationTypesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -554,10 +479,7 @@ export const serializeAws_json1_1ListReviewableHITsCommand = async ( input: ListReviewableHITsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ListReviewableHITs", - }; + const headers: __HeaderBag = sharedHeaders("ListReviewableHITs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReviewableHITsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -567,10 +489,7 @@ export const serializeAws_json1_1ListReviewPolicyResultsForHITCommand = async ( input: ListReviewPolicyResultsForHITCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ListReviewPolicyResultsForHIT", - }; + const headers: __HeaderBag = sharedHeaders("ListReviewPolicyResultsForHIT"); let body: any; body = JSON.stringify(serializeAws_json1_1ListReviewPolicyResultsForHITRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -580,10 +499,7 @@ export const serializeAws_json1_1ListWorkerBlocksCommand = async ( input: ListWorkerBlocksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ListWorkerBlocks", - }; + const headers: __HeaderBag = sharedHeaders("ListWorkerBlocks"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWorkerBlocksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -593,10 +509,7 @@ export const serializeAws_json1_1ListWorkersWithQualificationTypeCommand = async input: ListWorkersWithQualificationTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.ListWorkersWithQualificationType", - }; + const headers: __HeaderBag = sharedHeaders("ListWorkersWithQualificationType"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWorkersWithQualificationTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -606,10 +519,7 @@ export const serializeAws_json1_1NotifyWorkersCommand = async ( input: NotifyWorkersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.NotifyWorkers", - }; + const headers: __HeaderBag = sharedHeaders("NotifyWorkers"); let body: any; body = JSON.stringify(serializeAws_json1_1NotifyWorkersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -619,10 +529,7 @@ export const serializeAws_json1_1RejectAssignmentCommand = async ( input: RejectAssignmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.RejectAssignment", - }; + const headers: __HeaderBag = sharedHeaders("RejectAssignment"); let body: any; body = JSON.stringify(serializeAws_json1_1RejectAssignmentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -632,10 +539,7 @@ export const serializeAws_json1_1RejectQualificationRequestCommand = async ( input: RejectQualificationRequestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.RejectQualificationRequest", - }; + const headers: __HeaderBag = sharedHeaders("RejectQualificationRequest"); let body: any; body = JSON.stringify(serializeAws_json1_1RejectQualificationRequestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -645,10 +549,7 @@ export const serializeAws_json1_1SendBonusCommand = async ( input: SendBonusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.SendBonus", - }; + const headers: __HeaderBag = sharedHeaders("SendBonus"); let body: any; body = JSON.stringify(serializeAws_json1_1SendBonusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -658,10 +559,7 @@ export const serializeAws_json1_1SendTestEventNotificationCommand = async ( input: SendTestEventNotificationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.SendTestEventNotification", - }; + const headers: __HeaderBag = sharedHeaders("SendTestEventNotification"); let body: any; body = JSON.stringify(serializeAws_json1_1SendTestEventNotificationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -671,10 +569,7 @@ export const serializeAws_json1_1UpdateExpirationForHITCommand = async ( input: UpdateExpirationForHITCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.UpdateExpirationForHIT", - }; + const headers: __HeaderBag = sharedHeaders("UpdateExpirationForHIT"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateExpirationForHITRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -684,10 +579,7 @@ export const serializeAws_json1_1UpdateHITReviewStatusCommand = async ( input: UpdateHITReviewStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.UpdateHITReviewStatus", - }; + const headers: __HeaderBag = sharedHeaders("UpdateHITReviewStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateHITReviewStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -697,10 +589,7 @@ export const serializeAws_json1_1UpdateHITTypeOfHITCommand = async ( input: UpdateHITTypeOfHITCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.UpdateHITTypeOfHIT", - }; + const headers: __HeaderBag = sharedHeaders("UpdateHITTypeOfHIT"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateHITTypeOfHITRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -710,10 +599,7 @@ export const serializeAws_json1_1UpdateNotificationSettingsCommand = async ( input: UpdateNotificationSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.UpdateNotificationSettings", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNotificationSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNotificationSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -723,10 +609,7 @@ export const serializeAws_json1_1UpdateQualificationTypeCommand = async ( input: UpdateQualificationTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "MTurkRequesterServiceV20170117.UpdateQualificationType", - }; + const headers: __HeaderBag = sharedHeaders("UpdateQualificationType"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateQualificationTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3924,6 +3807,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `MTurkRequesterServiceV20170117.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-neptune/src/protocols/Aws_query.ts b/clients/client-neptune/src/protocols/Aws_query.ts index 90354e9cec8ee..38d0f7da1f00a 100644 --- a/clients/client-neptune/src/protocols/Aws_query.ts +++ b/clients/client-neptune/src/protocols/Aws_query.ts @@ -507,9 +507,7 @@ export const serializeAws_queryAddRoleToDBClusterCommand = async ( input: AddRoleToDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddRoleToDBClusterMessage(input, context), @@ -523,9 +521,7 @@ export const serializeAws_queryAddSourceIdentifierToSubscriptionCommand = async input: AddSourceIdentifierToSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddSourceIdentifierToSubscriptionMessage(input, context), @@ -539,9 +535,7 @@ export const serializeAws_queryAddTagsToResourceCommand = async ( input: AddTagsToResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddTagsToResourceMessage(input, context), @@ -555,9 +549,7 @@ export const serializeAws_queryApplyPendingMaintenanceActionCommand = async ( input: ApplyPendingMaintenanceActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryApplyPendingMaintenanceActionMessage(input, context), @@ -571,9 +563,7 @@ export const serializeAws_queryCopyDBClusterParameterGroupCommand = async ( input: CopyDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyDBClusterParameterGroupMessage(input, context), @@ -587,9 +577,7 @@ export const serializeAws_queryCopyDBClusterSnapshotCommand = async ( input: CopyDBClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyDBClusterSnapshotMessage(input, context), @@ -603,9 +591,7 @@ export const serializeAws_queryCopyDBParameterGroupCommand = async ( input: CopyDBParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyDBParameterGroupMessage(input, context), @@ -619,9 +605,7 @@ export const serializeAws_queryCreateDBClusterCommand = async ( input: CreateDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterMessage(input, context), @@ -635,9 +619,7 @@ export const serializeAws_queryCreateDBClusterEndpointCommand = async ( input: CreateDBClusterEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterEndpointMessage(input, context), @@ -651,9 +633,7 @@ export const serializeAws_queryCreateDBClusterParameterGroupCommand = async ( input: CreateDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterParameterGroupMessage(input, context), @@ -667,9 +647,7 @@ export const serializeAws_queryCreateDBClusterSnapshotCommand = async ( input: CreateDBClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterSnapshotMessage(input, context), @@ -683,9 +661,7 @@ export const serializeAws_queryCreateDBInstanceCommand = async ( input: CreateDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBInstanceMessage(input, context), @@ -699,9 +675,7 @@ export const serializeAws_queryCreateDBParameterGroupCommand = async ( input: CreateDBParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBParameterGroupMessage(input, context), @@ -715,9 +689,7 @@ export const serializeAws_queryCreateDBSubnetGroupCommand = async ( input: CreateDBSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBSubnetGroupMessage(input, context), @@ -731,9 +703,7 @@ export const serializeAws_queryCreateEventSubscriptionCommand = async ( input: CreateEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateEventSubscriptionMessage(input, context), @@ -747,9 +717,7 @@ export const serializeAws_queryCreateGlobalClusterCommand = async ( input: CreateGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateGlobalClusterMessage(input, context), @@ -763,9 +731,7 @@ export const serializeAws_queryDeleteDBClusterCommand = async ( input: DeleteDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterMessage(input, context), @@ -779,9 +745,7 @@ export const serializeAws_queryDeleteDBClusterEndpointCommand = async ( input: DeleteDBClusterEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterEndpointMessage(input, context), @@ -795,9 +759,7 @@ export const serializeAws_queryDeleteDBClusterParameterGroupCommand = async ( input: DeleteDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterParameterGroupMessage(input, context), @@ -811,9 +773,7 @@ export const serializeAws_queryDeleteDBClusterSnapshotCommand = async ( input: DeleteDBClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterSnapshotMessage(input, context), @@ -827,9 +787,7 @@ export const serializeAws_queryDeleteDBInstanceCommand = async ( input: DeleteDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBInstanceMessage(input, context), @@ -843,9 +801,7 @@ export const serializeAws_queryDeleteDBParameterGroupCommand = async ( input: DeleteDBParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBParameterGroupMessage(input, context), @@ -859,9 +815,7 @@ export const serializeAws_queryDeleteDBSubnetGroupCommand = async ( input: DeleteDBSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBSubnetGroupMessage(input, context), @@ -875,9 +829,7 @@ export const serializeAws_queryDeleteEventSubscriptionCommand = async ( input: DeleteEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteEventSubscriptionMessage(input, context), @@ -891,9 +843,7 @@ export const serializeAws_queryDeleteGlobalClusterCommand = async ( input: DeleteGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteGlobalClusterMessage(input, context), @@ -907,9 +857,7 @@ export const serializeAws_queryDescribeDBClusterEndpointsCommand = async ( input: DescribeDBClusterEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterEndpointsMessage(input, context), @@ -923,9 +871,7 @@ export const serializeAws_queryDescribeDBClusterParameterGroupsCommand = async ( input: DescribeDBClusterParameterGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterParameterGroupsMessage(input, context), @@ -939,9 +885,7 @@ export const serializeAws_queryDescribeDBClusterParametersCommand = async ( input: DescribeDBClusterParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterParametersMessage(input, context), @@ -955,9 +899,7 @@ export const serializeAws_queryDescribeDBClustersCommand = async ( input: DescribeDBClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClustersMessage(input, context), @@ -971,9 +913,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotAttributesCommand = asyn input: DescribeDBClusterSnapshotAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterSnapshotAttributesMessage(input, context), @@ -987,9 +927,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotsCommand = async ( input: DescribeDBClusterSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterSnapshotsMessage(input, context), @@ -1003,9 +941,7 @@ export const serializeAws_queryDescribeDBEngineVersionsCommand = async ( input: DescribeDBEngineVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBEngineVersionsMessage(input, context), @@ -1019,9 +955,7 @@ export const serializeAws_queryDescribeDBInstancesCommand = async ( input: DescribeDBInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBInstancesMessage(input, context), @@ -1035,9 +969,7 @@ export const serializeAws_queryDescribeDBParameterGroupsCommand = async ( input: DescribeDBParameterGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBParameterGroupsMessage(input, context), @@ -1051,9 +983,7 @@ export const serializeAws_queryDescribeDBParametersCommand = async ( input: DescribeDBParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBParametersMessage(input, context), @@ -1067,9 +997,7 @@ export const serializeAws_queryDescribeDBSubnetGroupsCommand = async ( input: DescribeDBSubnetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBSubnetGroupsMessage(input, context), @@ -1083,9 +1011,7 @@ export const serializeAws_queryDescribeEngineDefaultClusterParametersCommand = a input: DescribeEngineDefaultClusterParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEngineDefaultClusterParametersMessage(input, context), @@ -1099,9 +1025,7 @@ export const serializeAws_queryDescribeEngineDefaultParametersCommand = async ( input: DescribeEngineDefaultParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEngineDefaultParametersMessage(input, context), @@ -1115,9 +1039,7 @@ export const serializeAws_queryDescribeEventCategoriesCommand = async ( input: DescribeEventCategoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventCategoriesMessage(input, context), @@ -1131,9 +1053,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventsMessage(input, context), @@ -1147,9 +1067,7 @@ export const serializeAws_queryDescribeEventSubscriptionsCommand = async ( input: DescribeEventSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventSubscriptionsMessage(input, context), @@ -1163,9 +1081,7 @@ export const serializeAws_queryDescribeGlobalClustersCommand = async ( input: DescribeGlobalClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeGlobalClustersMessage(input, context), @@ -1179,9 +1095,7 @@ export const serializeAws_queryDescribeOrderableDBInstanceOptionsCommand = async input: DescribeOrderableDBInstanceOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeOrderableDBInstanceOptionsMessage(input, context), @@ -1195,9 +1109,7 @@ export const serializeAws_queryDescribePendingMaintenanceActionsCommand = async input: DescribePendingMaintenanceActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribePendingMaintenanceActionsMessage(input, context), @@ -1211,9 +1123,7 @@ export const serializeAws_queryDescribeValidDBInstanceModificationsCommand = asy input: DescribeValidDBInstanceModificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeValidDBInstanceModificationsMessage(input, context), @@ -1227,9 +1137,7 @@ export const serializeAws_queryFailoverDBClusterCommand = async ( input: FailoverDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryFailoverDBClusterMessage(input, context), @@ -1243,9 +1151,7 @@ export const serializeAws_queryFailoverGlobalClusterCommand = async ( input: FailoverGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryFailoverGlobalClusterMessage(input, context), @@ -1259,9 +1165,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTagsForResourceMessage(input, context), @@ -1275,9 +1179,7 @@ export const serializeAws_queryModifyDBClusterCommand = async ( input: ModifyDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterMessage(input, context), @@ -1291,9 +1193,7 @@ export const serializeAws_queryModifyDBClusterEndpointCommand = async ( input: ModifyDBClusterEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterEndpointMessage(input, context), @@ -1307,9 +1207,7 @@ export const serializeAws_queryModifyDBClusterParameterGroupCommand = async ( input: ModifyDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterParameterGroupMessage(input, context), @@ -1323,9 +1221,7 @@ export const serializeAws_queryModifyDBClusterSnapshotAttributeCommand = async ( input: ModifyDBClusterSnapshotAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterSnapshotAttributeMessage(input, context), @@ -1339,9 +1235,7 @@ export const serializeAws_queryModifyDBInstanceCommand = async ( input: ModifyDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBInstanceMessage(input, context), @@ -1355,9 +1249,7 @@ export const serializeAws_queryModifyDBParameterGroupCommand = async ( input: ModifyDBParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBParameterGroupMessage(input, context), @@ -1371,9 +1263,7 @@ export const serializeAws_queryModifyDBSubnetGroupCommand = async ( input: ModifyDBSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBSubnetGroupMessage(input, context), @@ -1387,9 +1277,7 @@ export const serializeAws_queryModifyEventSubscriptionCommand = async ( input: ModifyEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyEventSubscriptionMessage(input, context), @@ -1403,9 +1291,7 @@ export const serializeAws_queryModifyGlobalClusterCommand = async ( input: ModifyGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyGlobalClusterMessage(input, context), @@ -1419,9 +1305,7 @@ export const serializeAws_queryPromoteReadReplicaDBClusterCommand = async ( input: PromoteReadReplicaDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPromoteReadReplicaDBClusterMessage(input, context), @@ -1435,9 +1319,7 @@ export const serializeAws_queryRebootDBInstanceCommand = async ( input: RebootDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRebootDBInstanceMessage(input, context), @@ -1451,9 +1333,7 @@ export const serializeAws_queryRemoveFromGlobalClusterCommand = async ( input: RemoveFromGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveFromGlobalClusterMessage(input, context), @@ -1467,9 +1347,7 @@ export const serializeAws_queryRemoveRoleFromDBClusterCommand = async ( input: RemoveRoleFromDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveRoleFromDBClusterMessage(input, context), @@ -1483,9 +1361,7 @@ export const serializeAws_queryRemoveSourceIdentifierFromSubscriptionCommand = a input: RemoveSourceIdentifierFromSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveSourceIdentifierFromSubscriptionMessage(input, context), @@ -1499,9 +1375,7 @@ export const serializeAws_queryRemoveTagsFromResourceCommand = async ( input: RemoveTagsFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveTagsFromResourceMessage(input, context), @@ -1515,9 +1389,7 @@ export const serializeAws_queryResetDBClusterParameterGroupCommand = async ( input: ResetDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResetDBClusterParameterGroupMessage(input, context), @@ -1531,9 +1403,7 @@ export const serializeAws_queryResetDBParameterGroupCommand = async ( input: ResetDBParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResetDBParameterGroupMessage(input, context), @@ -1547,9 +1417,7 @@ export const serializeAws_queryRestoreDBClusterFromSnapshotCommand = async ( input: RestoreDBClusterFromSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreDBClusterFromSnapshotMessage(input, context), @@ -1563,9 +1431,7 @@ export const serializeAws_queryRestoreDBClusterToPointInTimeCommand = async ( input: RestoreDBClusterToPointInTimeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreDBClusterToPointInTimeMessage(input, context), @@ -1579,9 +1445,7 @@ export const serializeAws_queryStartDBClusterCommand = async ( input: StartDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStartDBClusterMessage(input, context), @@ -1595,9 +1459,7 @@ export const serializeAws_queryStopDBClusterCommand = async ( input: StopDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStopDBClusterMessage(input, context), @@ -11732,6 +11594,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-network-firewall/src/protocols/Aws_json1_0.ts b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts index e518b375ea0bd..9db269fdbdada 100644 --- a/clients/client-network-firewall/src/protocols/Aws_json1_0.ts +++ b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts @@ -233,10 +233,7 @@ export const serializeAws_json1_0AssociateFirewallPolicyCommand = async ( input: AssociateFirewallPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.AssociateFirewallPolicy", - }; + const headers: __HeaderBag = sharedHeaders("AssociateFirewallPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0AssociateFirewallPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -246,10 +243,7 @@ export const serializeAws_json1_0AssociateSubnetsCommand = async ( input: AssociateSubnetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.AssociateSubnets", - }; + const headers: __HeaderBag = sharedHeaders("AssociateSubnets"); let body: any; body = JSON.stringify(serializeAws_json1_0AssociateSubnetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -259,10 +253,7 @@ export const serializeAws_json1_0CreateFirewallCommand = async ( input: CreateFirewallCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.CreateFirewall", - }; + const headers: __HeaderBag = sharedHeaders("CreateFirewall"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateFirewallRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -272,10 +263,7 @@ export const serializeAws_json1_0CreateFirewallPolicyCommand = async ( input: CreateFirewallPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.CreateFirewallPolicy", - }; + const headers: __HeaderBag = sharedHeaders("CreateFirewallPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateFirewallPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -285,10 +273,7 @@ export const serializeAws_json1_0CreateRuleGroupCommand = async ( input: CreateRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.CreateRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -298,10 +283,7 @@ export const serializeAws_json1_0DeleteFirewallCommand = async ( input: DeleteFirewallCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DeleteFirewall", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFirewall"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteFirewallRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -311,10 +293,7 @@ export const serializeAws_json1_0DeleteFirewallPolicyCommand = async ( input: DeleteFirewallPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DeleteFirewallPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFirewallPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteFirewallPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -324,10 +303,7 @@ export const serializeAws_json1_0DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DeleteResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -337,10 +313,7 @@ export const serializeAws_json1_0DeleteRuleGroupCommand = async ( input: DeleteRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DeleteRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -350,10 +323,7 @@ export const serializeAws_json1_0DescribeFirewallCommand = async ( input: DescribeFirewallCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DescribeFirewall", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFirewall"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeFirewallRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -363,10 +333,7 @@ export const serializeAws_json1_0DescribeFirewallPolicyCommand = async ( input: DescribeFirewallPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DescribeFirewallPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFirewallPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeFirewallPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -376,10 +343,7 @@ export const serializeAws_json1_0DescribeLoggingConfigurationCommand = async ( input: DescribeLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DescribeLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -389,10 +353,7 @@ export const serializeAws_json1_0DescribeResourcePolicyCommand = async ( input: DescribeResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DescribeResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DescribeResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -402,10 +363,7 @@ export const serializeAws_json1_0DescribeRuleGroupCommand = async ( input: DescribeRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DescribeRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -415,10 +373,7 @@ export const serializeAws_json1_0DescribeRuleGroupMetadataCommand = async ( input: DescribeRuleGroupMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DescribeRuleGroupMetadata", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRuleGroupMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeRuleGroupMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -428,10 +383,7 @@ export const serializeAws_json1_0DisassociateSubnetsCommand = async ( input: DisassociateSubnetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.DisassociateSubnets", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateSubnets"); let body: any; body = JSON.stringify(serializeAws_json1_0DisassociateSubnetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -441,10 +393,7 @@ export const serializeAws_json1_0ListFirewallPoliciesCommand = async ( input: ListFirewallPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.ListFirewallPolicies", - }; + const headers: __HeaderBag = sharedHeaders("ListFirewallPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_0ListFirewallPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -454,10 +403,7 @@ export const serializeAws_json1_0ListFirewallsCommand = async ( input: ListFirewallsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.ListFirewalls", - }; + const headers: __HeaderBag = sharedHeaders("ListFirewalls"); let body: any; body = JSON.stringify(serializeAws_json1_0ListFirewallsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -467,10 +413,7 @@ export const serializeAws_json1_0ListRuleGroupsCommand = async ( input: ListRuleGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.ListRuleGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListRuleGroups"); let body: any; body = JSON.stringify(serializeAws_json1_0ListRuleGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -480,10 +423,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -493,10 +433,7 @@ export const serializeAws_json1_0PutResourcePolicyCommand = async ( input: PutResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.PutResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0PutResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -506,10 +443,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -519,10 +453,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -532,10 +463,7 @@ export const serializeAws_json1_0UpdateFirewallDeleteProtectionCommand = async ( input: UpdateFirewallDeleteProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.UpdateFirewallDeleteProtection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFirewallDeleteProtection"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateFirewallDeleteProtectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -545,10 +473,7 @@ export const serializeAws_json1_0UpdateFirewallDescriptionCommand = async ( input: UpdateFirewallDescriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.UpdateFirewallDescription", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFirewallDescription"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateFirewallDescriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -558,10 +483,7 @@ export const serializeAws_json1_0UpdateFirewallEncryptionConfigurationCommand = input: UpdateFirewallEncryptionConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.UpdateFirewallEncryptionConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFirewallEncryptionConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateFirewallEncryptionConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -571,10 +493,7 @@ export const serializeAws_json1_0UpdateFirewallPolicyCommand = async ( input: UpdateFirewallPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.UpdateFirewallPolicy", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFirewallPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateFirewallPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -584,10 +503,7 @@ export const serializeAws_json1_0UpdateFirewallPolicyChangeProtectionCommand = a input: UpdateFirewallPolicyChangeProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.UpdateFirewallPolicyChangeProtection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFirewallPolicyChangeProtection"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateFirewallPolicyChangeProtectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -597,10 +513,7 @@ export const serializeAws_json1_0UpdateLoggingConfigurationCommand = async ( input: UpdateLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.UpdateLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -610,10 +523,7 @@ export const serializeAws_json1_0UpdateRuleGroupCommand = async ( input: UpdateRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.UpdateRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -623,10 +533,7 @@ export const serializeAws_json1_0UpdateSubnetChangeProtectionCommand = async ( input: UpdateSubnetChangeProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "NetworkFirewall_20201112.UpdateSubnetChangeProtection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSubnetChangeProtection"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateSubnetChangeProtectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4684,6 +4591,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `NetworkFirewall_20201112.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts b/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts index f732d34cbedd4..cb1be89ac8a78 100644 --- a/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts +++ b/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts @@ -181,10 +181,7 @@ export const serializeAws_json1_0BatchGetCollectionCommand = async ( input: BatchGetCollectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.BatchGetCollection", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetCollection"); let body: any; body = JSON.stringify(serializeAws_json1_0BatchGetCollectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -194,10 +191,7 @@ export const serializeAws_json1_0BatchGetVpcEndpointCommand = async ( input: BatchGetVpcEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.BatchGetVpcEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("BatchGetVpcEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_0BatchGetVpcEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -207,10 +201,7 @@ export const serializeAws_json1_0CreateAccessPolicyCommand = async ( input: CreateAccessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.CreateAccessPolicy", - }; + const headers: __HeaderBag = sharedHeaders("CreateAccessPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateAccessPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -220,10 +211,7 @@ export const serializeAws_json1_0CreateCollectionCommand = async ( input: CreateCollectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.CreateCollection", - }; + const headers: __HeaderBag = sharedHeaders("CreateCollection"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateCollectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -233,10 +221,7 @@ export const serializeAws_json1_0CreateSecurityConfigCommand = async ( input: CreateSecurityConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.CreateSecurityConfig", - }; + const headers: __HeaderBag = sharedHeaders("CreateSecurityConfig"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateSecurityConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -246,10 +231,7 @@ export const serializeAws_json1_0CreateSecurityPolicyCommand = async ( input: CreateSecurityPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.CreateSecurityPolicy", - }; + const headers: __HeaderBag = sharedHeaders("CreateSecurityPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateSecurityPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -259,10 +241,7 @@ export const serializeAws_json1_0CreateVpcEndpointCommand = async ( input: CreateVpcEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.CreateVpcEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("CreateVpcEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateVpcEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -272,10 +251,7 @@ export const serializeAws_json1_0DeleteAccessPolicyCommand = async ( input: DeleteAccessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.DeleteAccessPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAccessPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteAccessPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -285,10 +261,7 @@ export const serializeAws_json1_0DeleteCollectionCommand = async ( input: DeleteCollectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.DeleteCollection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCollection"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteCollectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -298,10 +271,7 @@ export const serializeAws_json1_0DeleteSecurityConfigCommand = async ( input: DeleteSecurityConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.DeleteSecurityConfig", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSecurityConfig"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteSecurityConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -311,10 +281,7 @@ export const serializeAws_json1_0DeleteSecurityPolicyCommand = async ( input: DeleteSecurityPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.DeleteSecurityPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSecurityPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteSecurityPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -324,10 +291,7 @@ export const serializeAws_json1_0DeleteVpcEndpointCommand = async ( input: DeleteVpcEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.DeleteVpcEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVpcEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteVpcEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -337,10 +301,7 @@ export const serializeAws_json1_0GetAccessPolicyCommand = async ( input: GetAccessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.GetAccessPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetAccessPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0GetAccessPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -350,10 +311,7 @@ export const serializeAws_json1_0GetAccountSettingsCommand = async ( input: GetAccountSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.GetAccountSettings", - }; + const headers: __HeaderBag = sharedHeaders("GetAccountSettings"); let body: any; body = JSON.stringify(serializeAws_json1_0GetAccountSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -363,10 +321,7 @@ export const serializeAws_json1_0GetPoliciesStatsCommand = async ( input: GetPoliciesStatsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.GetPoliciesStats", - }; + const headers: __HeaderBag = sharedHeaders("GetPoliciesStats"); let body: any; body = JSON.stringify(serializeAws_json1_0GetPoliciesStatsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -376,10 +331,7 @@ export const serializeAws_json1_0GetSecurityConfigCommand = async ( input: GetSecurityConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.GetSecurityConfig", - }; + const headers: __HeaderBag = sharedHeaders("GetSecurityConfig"); let body: any; body = JSON.stringify(serializeAws_json1_0GetSecurityConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -389,10 +341,7 @@ export const serializeAws_json1_0GetSecurityPolicyCommand = async ( input: GetSecurityPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.GetSecurityPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetSecurityPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0GetSecurityPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -402,10 +351,7 @@ export const serializeAws_json1_0ListAccessPoliciesCommand = async ( input: ListAccessPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.ListAccessPolicies", - }; + const headers: __HeaderBag = sharedHeaders("ListAccessPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_0ListAccessPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -415,10 +361,7 @@ export const serializeAws_json1_0ListCollectionsCommand = async ( input: ListCollectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.ListCollections", - }; + const headers: __HeaderBag = sharedHeaders("ListCollections"); let body: any; body = JSON.stringify(serializeAws_json1_0ListCollectionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -428,10 +371,7 @@ export const serializeAws_json1_0ListSecurityConfigsCommand = async ( input: ListSecurityConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.ListSecurityConfigs", - }; + const headers: __HeaderBag = sharedHeaders("ListSecurityConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListSecurityConfigsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -441,10 +381,7 @@ export const serializeAws_json1_0ListSecurityPoliciesCommand = async ( input: ListSecurityPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.ListSecurityPolicies", - }; + const headers: __HeaderBag = sharedHeaders("ListSecurityPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_0ListSecurityPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -454,10 +391,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -467,10 +401,7 @@ export const serializeAws_json1_0ListVpcEndpointsCommand = async ( input: ListVpcEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.ListVpcEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("ListVpcEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_0ListVpcEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -480,10 +411,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -493,10 +421,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -506,10 +431,7 @@ export const serializeAws_json1_0UpdateAccessPolicyCommand = async ( input: UpdateAccessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.UpdateAccessPolicy", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAccessPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateAccessPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -519,10 +441,7 @@ export const serializeAws_json1_0UpdateAccountSettingsCommand = async ( input: UpdateAccountSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.UpdateAccountSettings", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAccountSettings"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateAccountSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -532,10 +451,7 @@ export const serializeAws_json1_0UpdateCollectionCommand = async ( input: UpdateCollectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.UpdateCollection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCollection"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateCollectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -545,10 +461,7 @@ export const serializeAws_json1_0UpdateSecurityConfigCommand = async ( input: UpdateSecurityConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.UpdateSecurityConfig", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSecurityConfig"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateSecurityConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -558,10 +471,7 @@ export const serializeAws_json1_0UpdateSecurityPolicyCommand = async ( input: UpdateSecurityPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.UpdateSecurityPolicy", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSecurityPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateSecurityPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -571,10 +481,7 @@ export const serializeAws_json1_0UpdateVpcEndpointCommand = async ( input: UpdateVpcEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "OpenSearchServerless.UpdateVpcEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVpcEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateVpcEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3369,6 +3276,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `OpenSearchServerless.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-opsworks/src/protocols/Aws_json1_1.ts b/clients/client-opsworks/src/protocols/Aws_json1_1.ts index 3e94b8483960e..b7494428666b2 100644 --- a/clients/client-opsworks/src/protocols/Aws_json1_1.ts +++ b/clients/client-opsworks/src/protocols/Aws_json1_1.ts @@ -332,10 +332,7 @@ export const serializeAws_json1_1AssignInstanceCommand = async ( input: AssignInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.AssignInstance", - }; + const headers: __HeaderBag = sharedHeaders("AssignInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1AssignInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -345,10 +342,7 @@ export const serializeAws_json1_1AssignVolumeCommand = async ( input: AssignVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.AssignVolume", - }; + const headers: __HeaderBag = sharedHeaders("AssignVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1AssignVolumeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -358,10 +352,7 @@ export const serializeAws_json1_1AssociateElasticIpCommand = async ( input: AssociateElasticIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.AssociateElasticIp", - }; + const headers: __HeaderBag = sharedHeaders("AssociateElasticIp"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateElasticIpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -371,10 +362,7 @@ export const serializeAws_json1_1AttachElasticLoadBalancerCommand = async ( input: AttachElasticLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.AttachElasticLoadBalancer", - }; + const headers: __HeaderBag = sharedHeaders("AttachElasticLoadBalancer"); let body: any; body = JSON.stringify(serializeAws_json1_1AttachElasticLoadBalancerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -384,10 +372,7 @@ export const serializeAws_json1_1CloneStackCommand = async ( input: CloneStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.CloneStack", - }; + const headers: __HeaderBag = sharedHeaders("CloneStack"); let body: any; body = JSON.stringify(serializeAws_json1_1CloneStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -397,10 +382,7 @@ export const serializeAws_json1_1CreateAppCommand = async ( input: CreateAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.CreateApp", - }; + const headers: __HeaderBag = sharedHeaders("CreateApp"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -410,10 +392,7 @@ export const serializeAws_json1_1CreateDeploymentCommand = async ( input: CreateDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.CreateDeployment", - }; + const headers: __HeaderBag = sharedHeaders("CreateDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDeploymentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -423,10 +402,7 @@ export const serializeAws_json1_1CreateInstanceCommand = async ( input: CreateInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.CreateInstance", - }; + const headers: __HeaderBag = sharedHeaders("CreateInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -436,10 +412,7 @@ export const serializeAws_json1_1CreateLayerCommand = async ( input: CreateLayerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.CreateLayer", - }; + const headers: __HeaderBag = sharedHeaders("CreateLayer"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLayerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -449,10 +422,7 @@ export const serializeAws_json1_1CreateStackCommand = async ( input: CreateStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.CreateStack", - }; + const headers: __HeaderBag = sharedHeaders("CreateStack"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -462,10 +432,7 @@ export const serializeAws_json1_1CreateUserProfileCommand = async ( input: CreateUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.CreateUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("CreateUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -475,10 +442,7 @@ export const serializeAws_json1_1DeleteAppCommand = async ( input: DeleteAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DeleteApp", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApp"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -488,10 +452,7 @@ export const serializeAws_json1_1DeleteInstanceCommand = async ( input: DeleteInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DeleteInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeleteInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -501,10 +462,7 @@ export const serializeAws_json1_1DeleteLayerCommand = async ( input: DeleteLayerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DeleteLayer", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLayer"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLayerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -514,10 +472,7 @@ export const serializeAws_json1_1DeleteStackCommand = async ( input: DeleteStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DeleteStack", - }; + const headers: __HeaderBag = sharedHeaders("DeleteStack"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -527,10 +482,7 @@ export const serializeAws_json1_1DeleteUserProfileCommand = async ( input: DeleteUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DeleteUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -540,10 +492,7 @@ export const serializeAws_json1_1DeregisterEcsClusterCommand = async ( input: DeregisterEcsClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DeregisterEcsCluster", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterEcsCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterEcsClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -553,10 +502,7 @@ export const serializeAws_json1_1DeregisterElasticIpCommand = async ( input: DeregisterElasticIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DeregisterElasticIp", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterElasticIp"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterElasticIpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -566,10 +512,7 @@ export const serializeAws_json1_1DeregisterInstanceCommand = async ( input: DeregisterInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DeregisterInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -579,10 +522,7 @@ export const serializeAws_json1_1DeregisterRdsDbInstanceCommand = async ( input: DeregisterRdsDbInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DeregisterRdsDbInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterRdsDbInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterRdsDbInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -592,10 +532,7 @@ export const serializeAws_json1_1DeregisterVolumeCommand = async ( input: DeregisterVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DeregisterVolume", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterVolumeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -605,10 +542,7 @@ export const serializeAws_json1_1DescribeAgentVersionsCommand = async ( input: DescribeAgentVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeAgentVersions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAgentVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAgentVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -618,10 +552,7 @@ export const serializeAws_json1_1DescribeAppsCommand = async ( input: DescribeAppsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeApps", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApps"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAppsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -631,10 +562,7 @@ export const serializeAws_json1_1DescribeCommandsCommand = async ( input: DescribeCommandsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeCommands", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCommands"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCommandsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -644,10 +572,7 @@ export const serializeAws_json1_1DescribeDeploymentsCommand = async ( input: DescribeDeploymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeDeployments", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDeployments"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDeploymentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -657,10 +582,7 @@ export const serializeAws_json1_1DescribeEcsClustersCommand = async ( input: DescribeEcsClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeEcsClusters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEcsClusters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEcsClustersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -670,10 +592,7 @@ export const serializeAws_json1_1DescribeElasticIpsCommand = async ( input: DescribeElasticIpsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeElasticIps", - }; + const headers: __HeaderBag = sharedHeaders("DescribeElasticIps"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeElasticIpsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -683,10 +602,7 @@ export const serializeAws_json1_1DescribeElasticLoadBalancersCommand = async ( input: DescribeElasticLoadBalancersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeElasticLoadBalancers", - }; + const headers: __HeaderBag = sharedHeaders("DescribeElasticLoadBalancers"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeElasticLoadBalancersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -696,10 +612,7 @@ export const serializeAws_json1_1DescribeInstancesCommand = async ( input: DescribeInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeInstances", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInstancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -709,10 +622,7 @@ export const serializeAws_json1_1DescribeLayersCommand = async ( input: DescribeLayersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeLayers", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLayers"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLayersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -722,10 +632,7 @@ export const serializeAws_json1_1DescribeLoadBasedAutoScalingCommand = async ( input: DescribeLoadBasedAutoScalingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeLoadBasedAutoScaling", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLoadBasedAutoScaling"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLoadBasedAutoScalingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -735,10 +642,7 @@ export const serializeAws_json1_1DescribeMyUserProfileCommand = async ( input: DescribeMyUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeMyUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMyUserProfile"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -747,10 +651,7 @@ export const serializeAws_json1_1DescribeOperatingSystemsCommand = async ( input: DescribeOperatingSystemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeOperatingSystems", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOperatingSystems"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -759,10 +660,7 @@ export const serializeAws_json1_1DescribePermissionsCommand = async ( input: DescribePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribePermissions", - }; + const headers: __HeaderBag = sharedHeaders("DescribePermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -772,10 +670,7 @@ export const serializeAws_json1_1DescribeRaidArraysCommand = async ( input: DescribeRaidArraysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeRaidArrays", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRaidArrays"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRaidArraysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -785,10 +680,7 @@ export const serializeAws_json1_1DescribeRdsDbInstancesCommand = async ( input: DescribeRdsDbInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeRdsDbInstances", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRdsDbInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRdsDbInstancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -798,10 +690,7 @@ export const serializeAws_json1_1DescribeServiceErrorsCommand = async ( input: DescribeServiceErrorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeServiceErrors", - }; + const headers: __HeaderBag = sharedHeaders("DescribeServiceErrors"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeServiceErrorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -811,10 +700,7 @@ export const serializeAws_json1_1DescribeStackProvisioningParametersCommand = as input: DescribeStackProvisioningParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeStackProvisioningParameters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStackProvisioningParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStackProvisioningParametersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -824,10 +710,7 @@ export const serializeAws_json1_1DescribeStacksCommand = async ( input: DescribeStacksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeStacks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStacks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStacksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -837,10 +720,7 @@ export const serializeAws_json1_1DescribeStackSummaryCommand = async ( input: DescribeStackSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeStackSummary", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStackSummary"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStackSummaryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -850,10 +730,7 @@ export const serializeAws_json1_1DescribeTimeBasedAutoScalingCommand = async ( input: DescribeTimeBasedAutoScalingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeTimeBasedAutoScaling", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTimeBasedAutoScaling"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTimeBasedAutoScalingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -863,10 +740,7 @@ export const serializeAws_json1_1DescribeUserProfilesCommand = async ( input: DescribeUserProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeUserProfiles", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUserProfiles"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserProfilesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -876,10 +750,7 @@ export const serializeAws_json1_1DescribeVolumesCommand = async ( input: DescribeVolumesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DescribeVolumes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeVolumes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeVolumesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -889,10 +760,7 @@ export const serializeAws_json1_1DetachElasticLoadBalancerCommand = async ( input: DetachElasticLoadBalancerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DetachElasticLoadBalancer", - }; + const headers: __HeaderBag = sharedHeaders("DetachElasticLoadBalancer"); let body: any; body = JSON.stringify(serializeAws_json1_1DetachElasticLoadBalancerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -902,10 +770,7 @@ export const serializeAws_json1_1DisassociateElasticIpCommand = async ( input: DisassociateElasticIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.DisassociateElasticIp", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateElasticIp"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateElasticIpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -915,10 +780,7 @@ export const serializeAws_json1_1GetHostnameSuggestionCommand = async ( input: GetHostnameSuggestionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.GetHostnameSuggestion", - }; + const headers: __HeaderBag = sharedHeaders("GetHostnameSuggestion"); let body: any; body = JSON.stringify(serializeAws_json1_1GetHostnameSuggestionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -928,10 +790,7 @@ export const serializeAws_json1_1GrantAccessCommand = async ( input: GrantAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.GrantAccess", - }; + const headers: __HeaderBag = sharedHeaders("GrantAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1GrantAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -941,10 +800,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.ListTags", - }; + const headers: __HeaderBag = sharedHeaders("ListTags"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -954,10 +810,7 @@ export const serializeAws_json1_1RebootInstanceCommand = async ( input: RebootInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.RebootInstance", - }; + const headers: __HeaderBag = sharedHeaders("RebootInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1RebootInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -967,10 +820,7 @@ export const serializeAws_json1_1RegisterEcsClusterCommand = async ( input: RegisterEcsClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.RegisterEcsCluster", - }; + const headers: __HeaderBag = sharedHeaders("RegisterEcsCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterEcsClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -980,10 +830,7 @@ export const serializeAws_json1_1RegisterElasticIpCommand = async ( input: RegisterElasticIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.RegisterElasticIp", - }; + const headers: __HeaderBag = sharedHeaders("RegisterElasticIp"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterElasticIpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -993,10 +840,7 @@ export const serializeAws_json1_1RegisterInstanceCommand = async ( input: RegisterInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.RegisterInstance", - }; + const headers: __HeaderBag = sharedHeaders("RegisterInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1006,10 +850,7 @@ export const serializeAws_json1_1RegisterRdsDbInstanceCommand = async ( input: RegisterRdsDbInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.RegisterRdsDbInstance", - }; + const headers: __HeaderBag = sharedHeaders("RegisterRdsDbInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterRdsDbInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1019,10 +860,7 @@ export const serializeAws_json1_1RegisterVolumeCommand = async ( input: RegisterVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.RegisterVolume", - }; + const headers: __HeaderBag = sharedHeaders("RegisterVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterVolumeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1032,10 +870,7 @@ export const serializeAws_json1_1SetLoadBasedAutoScalingCommand = async ( input: SetLoadBasedAutoScalingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.SetLoadBasedAutoScaling", - }; + const headers: __HeaderBag = sharedHeaders("SetLoadBasedAutoScaling"); let body: any; body = JSON.stringify(serializeAws_json1_1SetLoadBasedAutoScalingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1045,10 +880,7 @@ export const serializeAws_json1_1SetPermissionCommand = async ( input: SetPermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.SetPermission", - }; + const headers: __HeaderBag = sharedHeaders("SetPermission"); let body: any; body = JSON.stringify(serializeAws_json1_1SetPermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1058,10 +890,7 @@ export const serializeAws_json1_1SetTimeBasedAutoScalingCommand = async ( input: SetTimeBasedAutoScalingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.SetTimeBasedAutoScaling", - }; + const headers: __HeaderBag = sharedHeaders("SetTimeBasedAutoScaling"); let body: any; body = JSON.stringify(serializeAws_json1_1SetTimeBasedAutoScalingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1071,10 +900,7 @@ export const serializeAws_json1_1StartInstanceCommand = async ( input: StartInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.StartInstance", - }; + const headers: __HeaderBag = sharedHeaders("StartInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1StartInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1084,10 +910,7 @@ export const serializeAws_json1_1StartStackCommand = async ( input: StartStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.StartStack", - }; + const headers: __HeaderBag = sharedHeaders("StartStack"); let body: any; body = JSON.stringify(serializeAws_json1_1StartStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1097,10 +920,7 @@ export const serializeAws_json1_1StopInstanceCommand = async ( input: StopInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.StopInstance", - }; + const headers: __HeaderBag = sharedHeaders("StopInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1StopInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1110,10 +930,7 @@ export const serializeAws_json1_1StopStackCommand = async ( input: StopStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.StopStack", - }; + const headers: __HeaderBag = sharedHeaders("StopStack"); let body: any; body = JSON.stringify(serializeAws_json1_1StopStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1123,10 +940,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1136,10 +950,7 @@ export const serializeAws_json1_1UnassignInstanceCommand = async ( input: UnassignInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UnassignInstance", - }; + const headers: __HeaderBag = sharedHeaders("UnassignInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1UnassignInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1149,10 +960,7 @@ export const serializeAws_json1_1UnassignVolumeCommand = async ( input: UnassignVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UnassignVolume", - }; + const headers: __HeaderBag = sharedHeaders("UnassignVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1UnassignVolumeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1162,10 +970,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1175,10 +980,7 @@ export const serializeAws_json1_1UpdateAppCommand = async ( input: UpdateAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UpdateApp", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApp"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1188,10 +990,7 @@ export const serializeAws_json1_1UpdateElasticIpCommand = async ( input: UpdateElasticIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UpdateElasticIp", - }; + const headers: __HeaderBag = sharedHeaders("UpdateElasticIp"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateElasticIpRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1201,10 +1000,7 @@ export const serializeAws_json1_1UpdateInstanceCommand = async ( input: UpdateInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UpdateInstance", - }; + const headers: __HeaderBag = sharedHeaders("UpdateInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1214,10 +1010,7 @@ export const serializeAws_json1_1UpdateLayerCommand = async ( input: UpdateLayerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UpdateLayer", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLayer"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLayerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1227,10 +1020,7 @@ export const serializeAws_json1_1UpdateMyUserProfileCommand = async ( input: UpdateMyUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UpdateMyUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMyUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMyUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1240,10 +1030,7 @@ export const serializeAws_json1_1UpdateRdsDbInstanceCommand = async ( input: UpdateRdsDbInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UpdateRdsDbInstance", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRdsDbInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRdsDbInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1253,10 +1040,7 @@ export const serializeAws_json1_1UpdateStackCommand = async ( input: UpdateStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UpdateStack", - }; + const headers: __HeaderBag = sharedHeaders("UpdateStack"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1266,10 +1050,7 @@ export const serializeAws_json1_1UpdateUserProfileCommand = async ( input: UpdateUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UpdateUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1279,10 +1060,7 @@ export const serializeAws_json1_1UpdateVolumeCommand = async ( input: UpdateVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorks_20130218.UpdateVolume", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateVolumeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6935,6 +6713,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `OpsWorks_20130218.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts index e9bb32e6c73db..f048ffa697270 100644 --- a/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts +++ b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts @@ -109,10 +109,7 @@ export const serializeAws_json1_1AssociateNodeCommand = async ( input: AssociateNodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.AssociateNode", - }; + const headers: __HeaderBag = sharedHeaders("AssociateNode"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateNodeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -122,10 +119,7 @@ export const serializeAws_json1_1CreateBackupCommand = async ( input: CreateBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.CreateBackup", - }; + const headers: __HeaderBag = sharedHeaders("CreateBackup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBackupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -135,10 +129,7 @@ export const serializeAws_json1_1CreateServerCommand = async ( input: CreateServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.CreateServer", - }; + const headers: __HeaderBag = sharedHeaders("CreateServer"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -148,10 +139,7 @@ export const serializeAws_json1_1DeleteBackupCommand = async ( input: DeleteBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.DeleteBackup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBackup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBackupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -161,10 +149,7 @@ export const serializeAws_json1_1DeleteServerCommand = async ( input: DeleteServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.DeleteServer", - }; + const headers: __HeaderBag = sharedHeaders("DeleteServer"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -174,10 +159,7 @@ export const serializeAws_json1_1DescribeAccountAttributesCommand = async ( input: DescribeAccountAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.DescribeAccountAttributes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccountAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAccountAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -187,10 +169,7 @@ export const serializeAws_json1_1DescribeBackupsCommand = async ( input: DescribeBackupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.DescribeBackups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBackups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBackupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -200,10 +179,7 @@ export const serializeAws_json1_1DescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.DescribeEvents", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -213,10 +189,7 @@ export const serializeAws_json1_1DescribeNodeAssociationStatusCommand = async ( input: DescribeNodeAssociationStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.DescribeNodeAssociationStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeNodeAssociationStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeNodeAssociationStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -226,10 +199,7 @@ export const serializeAws_json1_1DescribeServersCommand = async ( input: DescribeServersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.DescribeServers", - }; + const headers: __HeaderBag = sharedHeaders("DescribeServers"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeServersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -239,10 +209,7 @@ export const serializeAws_json1_1DisassociateNodeCommand = async ( input: DisassociateNodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.DisassociateNode", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateNode"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateNodeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -252,10 +219,7 @@ export const serializeAws_json1_1ExportServerEngineAttributeCommand = async ( input: ExportServerEngineAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.ExportServerEngineAttribute", - }; + const headers: __HeaderBag = sharedHeaders("ExportServerEngineAttribute"); let body: any; body = JSON.stringify(serializeAws_json1_1ExportServerEngineAttributeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -265,10 +229,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -278,10 +239,7 @@ export const serializeAws_json1_1RestoreServerCommand = async ( input: RestoreServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.RestoreServer", - }; + const headers: __HeaderBag = sharedHeaders("RestoreServer"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -291,10 +249,7 @@ export const serializeAws_json1_1StartMaintenanceCommand = async ( input: StartMaintenanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.StartMaintenance", - }; + const headers: __HeaderBag = sharedHeaders("StartMaintenance"); let body: any; body = JSON.stringify(serializeAws_json1_1StartMaintenanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -304,10 +259,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -317,10 +269,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -330,10 +279,7 @@ export const serializeAws_json1_1UpdateServerCommand = async ( input: UpdateServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.UpdateServer", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServer"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -343,10 +289,7 @@ export const serializeAws_json1_1UpdateServerEngineAttributesCommand = async ( input: UpdateServerEngineAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "OpsWorksCM_V2016_11_01.UpdateServerEngineAttributes", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServerEngineAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateServerEngineAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1963,6 +1906,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `OpsWorksCM_V2016_11_01.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-organizations/src/protocols/Aws_json1_1.ts b/clients/client-organizations/src/protocols/Aws_json1_1.ts index 4b05cfcaa412b..3c9e2aac37c4b 100644 --- a/clients/client-organizations/src/protocols/Aws_json1_1.ts +++ b/clients/client-organizations/src/protocols/Aws_json1_1.ts @@ -319,10 +319,7 @@ export const serializeAws_json1_1AcceptHandshakeCommand = async ( input: AcceptHandshakeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.AcceptHandshake", - }; + const headers: __HeaderBag = sharedHeaders("AcceptHandshake"); let body: any; body = JSON.stringify(serializeAws_json1_1AcceptHandshakeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -332,10 +329,7 @@ export const serializeAws_json1_1AttachPolicyCommand = async ( input: AttachPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.AttachPolicy", - }; + const headers: __HeaderBag = sharedHeaders("AttachPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1AttachPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -345,10 +339,7 @@ export const serializeAws_json1_1CancelHandshakeCommand = async ( input: CancelHandshakeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.CancelHandshake", - }; + const headers: __HeaderBag = sharedHeaders("CancelHandshake"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelHandshakeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -358,10 +349,7 @@ export const serializeAws_json1_1CloseAccountCommand = async ( input: CloseAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.CloseAccount", - }; + const headers: __HeaderBag = sharedHeaders("CloseAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1CloseAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -371,10 +359,7 @@ export const serializeAws_json1_1CreateAccountCommand = async ( input: CreateAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.CreateAccount", - }; + const headers: __HeaderBag = sharedHeaders("CreateAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -384,10 +369,7 @@ export const serializeAws_json1_1CreateGovCloudAccountCommand = async ( input: CreateGovCloudAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.CreateGovCloudAccount", - }; + const headers: __HeaderBag = sharedHeaders("CreateGovCloudAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGovCloudAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -397,10 +379,7 @@ export const serializeAws_json1_1CreateOrganizationCommand = async ( input: CreateOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.CreateOrganization", - }; + const headers: __HeaderBag = sharedHeaders("CreateOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -410,10 +389,7 @@ export const serializeAws_json1_1CreateOrganizationalUnitCommand = async ( input: CreateOrganizationalUnitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.CreateOrganizationalUnit", - }; + const headers: __HeaderBag = sharedHeaders("CreateOrganizationalUnit"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateOrganizationalUnitRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -423,10 +399,7 @@ export const serializeAws_json1_1CreatePolicyCommand = async ( input: CreatePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.CreatePolicy", - }; + const headers: __HeaderBag = sharedHeaders("CreatePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -436,10 +409,7 @@ export const serializeAws_json1_1DeclineHandshakeCommand = async ( input: DeclineHandshakeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DeclineHandshake", - }; + const headers: __HeaderBag = sharedHeaders("DeclineHandshake"); let body: any; body = JSON.stringify(serializeAws_json1_1DeclineHandshakeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -449,10 +419,7 @@ export const serializeAws_json1_1DeleteOrganizationCommand = async ( input: DeleteOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DeleteOrganization", - }; + const headers: __HeaderBag = sharedHeaders("DeleteOrganization"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -461,10 +428,7 @@ export const serializeAws_json1_1DeleteOrganizationalUnitCommand = async ( input: DeleteOrganizationalUnitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DeleteOrganizationalUnit", - }; + const headers: __HeaderBag = sharedHeaders("DeleteOrganizationalUnit"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteOrganizationalUnitRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -474,10 +438,7 @@ export const serializeAws_json1_1DeletePolicyCommand = async ( input: DeletePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DeletePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeletePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -487,10 +448,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DeleteResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcePolicy"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -499,10 +457,7 @@ export const serializeAws_json1_1DeregisterDelegatedAdministratorCommand = async input: DeregisterDelegatedAdministratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DeregisterDelegatedAdministrator", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterDelegatedAdministrator"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterDelegatedAdministratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -512,10 +467,7 @@ export const serializeAws_json1_1DescribeAccountCommand = async ( input: DescribeAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DescribeAccount", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -525,10 +477,7 @@ export const serializeAws_json1_1DescribeCreateAccountStatusCommand = async ( input: DescribeCreateAccountStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DescribeCreateAccountStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCreateAccountStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCreateAccountStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -538,10 +487,7 @@ export const serializeAws_json1_1DescribeEffectivePolicyCommand = async ( input: DescribeEffectivePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DescribeEffectivePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEffectivePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEffectivePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -551,10 +497,7 @@ export const serializeAws_json1_1DescribeHandshakeCommand = async ( input: DescribeHandshakeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DescribeHandshake", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHandshake"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeHandshakeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -564,10 +507,7 @@ export const serializeAws_json1_1DescribeOrganizationCommand = async ( input: DescribeOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DescribeOrganization", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOrganization"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -576,10 +516,7 @@ export const serializeAws_json1_1DescribeOrganizationalUnitCommand = async ( input: DescribeOrganizationalUnitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DescribeOrganizationalUnit", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOrganizationalUnit"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeOrganizationalUnitRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -589,10 +526,7 @@ export const serializeAws_json1_1DescribePolicyCommand = async ( input: DescribePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DescribePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DescribePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -602,10 +536,7 @@ export const serializeAws_json1_1DescribeResourcePolicyCommand = async ( input: DescribeResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DescribeResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DescribeResourcePolicy"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -614,10 +545,7 @@ export const serializeAws_json1_1DetachPolicyCommand = async ( input: DetachPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DetachPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DetachPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DetachPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -627,10 +555,7 @@ export const serializeAws_json1_1DisableAWSServiceAccessCommand = async ( input: DisableAWSServiceAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DisableAWSServiceAccess", - }; + const headers: __HeaderBag = sharedHeaders("DisableAWSServiceAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableAWSServiceAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -640,10 +565,7 @@ export const serializeAws_json1_1DisablePolicyTypeCommand = async ( input: DisablePolicyTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.DisablePolicyType", - }; + const headers: __HeaderBag = sharedHeaders("DisablePolicyType"); let body: any; body = JSON.stringify(serializeAws_json1_1DisablePolicyTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -653,10 +575,7 @@ export const serializeAws_json1_1EnableAllFeaturesCommand = async ( input: EnableAllFeaturesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.EnableAllFeatures", - }; + const headers: __HeaderBag = sharedHeaders("EnableAllFeatures"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableAllFeaturesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -666,10 +585,7 @@ export const serializeAws_json1_1EnableAWSServiceAccessCommand = async ( input: EnableAWSServiceAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.EnableAWSServiceAccess", - }; + const headers: __HeaderBag = sharedHeaders("EnableAWSServiceAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableAWSServiceAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -679,10 +595,7 @@ export const serializeAws_json1_1EnablePolicyTypeCommand = async ( input: EnablePolicyTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.EnablePolicyType", - }; + const headers: __HeaderBag = sharedHeaders("EnablePolicyType"); let body: any; body = JSON.stringify(serializeAws_json1_1EnablePolicyTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -692,10 +605,7 @@ export const serializeAws_json1_1InviteAccountToOrganizationCommand = async ( input: InviteAccountToOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.InviteAccountToOrganization", - }; + const headers: __HeaderBag = sharedHeaders("InviteAccountToOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1InviteAccountToOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -705,10 +615,7 @@ export const serializeAws_json1_1LeaveOrganizationCommand = async ( input: LeaveOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.LeaveOrganization", - }; + const headers: __HeaderBag = sharedHeaders("LeaveOrganization"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -717,10 +624,7 @@ export const serializeAws_json1_1ListAccountsCommand = async ( input: ListAccountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListAccounts", - }; + const headers: __HeaderBag = sharedHeaders("ListAccounts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAccountsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -730,10 +634,7 @@ export const serializeAws_json1_1ListAccountsForParentCommand = async ( input: ListAccountsForParentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListAccountsForParent", - }; + const headers: __HeaderBag = sharedHeaders("ListAccountsForParent"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAccountsForParentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -743,10 +644,7 @@ export const serializeAws_json1_1ListAWSServiceAccessForOrganizationCommand = as input: ListAWSServiceAccessForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListAWSServiceAccessForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("ListAWSServiceAccessForOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAWSServiceAccessForOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -756,10 +654,7 @@ export const serializeAws_json1_1ListChildrenCommand = async ( input: ListChildrenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListChildren", - }; + const headers: __HeaderBag = sharedHeaders("ListChildren"); let body: any; body = JSON.stringify(serializeAws_json1_1ListChildrenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -769,10 +664,7 @@ export const serializeAws_json1_1ListCreateAccountStatusCommand = async ( input: ListCreateAccountStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListCreateAccountStatus", - }; + const headers: __HeaderBag = sharedHeaders("ListCreateAccountStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCreateAccountStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -782,10 +674,7 @@ export const serializeAws_json1_1ListDelegatedAdministratorsCommand = async ( input: ListDelegatedAdministratorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListDelegatedAdministrators", - }; + const headers: __HeaderBag = sharedHeaders("ListDelegatedAdministrators"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDelegatedAdministratorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -795,10 +684,7 @@ export const serializeAws_json1_1ListDelegatedServicesForAccountCommand = async input: ListDelegatedServicesForAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListDelegatedServicesForAccount", - }; + const headers: __HeaderBag = sharedHeaders("ListDelegatedServicesForAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDelegatedServicesForAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -808,10 +694,7 @@ export const serializeAws_json1_1ListHandshakesForAccountCommand = async ( input: ListHandshakesForAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListHandshakesForAccount", - }; + const headers: __HeaderBag = sharedHeaders("ListHandshakesForAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHandshakesForAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -821,10 +704,7 @@ export const serializeAws_json1_1ListHandshakesForOrganizationCommand = async ( input: ListHandshakesForOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListHandshakesForOrganization", - }; + const headers: __HeaderBag = sharedHeaders("ListHandshakesForOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHandshakesForOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -834,10 +714,7 @@ export const serializeAws_json1_1ListOrganizationalUnitsForParentCommand = async input: ListOrganizationalUnitsForParentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListOrganizationalUnitsForParent", - }; + const headers: __HeaderBag = sharedHeaders("ListOrganizationalUnitsForParent"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOrganizationalUnitsForParentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -847,10 +724,7 @@ export const serializeAws_json1_1ListParentsCommand = async ( input: ListParentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListParents", - }; + const headers: __HeaderBag = sharedHeaders("ListParents"); let body: any; body = JSON.stringify(serializeAws_json1_1ListParentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -860,10 +734,7 @@ export const serializeAws_json1_1ListPoliciesCommand = async ( input: ListPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListPolicies", - }; + const headers: __HeaderBag = sharedHeaders("ListPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -873,10 +744,7 @@ export const serializeAws_json1_1ListPoliciesForTargetCommand = async ( input: ListPoliciesForTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListPoliciesForTarget", - }; + const headers: __HeaderBag = sharedHeaders("ListPoliciesForTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPoliciesForTargetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -886,10 +754,7 @@ export const serializeAws_json1_1ListRootsCommand = async ( input: ListRootsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListRoots", - }; + const headers: __HeaderBag = sharedHeaders("ListRoots"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRootsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -899,10 +764,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -912,10 +774,7 @@ export const serializeAws_json1_1ListTargetsForPolicyCommand = async ( input: ListTargetsForPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.ListTargetsForPolicy", - }; + const headers: __HeaderBag = sharedHeaders("ListTargetsForPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTargetsForPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -925,10 +784,7 @@ export const serializeAws_json1_1MoveAccountCommand = async ( input: MoveAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.MoveAccount", - }; + const headers: __HeaderBag = sharedHeaders("MoveAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1MoveAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -938,10 +794,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( input: PutResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.PutResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -951,10 +804,7 @@ export const serializeAws_json1_1RegisterDelegatedAdministratorCommand = async ( input: RegisterDelegatedAdministratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.RegisterDelegatedAdministrator", - }; + const headers: __HeaderBag = sharedHeaders("RegisterDelegatedAdministrator"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterDelegatedAdministratorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -964,10 +814,7 @@ export const serializeAws_json1_1RemoveAccountFromOrganizationCommand = async ( input: RemoveAccountFromOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.RemoveAccountFromOrganization", - }; + const headers: __HeaderBag = sharedHeaders("RemoveAccountFromOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveAccountFromOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -977,10 +824,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -990,10 +834,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1003,10 +844,7 @@ export const serializeAws_json1_1UpdateOrganizationalUnitCommand = async ( input: UpdateOrganizationalUnitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.UpdateOrganizationalUnit", - }; + const headers: __HeaderBag = sharedHeaders("UpdateOrganizationalUnit"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateOrganizationalUnitRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1016,10 +854,7 @@ export const serializeAws_json1_1UpdatePolicyCommand = async ( input: UpdatePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSOrganizationsV20161128.UpdatePolicy", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6761,6 +6596,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSOrganizationsV20161128.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-personalize/src/protocols/Aws_json1_1.ts b/clients/client-personalize/src/protocols/Aws_json1_1.ts index 9c5a603a4b559..fd966efb75367 100644 --- a/clients/client-personalize/src/protocols/Aws_json1_1.ts +++ b/clients/client-personalize/src/protocols/Aws_json1_1.ts @@ -368,10 +368,7 @@ export const serializeAws_json1_1CreateBatchInferenceJobCommand = async ( input: CreateBatchInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateBatchInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateBatchInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBatchInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -381,10 +378,7 @@ export const serializeAws_json1_1CreateBatchSegmentJobCommand = async ( input: CreateBatchSegmentJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateBatchSegmentJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateBatchSegmentJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateBatchSegmentJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -394,10 +388,7 @@ export const serializeAws_json1_1CreateCampaignCommand = async ( input: CreateCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateCampaign", - }; + const headers: __HeaderBag = sharedHeaders("CreateCampaign"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCampaignRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -407,10 +398,7 @@ export const serializeAws_json1_1CreateDatasetCommand = async ( input: CreateDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateDataset", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -420,10 +408,7 @@ export const serializeAws_json1_1CreateDatasetExportJobCommand = async ( input: CreateDatasetExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateDatasetExportJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateDatasetExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDatasetExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -433,10 +418,7 @@ export const serializeAws_json1_1CreateDatasetGroupCommand = async ( input: CreateDatasetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateDatasetGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateDatasetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDatasetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -446,10 +428,7 @@ export const serializeAws_json1_1CreateDatasetImportJobCommand = async ( input: CreateDatasetImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateDatasetImportJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateDatasetImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDatasetImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -459,10 +438,7 @@ export const serializeAws_json1_1CreateEventTrackerCommand = async ( input: CreateEventTrackerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateEventTracker", - }; + const headers: __HeaderBag = sharedHeaders("CreateEventTracker"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEventTrackerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -472,10 +448,7 @@ export const serializeAws_json1_1CreateFilterCommand = async ( input: CreateFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateFilter", - }; + const headers: __HeaderBag = sharedHeaders("CreateFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -485,10 +458,7 @@ export const serializeAws_json1_1CreateMetricAttributionCommand = async ( input: CreateMetricAttributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateMetricAttribution", - }; + const headers: __HeaderBag = sharedHeaders("CreateMetricAttribution"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMetricAttributionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -498,10 +468,7 @@ export const serializeAws_json1_1CreateRecommenderCommand = async ( input: CreateRecommenderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateRecommender", - }; + const headers: __HeaderBag = sharedHeaders("CreateRecommender"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRecommenderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -511,10 +478,7 @@ export const serializeAws_json1_1CreateSchemaCommand = async ( input: CreateSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateSchema", - }; + const headers: __HeaderBag = sharedHeaders("CreateSchema"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSchemaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -524,10 +488,7 @@ export const serializeAws_json1_1CreateSolutionCommand = async ( input: CreateSolutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateSolution", - }; + const headers: __HeaderBag = sharedHeaders("CreateSolution"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSolutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -537,10 +498,7 @@ export const serializeAws_json1_1CreateSolutionVersionCommand = async ( input: CreateSolutionVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.CreateSolutionVersion", - }; + const headers: __HeaderBag = sharedHeaders("CreateSolutionVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSolutionVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -550,10 +508,7 @@ export const serializeAws_json1_1DeleteCampaignCommand = async ( input: DeleteCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DeleteCampaign", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCampaign"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCampaignRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -563,10 +518,7 @@ export const serializeAws_json1_1DeleteDatasetCommand = async ( input: DeleteDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DeleteDataset", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -576,10 +528,7 @@ export const serializeAws_json1_1DeleteDatasetGroupCommand = async ( input: DeleteDatasetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DeleteDatasetGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDatasetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDatasetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -589,10 +538,7 @@ export const serializeAws_json1_1DeleteEventTrackerCommand = async ( input: DeleteEventTrackerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DeleteEventTracker", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEventTracker"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEventTrackerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -602,10 +548,7 @@ export const serializeAws_json1_1DeleteFilterCommand = async ( input: DeleteFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DeleteFilter", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -615,10 +558,7 @@ export const serializeAws_json1_1DeleteMetricAttributionCommand = async ( input: DeleteMetricAttributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DeleteMetricAttribution", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMetricAttribution"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMetricAttributionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -628,10 +568,7 @@ export const serializeAws_json1_1DeleteRecommenderCommand = async ( input: DeleteRecommenderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DeleteRecommender", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRecommender"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRecommenderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -641,10 +578,7 @@ export const serializeAws_json1_1DeleteSchemaCommand = async ( input: DeleteSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DeleteSchema", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSchema"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSchemaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -654,10 +588,7 @@ export const serializeAws_json1_1DeleteSolutionCommand = async ( input: DeleteSolutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DeleteSolution", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSolution"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSolutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -667,10 +598,7 @@ export const serializeAws_json1_1DescribeAlgorithmCommand = async ( input: DescribeAlgorithmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeAlgorithm", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAlgorithm"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAlgorithmRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -680,10 +608,7 @@ export const serializeAws_json1_1DescribeBatchInferenceJobCommand = async ( input: DescribeBatchInferenceJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeBatchInferenceJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBatchInferenceJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBatchInferenceJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -693,10 +618,7 @@ export const serializeAws_json1_1DescribeBatchSegmentJobCommand = async ( input: DescribeBatchSegmentJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeBatchSegmentJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBatchSegmentJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBatchSegmentJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -706,10 +628,7 @@ export const serializeAws_json1_1DescribeCampaignCommand = async ( input: DescribeCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeCampaign", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCampaign"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCampaignRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -719,10 +638,7 @@ export const serializeAws_json1_1DescribeDatasetCommand = async ( input: DescribeDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeDataset", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -732,10 +648,7 @@ export const serializeAws_json1_1DescribeDatasetExportJobCommand = async ( input: DescribeDatasetExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeDatasetExportJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDatasetExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDatasetExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -745,10 +658,7 @@ export const serializeAws_json1_1DescribeDatasetGroupCommand = async ( input: DescribeDatasetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeDatasetGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDatasetGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDatasetGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -758,10 +668,7 @@ export const serializeAws_json1_1DescribeDatasetImportJobCommand = async ( input: DescribeDatasetImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeDatasetImportJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDatasetImportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDatasetImportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -771,10 +678,7 @@ export const serializeAws_json1_1DescribeEventTrackerCommand = async ( input: DescribeEventTrackerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeEventTracker", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEventTracker"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEventTrackerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -784,10 +688,7 @@ export const serializeAws_json1_1DescribeFeatureTransformationCommand = async ( input: DescribeFeatureTransformationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeFeatureTransformation", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFeatureTransformation"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFeatureTransformationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -797,10 +698,7 @@ export const serializeAws_json1_1DescribeFilterCommand = async ( input: DescribeFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeFilter", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -810,10 +708,7 @@ export const serializeAws_json1_1DescribeMetricAttributionCommand = async ( input: DescribeMetricAttributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeMetricAttribution", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMetricAttribution"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMetricAttributionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -823,10 +718,7 @@ export const serializeAws_json1_1DescribeRecipeCommand = async ( input: DescribeRecipeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeRecipe", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRecipe"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRecipeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -836,10 +728,7 @@ export const serializeAws_json1_1DescribeRecommenderCommand = async ( input: DescribeRecommenderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeRecommender", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRecommender"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRecommenderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -849,10 +738,7 @@ export const serializeAws_json1_1DescribeSchemaCommand = async ( input: DescribeSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeSchema", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSchema"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSchemaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -862,10 +748,7 @@ export const serializeAws_json1_1DescribeSolutionCommand = async ( input: DescribeSolutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeSolution", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSolution"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSolutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -875,10 +758,7 @@ export const serializeAws_json1_1DescribeSolutionVersionCommand = async ( input: DescribeSolutionVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.DescribeSolutionVersion", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSolutionVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSolutionVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -888,10 +768,7 @@ export const serializeAws_json1_1GetSolutionMetricsCommand = async ( input: GetSolutionMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.GetSolutionMetrics", - }; + const headers: __HeaderBag = sharedHeaders("GetSolutionMetrics"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSolutionMetricsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -901,10 +778,7 @@ export const serializeAws_json1_1ListBatchInferenceJobsCommand = async ( input: ListBatchInferenceJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListBatchInferenceJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListBatchInferenceJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBatchInferenceJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -914,10 +788,7 @@ export const serializeAws_json1_1ListBatchSegmentJobsCommand = async ( input: ListBatchSegmentJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListBatchSegmentJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListBatchSegmentJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBatchSegmentJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -927,10 +798,7 @@ export const serializeAws_json1_1ListCampaignsCommand = async ( input: ListCampaignsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListCampaigns", - }; + const headers: __HeaderBag = sharedHeaders("ListCampaigns"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCampaignsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -940,10 +808,7 @@ export const serializeAws_json1_1ListDatasetExportJobsCommand = async ( input: ListDatasetExportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListDatasetExportJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasetExportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatasetExportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -953,10 +818,7 @@ export const serializeAws_json1_1ListDatasetGroupsCommand = async ( input: ListDatasetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListDatasetGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasetGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatasetGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -966,10 +828,7 @@ export const serializeAws_json1_1ListDatasetImportJobsCommand = async ( input: ListDatasetImportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListDatasetImportJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasetImportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatasetImportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -979,10 +838,7 @@ export const serializeAws_json1_1ListDatasetsCommand = async ( input: ListDatasetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListDatasets", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatasetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -992,10 +848,7 @@ export const serializeAws_json1_1ListEventTrackersCommand = async ( input: ListEventTrackersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListEventTrackers", - }; + const headers: __HeaderBag = sharedHeaders("ListEventTrackers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEventTrackersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1005,10 +858,7 @@ export const serializeAws_json1_1ListFiltersCommand = async ( input: ListFiltersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListFilters", - }; + const headers: __HeaderBag = sharedHeaders("ListFilters"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFiltersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1018,10 +868,7 @@ export const serializeAws_json1_1ListMetricAttributionMetricsCommand = async ( input: ListMetricAttributionMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListMetricAttributionMetrics", - }; + const headers: __HeaderBag = sharedHeaders("ListMetricAttributionMetrics"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMetricAttributionMetricsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1031,10 +878,7 @@ export const serializeAws_json1_1ListMetricAttributionsCommand = async ( input: ListMetricAttributionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListMetricAttributions", - }; + const headers: __HeaderBag = sharedHeaders("ListMetricAttributions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMetricAttributionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1044,10 +888,7 @@ export const serializeAws_json1_1ListRecipesCommand = async ( input: ListRecipesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListRecipes", - }; + const headers: __HeaderBag = sharedHeaders("ListRecipes"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRecipesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1057,10 +898,7 @@ export const serializeAws_json1_1ListRecommendersCommand = async ( input: ListRecommendersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListRecommenders", - }; + const headers: __HeaderBag = sharedHeaders("ListRecommenders"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRecommendersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1070,10 +908,7 @@ export const serializeAws_json1_1ListSchemasCommand = async ( input: ListSchemasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListSchemas", - }; + const headers: __HeaderBag = sharedHeaders("ListSchemas"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSchemasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1083,10 +918,7 @@ export const serializeAws_json1_1ListSolutionsCommand = async ( input: ListSolutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListSolutions", - }; + const headers: __HeaderBag = sharedHeaders("ListSolutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSolutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1096,10 +928,7 @@ export const serializeAws_json1_1ListSolutionVersionsCommand = async ( input: ListSolutionVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListSolutionVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListSolutionVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSolutionVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1109,10 +938,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1122,10 +948,7 @@ export const serializeAws_json1_1StartRecommenderCommand = async ( input: StartRecommenderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.StartRecommender", - }; + const headers: __HeaderBag = sharedHeaders("StartRecommender"); let body: any; body = JSON.stringify(serializeAws_json1_1StartRecommenderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1135,10 +958,7 @@ export const serializeAws_json1_1StopRecommenderCommand = async ( input: StopRecommenderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.StopRecommender", - }; + const headers: __HeaderBag = sharedHeaders("StopRecommender"); let body: any; body = JSON.stringify(serializeAws_json1_1StopRecommenderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1148,10 +968,7 @@ export const serializeAws_json1_1StopSolutionVersionCreationCommand = async ( input: StopSolutionVersionCreationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.StopSolutionVersionCreation", - }; + const headers: __HeaderBag = sharedHeaders("StopSolutionVersionCreation"); let body: any; body = JSON.stringify(serializeAws_json1_1StopSolutionVersionCreationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1161,10 +978,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1174,10 +988,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1187,10 +998,7 @@ export const serializeAws_json1_1UpdateCampaignCommand = async ( input: UpdateCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.UpdateCampaign", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCampaign"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCampaignRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1200,10 +1008,7 @@ export const serializeAws_json1_1UpdateMetricAttributionCommand = async ( input: UpdateMetricAttributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.UpdateMetricAttribution", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMetricAttribution"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMetricAttributionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1213,10 +1018,7 @@ export const serializeAws_json1_1UpdateRecommenderCommand = async ( input: UpdateRecommenderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonPersonalize.UpdateRecommender", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRecommender"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRecommenderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -7379,6 +7181,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonPersonalize.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-pi/src/protocols/Aws_json1_1.ts b/clients/client-pi/src/protocols/Aws_json1_1.ts index 8a2c88102919c..02257496ed5f6 100644 --- a/clients/client-pi/src/protocols/Aws_json1_1.ts +++ b/clients/client-pi/src/protocols/Aws_json1_1.ts @@ -73,10 +73,7 @@ export const serializeAws_json1_1DescribeDimensionKeysCommand = async ( input: DescribeDimensionKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PerformanceInsightsv20180227.DescribeDimensionKeys", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDimensionKeys"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDimensionKeysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -86,10 +83,7 @@ export const serializeAws_json1_1GetDimensionKeyDetailsCommand = async ( input: GetDimensionKeyDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PerformanceInsightsv20180227.GetDimensionKeyDetails", - }; + const headers: __HeaderBag = sharedHeaders("GetDimensionKeyDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDimensionKeyDetailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -99,10 +93,7 @@ export const serializeAws_json1_1GetResourceMetadataCommand = async ( input: GetResourceMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PerformanceInsightsv20180227.GetResourceMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetResourceMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourceMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -112,10 +103,7 @@ export const serializeAws_json1_1GetResourceMetricsCommand = async ( input: GetResourceMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PerformanceInsightsv20180227.GetResourceMetrics", - }; + const headers: __HeaderBag = sharedHeaders("GetResourceMetrics"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourceMetricsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -125,10 +113,7 @@ export const serializeAws_json1_1ListAvailableResourceDimensionsCommand = async input: ListAvailableResourceDimensionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PerformanceInsightsv20180227.ListAvailableResourceDimensions", - }; + const headers: __HeaderBag = sharedHeaders("ListAvailableResourceDimensions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAvailableResourceDimensionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -138,10 +123,7 @@ export const serializeAws_json1_1ListAvailableResourceMetricsCommand = async ( input: ListAvailableResourceMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "PerformanceInsightsv20180227.ListAvailableResourceMetrics", - }; + const headers: __HeaderBag = sharedHeaders("ListAvailableResourceMetrics"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAvailableResourceMetricsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1041,6 +1023,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `PerformanceInsightsv20180227.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts b/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts index 6b2bbd57eec98..a834970d47b81 100644 --- a/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts +++ b/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts @@ -263,10 +263,7 @@ export const serializeAws_json1_0AssociateOriginationIdentityCommand = async ( input: AssociateOriginationIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.AssociateOriginationIdentity", - }; + const headers: __HeaderBag = sharedHeaders("AssociateOriginationIdentity"); let body: any; body = JSON.stringify(serializeAws_json1_0AssociateOriginationIdentityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -276,10 +273,7 @@ export const serializeAws_json1_0CreateConfigurationSetCommand = async ( input: CreateConfigurationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.CreateConfigurationSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateConfigurationSet"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateConfigurationSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -289,10 +283,7 @@ export const serializeAws_json1_0CreateEventDestinationCommand = async ( input: CreateEventDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.CreateEventDestination", - }; + const headers: __HeaderBag = sharedHeaders("CreateEventDestination"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateEventDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -302,10 +293,7 @@ export const serializeAws_json1_0CreateOptOutListCommand = async ( input: CreateOptOutListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.CreateOptOutList", - }; + const headers: __HeaderBag = sharedHeaders("CreateOptOutList"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateOptOutListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -315,10 +303,7 @@ export const serializeAws_json1_0CreatePoolCommand = async ( input: CreatePoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.CreatePool", - }; + const headers: __HeaderBag = sharedHeaders("CreatePool"); let body: any; body = JSON.stringify(serializeAws_json1_0CreatePoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -328,10 +313,7 @@ export const serializeAws_json1_0DeleteConfigurationSetCommand = async ( input: DeleteConfigurationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DeleteConfigurationSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConfigurationSet"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteConfigurationSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -341,10 +323,7 @@ export const serializeAws_json1_0DeleteDefaultMessageTypeCommand = async ( input: DeleteDefaultMessageTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DeleteDefaultMessageType", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDefaultMessageType"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteDefaultMessageTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -354,10 +333,7 @@ export const serializeAws_json1_0DeleteDefaultSenderIdCommand = async ( input: DeleteDefaultSenderIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DeleteDefaultSenderId", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDefaultSenderId"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteDefaultSenderIdRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -367,10 +343,7 @@ export const serializeAws_json1_0DeleteEventDestinationCommand = async ( input: DeleteEventDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DeleteEventDestination", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEventDestination"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteEventDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -380,10 +353,7 @@ export const serializeAws_json1_0DeleteKeywordCommand = async ( input: DeleteKeywordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DeleteKeyword", - }; + const headers: __HeaderBag = sharedHeaders("DeleteKeyword"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteKeywordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -393,10 +363,7 @@ export const serializeAws_json1_0DeleteOptedOutNumberCommand = async ( input: DeleteOptedOutNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DeleteOptedOutNumber", - }; + const headers: __HeaderBag = sharedHeaders("DeleteOptedOutNumber"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteOptedOutNumberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -406,10 +373,7 @@ export const serializeAws_json1_0DeleteOptOutListCommand = async ( input: DeleteOptOutListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DeleteOptOutList", - }; + const headers: __HeaderBag = sharedHeaders("DeleteOptOutList"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteOptOutListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -419,10 +383,7 @@ export const serializeAws_json1_0DeletePoolCommand = async ( input: DeletePoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DeletePool", - }; + const headers: __HeaderBag = sharedHeaders("DeletePool"); let body: any; body = JSON.stringify(serializeAws_json1_0DeletePoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -432,10 +393,7 @@ export const serializeAws_json1_0DeleteTextMessageSpendLimitOverrideCommand = as input: DeleteTextMessageSpendLimitOverrideCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DeleteTextMessageSpendLimitOverride", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTextMessageSpendLimitOverride"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteTextMessageSpendLimitOverrideRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -445,10 +403,7 @@ export const serializeAws_json1_0DeleteVoiceMessageSpendLimitOverrideCommand = a input: DeleteVoiceMessageSpendLimitOverrideCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DeleteVoiceMessageSpendLimitOverride", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVoiceMessageSpendLimitOverride"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteVoiceMessageSpendLimitOverrideRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -458,10 +413,7 @@ export const serializeAws_json1_0DescribeAccountAttributesCommand = async ( input: DescribeAccountAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DescribeAccountAttributes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccountAttributes"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeAccountAttributesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -471,10 +423,7 @@ export const serializeAws_json1_0DescribeAccountLimitsCommand = async ( input: DescribeAccountLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DescribeAccountLimits", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccountLimits"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeAccountLimitsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -484,10 +433,7 @@ export const serializeAws_json1_0DescribeConfigurationSetsCommand = async ( input: DescribeConfigurationSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DescribeConfigurationSets", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConfigurationSets"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeConfigurationSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -497,10 +443,7 @@ export const serializeAws_json1_0DescribeKeywordsCommand = async ( input: DescribeKeywordsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DescribeKeywords", - }; + const headers: __HeaderBag = sharedHeaders("DescribeKeywords"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeKeywordsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -510,10 +453,7 @@ export const serializeAws_json1_0DescribeOptedOutNumbersCommand = async ( input: DescribeOptedOutNumbersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DescribeOptedOutNumbers", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOptedOutNumbers"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeOptedOutNumbersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -523,10 +463,7 @@ export const serializeAws_json1_0DescribeOptOutListsCommand = async ( input: DescribeOptOutListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DescribeOptOutLists", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOptOutLists"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeOptOutListsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -536,10 +473,7 @@ export const serializeAws_json1_0DescribePhoneNumbersCommand = async ( input: DescribePhoneNumbersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DescribePhoneNumbers", - }; + const headers: __HeaderBag = sharedHeaders("DescribePhoneNumbers"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribePhoneNumbersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -549,10 +483,7 @@ export const serializeAws_json1_0DescribePoolsCommand = async ( input: DescribePoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DescribePools", - }; + const headers: __HeaderBag = sharedHeaders("DescribePools"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribePoolsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -562,10 +493,7 @@ export const serializeAws_json1_0DescribeSenderIdsCommand = async ( input: DescribeSenderIdsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DescribeSenderIds", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSenderIds"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeSenderIdsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -575,10 +503,7 @@ export const serializeAws_json1_0DescribeSpendLimitsCommand = async ( input: DescribeSpendLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DescribeSpendLimits", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSpendLimits"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeSpendLimitsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -588,10 +513,7 @@ export const serializeAws_json1_0DisassociateOriginationIdentityCommand = async input: DisassociateOriginationIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.DisassociateOriginationIdentity", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateOriginationIdentity"); let body: any; body = JSON.stringify(serializeAws_json1_0DisassociateOriginationIdentityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -601,10 +523,7 @@ export const serializeAws_json1_0ListPoolOriginationIdentitiesCommand = async ( input: ListPoolOriginationIdentitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.ListPoolOriginationIdentities", - }; + const headers: __HeaderBag = sharedHeaders("ListPoolOriginationIdentities"); let body: any; body = JSON.stringify(serializeAws_json1_0ListPoolOriginationIdentitiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -614,10 +533,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -627,10 +543,7 @@ export const serializeAws_json1_0PutKeywordCommand = async ( input: PutKeywordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.PutKeyword", - }; + const headers: __HeaderBag = sharedHeaders("PutKeyword"); let body: any; body = JSON.stringify(serializeAws_json1_0PutKeywordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -640,10 +553,7 @@ export const serializeAws_json1_0PutOptedOutNumberCommand = async ( input: PutOptedOutNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.PutOptedOutNumber", - }; + const headers: __HeaderBag = sharedHeaders("PutOptedOutNumber"); let body: any; body = JSON.stringify(serializeAws_json1_0PutOptedOutNumberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -653,10 +563,7 @@ export const serializeAws_json1_0ReleasePhoneNumberCommand = async ( input: ReleasePhoneNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.ReleasePhoneNumber", - }; + const headers: __HeaderBag = sharedHeaders("ReleasePhoneNumber"); let body: any; body = JSON.stringify(serializeAws_json1_0ReleasePhoneNumberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -666,10 +573,7 @@ export const serializeAws_json1_0RequestPhoneNumberCommand = async ( input: RequestPhoneNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.RequestPhoneNumber", - }; + const headers: __HeaderBag = sharedHeaders("RequestPhoneNumber"); let body: any; body = JSON.stringify(serializeAws_json1_0RequestPhoneNumberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -679,10 +583,7 @@ export const serializeAws_json1_0SendTextMessageCommand = async ( input: SendTextMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.SendTextMessage", - }; + const headers: __HeaderBag = sharedHeaders("SendTextMessage"); let body: any; body = JSON.stringify(serializeAws_json1_0SendTextMessageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -692,10 +593,7 @@ export const serializeAws_json1_0SendVoiceMessageCommand = async ( input: SendVoiceMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.SendVoiceMessage", - }; + const headers: __HeaderBag = sharedHeaders("SendVoiceMessage"); let body: any; body = JSON.stringify(serializeAws_json1_0SendVoiceMessageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -705,10 +603,7 @@ export const serializeAws_json1_0SetDefaultMessageTypeCommand = async ( input: SetDefaultMessageTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.SetDefaultMessageType", - }; + const headers: __HeaderBag = sharedHeaders("SetDefaultMessageType"); let body: any; body = JSON.stringify(serializeAws_json1_0SetDefaultMessageTypeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -718,10 +613,7 @@ export const serializeAws_json1_0SetDefaultSenderIdCommand = async ( input: SetDefaultSenderIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.SetDefaultSenderId", - }; + const headers: __HeaderBag = sharedHeaders("SetDefaultSenderId"); let body: any; body = JSON.stringify(serializeAws_json1_0SetDefaultSenderIdRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -731,10 +623,7 @@ export const serializeAws_json1_0SetTextMessageSpendLimitOverrideCommand = async input: SetTextMessageSpendLimitOverrideCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.SetTextMessageSpendLimitOverride", - }; + const headers: __HeaderBag = sharedHeaders("SetTextMessageSpendLimitOverride"); let body: any; body = JSON.stringify(serializeAws_json1_0SetTextMessageSpendLimitOverrideRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -744,10 +633,7 @@ export const serializeAws_json1_0SetVoiceMessageSpendLimitOverrideCommand = asyn input: SetVoiceMessageSpendLimitOverrideCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.SetVoiceMessageSpendLimitOverride", - }; + const headers: __HeaderBag = sharedHeaders("SetVoiceMessageSpendLimitOverride"); let body: any; body = JSON.stringify(serializeAws_json1_0SetVoiceMessageSpendLimitOverrideRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -757,10 +643,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -770,10 +653,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -783,10 +663,7 @@ export const serializeAws_json1_0UpdateEventDestinationCommand = async ( input: UpdateEventDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.UpdateEventDestination", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEventDestination"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateEventDestinationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -796,10 +673,7 @@ export const serializeAws_json1_0UpdatePhoneNumberCommand = async ( input: UpdatePhoneNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.UpdatePhoneNumber", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePhoneNumber"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdatePhoneNumberRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -809,10 +683,7 @@ export const serializeAws_json1_0UpdatePoolCommand = async ( input: UpdatePoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "PinpointSMSVoiceV2.UpdatePool", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePool"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdatePoolRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5135,6 +5006,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `PinpointSMSVoiceV2.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-pricing/src/protocols/Aws_json1_1.ts b/clients/client-pricing/src/protocols/Aws_json1_1.ts index 1cb19725fe793..5c0224f98ea3e 100644 --- a/clients/client-pricing/src/protocols/Aws_json1_1.ts +++ b/clients/client-pricing/src/protocols/Aws_json1_1.ts @@ -49,10 +49,7 @@ export const serializeAws_json1_1DescribeServicesCommand = async ( input: DescribeServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPriceListService.DescribeServices", - }; + const headers: __HeaderBag = sharedHeaders("DescribeServices"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeServicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -62,10 +59,7 @@ export const serializeAws_json1_1GetAttributeValuesCommand = async ( input: GetAttributeValuesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPriceListService.GetAttributeValues", - }; + const headers: __HeaderBag = sharedHeaders("GetAttributeValues"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAttributeValuesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -75,10 +69,7 @@ export const serializeAws_json1_1GetPriceListFileUrlCommand = async ( input: GetPriceListFileUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPriceListService.GetPriceListFileUrl", - }; + const headers: __HeaderBag = sharedHeaders("GetPriceListFileUrl"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPriceListFileUrlRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -88,10 +79,7 @@ export const serializeAws_json1_1GetProductsCommand = async ( input: GetProductsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPriceListService.GetProducts", - }; + const headers: __HeaderBag = sharedHeaders("GetProducts"); let body: any; body = JSON.stringify(serializeAws_json1_1GetProductsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -101,10 +89,7 @@ export const serializeAws_json1_1ListPriceListsCommand = async ( input: ListPriceListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSPriceListService.ListPriceLists", - }; + const headers: __HeaderBag = sharedHeaders("ListPriceLists"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPriceListsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -760,6 +745,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSPriceListService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-proton/src/protocols/Aws_json1_0.ts b/clients/client-proton/src/protocols/Aws_json1_0.ts index 8d00e1976f86d..ce35e6e3e8ef4 100644 --- a/clients/client-proton/src/protocols/Aws_json1_0.ts +++ b/clients/client-proton/src/protocols/Aws_json1_0.ts @@ -460,10 +460,7 @@ export const serializeAws_json1_0AcceptEnvironmentAccountConnectionCommand = asy input: AcceptEnvironmentAccountConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.AcceptEnvironmentAccountConnection", - }; + const headers: __HeaderBag = sharedHeaders("AcceptEnvironmentAccountConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0AcceptEnvironmentAccountConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -473,10 +470,7 @@ export const serializeAws_json1_0CancelComponentDeploymentCommand = async ( input: CancelComponentDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CancelComponentDeployment", - }; + const headers: __HeaderBag = sharedHeaders("CancelComponentDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_0CancelComponentDeploymentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -486,10 +480,7 @@ export const serializeAws_json1_0CancelEnvironmentDeploymentCommand = async ( input: CancelEnvironmentDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CancelEnvironmentDeployment", - }; + const headers: __HeaderBag = sharedHeaders("CancelEnvironmentDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_0CancelEnvironmentDeploymentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -499,10 +490,7 @@ export const serializeAws_json1_0CancelServiceInstanceDeploymentCommand = async input: CancelServiceInstanceDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CancelServiceInstanceDeployment", - }; + const headers: __HeaderBag = sharedHeaders("CancelServiceInstanceDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_0CancelServiceInstanceDeploymentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -512,10 +500,7 @@ export const serializeAws_json1_0CancelServicePipelineDeploymentCommand = async input: CancelServicePipelineDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CancelServicePipelineDeployment", - }; + const headers: __HeaderBag = sharedHeaders("CancelServicePipelineDeployment"); let body: any; body = JSON.stringify(serializeAws_json1_0CancelServicePipelineDeploymentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -525,10 +510,7 @@ export const serializeAws_json1_0CreateComponentCommand = async ( input: CreateComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CreateComponent", - }; + const headers: __HeaderBag = sharedHeaders("CreateComponent"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateComponentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -538,10 +520,7 @@ export const serializeAws_json1_0CreateEnvironmentCommand = async ( input: CreateEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CreateEnvironment", - }; + const headers: __HeaderBag = sharedHeaders("CreateEnvironment"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateEnvironmentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -551,10 +530,7 @@ export const serializeAws_json1_0CreateEnvironmentAccountConnectionCommand = asy input: CreateEnvironmentAccountConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CreateEnvironmentAccountConnection", - }; + const headers: __HeaderBag = sharedHeaders("CreateEnvironmentAccountConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateEnvironmentAccountConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -564,10 +540,7 @@ export const serializeAws_json1_0CreateEnvironmentTemplateCommand = async ( input: CreateEnvironmentTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CreateEnvironmentTemplate", - }; + const headers: __HeaderBag = sharedHeaders("CreateEnvironmentTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateEnvironmentTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -577,10 +550,7 @@ export const serializeAws_json1_0CreateEnvironmentTemplateVersionCommand = async input: CreateEnvironmentTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CreateEnvironmentTemplateVersion", - }; + const headers: __HeaderBag = sharedHeaders("CreateEnvironmentTemplateVersion"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateEnvironmentTemplateVersionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -590,10 +560,7 @@ export const serializeAws_json1_0CreateRepositoryCommand = async ( input: CreateRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CreateRepository", - }; + const headers: __HeaderBag = sharedHeaders("CreateRepository"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -603,10 +570,7 @@ export const serializeAws_json1_0CreateServiceCommand = async ( input: CreateServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CreateService", - }; + const headers: __HeaderBag = sharedHeaders("CreateService"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateServiceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -616,10 +580,7 @@ export const serializeAws_json1_0CreateServiceTemplateCommand = async ( input: CreateServiceTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CreateServiceTemplate", - }; + const headers: __HeaderBag = sharedHeaders("CreateServiceTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateServiceTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -629,10 +590,7 @@ export const serializeAws_json1_0CreateServiceTemplateVersionCommand = async ( input: CreateServiceTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CreateServiceTemplateVersion", - }; + const headers: __HeaderBag = sharedHeaders("CreateServiceTemplateVersion"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateServiceTemplateVersionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -642,10 +600,7 @@ export const serializeAws_json1_0CreateTemplateSyncConfigCommand = async ( input: CreateTemplateSyncConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.CreateTemplateSyncConfig", - }; + const headers: __HeaderBag = sharedHeaders("CreateTemplateSyncConfig"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateTemplateSyncConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -655,10 +610,7 @@ export const serializeAws_json1_0DeleteComponentCommand = async ( input: DeleteComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.DeleteComponent", - }; + const headers: __HeaderBag = sharedHeaders("DeleteComponent"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteComponentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -668,10 +620,7 @@ export const serializeAws_json1_0DeleteEnvironmentCommand = async ( input: DeleteEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.DeleteEnvironment", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEnvironment"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteEnvironmentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -681,10 +630,7 @@ export const serializeAws_json1_0DeleteEnvironmentAccountConnectionCommand = asy input: DeleteEnvironmentAccountConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.DeleteEnvironmentAccountConnection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEnvironmentAccountConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteEnvironmentAccountConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -694,10 +640,7 @@ export const serializeAws_json1_0DeleteEnvironmentTemplateCommand = async ( input: DeleteEnvironmentTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.DeleteEnvironmentTemplate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEnvironmentTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteEnvironmentTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -707,10 +650,7 @@ export const serializeAws_json1_0DeleteEnvironmentTemplateVersionCommand = async input: DeleteEnvironmentTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.DeleteEnvironmentTemplateVersion", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEnvironmentTemplateVersion"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteEnvironmentTemplateVersionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -720,10 +660,7 @@ export const serializeAws_json1_0DeleteRepositoryCommand = async ( input: DeleteRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.DeleteRepository", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRepository"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -733,10 +670,7 @@ export const serializeAws_json1_0DeleteServiceCommand = async ( input: DeleteServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.DeleteService", - }; + const headers: __HeaderBag = sharedHeaders("DeleteService"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteServiceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -746,10 +680,7 @@ export const serializeAws_json1_0DeleteServiceTemplateCommand = async ( input: DeleteServiceTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.DeleteServiceTemplate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteServiceTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteServiceTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -759,10 +690,7 @@ export const serializeAws_json1_0DeleteServiceTemplateVersionCommand = async ( input: DeleteServiceTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.DeleteServiceTemplateVersion", - }; + const headers: __HeaderBag = sharedHeaders("DeleteServiceTemplateVersion"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteServiceTemplateVersionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -772,10 +700,7 @@ export const serializeAws_json1_0DeleteTemplateSyncConfigCommand = async ( input: DeleteTemplateSyncConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.DeleteTemplateSyncConfig", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTemplateSyncConfig"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteTemplateSyncConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -785,10 +710,7 @@ export const serializeAws_json1_0GetAccountSettingsCommand = async ( input: GetAccountSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetAccountSettings", - }; + const headers: __HeaderBag = sharedHeaders("GetAccountSettings"); let body: any; body = JSON.stringify(serializeAws_json1_0GetAccountSettingsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -798,10 +720,7 @@ export const serializeAws_json1_0GetComponentCommand = async ( input: GetComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetComponent", - }; + const headers: __HeaderBag = sharedHeaders("GetComponent"); let body: any; body = JSON.stringify(serializeAws_json1_0GetComponentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -811,10 +730,7 @@ export const serializeAws_json1_0GetEnvironmentCommand = async ( input: GetEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetEnvironment", - }; + const headers: __HeaderBag = sharedHeaders("GetEnvironment"); let body: any; body = JSON.stringify(serializeAws_json1_0GetEnvironmentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -824,10 +740,7 @@ export const serializeAws_json1_0GetEnvironmentAccountConnectionCommand = async input: GetEnvironmentAccountConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetEnvironmentAccountConnection", - }; + const headers: __HeaderBag = sharedHeaders("GetEnvironmentAccountConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0GetEnvironmentAccountConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -837,10 +750,7 @@ export const serializeAws_json1_0GetEnvironmentTemplateCommand = async ( input: GetEnvironmentTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetEnvironmentTemplate", - }; + const headers: __HeaderBag = sharedHeaders("GetEnvironmentTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_0GetEnvironmentTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -850,10 +760,7 @@ export const serializeAws_json1_0GetEnvironmentTemplateVersionCommand = async ( input: GetEnvironmentTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetEnvironmentTemplateVersion", - }; + const headers: __HeaderBag = sharedHeaders("GetEnvironmentTemplateVersion"); let body: any; body = JSON.stringify(serializeAws_json1_0GetEnvironmentTemplateVersionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -863,10 +770,7 @@ export const serializeAws_json1_0GetRepositoryCommand = async ( input: GetRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetRepository", - }; + const headers: __HeaderBag = sharedHeaders("GetRepository"); let body: any; body = JSON.stringify(serializeAws_json1_0GetRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -876,10 +780,7 @@ export const serializeAws_json1_0GetRepositorySyncStatusCommand = async ( input: GetRepositorySyncStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetRepositorySyncStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetRepositorySyncStatus"); let body: any; body = JSON.stringify(serializeAws_json1_0GetRepositorySyncStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -889,10 +790,7 @@ export const serializeAws_json1_0GetResourcesSummaryCommand = async ( input: GetResourcesSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetResourcesSummary", - }; + const headers: __HeaderBag = sharedHeaders("GetResourcesSummary"); let body: any; body = JSON.stringify(serializeAws_json1_0GetResourcesSummaryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -902,10 +800,7 @@ export const serializeAws_json1_0GetServiceCommand = async ( input: GetServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetService", - }; + const headers: __HeaderBag = sharedHeaders("GetService"); let body: any; body = JSON.stringify(serializeAws_json1_0GetServiceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -915,10 +810,7 @@ export const serializeAws_json1_0GetServiceInstanceCommand = async ( input: GetServiceInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetServiceInstance", - }; + const headers: __HeaderBag = sharedHeaders("GetServiceInstance"); let body: any; body = JSON.stringify(serializeAws_json1_0GetServiceInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -928,10 +820,7 @@ export const serializeAws_json1_0GetServiceTemplateCommand = async ( input: GetServiceTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetServiceTemplate", - }; + const headers: __HeaderBag = sharedHeaders("GetServiceTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_0GetServiceTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -941,10 +830,7 @@ export const serializeAws_json1_0GetServiceTemplateVersionCommand = async ( input: GetServiceTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetServiceTemplateVersion", - }; + const headers: __HeaderBag = sharedHeaders("GetServiceTemplateVersion"); let body: any; body = JSON.stringify(serializeAws_json1_0GetServiceTemplateVersionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -954,10 +840,7 @@ export const serializeAws_json1_0GetTemplateSyncConfigCommand = async ( input: GetTemplateSyncConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetTemplateSyncConfig", - }; + const headers: __HeaderBag = sharedHeaders("GetTemplateSyncConfig"); let body: any; body = JSON.stringify(serializeAws_json1_0GetTemplateSyncConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -967,10 +850,7 @@ export const serializeAws_json1_0GetTemplateSyncStatusCommand = async ( input: GetTemplateSyncStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.GetTemplateSyncStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetTemplateSyncStatus"); let body: any; body = JSON.stringify(serializeAws_json1_0GetTemplateSyncStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -980,10 +860,7 @@ export const serializeAws_json1_0ListComponentOutputsCommand = async ( input: ListComponentOutputsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListComponentOutputs", - }; + const headers: __HeaderBag = sharedHeaders("ListComponentOutputs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListComponentOutputsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -993,10 +870,7 @@ export const serializeAws_json1_0ListComponentProvisionedResourcesCommand = asyn input: ListComponentProvisionedResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListComponentProvisionedResources", - }; + const headers: __HeaderBag = sharedHeaders("ListComponentProvisionedResources"); let body: any; body = JSON.stringify(serializeAws_json1_0ListComponentProvisionedResourcesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1006,10 +880,7 @@ export const serializeAws_json1_0ListComponentsCommand = async ( input: ListComponentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListComponents", - }; + const headers: __HeaderBag = sharedHeaders("ListComponents"); let body: any; body = JSON.stringify(serializeAws_json1_0ListComponentsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1019,10 +890,7 @@ export const serializeAws_json1_0ListEnvironmentAccountConnectionsCommand = asyn input: ListEnvironmentAccountConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListEnvironmentAccountConnections", - }; + const headers: __HeaderBag = sharedHeaders("ListEnvironmentAccountConnections"); let body: any; body = JSON.stringify(serializeAws_json1_0ListEnvironmentAccountConnectionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1032,10 +900,7 @@ export const serializeAws_json1_0ListEnvironmentOutputsCommand = async ( input: ListEnvironmentOutputsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListEnvironmentOutputs", - }; + const headers: __HeaderBag = sharedHeaders("ListEnvironmentOutputs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListEnvironmentOutputsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1045,10 +910,7 @@ export const serializeAws_json1_0ListEnvironmentProvisionedResourcesCommand = as input: ListEnvironmentProvisionedResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListEnvironmentProvisionedResources", - }; + const headers: __HeaderBag = sharedHeaders("ListEnvironmentProvisionedResources"); let body: any; body = JSON.stringify(serializeAws_json1_0ListEnvironmentProvisionedResourcesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1058,10 +920,7 @@ export const serializeAws_json1_0ListEnvironmentsCommand = async ( input: ListEnvironmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListEnvironments", - }; + const headers: __HeaderBag = sharedHeaders("ListEnvironments"); let body: any; body = JSON.stringify(serializeAws_json1_0ListEnvironmentsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1071,10 +930,7 @@ export const serializeAws_json1_0ListEnvironmentTemplatesCommand = async ( input: ListEnvironmentTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListEnvironmentTemplates", - }; + const headers: __HeaderBag = sharedHeaders("ListEnvironmentTemplates"); let body: any; body = JSON.stringify(serializeAws_json1_0ListEnvironmentTemplatesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1084,10 +940,7 @@ export const serializeAws_json1_0ListEnvironmentTemplateVersionsCommand = async input: ListEnvironmentTemplateVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListEnvironmentTemplateVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListEnvironmentTemplateVersions"); let body: any; body = JSON.stringify(serializeAws_json1_0ListEnvironmentTemplateVersionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1097,10 +950,7 @@ export const serializeAws_json1_0ListRepositoriesCommand = async ( input: ListRepositoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListRepositories", - }; + const headers: __HeaderBag = sharedHeaders("ListRepositories"); let body: any; body = JSON.stringify(serializeAws_json1_0ListRepositoriesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1110,10 +960,7 @@ export const serializeAws_json1_0ListRepositorySyncDefinitionsCommand = async ( input: ListRepositorySyncDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListRepositorySyncDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("ListRepositorySyncDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_0ListRepositorySyncDefinitionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1123,10 +970,7 @@ export const serializeAws_json1_0ListServiceInstanceOutputsCommand = async ( input: ListServiceInstanceOutputsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListServiceInstanceOutputs", - }; + const headers: __HeaderBag = sharedHeaders("ListServiceInstanceOutputs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListServiceInstanceOutputsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1136,10 +980,7 @@ export const serializeAws_json1_0ListServiceInstanceProvisionedResourcesCommand input: ListServiceInstanceProvisionedResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListServiceInstanceProvisionedResources", - }; + const headers: __HeaderBag = sharedHeaders("ListServiceInstanceProvisionedResources"); let body: any; body = JSON.stringify(serializeAws_json1_0ListServiceInstanceProvisionedResourcesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1149,10 +990,7 @@ export const serializeAws_json1_0ListServiceInstancesCommand = async ( input: ListServiceInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListServiceInstances", - }; + const headers: __HeaderBag = sharedHeaders("ListServiceInstances"); let body: any; body = JSON.stringify(serializeAws_json1_0ListServiceInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1162,10 +1000,7 @@ export const serializeAws_json1_0ListServicePipelineOutputsCommand = async ( input: ListServicePipelineOutputsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListServicePipelineOutputs", - }; + const headers: __HeaderBag = sharedHeaders("ListServicePipelineOutputs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListServicePipelineOutputsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1175,10 +1010,7 @@ export const serializeAws_json1_0ListServicePipelineProvisionedResourcesCommand input: ListServicePipelineProvisionedResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListServicePipelineProvisionedResources", - }; + const headers: __HeaderBag = sharedHeaders("ListServicePipelineProvisionedResources"); let body: any; body = JSON.stringify(serializeAws_json1_0ListServicePipelineProvisionedResourcesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1188,10 +1020,7 @@ export const serializeAws_json1_0ListServicesCommand = async ( input: ListServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListServices", - }; + const headers: __HeaderBag = sharedHeaders("ListServices"); let body: any; body = JSON.stringify(serializeAws_json1_0ListServicesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1201,10 +1030,7 @@ export const serializeAws_json1_0ListServiceTemplatesCommand = async ( input: ListServiceTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListServiceTemplates", - }; + const headers: __HeaderBag = sharedHeaders("ListServiceTemplates"); let body: any; body = JSON.stringify(serializeAws_json1_0ListServiceTemplatesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1214,10 +1040,7 @@ export const serializeAws_json1_0ListServiceTemplateVersionsCommand = async ( input: ListServiceTemplateVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListServiceTemplateVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListServiceTemplateVersions"); let body: any; body = JSON.stringify(serializeAws_json1_0ListServiceTemplateVersionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1227,10 +1050,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1240,10 +1060,7 @@ export const serializeAws_json1_0NotifyResourceDeploymentStatusChangeCommand = a input: NotifyResourceDeploymentStatusChangeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.NotifyResourceDeploymentStatusChange", - }; + const headers: __HeaderBag = sharedHeaders("NotifyResourceDeploymentStatusChange"); let body: any; body = JSON.stringify(serializeAws_json1_0NotifyResourceDeploymentStatusChangeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1253,10 +1070,7 @@ export const serializeAws_json1_0RejectEnvironmentAccountConnectionCommand = asy input: RejectEnvironmentAccountConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.RejectEnvironmentAccountConnection", - }; + const headers: __HeaderBag = sharedHeaders("RejectEnvironmentAccountConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0RejectEnvironmentAccountConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1266,10 +1080,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1279,10 +1090,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1292,10 +1100,7 @@ export const serializeAws_json1_0UpdateAccountSettingsCommand = async ( input: UpdateAccountSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateAccountSettings", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAccountSettings"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateAccountSettingsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1305,10 +1110,7 @@ export const serializeAws_json1_0UpdateComponentCommand = async ( input: UpdateComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateComponent", - }; + const headers: __HeaderBag = sharedHeaders("UpdateComponent"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateComponentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1318,10 +1120,7 @@ export const serializeAws_json1_0UpdateEnvironmentCommand = async ( input: UpdateEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateEnvironment", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEnvironment"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateEnvironmentInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1331,10 +1130,7 @@ export const serializeAws_json1_0UpdateEnvironmentAccountConnectionCommand = asy input: UpdateEnvironmentAccountConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateEnvironmentAccountConnection", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEnvironmentAccountConnection"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateEnvironmentAccountConnectionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1344,10 +1140,7 @@ export const serializeAws_json1_0UpdateEnvironmentTemplateCommand = async ( input: UpdateEnvironmentTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateEnvironmentTemplate", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEnvironmentTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateEnvironmentTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1357,10 +1150,7 @@ export const serializeAws_json1_0UpdateEnvironmentTemplateVersionCommand = async input: UpdateEnvironmentTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateEnvironmentTemplateVersion", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEnvironmentTemplateVersion"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateEnvironmentTemplateVersionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1370,10 +1160,7 @@ export const serializeAws_json1_0UpdateServiceCommand = async ( input: UpdateServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateService", - }; + const headers: __HeaderBag = sharedHeaders("UpdateService"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateServiceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1383,10 +1170,7 @@ export const serializeAws_json1_0UpdateServiceInstanceCommand = async ( input: UpdateServiceInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateServiceInstance", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServiceInstance"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateServiceInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1396,10 +1180,7 @@ export const serializeAws_json1_0UpdateServicePipelineCommand = async ( input: UpdateServicePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateServicePipeline", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServicePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateServicePipelineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1409,10 +1190,7 @@ export const serializeAws_json1_0UpdateServiceTemplateCommand = async ( input: UpdateServiceTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateServiceTemplate", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServiceTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateServiceTemplateInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1422,10 +1200,7 @@ export const serializeAws_json1_0UpdateServiceTemplateVersionCommand = async ( input: UpdateServiceTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateServiceTemplateVersion", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServiceTemplateVersion"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateServiceTemplateVersionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1435,10 +1210,7 @@ export const serializeAws_json1_0UpdateTemplateSyncConfigCommand = async ( input: UpdateTemplateSyncConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AwsProton20200720.UpdateTemplateSyncConfig", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTemplateSyncConfig"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateTemplateSyncConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -8420,6 +8192,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `AwsProton20200720.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-qldb-session/src/protocols/Aws_json1_0.ts b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts index caa35a6ea1487..c1ad71ce4b1bd 100644 --- a/clients/client-qldb-session/src/protocols/Aws_json1_0.ts +++ b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts @@ -48,10 +48,7 @@ export const serializeAws_json1_0SendCommandCommand = async ( input: SendCommandCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "QLDBSession.SendCommand", - }; + const headers: __HeaderBag = sharedHeaders("SendCommand"); let body: any; body = JSON.stringify(serializeAws_json1_0SendCommandRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -500,6 +497,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `QLDBSession.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-rds/src/protocols/Aws_query.ts b/clients/client-rds/src/protocols/Aws_query.ts index 209f313eaaa0a..1d1f1ccef9f81 100644 --- a/clients/client-rds/src/protocols/Aws_query.ts +++ b/clients/client-rds/src/protocols/Aws_query.ts @@ -969,9 +969,7 @@ export const serializeAws_queryAddRoleToDBClusterCommand = async ( input: AddRoleToDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddRoleToDBClusterMessage(input, context), @@ -985,9 +983,7 @@ export const serializeAws_queryAddRoleToDBInstanceCommand = async ( input: AddRoleToDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddRoleToDBInstanceMessage(input, context), @@ -1001,9 +997,7 @@ export const serializeAws_queryAddSourceIdentifierToSubscriptionCommand = async input: AddSourceIdentifierToSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddSourceIdentifierToSubscriptionMessage(input, context), @@ -1017,9 +1011,7 @@ export const serializeAws_queryAddTagsToResourceCommand = async ( input: AddTagsToResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddTagsToResourceMessage(input, context), @@ -1033,9 +1025,7 @@ export const serializeAws_queryApplyPendingMaintenanceActionCommand = async ( input: ApplyPendingMaintenanceActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryApplyPendingMaintenanceActionMessage(input, context), @@ -1049,9 +1039,7 @@ export const serializeAws_queryAuthorizeDBSecurityGroupIngressCommand = async ( input: AuthorizeDBSecurityGroupIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAuthorizeDBSecurityGroupIngressMessage(input, context), @@ -1065,9 +1053,7 @@ export const serializeAws_queryBacktrackDBClusterCommand = async ( input: BacktrackDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryBacktrackDBClusterMessage(input, context), @@ -1081,9 +1067,7 @@ export const serializeAws_queryCancelExportTaskCommand = async ( input: CancelExportTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCancelExportTaskMessage(input, context), @@ -1097,9 +1081,7 @@ export const serializeAws_queryCopyDBClusterParameterGroupCommand = async ( input: CopyDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyDBClusterParameterGroupMessage(input, context), @@ -1113,9 +1095,7 @@ export const serializeAws_queryCopyDBClusterSnapshotCommand = async ( input: CopyDBClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyDBClusterSnapshotMessage(input, context), @@ -1129,9 +1109,7 @@ export const serializeAws_queryCopyDBParameterGroupCommand = async ( input: CopyDBParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyDBParameterGroupMessage(input, context), @@ -1145,9 +1123,7 @@ export const serializeAws_queryCopyDBSnapshotCommand = async ( input: CopyDBSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyDBSnapshotMessage(input, context), @@ -1161,9 +1137,7 @@ export const serializeAws_queryCopyOptionGroupCommand = async ( input: CopyOptionGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyOptionGroupMessage(input, context), @@ -1177,9 +1151,7 @@ export const serializeAws_queryCreateBlueGreenDeploymentCommand = async ( input: CreateBlueGreenDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateBlueGreenDeploymentRequest(input, context), @@ -1193,9 +1165,7 @@ export const serializeAws_queryCreateCustomDBEngineVersionCommand = async ( input: CreateCustomDBEngineVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateCustomDBEngineVersionMessage(input, context), @@ -1209,9 +1179,7 @@ export const serializeAws_queryCreateDBClusterCommand = async ( input: CreateDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterMessage(input, context), @@ -1225,9 +1193,7 @@ export const serializeAws_queryCreateDBClusterEndpointCommand = async ( input: CreateDBClusterEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterEndpointMessage(input, context), @@ -1241,9 +1207,7 @@ export const serializeAws_queryCreateDBClusterParameterGroupCommand = async ( input: CreateDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterParameterGroupMessage(input, context), @@ -1257,9 +1221,7 @@ export const serializeAws_queryCreateDBClusterSnapshotCommand = async ( input: CreateDBClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBClusterSnapshotMessage(input, context), @@ -1273,9 +1235,7 @@ export const serializeAws_queryCreateDBInstanceCommand = async ( input: CreateDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBInstanceMessage(input, context), @@ -1289,9 +1249,7 @@ export const serializeAws_queryCreateDBInstanceReadReplicaCommand = async ( input: CreateDBInstanceReadReplicaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBInstanceReadReplicaMessage(input, context), @@ -1305,9 +1263,7 @@ export const serializeAws_queryCreateDBParameterGroupCommand = async ( input: CreateDBParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBParameterGroupMessage(input, context), @@ -1321,9 +1277,7 @@ export const serializeAws_queryCreateDBProxyCommand = async ( input: CreateDBProxyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBProxyRequest(input, context), @@ -1337,9 +1291,7 @@ export const serializeAws_queryCreateDBProxyEndpointCommand = async ( input: CreateDBProxyEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBProxyEndpointRequest(input, context), @@ -1353,9 +1305,7 @@ export const serializeAws_queryCreateDBSecurityGroupCommand = async ( input: CreateDBSecurityGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBSecurityGroupMessage(input, context), @@ -1369,9 +1319,7 @@ export const serializeAws_queryCreateDBSnapshotCommand = async ( input: CreateDBSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBSnapshotMessage(input, context), @@ -1385,9 +1333,7 @@ export const serializeAws_queryCreateDBSubnetGroupCommand = async ( input: CreateDBSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateDBSubnetGroupMessage(input, context), @@ -1401,9 +1347,7 @@ export const serializeAws_queryCreateEventSubscriptionCommand = async ( input: CreateEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateEventSubscriptionMessage(input, context), @@ -1417,9 +1361,7 @@ export const serializeAws_queryCreateGlobalClusterCommand = async ( input: CreateGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateGlobalClusterMessage(input, context), @@ -1433,9 +1375,7 @@ export const serializeAws_queryCreateOptionGroupCommand = async ( input: CreateOptionGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateOptionGroupMessage(input, context), @@ -1449,9 +1389,7 @@ export const serializeAws_queryDeleteBlueGreenDeploymentCommand = async ( input: DeleteBlueGreenDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteBlueGreenDeploymentRequest(input, context), @@ -1465,9 +1403,7 @@ export const serializeAws_queryDeleteCustomDBEngineVersionCommand = async ( input: DeleteCustomDBEngineVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteCustomDBEngineVersionMessage(input, context), @@ -1481,9 +1417,7 @@ export const serializeAws_queryDeleteDBClusterCommand = async ( input: DeleteDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterMessage(input, context), @@ -1497,9 +1431,7 @@ export const serializeAws_queryDeleteDBClusterEndpointCommand = async ( input: DeleteDBClusterEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterEndpointMessage(input, context), @@ -1513,9 +1445,7 @@ export const serializeAws_queryDeleteDBClusterParameterGroupCommand = async ( input: DeleteDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterParameterGroupMessage(input, context), @@ -1529,9 +1459,7 @@ export const serializeAws_queryDeleteDBClusterSnapshotCommand = async ( input: DeleteDBClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBClusterSnapshotMessage(input, context), @@ -1545,9 +1473,7 @@ export const serializeAws_queryDeleteDBInstanceCommand = async ( input: DeleteDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBInstanceMessage(input, context), @@ -1561,9 +1487,7 @@ export const serializeAws_queryDeleteDBInstanceAutomatedBackupCommand = async ( input: DeleteDBInstanceAutomatedBackupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBInstanceAutomatedBackupMessage(input, context), @@ -1577,9 +1501,7 @@ export const serializeAws_queryDeleteDBParameterGroupCommand = async ( input: DeleteDBParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBParameterGroupMessage(input, context), @@ -1593,9 +1515,7 @@ export const serializeAws_queryDeleteDBProxyCommand = async ( input: DeleteDBProxyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBProxyRequest(input, context), @@ -1609,9 +1529,7 @@ export const serializeAws_queryDeleteDBProxyEndpointCommand = async ( input: DeleteDBProxyEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBProxyEndpointRequest(input, context), @@ -1625,9 +1543,7 @@ export const serializeAws_queryDeleteDBSecurityGroupCommand = async ( input: DeleteDBSecurityGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBSecurityGroupMessage(input, context), @@ -1641,9 +1557,7 @@ export const serializeAws_queryDeleteDBSnapshotCommand = async ( input: DeleteDBSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBSnapshotMessage(input, context), @@ -1657,9 +1571,7 @@ export const serializeAws_queryDeleteDBSubnetGroupCommand = async ( input: DeleteDBSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteDBSubnetGroupMessage(input, context), @@ -1673,9 +1585,7 @@ export const serializeAws_queryDeleteEventSubscriptionCommand = async ( input: DeleteEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteEventSubscriptionMessage(input, context), @@ -1689,9 +1599,7 @@ export const serializeAws_queryDeleteGlobalClusterCommand = async ( input: DeleteGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteGlobalClusterMessage(input, context), @@ -1705,9 +1613,7 @@ export const serializeAws_queryDeleteOptionGroupCommand = async ( input: DeleteOptionGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteOptionGroupMessage(input, context), @@ -1721,9 +1627,7 @@ export const serializeAws_queryDeregisterDBProxyTargetsCommand = async ( input: DeregisterDBProxyTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeregisterDBProxyTargetsRequest(input, context), @@ -1737,9 +1641,7 @@ export const serializeAws_queryDescribeAccountAttributesCommand = async ( input: DescribeAccountAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAccountAttributesMessage(input, context), @@ -1753,9 +1655,7 @@ export const serializeAws_queryDescribeBlueGreenDeploymentsCommand = async ( input: DescribeBlueGreenDeploymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeBlueGreenDeploymentsRequest(input, context), @@ -1769,9 +1669,7 @@ export const serializeAws_queryDescribeCertificatesCommand = async ( input: DescribeCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeCertificatesMessage(input, context), @@ -1785,9 +1683,7 @@ export const serializeAws_queryDescribeDBClusterBacktracksCommand = async ( input: DescribeDBClusterBacktracksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterBacktracksMessage(input, context), @@ -1801,9 +1697,7 @@ export const serializeAws_queryDescribeDBClusterEndpointsCommand = async ( input: DescribeDBClusterEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterEndpointsMessage(input, context), @@ -1817,9 +1711,7 @@ export const serializeAws_queryDescribeDBClusterParameterGroupsCommand = async ( input: DescribeDBClusterParameterGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterParameterGroupsMessage(input, context), @@ -1833,9 +1725,7 @@ export const serializeAws_queryDescribeDBClusterParametersCommand = async ( input: DescribeDBClusterParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterParametersMessage(input, context), @@ -1849,9 +1739,7 @@ export const serializeAws_queryDescribeDBClustersCommand = async ( input: DescribeDBClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClustersMessage(input, context), @@ -1865,9 +1753,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotAttributesCommand = asyn input: DescribeDBClusterSnapshotAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterSnapshotAttributesMessage(input, context), @@ -1881,9 +1767,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotsCommand = async ( input: DescribeDBClusterSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBClusterSnapshotsMessage(input, context), @@ -1897,9 +1781,7 @@ export const serializeAws_queryDescribeDBEngineVersionsCommand = async ( input: DescribeDBEngineVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBEngineVersionsMessage(input, context), @@ -1913,9 +1795,7 @@ export const serializeAws_queryDescribeDBInstanceAutomatedBackupsCommand = async input: DescribeDBInstanceAutomatedBackupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBInstanceAutomatedBackupsMessage(input, context), @@ -1929,9 +1809,7 @@ export const serializeAws_queryDescribeDBInstancesCommand = async ( input: DescribeDBInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBInstancesMessage(input, context), @@ -1945,9 +1823,7 @@ export const serializeAws_queryDescribeDBLogFilesCommand = async ( input: DescribeDBLogFilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBLogFilesMessage(input, context), @@ -1961,9 +1837,7 @@ export const serializeAws_queryDescribeDBParameterGroupsCommand = async ( input: DescribeDBParameterGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBParameterGroupsMessage(input, context), @@ -1977,9 +1851,7 @@ export const serializeAws_queryDescribeDBParametersCommand = async ( input: DescribeDBParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBParametersMessage(input, context), @@ -1993,9 +1865,7 @@ export const serializeAws_queryDescribeDBProxiesCommand = async ( input: DescribeDBProxiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBProxiesRequest(input, context), @@ -2009,9 +1879,7 @@ export const serializeAws_queryDescribeDBProxyEndpointsCommand = async ( input: DescribeDBProxyEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBProxyEndpointsRequest(input, context), @@ -2025,9 +1893,7 @@ export const serializeAws_queryDescribeDBProxyTargetGroupsCommand = async ( input: DescribeDBProxyTargetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBProxyTargetGroupsRequest(input, context), @@ -2041,9 +1907,7 @@ export const serializeAws_queryDescribeDBProxyTargetsCommand = async ( input: DescribeDBProxyTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBProxyTargetsRequest(input, context), @@ -2057,9 +1921,7 @@ export const serializeAws_queryDescribeDBSecurityGroupsCommand = async ( input: DescribeDBSecurityGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBSecurityGroupsMessage(input, context), @@ -2073,9 +1935,7 @@ export const serializeAws_queryDescribeDBSnapshotAttributesCommand = async ( input: DescribeDBSnapshotAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBSnapshotAttributesMessage(input, context), @@ -2089,9 +1949,7 @@ export const serializeAws_queryDescribeDBSnapshotsCommand = async ( input: DescribeDBSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBSnapshotsMessage(input, context), @@ -2105,9 +1963,7 @@ export const serializeAws_queryDescribeDBSubnetGroupsCommand = async ( input: DescribeDBSubnetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDBSubnetGroupsMessage(input, context), @@ -2121,9 +1977,7 @@ export const serializeAws_queryDescribeEngineDefaultClusterParametersCommand = a input: DescribeEngineDefaultClusterParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEngineDefaultClusterParametersMessage(input, context), @@ -2137,9 +1991,7 @@ export const serializeAws_queryDescribeEngineDefaultParametersCommand = async ( input: DescribeEngineDefaultParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEngineDefaultParametersMessage(input, context), @@ -2153,9 +2005,7 @@ export const serializeAws_queryDescribeEventCategoriesCommand = async ( input: DescribeEventCategoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventCategoriesMessage(input, context), @@ -2169,9 +2019,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventsMessage(input, context), @@ -2185,9 +2033,7 @@ export const serializeAws_queryDescribeEventSubscriptionsCommand = async ( input: DescribeEventSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventSubscriptionsMessage(input, context), @@ -2201,9 +2047,7 @@ export const serializeAws_queryDescribeExportTasksCommand = async ( input: DescribeExportTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeExportTasksMessage(input, context), @@ -2217,9 +2061,7 @@ export const serializeAws_queryDescribeGlobalClustersCommand = async ( input: DescribeGlobalClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeGlobalClustersMessage(input, context), @@ -2233,9 +2075,7 @@ export const serializeAws_queryDescribeOptionGroupOptionsCommand = async ( input: DescribeOptionGroupOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeOptionGroupOptionsMessage(input, context), @@ -2249,9 +2089,7 @@ export const serializeAws_queryDescribeOptionGroupsCommand = async ( input: DescribeOptionGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeOptionGroupsMessage(input, context), @@ -2265,9 +2103,7 @@ export const serializeAws_queryDescribeOrderableDBInstanceOptionsCommand = async input: DescribeOrderableDBInstanceOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeOrderableDBInstanceOptionsMessage(input, context), @@ -2281,9 +2117,7 @@ export const serializeAws_queryDescribePendingMaintenanceActionsCommand = async input: DescribePendingMaintenanceActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribePendingMaintenanceActionsMessage(input, context), @@ -2297,9 +2131,7 @@ export const serializeAws_queryDescribeReservedDBInstancesCommand = async ( input: DescribeReservedDBInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeReservedDBInstancesMessage(input, context), @@ -2313,9 +2145,7 @@ export const serializeAws_queryDescribeReservedDBInstancesOfferingsCommand = asy input: DescribeReservedDBInstancesOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeReservedDBInstancesOfferingsMessage(input, context), @@ -2329,9 +2159,7 @@ export const serializeAws_queryDescribeSourceRegionsCommand = async ( input: DescribeSourceRegionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeSourceRegionsMessage(input, context), @@ -2345,9 +2173,7 @@ export const serializeAws_queryDescribeValidDBInstanceModificationsCommand = asy input: DescribeValidDBInstanceModificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeValidDBInstanceModificationsMessage(input, context), @@ -2361,9 +2187,7 @@ export const serializeAws_queryDownloadDBLogFilePortionCommand = async ( input: DownloadDBLogFilePortionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDownloadDBLogFilePortionMessage(input, context), @@ -2377,9 +2201,7 @@ export const serializeAws_queryFailoverDBClusterCommand = async ( input: FailoverDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryFailoverDBClusterMessage(input, context), @@ -2393,9 +2215,7 @@ export const serializeAws_queryFailoverGlobalClusterCommand = async ( input: FailoverGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryFailoverGlobalClusterMessage(input, context), @@ -2409,9 +2229,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTagsForResourceMessage(input, context), @@ -2425,9 +2243,7 @@ export const serializeAws_queryModifyActivityStreamCommand = async ( input: ModifyActivityStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyActivityStreamRequest(input, context), @@ -2441,9 +2257,7 @@ export const serializeAws_queryModifyCertificatesCommand = async ( input: ModifyCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyCertificatesMessage(input, context), @@ -2457,9 +2271,7 @@ export const serializeAws_queryModifyCurrentDBClusterCapacityCommand = async ( input: ModifyCurrentDBClusterCapacityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyCurrentDBClusterCapacityMessage(input, context), @@ -2473,9 +2285,7 @@ export const serializeAws_queryModifyCustomDBEngineVersionCommand = async ( input: ModifyCustomDBEngineVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyCustomDBEngineVersionMessage(input, context), @@ -2489,9 +2299,7 @@ export const serializeAws_queryModifyDBClusterCommand = async ( input: ModifyDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterMessage(input, context), @@ -2505,9 +2313,7 @@ export const serializeAws_queryModifyDBClusterEndpointCommand = async ( input: ModifyDBClusterEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterEndpointMessage(input, context), @@ -2521,9 +2327,7 @@ export const serializeAws_queryModifyDBClusterParameterGroupCommand = async ( input: ModifyDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterParameterGroupMessage(input, context), @@ -2537,9 +2341,7 @@ export const serializeAws_queryModifyDBClusterSnapshotAttributeCommand = async ( input: ModifyDBClusterSnapshotAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBClusterSnapshotAttributeMessage(input, context), @@ -2553,9 +2355,7 @@ export const serializeAws_queryModifyDBInstanceCommand = async ( input: ModifyDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBInstanceMessage(input, context), @@ -2569,9 +2369,7 @@ export const serializeAws_queryModifyDBParameterGroupCommand = async ( input: ModifyDBParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBParameterGroupMessage(input, context), @@ -2585,9 +2383,7 @@ export const serializeAws_queryModifyDBProxyCommand = async ( input: ModifyDBProxyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBProxyRequest(input, context), @@ -2601,9 +2397,7 @@ export const serializeAws_queryModifyDBProxyEndpointCommand = async ( input: ModifyDBProxyEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBProxyEndpointRequest(input, context), @@ -2617,9 +2411,7 @@ export const serializeAws_queryModifyDBProxyTargetGroupCommand = async ( input: ModifyDBProxyTargetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBProxyTargetGroupRequest(input, context), @@ -2633,9 +2425,7 @@ export const serializeAws_queryModifyDBSnapshotCommand = async ( input: ModifyDBSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBSnapshotMessage(input, context), @@ -2649,9 +2439,7 @@ export const serializeAws_queryModifyDBSnapshotAttributeCommand = async ( input: ModifyDBSnapshotAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBSnapshotAttributeMessage(input, context), @@ -2665,9 +2453,7 @@ export const serializeAws_queryModifyDBSubnetGroupCommand = async ( input: ModifyDBSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyDBSubnetGroupMessage(input, context), @@ -2681,9 +2467,7 @@ export const serializeAws_queryModifyEventSubscriptionCommand = async ( input: ModifyEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyEventSubscriptionMessage(input, context), @@ -2697,9 +2481,7 @@ export const serializeAws_queryModifyGlobalClusterCommand = async ( input: ModifyGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyGlobalClusterMessage(input, context), @@ -2713,9 +2495,7 @@ export const serializeAws_queryModifyOptionGroupCommand = async ( input: ModifyOptionGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyOptionGroupMessage(input, context), @@ -2729,9 +2509,7 @@ export const serializeAws_queryPromoteReadReplicaCommand = async ( input: PromoteReadReplicaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPromoteReadReplicaMessage(input, context), @@ -2745,9 +2523,7 @@ export const serializeAws_queryPromoteReadReplicaDBClusterCommand = async ( input: PromoteReadReplicaDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPromoteReadReplicaDBClusterMessage(input, context), @@ -2761,9 +2537,7 @@ export const serializeAws_queryPurchaseReservedDBInstancesOfferingCommand = asyn input: PurchaseReservedDBInstancesOfferingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPurchaseReservedDBInstancesOfferingMessage(input, context), @@ -2777,9 +2551,7 @@ export const serializeAws_queryRebootDBClusterCommand = async ( input: RebootDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRebootDBClusterMessage(input, context), @@ -2793,9 +2565,7 @@ export const serializeAws_queryRebootDBInstanceCommand = async ( input: RebootDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRebootDBInstanceMessage(input, context), @@ -2809,9 +2579,7 @@ export const serializeAws_queryRegisterDBProxyTargetsCommand = async ( input: RegisterDBProxyTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRegisterDBProxyTargetsRequest(input, context), @@ -2825,9 +2593,7 @@ export const serializeAws_queryRemoveFromGlobalClusterCommand = async ( input: RemoveFromGlobalClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveFromGlobalClusterMessage(input, context), @@ -2841,9 +2607,7 @@ export const serializeAws_queryRemoveRoleFromDBClusterCommand = async ( input: RemoveRoleFromDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveRoleFromDBClusterMessage(input, context), @@ -2857,9 +2621,7 @@ export const serializeAws_queryRemoveRoleFromDBInstanceCommand = async ( input: RemoveRoleFromDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveRoleFromDBInstanceMessage(input, context), @@ -2873,9 +2635,7 @@ export const serializeAws_queryRemoveSourceIdentifierFromSubscriptionCommand = a input: RemoveSourceIdentifierFromSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveSourceIdentifierFromSubscriptionMessage(input, context), @@ -2889,9 +2649,7 @@ export const serializeAws_queryRemoveTagsFromResourceCommand = async ( input: RemoveTagsFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemoveTagsFromResourceMessage(input, context), @@ -2905,9 +2663,7 @@ export const serializeAws_queryResetDBClusterParameterGroupCommand = async ( input: ResetDBClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResetDBClusterParameterGroupMessage(input, context), @@ -2921,9 +2677,7 @@ export const serializeAws_queryResetDBParameterGroupCommand = async ( input: ResetDBParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResetDBParameterGroupMessage(input, context), @@ -2937,9 +2691,7 @@ export const serializeAws_queryRestoreDBClusterFromS3Command = async ( input: RestoreDBClusterFromS3CommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreDBClusterFromS3Message(input, context), @@ -2953,9 +2705,7 @@ export const serializeAws_queryRestoreDBClusterFromSnapshotCommand = async ( input: RestoreDBClusterFromSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreDBClusterFromSnapshotMessage(input, context), @@ -2969,9 +2719,7 @@ export const serializeAws_queryRestoreDBClusterToPointInTimeCommand = async ( input: RestoreDBClusterToPointInTimeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreDBClusterToPointInTimeMessage(input, context), @@ -2985,9 +2733,7 @@ export const serializeAws_queryRestoreDBInstanceFromDBSnapshotCommand = async ( input: RestoreDBInstanceFromDBSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreDBInstanceFromDBSnapshotMessage(input, context), @@ -3001,9 +2747,7 @@ export const serializeAws_queryRestoreDBInstanceFromS3Command = async ( input: RestoreDBInstanceFromS3CommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreDBInstanceFromS3Message(input, context), @@ -3017,9 +2761,7 @@ export const serializeAws_queryRestoreDBInstanceToPointInTimeCommand = async ( input: RestoreDBInstanceToPointInTimeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreDBInstanceToPointInTimeMessage(input, context), @@ -3033,9 +2775,7 @@ export const serializeAws_queryRevokeDBSecurityGroupIngressCommand = async ( input: RevokeDBSecurityGroupIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRevokeDBSecurityGroupIngressMessage(input, context), @@ -3049,9 +2789,7 @@ export const serializeAws_queryStartActivityStreamCommand = async ( input: StartActivityStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStartActivityStreamRequest(input, context), @@ -3065,9 +2803,7 @@ export const serializeAws_queryStartDBClusterCommand = async ( input: StartDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStartDBClusterMessage(input, context), @@ -3081,9 +2817,7 @@ export const serializeAws_queryStartDBInstanceCommand = async ( input: StartDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStartDBInstanceMessage(input, context), @@ -3097,9 +2831,7 @@ export const serializeAws_queryStartDBInstanceAutomatedBackupsReplicationCommand input: StartDBInstanceAutomatedBackupsReplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStartDBInstanceAutomatedBackupsReplicationMessage(input, context), @@ -3113,9 +2845,7 @@ export const serializeAws_queryStartExportTaskCommand = async ( input: StartExportTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStartExportTaskMessage(input, context), @@ -3129,9 +2859,7 @@ export const serializeAws_queryStopActivityStreamCommand = async ( input: StopActivityStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStopActivityStreamRequest(input, context), @@ -3145,9 +2873,7 @@ export const serializeAws_queryStopDBClusterCommand = async ( input: StopDBClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStopDBClusterMessage(input, context), @@ -3161,9 +2887,7 @@ export const serializeAws_queryStopDBInstanceCommand = async ( input: StopDBInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStopDBInstanceMessage(input, context), @@ -3177,9 +2901,7 @@ export const serializeAws_queryStopDBInstanceAutomatedBackupsReplicationCommand input: StopDBInstanceAutomatedBackupsReplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryStopDBInstanceAutomatedBackupsReplicationMessage(input, context), @@ -3193,9 +2915,7 @@ export const serializeAws_querySwitchoverBlueGreenDeploymentCommand = async ( input: SwitchoverBlueGreenDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySwitchoverBlueGreenDeploymentRequest(input, context), @@ -3209,9 +2929,7 @@ export const serializeAws_querySwitchoverReadReplicaCommand = async ( input: SwitchoverReadReplicaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySwitchoverReadReplicaMessage(input, context), @@ -24257,6 +23975,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-redshift-data/src/protocols/Aws_json1_1.ts b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts index d76ee0ad48f76..93790396d9b51 100644 --- a/clients/client-redshift-data/src/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts @@ -75,10 +75,7 @@ export const serializeAws_json1_1BatchExecuteStatementCommand = async ( input: BatchExecuteStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftData.BatchExecuteStatement", - }; + const headers: __HeaderBag = sharedHeaders("BatchExecuteStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchExecuteStatementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -88,10 +85,7 @@ export const serializeAws_json1_1CancelStatementCommand = async ( input: CancelStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftData.CancelStatement", - }; + const headers: __HeaderBag = sharedHeaders("CancelStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelStatementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -101,10 +95,7 @@ export const serializeAws_json1_1DescribeStatementCommand = async ( input: DescribeStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftData.DescribeStatement", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStatementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -114,10 +105,7 @@ export const serializeAws_json1_1DescribeTableCommand = async ( input: DescribeTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftData.DescribeTable", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTable"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -127,10 +115,7 @@ export const serializeAws_json1_1ExecuteStatementCommand = async ( input: ExecuteStatementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftData.ExecuteStatement", - }; + const headers: __HeaderBag = sharedHeaders("ExecuteStatement"); let body: any; body = JSON.stringify(serializeAws_json1_1ExecuteStatementInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -140,10 +125,7 @@ export const serializeAws_json1_1GetStatementResultCommand = async ( input: GetStatementResultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftData.GetStatementResult", - }; + const headers: __HeaderBag = sharedHeaders("GetStatementResult"); let body: any; body = JSON.stringify(serializeAws_json1_1GetStatementResultRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -153,10 +135,7 @@ export const serializeAws_json1_1ListDatabasesCommand = async ( input: ListDatabasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftData.ListDatabases", - }; + const headers: __HeaderBag = sharedHeaders("ListDatabases"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatabasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -166,10 +145,7 @@ export const serializeAws_json1_1ListSchemasCommand = async ( input: ListSchemasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftData.ListSchemas", - }; + const headers: __HeaderBag = sharedHeaders("ListSchemas"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSchemasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -179,10 +155,7 @@ export const serializeAws_json1_1ListStatementsCommand = async ( input: ListStatementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftData.ListStatements", - }; + const headers: __HeaderBag = sharedHeaders("ListStatements"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStatementsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -192,10 +165,7 @@ export const serializeAws_json1_1ListTablesCommand = async ( input: ListTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftData.ListTables", - }; + const headers: __HeaderBag = sharedHeaders("ListTables"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTablesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1365,6 +1335,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `RedshiftData.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts b/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts index b28ac2e4ae00f..048735de8fd28 100644 --- a/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts @@ -206,10 +206,7 @@ export const serializeAws_json1_1ConvertRecoveryPointToSnapshotCommand = async ( input: ConvertRecoveryPointToSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.ConvertRecoveryPointToSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("ConvertRecoveryPointToSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1ConvertRecoveryPointToSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -219,10 +216,7 @@ export const serializeAws_json1_1CreateEndpointAccessCommand = async ( input: CreateEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.CreateEndpointAccess", - }; + const headers: __HeaderBag = sharedHeaders("CreateEndpointAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEndpointAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -232,10 +226,7 @@ export const serializeAws_json1_1CreateNamespaceCommand = async ( input: CreateNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.CreateNamespace", - }; + const headers: __HeaderBag = sharedHeaders("CreateNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -245,10 +236,7 @@ export const serializeAws_json1_1CreateSnapshotCommand = async ( input: CreateSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.CreateSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -258,10 +246,7 @@ export const serializeAws_json1_1CreateUsageLimitCommand = async ( input: CreateUsageLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.CreateUsageLimit", - }; + const headers: __HeaderBag = sharedHeaders("CreateUsageLimit"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUsageLimitRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -271,10 +256,7 @@ export const serializeAws_json1_1CreateWorkgroupCommand = async ( input: CreateWorkgroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.CreateWorkgroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateWorkgroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWorkgroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -284,10 +266,7 @@ export const serializeAws_json1_1DeleteEndpointAccessCommand = async ( input: DeleteEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.DeleteEndpointAccess", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEndpointAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEndpointAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -297,10 +276,7 @@ export const serializeAws_json1_1DeleteNamespaceCommand = async ( input: DeleteNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.DeleteNamespace", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -310,10 +286,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.DeleteResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -323,10 +296,7 @@ export const serializeAws_json1_1DeleteSnapshotCommand = async ( input: DeleteSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.DeleteSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -336,10 +306,7 @@ export const serializeAws_json1_1DeleteUsageLimitCommand = async ( input: DeleteUsageLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.DeleteUsageLimit", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUsageLimit"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUsageLimitRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -349,10 +316,7 @@ export const serializeAws_json1_1DeleteWorkgroupCommand = async ( input: DeleteWorkgroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.DeleteWorkgroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWorkgroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWorkgroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -362,10 +326,7 @@ export const serializeAws_json1_1GetCredentialsCommand = async ( input: GetCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.GetCredentials", - }; + const headers: __HeaderBag = sharedHeaders("GetCredentials"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCredentialsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -375,10 +336,7 @@ export const serializeAws_json1_1GetEndpointAccessCommand = async ( input: GetEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.GetEndpointAccess", - }; + const headers: __HeaderBag = sharedHeaders("GetEndpointAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1GetEndpointAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -388,10 +346,7 @@ export const serializeAws_json1_1GetNamespaceCommand = async ( input: GetNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.GetNamespace", - }; + const headers: __HeaderBag = sharedHeaders("GetNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1GetNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -401,10 +356,7 @@ export const serializeAws_json1_1GetRecoveryPointCommand = async ( input: GetRecoveryPointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.GetRecoveryPoint", - }; + const headers: __HeaderBag = sharedHeaders("GetRecoveryPoint"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRecoveryPointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -414,10 +366,7 @@ export const serializeAws_json1_1GetResourcePolicyCommand = async ( input: GetResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.GetResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -427,10 +376,7 @@ export const serializeAws_json1_1GetSnapshotCommand = async ( input: GetSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.GetSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("GetSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -440,10 +386,7 @@ export const serializeAws_json1_1GetTableRestoreStatusCommand = async ( input: GetTableRestoreStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.GetTableRestoreStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetTableRestoreStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTableRestoreStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -453,10 +396,7 @@ export const serializeAws_json1_1GetUsageLimitCommand = async ( input: GetUsageLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.GetUsageLimit", - }; + const headers: __HeaderBag = sharedHeaders("GetUsageLimit"); let body: any; body = JSON.stringify(serializeAws_json1_1GetUsageLimitRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -466,10 +406,7 @@ export const serializeAws_json1_1GetWorkgroupCommand = async ( input: GetWorkgroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.GetWorkgroup", - }; + const headers: __HeaderBag = sharedHeaders("GetWorkgroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWorkgroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -479,10 +416,7 @@ export const serializeAws_json1_1ListEndpointAccessCommand = async ( input: ListEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.ListEndpointAccess", - }; + const headers: __HeaderBag = sharedHeaders("ListEndpointAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEndpointAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -492,10 +426,7 @@ export const serializeAws_json1_1ListNamespacesCommand = async ( input: ListNamespacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.ListNamespaces", - }; + const headers: __HeaderBag = sharedHeaders("ListNamespaces"); let body: any; body = JSON.stringify(serializeAws_json1_1ListNamespacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -505,10 +436,7 @@ export const serializeAws_json1_1ListRecoveryPointsCommand = async ( input: ListRecoveryPointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.ListRecoveryPoints", - }; + const headers: __HeaderBag = sharedHeaders("ListRecoveryPoints"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRecoveryPointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -518,10 +446,7 @@ export const serializeAws_json1_1ListSnapshotsCommand = async ( input: ListSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.ListSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("ListSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -531,10 +456,7 @@ export const serializeAws_json1_1ListTableRestoreStatusCommand = async ( input: ListTableRestoreStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.ListTableRestoreStatus", - }; + const headers: __HeaderBag = sharedHeaders("ListTableRestoreStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTableRestoreStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -544,10 +466,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -557,10 +476,7 @@ export const serializeAws_json1_1ListUsageLimitsCommand = async ( input: ListUsageLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.ListUsageLimits", - }; + const headers: __HeaderBag = sharedHeaders("ListUsageLimits"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUsageLimitsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -570,10 +486,7 @@ export const serializeAws_json1_1ListWorkgroupsCommand = async ( input: ListWorkgroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.ListWorkgroups", - }; + const headers: __HeaderBag = sharedHeaders("ListWorkgroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWorkgroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -583,10 +496,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( input: PutResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.PutResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -596,10 +506,7 @@ export const serializeAws_json1_1RestoreFromRecoveryPointCommand = async ( input: RestoreFromRecoveryPointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.RestoreFromRecoveryPoint", - }; + const headers: __HeaderBag = sharedHeaders("RestoreFromRecoveryPoint"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreFromRecoveryPointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -609,10 +516,7 @@ export const serializeAws_json1_1RestoreFromSnapshotCommand = async ( input: RestoreFromSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.RestoreFromSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("RestoreFromSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreFromSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -622,10 +526,7 @@ export const serializeAws_json1_1RestoreTableFromSnapshotCommand = async ( input: RestoreTableFromSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.RestoreTableFromSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("RestoreTableFromSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreTableFromSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -635,10 +536,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -648,10 +546,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -661,10 +556,7 @@ export const serializeAws_json1_1UpdateEndpointAccessCommand = async ( input: UpdateEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.UpdateEndpointAccess", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEndpointAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEndpointAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -674,10 +566,7 @@ export const serializeAws_json1_1UpdateNamespaceCommand = async ( input: UpdateNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.UpdateNamespace", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -687,10 +576,7 @@ export const serializeAws_json1_1UpdateSnapshotCommand = async ( input: UpdateSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.UpdateSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSnapshotRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -700,10 +586,7 @@ export const serializeAws_json1_1UpdateUsageLimitCommand = async ( input: UpdateUsageLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.UpdateUsageLimit", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUsageLimit"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUsageLimitRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -713,10 +596,7 @@ export const serializeAws_json1_1UpdateWorkgroupCommand = async ( input: UpdateWorkgroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RedshiftServerless.UpdateWorkgroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWorkgroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWorkgroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4214,6 +4094,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `RedshiftServerless.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-redshift/src/protocols/Aws_query.ts b/clients/client-redshift/src/protocols/Aws_query.ts index dbef58ff7ed1a..c2f36037ac418 100644 --- a/clients/client-redshift/src/protocols/Aws_query.ts +++ b/clients/client-redshift/src/protocols/Aws_query.ts @@ -825,9 +825,7 @@ export const serializeAws_queryAcceptReservedNodeExchangeCommand = async ( input: AcceptReservedNodeExchangeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAcceptReservedNodeExchangeInputMessage(input, context), @@ -841,9 +839,7 @@ export const serializeAws_queryAddPartnerCommand = async ( input: AddPartnerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPartnerIntegrationInputMessage(input, context), @@ -857,9 +853,7 @@ export const serializeAws_queryAssociateDataShareConsumerCommand = async ( input: AssociateDataShareConsumerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAssociateDataShareConsumerMessage(input, context), @@ -873,9 +867,7 @@ export const serializeAws_queryAuthorizeClusterSecurityGroupIngressCommand = asy input: AuthorizeClusterSecurityGroupIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAuthorizeClusterSecurityGroupIngressMessage(input, context), @@ -889,9 +881,7 @@ export const serializeAws_queryAuthorizeDataShareCommand = async ( input: AuthorizeDataShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAuthorizeDataShareMessage(input, context), @@ -905,9 +895,7 @@ export const serializeAws_queryAuthorizeEndpointAccessCommand = async ( input: AuthorizeEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAuthorizeEndpointAccessMessage(input, context), @@ -921,9 +909,7 @@ export const serializeAws_queryAuthorizeSnapshotAccessCommand = async ( input: AuthorizeSnapshotAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAuthorizeSnapshotAccessMessage(input, context), @@ -937,9 +923,7 @@ export const serializeAws_queryBatchDeleteClusterSnapshotsCommand = async ( input: BatchDeleteClusterSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryBatchDeleteClusterSnapshotsRequest(input, context), @@ -953,9 +937,7 @@ export const serializeAws_queryBatchModifyClusterSnapshotsCommand = async ( input: BatchModifyClusterSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryBatchModifyClusterSnapshotsMessage(input, context), @@ -969,9 +951,7 @@ export const serializeAws_queryCancelResizeCommand = async ( input: CancelResizeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCancelResizeMessage(input, context), @@ -985,9 +965,7 @@ export const serializeAws_queryCopyClusterSnapshotCommand = async ( input: CopyClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCopyClusterSnapshotMessage(input, context), @@ -1001,9 +979,7 @@ export const serializeAws_queryCreateAuthenticationProfileCommand = async ( input: CreateAuthenticationProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateAuthenticationProfileMessage(input, context), @@ -1017,9 +993,7 @@ export const serializeAws_queryCreateClusterCommand = async ( input: CreateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateClusterMessage(input, context), @@ -1033,9 +1007,7 @@ export const serializeAws_queryCreateClusterParameterGroupCommand = async ( input: CreateClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateClusterParameterGroupMessage(input, context), @@ -1049,9 +1021,7 @@ export const serializeAws_queryCreateClusterSecurityGroupCommand = async ( input: CreateClusterSecurityGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateClusterSecurityGroupMessage(input, context), @@ -1065,9 +1035,7 @@ export const serializeAws_queryCreateClusterSnapshotCommand = async ( input: CreateClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateClusterSnapshotMessage(input, context), @@ -1081,9 +1049,7 @@ export const serializeAws_queryCreateClusterSubnetGroupCommand = async ( input: CreateClusterSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateClusterSubnetGroupMessage(input, context), @@ -1097,9 +1063,7 @@ export const serializeAws_queryCreateEndpointAccessCommand = async ( input: CreateEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateEndpointAccessMessage(input, context), @@ -1113,9 +1077,7 @@ export const serializeAws_queryCreateEventSubscriptionCommand = async ( input: CreateEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateEventSubscriptionMessage(input, context), @@ -1129,9 +1091,7 @@ export const serializeAws_queryCreateHsmClientCertificateCommand = async ( input: CreateHsmClientCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateHsmClientCertificateMessage(input, context), @@ -1145,9 +1105,7 @@ export const serializeAws_queryCreateHsmConfigurationCommand = async ( input: CreateHsmConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateHsmConfigurationMessage(input, context), @@ -1161,9 +1119,7 @@ export const serializeAws_queryCreateScheduledActionCommand = async ( input: CreateScheduledActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateScheduledActionMessage(input, context), @@ -1177,9 +1133,7 @@ export const serializeAws_queryCreateSnapshotCopyGrantCommand = async ( input: CreateSnapshotCopyGrantCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateSnapshotCopyGrantMessage(input, context), @@ -1193,9 +1147,7 @@ export const serializeAws_queryCreateSnapshotScheduleCommand = async ( input: CreateSnapshotScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateSnapshotScheduleMessage(input, context), @@ -1209,9 +1161,7 @@ export const serializeAws_queryCreateTagsCommand = async ( input: CreateTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateTagsMessage(input, context), @@ -1225,9 +1175,7 @@ export const serializeAws_queryCreateUsageLimitCommand = async ( input: CreateUsageLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateUsageLimitMessage(input, context), @@ -1241,9 +1189,7 @@ export const serializeAws_queryDeauthorizeDataShareCommand = async ( input: DeauthorizeDataShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeauthorizeDataShareMessage(input, context), @@ -1257,9 +1203,7 @@ export const serializeAws_queryDeleteAuthenticationProfileCommand = async ( input: DeleteAuthenticationProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteAuthenticationProfileMessage(input, context), @@ -1273,9 +1217,7 @@ export const serializeAws_queryDeleteClusterCommand = async ( input: DeleteClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteClusterMessage(input, context), @@ -1289,9 +1231,7 @@ export const serializeAws_queryDeleteClusterParameterGroupCommand = async ( input: DeleteClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteClusterParameterGroupMessage(input, context), @@ -1305,9 +1245,7 @@ export const serializeAws_queryDeleteClusterSecurityGroupCommand = async ( input: DeleteClusterSecurityGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteClusterSecurityGroupMessage(input, context), @@ -1321,9 +1259,7 @@ export const serializeAws_queryDeleteClusterSnapshotCommand = async ( input: DeleteClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteClusterSnapshotMessage(input, context), @@ -1337,9 +1273,7 @@ export const serializeAws_queryDeleteClusterSubnetGroupCommand = async ( input: DeleteClusterSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteClusterSubnetGroupMessage(input, context), @@ -1353,9 +1287,7 @@ export const serializeAws_queryDeleteEndpointAccessCommand = async ( input: DeleteEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteEndpointAccessMessage(input, context), @@ -1369,9 +1301,7 @@ export const serializeAws_queryDeleteEventSubscriptionCommand = async ( input: DeleteEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteEventSubscriptionMessage(input, context), @@ -1385,9 +1315,7 @@ export const serializeAws_queryDeleteHsmClientCertificateCommand = async ( input: DeleteHsmClientCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteHsmClientCertificateMessage(input, context), @@ -1401,9 +1329,7 @@ export const serializeAws_queryDeleteHsmConfigurationCommand = async ( input: DeleteHsmConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteHsmConfigurationMessage(input, context), @@ -1417,9 +1343,7 @@ export const serializeAws_queryDeletePartnerCommand = async ( input: DeletePartnerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPartnerIntegrationInputMessage(input, context), @@ -1433,9 +1357,7 @@ export const serializeAws_queryDeleteScheduledActionCommand = async ( input: DeleteScheduledActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteScheduledActionMessage(input, context), @@ -1449,9 +1371,7 @@ export const serializeAws_queryDeleteSnapshotCopyGrantCommand = async ( input: DeleteSnapshotCopyGrantCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteSnapshotCopyGrantMessage(input, context), @@ -1465,9 +1385,7 @@ export const serializeAws_queryDeleteSnapshotScheduleCommand = async ( input: DeleteSnapshotScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteSnapshotScheduleMessage(input, context), @@ -1481,9 +1399,7 @@ export const serializeAws_queryDeleteTagsCommand = async ( input: DeleteTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteTagsMessage(input, context), @@ -1497,9 +1413,7 @@ export const serializeAws_queryDeleteUsageLimitCommand = async ( input: DeleteUsageLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteUsageLimitMessage(input, context), @@ -1513,9 +1427,7 @@ export const serializeAws_queryDescribeAccountAttributesCommand = async ( input: DescribeAccountAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAccountAttributesMessage(input, context), @@ -1529,9 +1441,7 @@ export const serializeAws_queryDescribeAuthenticationProfilesCommand = async ( input: DescribeAuthenticationProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeAuthenticationProfilesMessage(input, context), @@ -1545,9 +1455,7 @@ export const serializeAws_queryDescribeClusterDbRevisionsCommand = async ( input: DescribeClusterDbRevisionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeClusterDbRevisionsMessage(input, context), @@ -1561,9 +1469,7 @@ export const serializeAws_queryDescribeClusterParameterGroupsCommand = async ( input: DescribeClusterParameterGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeClusterParameterGroupsMessage(input, context), @@ -1577,9 +1483,7 @@ export const serializeAws_queryDescribeClusterParametersCommand = async ( input: DescribeClusterParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeClusterParametersMessage(input, context), @@ -1593,9 +1497,7 @@ export const serializeAws_queryDescribeClustersCommand = async ( input: DescribeClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeClustersMessage(input, context), @@ -1609,9 +1511,7 @@ export const serializeAws_queryDescribeClusterSecurityGroupsCommand = async ( input: DescribeClusterSecurityGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeClusterSecurityGroupsMessage(input, context), @@ -1625,9 +1525,7 @@ export const serializeAws_queryDescribeClusterSnapshotsCommand = async ( input: DescribeClusterSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeClusterSnapshotsMessage(input, context), @@ -1641,9 +1539,7 @@ export const serializeAws_queryDescribeClusterSubnetGroupsCommand = async ( input: DescribeClusterSubnetGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeClusterSubnetGroupsMessage(input, context), @@ -1657,9 +1553,7 @@ export const serializeAws_queryDescribeClusterTracksCommand = async ( input: DescribeClusterTracksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeClusterTracksMessage(input, context), @@ -1673,9 +1567,7 @@ export const serializeAws_queryDescribeClusterVersionsCommand = async ( input: DescribeClusterVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeClusterVersionsMessage(input, context), @@ -1689,9 +1581,7 @@ export const serializeAws_queryDescribeDataSharesCommand = async ( input: DescribeDataSharesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDataSharesMessage(input, context), @@ -1705,9 +1595,7 @@ export const serializeAws_queryDescribeDataSharesForConsumerCommand = async ( input: DescribeDataSharesForConsumerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDataSharesForConsumerMessage(input, context), @@ -1721,9 +1609,7 @@ export const serializeAws_queryDescribeDataSharesForProducerCommand = async ( input: DescribeDataSharesForProducerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDataSharesForProducerMessage(input, context), @@ -1737,9 +1623,7 @@ export const serializeAws_queryDescribeDefaultClusterParametersCommand = async ( input: DescribeDefaultClusterParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeDefaultClusterParametersMessage(input, context), @@ -1753,9 +1637,7 @@ export const serializeAws_queryDescribeEndpointAccessCommand = async ( input: DescribeEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEndpointAccessMessage(input, context), @@ -1769,9 +1651,7 @@ export const serializeAws_queryDescribeEndpointAuthorizationCommand = async ( input: DescribeEndpointAuthorizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEndpointAuthorizationMessage(input, context), @@ -1785,9 +1665,7 @@ export const serializeAws_queryDescribeEventCategoriesCommand = async ( input: DescribeEventCategoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventCategoriesMessage(input, context), @@ -1801,9 +1679,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( input: DescribeEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventsMessage(input, context), @@ -1817,9 +1693,7 @@ export const serializeAws_queryDescribeEventSubscriptionsCommand = async ( input: DescribeEventSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeEventSubscriptionsMessage(input, context), @@ -1833,9 +1707,7 @@ export const serializeAws_queryDescribeHsmClientCertificatesCommand = async ( input: DescribeHsmClientCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeHsmClientCertificatesMessage(input, context), @@ -1849,9 +1721,7 @@ export const serializeAws_queryDescribeHsmConfigurationsCommand = async ( input: DescribeHsmConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeHsmConfigurationsMessage(input, context), @@ -1865,9 +1735,7 @@ export const serializeAws_queryDescribeLoggingStatusCommand = async ( input: DescribeLoggingStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeLoggingStatusMessage(input, context), @@ -1881,9 +1749,7 @@ export const serializeAws_queryDescribeNodeConfigurationOptionsCommand = async ( input: DescribeNodeConfigurationOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeNodeConfigurationOptionsMessage(input, context), @@ -1897,9 +1763,7 @@ export const serializeAws_queryDescribeOrderableClusterOptionsCommand = async ( input: DescribeOrderableClusterOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeOrderableClusterOptionsMessage(input, context), @@ -1913,9 +1777,7 @@ export const serializeAws_queryDescribePartnersCommand = async ( input: DescribePartnersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribePartnersInputMessage(input, context), @@ -1929,9 +1791,7 @@ export const serializeAws_queryDescribeReservedNodeExchangeStatusCommand = async input: DescribeReservedNodeExchangeStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeReservedNodeExchangeStatusInputMessage(input, context), @@ -1945,9 +1805,7 @@ export const serializeAws_queryDescribeReservedNodeOfferingsCommand = async ( input: DescribeReservedNodeOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeReservedNodeOfferingsMessage(input, context), @@ -1961,9 +1819,7 @@ export const serializeAws_queryDescribeReservedNodesCommand = async ( input: DescribeReservedNodesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeReservedNodesMessage(input, context), @@ -1977,9 +1833,7 @@ export const serializeAws_queryDescribeResizeCommand = async ( input: DescribeResizeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeResizeMessage(input, context), @@ -1993,9 +1847,7 @@ export const serializeAws_queryDescribeScheduledActionsCommand = async ( input: DescribeScheduledActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeScheduledActionsMessage(input, context), @@ -2009,9 +1861,7 @@ export const serializeAws_queryDescribeSnapshotCopyGrantsCommand = async ( input: DescribeSnapshotCopyGrantsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeSnapshotCopyGrantsMessage(input, context), @@ -2025,9 +1875,7 @@ export const serializeAws_queryDescribeSnapshotSchedulesCommand = async ( input: DescribeSnapshotSchedulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeSnapshotSchedulesMessage(input, context), @@ -2041,9 +1889,7 @@ export const serializeAws_queryDescribeStorageCommand = async ( input: DescribeStorageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DescribeStorage", Version: "2012-12-01", @@ -2055,9 +1901,7 @@ export const serializeAws_queryDescribeTableRestoreStatusCommand = async ( input: DescribeTableRestoreStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTableRestoreStatusMessage(input, context), @@ -2071,9 +1915,7 @@ export const serializeAws_queryDescribeTagsCommand = async ( input: DescribeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeTagsMessage(input, context), @@ -2087,9 +1929,7 @@ export const serializeAws_queryDescribeUsageLimitsCommand = async ( input: DescribeUsageLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeUsageLimitsMessage(input, context), @@ -2103,9 +1943,7 @@ export const serializeAws_queryDisableLoggingCommand = async ( input: DisableLoggingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDisableLoggingMessage(input, context), @@ -2119,9 +1957,7 @@ export const serializeAws_queryDisableSnapshotCopyCommand = async ( input: DisableSnapshotCopyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDisableSnapshotCopyMessage(input, context), @@ -2135,9 +1971,7 @@ export const serializeAws_queryDisassociateDataShareConsumerCommand = async ( input: DisassociateDataShareConsumerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDisassociateDataShareConsumerMessage(input, context), @@ -2151,9 +1985,7 @@ export const serializeAws_queryEnableLoggingCommand = async ( input: EnableLoggingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryEnableLoggingMessage(input, context), @@ -2167,9 +1999,7 @@ export const serializeAws_queryEnableSnapshotCopyCommand = async ( input: EnableSnapshotCopyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryEnableSnapshotCopyMessage(input, context), @@ -2183,9 +2013,7 @@ export const serializeAws_queryGetClusterCredentialsCommand = async ( input: GetClusterCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetClusterCredentialsMessage(input, context), @@ -2199,9 +2027,7 @@ export const serializeAws_queryGetClusterCredentialsWithIAMCommand = async ( input: GetClusterCredentialsWithIAMCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetClusterCredentialsWithIAMMessage(input, context), @@ -2215,9 +2041,7 @@ export const serializeAws_queryGetReservedNodeExchangeConfigurationOptionsComman input: GetReservedNodeExchangeConfigurationOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetReservedNodeExchangeConfigurationOptionsInputMessage(input, context), @@ -2231,9 +2055,7 @@ export const serializeAws_queryGetReservedNodeExchangeOfferingsCommand = async ( input: GetReservedNodeExchangeOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetReservedNodeExchangeOfferingsInputMessage(input, context), @@ -2247,9 +2069,7 @@ export const serializeAws_queryModifyAquaConfigurationCommand = async ( input: ModifyAquaConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyAquaInputMessage(input, context), @@ -2263,9 +2083,7 @@ export const serializeAws_queryModifyAuthenticationProfileCommand = async ( input: ModifyAuthenticationProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyAuthenticationProfileMessage(input, context), @@ -2279,9 +2097,7 @@ export const serializeAws_queryModifyClusterCommand = async ( input: ModifyClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyClusterMessage(input, context), @@ -2295,9 +2111,7 @@ export const serializeAws_queryModifyClusterDbRevisionCommand = async ( input: ModifyClusterDbRevisionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyClusterDbRevisionMessage(input, context), @@ -2311,9 +2125,7 @@ export const serializeAws_queryModifyClusterIamRolesCommand = async ( input: ModifyClusterIamRolesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyClusterIamRolesMessage(input, context), @@ -2327,9 +2139,7 @@ export const serializeAws_queryModifyClusterMaintenanceCommand = async ( input: ModifyClusterMaintenanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyClusterMaintenanceMessage(input, context), @@ -2343,9 +2153,7 @@ export const serializeAws_queryModifyClusterParameterGroupCommand = async ( input: ModifyClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyClusterParameterGroupMessage(input, context), @@ -2359,9 +2167,7 @@ export const serializeAws_queryModifyClusterSnapshotCommand = async ( input: ModifyClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyClusterSnapshotMessage(input, context), @@ -2375,9 +2181,7 @@ export const serializeAws_queryModifyClusterSnapshotScheduleCommand = async ( input: ModifyClusterSnapshotScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyClusterSnapshotScheduleMessage(input, context), @@ -2391,9 +2195,7 @@ export const serializeAws_queryModifyClusterSubnetGroupCommand = async ( input: ModifyClusterSubnetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyClusterSubnetGroupMessage(input, context), @@ -2407,9 +2209,7 @@ export const serializeAws_queryModifyEndpointAccessCommand = async ( input: ModifyEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyEndpointAccessMessage(input, context), @@ -2423,9 +2223,7 @@ export const serializeAws_queryModifyEventSubscriptionCommand = async ( input: ModifyEventSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyEventSubscriptionMessage(input, context), @@ -2439,9 +2237,7 @@ export const serializeAws_queryModifyScheduledActionCommand = async ( input: ModifyScheduledActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyScheduledActionMessage(input, context), @@ -2455,9 +2251,7 @@ export const serializeAws_queryModifySnapshotCopyRetentionPeriodCommand = async input: ModifySnapshotCopyRetentionPeriodCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifySnapshotCopyRetentionPeriodMessage(input, context), @@ -2471,9 +2265,7 @@ export const serializeAws_queryModifySnapshotScheduleCommand = async ( input: ModifySnapshotScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifySnapshotScheduleMessage(input, context), @@ -2487,9 +2279,7 @@ export const serializeAws_queryModifyUsageLimitCommand = async ( input: ModifyUsageLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryModifyUsageLimitMessage(input, context), @@ -2503,9 +2293,7 @@ export const serializeAws_queryPauseClusterCommand = async ( input: PauseClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPauseClusterMessage(input, context), @@ -2519,9 +2307,7 @@ export const serializeAws_queryPurchaseReservedNodeOfferingCommand = async ( input: PurchaseReservedNodeOfferingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPurchaseReservedNodeOfferingMessage(input, context), @@ -2535,9 +2321,7 @@ export const serializeAws_queryRebootClusterCommand = async ( input: RebootClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRebootClusterMessage(input, context), @@ -2551,9 +2335,7 @@ export const serializeAws_queryRejectDataShareCommand = async ( input: RejectDataShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRejectDataShareMessage(input, context), @@ -2567,9 +2349,7 @@ export const serializeAws_queryResetClusterParameterGroupCommand = async ( input: ResetClusterParameterGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResetClusterParameterGroupMessage(input, context), @@ -2583,9 +2363,7 @@ export const serializeAws_queryResizeClusterCommand = async ( input: ResizeClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResizeClusterMessage(input, context), @@ -2599,9 +2377,7 @@ export const serializeAws_queryRestoreFromClusterSnapshotCommand = async ( input: RestoreFromClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreFromClusterSnapshotMessage(input, context), @@ -2615,9 +2391,7 @@ export const serializeAws_queryRestoreTableFromClusterSnapshotCommand = async ( input: RestoreTableFromClusterSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRestoreTableFromClusterSnapshotMessage(input, context), @@ -2631,9 +2405,7 @@ export const serializeAws_queryResumeClusterCommand = async ( input: ResumeClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryResumeClusterMessage(input, context), @@ -2647,9 +2419,7 @@ export const serializeAws_queryRevokeClusterSecurityGroupIngressCommand = async input: RevokeClusterSecurityGroupIngressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRevokeClusterSecurityGroupIngressMessage(input, context), @@ -2663,9 +2433,7 @@ export const serializeAws_queryRevokeEndpointAccessCommand = async ( input: RevokeEndpointAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRevokeEndpointAccessMessage(input, context), @@ -2679,9 +2447,7 @@ export const serializeAws_queryRevokeSnapshotAccessCommand = async ( input: RevokeSnapshotAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRevokeSnapshotAccessMessage(input, context), @@ -2695,9 +2461,7 @@ export const serializeAws_queryRotateEncryptionKeyCommand = async ( input: RotateEncryptionKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRotateEncryptionKeyMessage(input, context), @@ -2711,9 +2475,7 @@ export const serializeAws_queryUpdatePartnerStatusCommand = async ( input: UpdatePartnerStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdatePartnerStatusInputMessage(input, context), @@ -18668,6 +18430,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-rekognition/src/protocols/Aws_json1_1.ts b/clients/client-rekognition/src/protocols/Aws_json1_1.ts index e7ce0901ae9ed..806466710b1fa 100644 --- a/clients/client-rekognition/src/protocols/Aws_json1_1.ts +++ b/clients/client-rekognition/src/protocols/Aws_json1_1.ts @@ -443,10 +443,7 @@ export const serializeAws_json1_1CompareFacesCommand = async ( input: CompareFacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.CompareFaces", - }; + const headers: __HeaderBag = sharedHeaders("CompareFaces"); let body: any; body = JSON.stringify(serializeAws_json1_1CompareFacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -456,10 +453,7 @@ export const serializeAws_json1_1CopyProjectVersionCommand = async ( input: CopyProjectVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.CopyProjectVersion", - }; + const headers: __HeaderBag = sharedHeaders("CopyProjectVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1CopyProjectVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -469,10 +463,7 @@ export const serializeAws_json1_1CreateCollectionCommand = async ( input: CreateCollectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.CreateCollection", - }; + const headers: __HeaderBag = sharedHeaders("CreateCollection"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCollectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -482,10 +473,7 @@ export const serializeAws_json1_1CreateDatasetCommand = async ( input: CreateDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.CreateDataset", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -495,10 +483,7 @@ export const serializeAws_json1_1CreateProjectCommand = async ( input: CreateProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.CreateProject", - }; + const headers: __HeaderBag = sharedHeaders("CreateProject"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -508,10 +493,7 @@ export const serializeAws_json1_1CreateProjectVersionCommand = async ( input: CreateProjectVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.CreateProjectVersion", - }; + const headers: __HeaderBag = sharedHeaders("CreateProjectVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProjectVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -521,10 +503,7 @@ export const serializeAws_json1_1CreateStreamProcessorCommand = async ( input: CreateStreamProcessorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.CreateStreamProcessor", - }; + const headers: __HeaderBag = sharedHeaders("CreateStreamProcessor"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStreamProcessorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -534,10 +513,7 @@ export const serializeAws_json1_1DeleteCollectionCommand = async ( input: DeleteCollectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DeleteCollection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCollection"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCollectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -547,10 +523,7 @@ export const serializeAws_json1_1DeleteDatasetCommand = async ( input: DeleteDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DeleteDataset", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -560,10 +533,7 @@ export const serializeAws_json1_1DeleteFacesCommand = async ( input: DeleteFacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DeleteFaces", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFaces"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -573,10 +543,7 @@ export const serializeAws_json1_1DeleteProjectCommand = async ( input: DeleteProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DeleteProject", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProject"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProjectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -586,10 +553,7 @@ export const serializeAws_json1_1DeleteProjectPolicyCommand = async ( input: DeleteProjectPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DeleteProjectPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProjectPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProjectPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -599,10 +563,7 @@ export const serializeAws_json1_1DeleteProjectVersionCommand = async ( input: DeleteProjectVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DeleteProjectVersion", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProjectVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProjectVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -612,10 +573,7 @@ export const serializeAws_json1_1DeleteStreamProcessorCommand = async ( input: DeleteStreamProcessorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DeleteStreamProcessor", - }; + const headers: __HeaderBag = sharedHeaders("DeleteStreamProcessor"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteStreamProcessorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -625,10 +583,7 @@ export const serializeAws_json1_1DescribeCollectionCommand = async ( input: DescribeCollectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DescribeCollection", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCollection"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCollectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -638,10 +593,7 @@ export const serializeAws_json1_1DescribeDatasetCommand = async ( input: DescribeDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DescribeDataset", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataset"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDatasetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -651,10 +603,7 @@ export const serializeAws_json1_1DescribeProjectsCommand = async ( input: DescribeProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DescribeProjects", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProjects"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProjectsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -664,10 +613,7 @@ export const serializeAws_json1_1DescribeProjectVersionsCommand = async ( input: DescribeProjectVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DescribeProjectVersions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProjectVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProjectVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -677,10 +623,7 @@ export const serializeAws_json1_1DescribeStreamProcessorCommand = async ( input: DescribeStreamProcessorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DescribeStreamProcessor", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStreamProcessor"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStreamProcessorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -690,10 +633,7 @@ export const serializeAws_json1_1DetectCustomLabelsCommand = async ( input: DetectCustomLabelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DetectCustomLabels", - }; + const headers: __HeaderBag = sharedHeaders("DetectCustomLabels"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectCustomLabelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -703,10 +643,7 @@ export const serializeAws_json1_1DetectFacesCommand = async ( input: DetectFacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DetectFaces", - }; + const headers: __HeaderBag = sharedHeaders("DetectFaces"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectFacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -716,10 +653,7 @@ export const serializeAws_json1_1DetectLabelsCommand = async ( input: DetectLabelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DetectLabels", - }; + const headers: __HeaderBag = sharedHeaders("DetectLabels"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectLabelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -729,10 +663,7 @@ export const serializeAws_json1_1DetectModerationLabelsCommand = async ( input: DetectModerationLabelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DetectModerationLabels", - }; + const headers: __HeaderBag = sharedHeaders("DetectModerationLabels"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectModerationLabelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -742,10 +673,7 @@ export const serializeAws_json1_1DetectProtectiveEquipmentCommand = async ( input: DetectProtectiveEquipmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DetectProtectiveEquipment", - }; + const headers: __HeaderBag = sharedHeaders("DetectProtectiveEquipment"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectProtectiveEquipmentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -755,10 +683,7 @@ export const serializeAws_json1_1DetectTextCommand = async ( input: DetectTextCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DetectText", - }; + const headers: __HeaderBag = sharedHeaders("DetectText"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectTextRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -768,10 +693,7 @@ export const serializeAws_json1_1DistributeDatasetEntriesCommand = async ( input: DistributeDatasetEntriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.DistributeDatasetEntries", - }; + const headers: __HeaderBag = sharedHeaders("DistributeDatasetEntries"); let body: any; body = JSON.stringify(serializeAws_json1_1DistributeDatasetEntriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -781,10 +703,7 @@ export const serializeAws_json1_1GetCelebrityInfoCommand = async ( input: GetCelebrityInfoCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.GetCelebrityInfo", - }; + const headers: __HeaderBag = sharedHeaders("GetCelebrityInfo"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCelebrityInfoRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -794,10 +713,7 @@ export const serializeAws_json1_1GetCelebrityRecognitionCommand = async ( input: GetCelebrityRecognitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.GetCelebrityRecognition", - }; + const headers: __HeaderBag = sharedHeaders("GetCelebrityRecognition"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCelebrityRecognitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -807,10 +723,7 @@ export const serializeAws_json1_1GetContentModerationCommand = async ( input: GetContentModerationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.GetContentModeration", - }; + const headers: __HeaderBag = sharedHeaders("GetContentModeration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContentModerationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -820,10 +733,7 @@ export const serializeAws_json1_1GetFaceDetectionCommand = async ( input: GetFaceDetectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.GetFaceDetection", - }; + const headers: __HeaderBag = sharedHeaders("GetFaceDetection"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFaceDetectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -833,10 +743,7 @@ export const serializeAws_json1_1GetFaceSearchCommand = async ( input: GetFaceSearchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.GetFaceSearch", - }; + const headers: __HeaderBag = sharedHeaders("GetFaceSearch"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFaceSearchRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -846,10 +753,7 @@ export const serializeAws_json1_1GetLabelDetectionCommand = async ( input: GetLabelDetectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.GetLabelDetection", - }; + const headers: __HeaderBag = sharedHeaders("GetLabelDetection"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLabelDetectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -859,10 +763,7 @@ export const serializeAws_json1_1GetPersonTrackingCommand = async ( input: GetPersonTrackingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.GetPersonTracking", - }; + const headers: __HeaderBag = sharedHeaders("GetPersonTracking"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPersonTrackingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -872,10 +773,7 @@ export const serializeAws_json1_1GetSegmentDetectionCommand = async ( input: GetSegmentDetectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.GetSegmentDetection", - }; + const headers: __HeaderBag = sharedHeaders("GetSegmentDetection"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSegmentDetectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -885,10 +783,7 @@ export const serializeAws_json1_1GetTextDetectionCommand = async ( input: GetTextDetectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.GetTextDetection", - }; + const headers: __HeaderBag = sharedHeaders("GetTextDetection"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTextDetectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -898,10 +793,7 @@ export const serializeAws_json1_1IndexFacesCommand = async ( input: IndexFacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.IndexFaces", - }; + const headers: __HeaderBag = sharedHeaders("IndexFaces"); let body: any; body = JSON.stringify(serializeAws_json1_1IndexFacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -911,10 +803,7 @@ export const serializeAws_json1_1ListCollectionsCommand = async ( input: ListCollectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.ListCollections", - }; + const headers: __HeaderBag = sharedHeaders("ListCollections"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCollectionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -924,10 +813,7 @@ export const serializeAws_json1_1ListDatasetEntriesCommand = async ( input: ListDatasetEntriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.ListDatasetEntries", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasetEntries"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatasetEntriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -937,10 +823,7 @@ export const serializeAws_json1_1ListDatasetLabelsCommand = async ( input: ListDatasetLabelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.ListDatasetLabels", - }; + const headers: __HeaderBag = sharedHeaders("ListDatasetLabels"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDatasetLabelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -950,10 +833,7 @@ export const serializeAws_json1_1ListFacesCommand = async ( input: ListFacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.ListFaces", - }; + const headers: __HeaderBag = sharedHeaders("ListFaces"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -963,10 +843,7 @@ export const serializeAws_json1_1ListProjectPoliciesCommand = async ( input: ListProjectPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.ListProjectPolicies", - }; + const headers: __HeaderBag = sharedHeaders("ListProjectPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProjectPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -976,10 +853,7 @@ export const serializeAws_json1_1ListStreamProcessorsCommand = async ( input: ListStreamProcessorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.ListStreamProcessors", - }; + const headers: __HeaderBag = sharedHeaders("ListStreamProcessors"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStreamProcessorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -989,10 +863,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1002,10 +873,7 @@ export const serializeAws_json1_1PutProjectPolicyCommand = async ( input: PutProjectPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.PutProjectPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutProjectPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutProjectPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1015,10 +883,7 @@ export const serializeAws_json1_1RecognizeCelebritiesCommand = async ( input: RecognizeCelebritiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.RecognizeCelebrities", - }; + const headers: __HeaderBag = sharedHeaders("RecognizeCelebrities"); let body: any; body = JSON.stringify(serializeAws_json1_1RecognizeCelebritiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1028,10 +893,7 @@ export const serializeAws_json1_1SearchFacesCommand = async ( input: SearchFacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.SearchFaces", - }; + const headers: __HeaderBag = sharedHeaders("SearchFaces"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchFacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1041,10 +903,7 @@ export const serializeAws_json1_1SearchFacesByImageCommand = async ( input: SearchFacesByImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.SearchFacesByImage", - }; + const headers: __HeaderBag = sharedHeaders("SearchFacesByImage"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchFacesByImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1054,10 +913,7 @@ export const serializeAws_json1_1StartCelebrityRecognitionCommand = async ( input: StartCelebrityRecognitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StartCelebrityRecognition", - }; + const headers: __HeaderBag = sharedHeaders("StartCelebrityRecognition"); let body: any; body = JSON.stringify(serializeAws_json1_1StartCelebrityRecognitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1067,10 +923,7 @@ export const serializeAws_json1_1StartContentModerationCommand = async ( input: StartContentModerationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StartContentModeration", - }; + const headers: __HeaderBag = sharedHeaders("StartContentModeration"); let body: any; body = JSON.stringify(serializeAws_json1_1StartContentModerationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1080,10 +933,7 @@ export const serializeAws_json1_1StartFaceDetectionCommand = async ( input: StartFaceDetectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StartFaceDetection", - }; + const headers: __HeaderBag = sharedHeaders("StartFaceDetection"); let body: any; body = JSON.stringify(serializeAws_json1_1StartFaceDetectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1093,10 +943,7 @@ export const serializeAws_json1_1StartFaceSearchCommand = async ( input: StartFaceSearchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StartFaceSearch", - }; + const headers: __HeaderBag = sharedHeaders("StartFaceSearch"); let body: any; body = JSON.stringify(serializeAws_json1_1StartFaceSearchRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1106,10 +953,7 @@ export const serializeAws_json1_1StartLabelDetectionCommand = async ( input: StartLabelDetectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StartLabelDetection", - }; + const headers: __HeaderBag = sharedHeaders("StartLabelDetection"); let body: any; body = JSON.stringify(serializeAws_json1_1StartLabelDetectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1119,10 +963,7 @@ export const serializeAws_json1_1StartPersonTrackingCommand = async ( input: StartPersonTrackingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StartPersonTracking", - }; + const headers: __HeaderBag = sharedHeaders("StartPersonTracking"); let body: any; body = JSON.stringify(serializeAws_json1_1StartPersonTrackingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1132,10 +973,7 @@ export const serializeAws_json1_1StartProjectVersionCommand = async ( input: StartProjectVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StartProjectVersion", - }; + const headers: __HeaderBag = sharedHeaders("StartProjectVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1StartProjectVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1145,10 +983,7 @@ export const serializeAws_json1_1StartSegmentDetectionCommand = async ( input: StartSegmentDetectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StartSegmentDetection", - }; + const headers: __HeaderBag = sharedHeaders("StartSegmentDetection"); let body: any; body = JSON.stringify(serializeAws_json1_1StartSegmentDetectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1158,10 +993,7 @@ export const serializeAws_json1_1StartStreamProcessorCommand = async ( input: StartStreamProcessorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StartStreamProcessor", - }; + const headers: __HeaderBag = sharedHeaders("StartStreamProcessor"); let body: any; body = JSON.stringify(serializeAws_json1_1StartStreamProcessorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1171,10 +1003,7 @@ export const serializeAws_json1_1StartTextDetectionCommand = async ( input: StartTextDetectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StartTextDetection", - }; + const headers: __HeaderBag = sharedHeaders("StartTextDetection"); let body: any; body = JSON.stringify(serializeAws_json1_1StartTextDetectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1184,10 +1013,7 @@ export const serializeAws_json1_1StopProjectVersionCommand = async ( input: StopProjectVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StopProjectVersion", - }; + const headers: __HeaderBag = sharedHeaders("StopProjectVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1StopProjectVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1197,10 +1023,7 @@ export const serializeAws_json1_1StopStreamProcessorCommand = async ( input: StopStreamProcessorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.StopStreamProcessor", - }; + const headers: __HeaderBag = sharedHeaders("StopStreamProcessor"); let body: any; body = JSON.stringify(serializeAws_json1_1StopStreamProcessorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1210,10 +1033,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1223,10 +1043,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1236,10 +1053,7 @@ export const serializeAws_json1_1UpdateDatasetEntriesCommand = async ( input: UpdateDatasetEntriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.UpdateDatasetEntries", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDatasetEntries"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDatasetEntriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1249,10 +1063,7 @@ export const serializeAws_json1_1UpdateStreamProcessorCommand = async ( input: UpdateStreamProcessorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "RekognitionService.UpdateStreamProcessor", - }; + const headers: __HeaderBag = sharedHeaders("UpdateStreamProcessor"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateStreamProcessorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -9084,6 +8895,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `RekognitionService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts index 818dbcf5d44ba..e898ed3f07656 100644 --- a/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts +++ b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts @@ -69,10 +69,7 @@ export const serializeAws_json1_1DescribeReportCreationCommand = async ( input: DescribeReportCreationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ResourceGroupsTaggingAPI_20170126.DescribeReportCreation", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReportCreation"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReportCreationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -82,10 +79,7 @@ export const serializeAws_json1_1GetComplianceSummaryCommand = async ( input: GetComplianceSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetComplianceSummary", - }; + const headers: __HeaderBag = sharedHeaders("GetComplianceSummary"); let body: any; body = JSON.stringify(serializeAws_json1_1GetComplianceSummaryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -95,10 +89,7 @@ export const serializeAws_json1_1GetResourcesCommand = async ( input: GetResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetResources", - }; + const headers: __HeaderBag = sharedHeaders("GetResources"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourcesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -108,10 +99,7 @@ export const serializeAws_json1_1GetTagKeysCommand = async ( input: GetTagKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetTagKeys", - }; + const headers: __HeaderBag = sharedHeaders("GetTagKeys"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTagKeysInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -121,10 +109,7 @@ export const serializeAws_json1_1GetTagValuesCommand = async ( input: GetTagValuesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetTagValues", - }; + const headers: __HeaderBag = sharedHeaders("GetTagValues"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTagValuesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -134,10 +119,7 @@ export const serializeAws_json1_1StartReportCreationCommand = async ( input: StartReportCreationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ResourceGroupsTaggingAPI_20170126.StartReportCreation", - }; + const headers: __HeaderBag = sharedHeaders("StartReportCreation"); let body: any; body = JSON.stringify(serializeAws_json1_1StartReportCreationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -147,10 +129,7 @@ export const serializeAws_json1_1TagResourcesCommand = async ( input: TagResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ResourceGroupsTaggingAPI_20170126.TagResources", - }; + const headers: __HeaderBag = sharedHeaders("TagResources"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourcesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -160,10 +139,7 @@ export const serializeAws_json1_1UntagResourcesCommand = async ( input: UntagResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ResourceGroupsTaggingAPI_20170126.UntagResources", - }; + const headers: __HeaderBag = sharedHeaders("UntagResources"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourcesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1118,6 +1094,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `ResourceGroupsTaggingAPI_20170126.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts index 91b8f2179e7c7..d42422fdf2461 100644 --- a/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts +++ b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts @@ -218,10 +218,7 @@ export const serializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountComman input: AcceptDomainTransferFromAnotherAwsAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.AcceptDomainTransferFromAnotherAwsAccount", - }; + const headers: __HeaderBag = sharedHeaders("AcceptDomainTransferFromAnotherAwsAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -231,10 +228,7 @@ export const serializeAws_json1_1AssociateDelegationSignerToDomainCommand = asyn input: AssociateDelegationSignerToDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.AssociateDelegationSignerToDomain", - }; + const headers: __HeaderBag = sharedHeaders("AssociateDelegationSignerToDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateDelegationSignerToDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -244,10 +238,7 @@ export const serializeAws_json1_1CancelDomainTransferToAnotherAwsAccountCommand input: CancelDomainTransferToAnotherAwsAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.CancelDomainTransferToAnotherAwsAccount", - }; + const headers: __HeaderBag = sharedHeaders("CancelDomainTransferToAnotherAwsAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelDomainTransferToAnotherAwsAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -257,10 +248,7 @@ export const serializeAws_json1_1CheckDomainAvailabilityCommand = async ( input: CheckDomainAvailabilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.CheckDomainAvailability", - }; + const headers: __HeaderBag = sharedHeaders("CheckDomainAvailability"); let body: any; body = JSON.stringify(serializeAws_json1_1CheckDomainAvailabilityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -270,10 +258,7 @@ export const serializeAws_json1_1CheckDomainTransferabilityCommand = async ( input: CheckDomainTransferabilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.CheckDomainTransferability", - }; + const headers: __HeaderBag = sharedHeaders("CheckDomainTransferability"); let body: any; body = JSON.stringify(serializeAws_json1_1CheckDomainTransferabilityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -283,10 +268,7 @@ export const serializeAws_json1_1DeleteDomainCommand = async ( input: DeleteDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.DeleteDomain", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -296,10 +278,7 @@ export const serializeAws_json1_1DeleteTagsForDomainCommand = async ( input: DeleteTagsForDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.DeleteTagsForDomain", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTagsForDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTagsForDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -309,10 +288,7 @@ export const serializeAws_json1_1DisableDomainAutoRenewCommand = async ( input: DisableDomainAutoRenewCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.DisableDomainAutoRenew", - }; + const headers: __HeaderBag = sharedHeaders("DisableDomainAutoRenew"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableDomainAutoRenewRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -322,10 +298,7 @@ export const serializeAws_json1_1DisableDomainTransferLockCommand = async ( input: DisableDomainTransferLockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.DisableDomainTransferLock", - }; + const headers: __HeaderBag = sharedHeaders("DisableDomainTransferLock"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableDomainTransferLockRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -335,10 +308,7 @@ export const serializeAws_json1_1DisassociateDelegationSignerFromDomainCommand = input: DisassociateDelegationSignerFromDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.DisassociateDelegationSignerFromDomain", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateDelegationSignerFromDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateDelegationSignerFromDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -348,10 +318,7 @@ export const serializeAws_json1_1EnableDomainAutoRenewCommand = async ( input: EnableDomainAutoRenewCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.EnableDomainAutoRenew", - }; + const headers: __HeaderBag = sharedHeaders("EnableDomainAutoRenew"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableDomainAutoRenewRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -361,10 +328,7 @@ export const serializeAws_json1_1EnableDomainTransferLockCommand = async ( input: EnableDomainTransferLockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.EnableDomainTransferLock", - }; + const headers: __HeaderBag = sharedHeaders("EnableDomainTransferLock"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableDomainTransferLockRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -374,10 +338,7 @@ export const serializeAws_json1_1GetContactReachabilityStatusCommand = async ( input: GetContactReachabilityStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.GetContactReachabilityStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetContactReachabilityStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContactReachabilityStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -387,10 +348,7 @@ export const serializeAws_json1_1GetDomainDetailCommand = async ( input: GetDomainDetailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.GetDomainDetail", - }; + const headers: __HeaderBag = sharedHeaders("GetDomainDetail"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDomainDetailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -400,10 +358,7 @@ export const serializeAws_json1_1GetDomainSuggestionsCommand = async ( input: GetDomainSuggestionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.GetDomainSuggestions", - }; + const headers: __HeaderBag = sharedHeaders("GetDomainSuggestions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDomainSuggestionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -413,10 +368,7 @@ export const serializeAws_json1_1GetOperationDetailCommand = async ( input: GetOperationDetailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.GetOperationDetail", - }; + const headers: __HeaderBag = sharedHeaders("GetOperationDetail"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOperationDetailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -426,10 +378,7 @@ export const serializeAws_json1_1ListDomainsCommand = async ( input: ListDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.ListDomains", - }; + const headers: __HeaderBag = sharedHeaders("ListDomains"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDomainsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -439,10 +388,7 @@ export const serializeAws_json1_1ListOperationsCommand = async ( input: ListOperationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.ListOperations", - }; + const headers: __HeaderBag = sharedHeaders("ListOperations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOperationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -452,10 +398,7 @@ export const serializeAws_json1_1ListPricesCommand = async ( input: ListPricesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.ListPrices", - }; + const headers: __HeaderBag = sharedHeaders("ListPrices"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPricesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -465,10 +408,7 @@ export const serializeAws_json1_1ListTagsForDomainCommand = async ( input: ListTagsForDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.ListTagsForDomain", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -478,10 +418,7 @@ export const serializeAws_json1_1PushDomainCommand = async ( input: PushDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.PushDomain", - }; + const headers: __HeaderBag = sharedHeaders("PushDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1PushDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -491,10 +428,7 @@ export const serializeAws_json1_1RegisterDomainCommand = async ( input: RegisterDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.RegisterDomain", - }; + const headers: __HeaderBag = sharedHeaders("RegisterDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -504,10 +438,7 @@ export const serializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountComman input: RejectDomainTransferFromAnotherAwsAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.RejectDomainTransferFromAnotherAwsAccount", - }; + const headers: __HeaderBag = sharedHeaders("RejectDomainTransferFromAnotherAwsAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -517,10 +448,7 @@ export const serializeAws_json1_1RenewDomainCommand = async ( input: RenewDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.RenewDomain", - }; + const headers: __HeaderBag = sharedHeaders("RenewDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1RenewDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -530,10 +458,7 @@ export const serializeAws_json1_1ResendContactReachabilityEmailCommand = async ( input: ResendContactReachabilityEmailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.ResendContactReachabilityEmail", - }; + const headers: __HeaderBag = sharedHeaders("ResendContactReachabilityEmail"); let body: any; body = JSON.stringify(serializeAws_json1_1ResendContactReachabilityEmailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -543,10 +468,7 @@ export const serializeAws_json1_1ResendOperationAuthorizationCommand = async ( input: ResendOperationAuthorizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.ResendOperationAuthorization", - }; + const headers: __HeaderBag = sharedHeaders("ResendOperationAuthorization"); let body: any; body = JSON.stringify(serializeAws_json1_1ResendOperationAuthorizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -556,10 +478,7 @@ export const serializeAws_json1_1RetrieveDomainAuthCodeCommand = async ( input: RetrieveDomainAuthCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.RetrieveDomainAuthCode", - }; + const headers: __HeaderBag = sharedHeaders("RetrieveDomainAuthCode"); let body: any; body = JSON.stringify(serializeAws_json1_1RetrieveDomainAuthCodeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -569,10 +488,7 @@ export const serializeAws_json1_1TransferDomainCommand = async ( input: TransferDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.TransferDomain", - }; + const headers: __HeaderBag = sharedHeaders("TransferDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1TransferDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -582,10 +498,7 @@ export const serializeAws_json1_1TransferDomainToAnotherAwsAccountCommand = asyn input: TransferDomainToAnotherAwsAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.TransferDomainToAnotherAwsAccount", - }; + const headers: __HeaderBag = sharedHeaders("TransferDomainToAnotherAwsAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1TransferDomainToAnotherAwsAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -595,10 +508,7 @@ export const serializeAws_json1_1UpdateDomainContactCommand = async ( input: UpdateDomainContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.UpdateDomainContact", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDomainContact"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDomainContactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -608,10 +518,7 @@ export const serializeAws_json1_1UpdateDomainContactPrivacyCommand = async ( input: UpdateDomainContactPrivacyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.UpdateDomainContactPrivacy", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDomainContactPrivacy"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDomainContactPrivacyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -621,10 +528,7 @@ export const serializeAws_json1_1UpdateDomainNameserversCommand = async ( input: UpdateDomainNameserversCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.UpdateDomainNameservers", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDomainNameservers"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDomainNameserversRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -634,10 +538,7 @@ export const serializeAws_json1_1UpdateTagsForDomainCommand = async ( input: UpdateTagsForDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.UpdateTagsForDomain", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTagsForDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTagsForDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -647,10 +548,7 @@ export const serializeAws_json1_1ViewBillingCommand = async ( input: ViewBillingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Domains_v20140515.ViewBilling", - }; + const headers: __HeaderBag = sharedHeaders("ViewBilling"); let body: any; body = JSON.stringify(serializeAws_json1_1ViewBillingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3530,6 +3428,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `Route53Domains_v20140515.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts index 15c3901543f88..8402a299992fc 100644 --- a/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts +++ b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts @@ -56,10 +56,7 @@ export const serializeAws_json1_0GetRoutingControlStateCommand = async ( input: GetRoutingControlStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ToggleCustomerAPI.GetRoutingControlState", - }; + const headers: __HeaderBag = sharedHeaders("GetRoutingControlState"); let body: any; body = JSON.stringify(serializeAws_json1_0GetRoutingControlStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -69,10 +66,7 @@ export const serializeAws_json1_0ListRoutingControlsCommand = async ( input: ListRoutingControlsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ToggleCustomerAPI.ListRoutingControls", - }; + const headers: __HeaderBag = sharedHeaders("ListRoutingControls"); let body: any; body = JSON.stringify(serializeAws_json1_0ListRoutingControlsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -82,10 +76,7 @@ export const serializeAws_json1_0UpdateRoutingControlStateCommand = async ( input: UpdateRoutingControlStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ToggleCustomerAPI.UpdateRoutingControlState", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRoutingControlState"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateRoutingControlStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -95,10 +86,7 @@ export const serializeAws_json1_0UpdateRoutingControlStatesCommand = async ( input: UpdateRoutingControlStatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "ToggleCustomerAPI.UpdateRoutingControlStates", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRoutingControlStates"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateRoutingControlStatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -722,6 +710,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `ToggleCustomerAPI.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-route53resolver/src/protocols/Aws_json1_1.ts b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts index ef021328490b4..826f307246c04 100644 --- a/clients/client-route53resolver/src/protocols/Aws_json1_1.ts +++ b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts @@ -400,10 +400,7 @@ export const serializeAws_json1_1AssociateFirewallRuleGroupCommand = async ( input: AssociateFirewallRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.AssociateFirewallRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("AssociateFirewallRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateFirewallRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -413,10 +410,7 @@ export const serializeAws_json1_1AssociateResolverEndpointIpAddressCommand = asy input: AssociateResolverEndpointIpAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.AssociateResolverEndpointIpAddress", - }; + const headers: __HeaderBag = sharedHeaders("AssociateResolverEndpointIpAddress"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateResolverEndpointIpAddressRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -426,10 +420,7 @@ export const serializeAws_json1_1AssociateResolverQueryLogConfigCommand = async input: AssociateResolverQueryLogConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.AssociateResolverQueryLogConfig", - }; + const headers: __HeaderBag = sharedHeaders("AssociateResolverQueryLogConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateResolverQueryLogConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -439,10 +430,7 @@ export const serializeAws_json1_1AssociateResolverRuleCommand = async ( input: AssociateResolverRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.AssociateResolverRule", - }; + const headers: __HeaderBag = sharedHeaders("AssociateResolverRule"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateResolverRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -452,10 +440,7 @@ export const serializeAws_json1_1CreateFirewallDomainListCommand = async ( input: CreateFirewallDomainListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.CreateFirewallDomainList", - }; + const headers: __HeaderBag = sharedHeaders("CreateFirewallDomainList"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFirewallDomainListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -465,10 +450,7 @@ export const serializeAws_json1_1CreateFirewallRuleCommand = async ( input: CreateFirewallRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.CreateFirewallRule", - }; + const headers: __HeaderBag = sharedHeaders("CreateFirewallRule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFirewallRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -478,10 +460,7 @@ export const serializeAws_json1_1CreateFirewallRuleGroupCommand = async ( input: CreateFirewallRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.CreateFirewallRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateFirewallRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFirewallRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -491,10 +470,7 @@ export const serializeAws_json1_1CreateResolverEndpointCommand = async ( input: CreateResolverEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.CreateResolverEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("CreateResolverEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateResolverEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -504,10 +480,7 @@ export const serializeAws_json1_1CreateResolverQueryLogConfigCommand = async ( input: CreateResolverQueryLogConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.CreateResolverQueryLogConfig", - }; + const headers: __HeaderBag = sharedHeaders("CreateResolverQueryLogConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateResolverQueryLogConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -517,10 +490,7 @@ export const serializeAws_json1_1CreateResolverRuleCommand = async ( input: CreateResolverRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.CreateResolverRule", - }; + const headers: __HeaderBag = sharedHeaders("CreateResolverRule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateResolverRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -530,10 +500,7 @@ export const serializeAws_json1_1DeleteFirewallDomainListCommand = async ( input: DeleteFirewallDomainListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.DeleteFirewallDomainList", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFirewallDomainList"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFirewallDomainListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -543,10 +510,7 @@ export const serializeAws_json1_1DeleteFirewallRuleCommand = async ( input: DeleteFirewallRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.DeleteFirewallRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFirewallRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFirewallRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -556,10 +520,7 @@ export const serializeAws_json1_1DeleteFirewallRuleGroupCommand = async ( input: DeleteFirewallRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.DeleteFirewallRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFirewallRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFirewallRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -569,10 +530,7 @@ export const serializeAws_json1_1DeleteResolverEndpointCommand = async ( input: DeleteResolverEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.DeleteResolverEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResolverEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResolverEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -582,10 +540,7 @@ export const serializeAws_json1_1DeleteResolverQueryLogConfigCommand = async ( input: DeleteResolverQueryLogConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.DeleteResolverQueryLogConfig", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResolverQueryLogConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResolverQueryLogConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -595,10 +550,7 @@ export const serializeAws_json1_1DeleteResolverRuleCommand = async ( input: DeleteResolverRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.DeleteResolverRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResolverRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResolverRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -608,10 +560,7 @@ export const serializeAws_json1_1DisassociateFirewallRuleGroupCommand = async ( input: DisassociateFirewallRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.DisassociateFirewallRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateFirewallRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateFirewallRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -621,10 +570,7 @@ export const serializeAws_json1_1DisassociateResolverEndpointIpAddressCommand = input: DisassociateResolverEndpointIpAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.DisassociateResolverEndpointIpAddress", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateResolverEndpointIpAddress"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateResolverEndpointIpAddressRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -634,10 +580,7 @@ export const serializeAws_json1_1DisassociateResolverQueryLogConfigCommand = asy input: DisassociateResolverQueryLogConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.DisassociateResolverQueryLogConfig", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateResolverQueryLogConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateResolverQueryLogConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -647,10 +590,7 @@ export const serializeAws_json1_1DisassociateResolverRuleCommand = async ( input: DisassociateResolverRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.DisassociateResolverRule", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateResolverRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateResolverRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -660,10 +600,7 @@ export const serializeAws_json1_1GetFirewallConfigCommand = async ( input: GetFirewallConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetFirewallConfig", - }; + const headers: __HeaderBag = sharedHeaders("GetFirewallConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFirewallConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -673,10 +610,7 @@ export const serializeAws_json1_1GetFirewallDomainListCommand = async ( input: GetFirewallDomainListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetFirewallDomainList", - }; + const headers: __HeaderBag = sharedHeaders("GetFirewallDomainList"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFirewallDomainListRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -686,10 +620,7 @@ export const serializeAws_json1_1GetFirewallRuleGroupCommand = async ( input: GetFirewallRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetFirewallRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("GetFirewallRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFirewallRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -699,10 +630,7 @@ export const serializeAws_json1_1GetFirewallRuleGroupAssociationCommand = async input: GetFirewallRuleGroupAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetFirewallRuleGroupAssociation", - }; + const headers: __HeaderBag = sharedHeaders("GetFirewallRuleGroupAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFirewallRuleGroupAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -712,10 +640,7 @@ export const serializeAws_json1_1GetFirewallRuleGroupPolicyCommand = async ( input: GetFirewallRuleGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetFirewallRuleGroupPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetFirewallRuleGroupPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetFirewallRuleGroupPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -725,10 +650,7 @@ export const serializeAws_json1_1GetResolverConfigCommand = async ( input: GetResolverConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetResolverConfig", - }; + const headers: __HeaderBag = sharedHeaders("GetResolverConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResolverConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -738,10 +660,7 @@ export const serializeAws_json1_1GetResolverDnssecConfigCommand = async ( input: GetResolverDnssecConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetResolverDnssecConfig", - }; + const headers: __HeaderBag = sharedHeaders("GetResolverDnssecConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResolverDnssecConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -751,10 +670,7 @@ export const serializeAws_json1_1GetResolverEndpointCommand = async ( input: GetResolverEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetResolverEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("GetResolverEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResolverEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -764,10 +680,7 @@ export const serializeAws_json1_1GetResolverQueryLogConfigCommand = async ( input: GetResolverQueryLogConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetResolverQueryLogConfig", - }; + const headers: __HeaderBag = sharedHeaders("GetResolverQueryLogConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResolverQueryLogConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -777,10 +690,7 @@ export const serializeAws_json1_1GetResolverQueryLogConfigAssociationCommand = a input: GetResolverQueryLogConfigAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetResolverQueryLogConfigAssociation", - }; + const headers: __HeaderBag = sharedHeaders("GetResolverQueryLogConfigAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResolverQueryLogConfigAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -790,10 +700,7 @@ export const serializeAws_json1_1GetResolverQueryLogConfigPolicyCommand = async input: GetResolverQueryLogConfigPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetResolverQueryLogConfigPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetResolverQueryLogConfigPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResolverQueryLogConfigPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -803,10 +710,7 @@ export const serializeAws_json1_1GetResolverRuleCommand = async ( input: GetResolverRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetResolverRule", - }; + const headers: __HeaderBag = sharedHeaders("GetResolverRule"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResolverRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -816,10 +720,7 @@ export const serializeAws_json1_1GetResolverRuleAssociationCommand = async ( input: GetResolverRuleAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetResolverRuleAssociation", - }; + const headers: __HeaderBag = sharedHeaders("GetResolverRuleAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResolverRuleAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -829,10 +730,7 @@ export const serializeAws_json1_1GetResolverRulePolicyCommand = async ( input: GetResolverRulePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.GetResolverRulePolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetResolverRulePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResolverRulePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -842,10 +740,7 @@ export const serializeAws_json1_1ImportFirewallDomainsCommand = async ( input: ImportFirewallDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ImportFirewallDomains", - }; + const headers: __HeaderBag = sharedHeaders("ImportFirewallDomains"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportFirewallDomainsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -855,10 +750,7 @@ export const serializeAws_json1_1ListFirewallConfigsCommand = async ( input: ListFirewallConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListFirewallConfigs", - }; + const headers: __HeaderBag = sharedHeaders("ListFirewallConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFirewallConfigsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -868,10 +760,7 @@ export const serializeAws_json1_1ListFirewallDomainListsCommand = async ( input: ListFirewallDomainListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListFirewallDomainLists", - }; + const headers: __HeaderBag = sharedHeaders("ListFirewallDomainLists"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFirewallDomainListsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -881,10 +770,7 @@ export const serializeAws_json1_1ListFirewallDomainsCommand = async ( input: ListFirewallDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListFirewallDomains", - }; + const headers: __HeaderBag = sharedHeaders("ListFirewallDomains"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFirewallDomainsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -894,10 +780,7 @@ export const serializeAws_json1_1ListFirewallRuleGroupAssociationsCommand = asyn input: ListFirewallRuleGroupAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListFirewallRuleGroupAssociations", - }; + const headers: __HeaderBag = sharedHeaders("ListFirewallRuleGroupAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFirewallRuleGroupAssociationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -907,10 +790,7 @@ export const serializeAws_json1_1ListFirewallRuleGroupsCommand = async ( input: ListFirewallRuleGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListFirewallRuleGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListFirewallRuleGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFirewallRuleGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -920,10 +800,7 @@ export const serializeAws_json1_1ListFirewallRulesCommand = async ( input: ListFirewallRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListFirewallRules", - }; + const headers: __HeaderBag = sharedHeaders("ListFirewallRules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFirewallRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -933,10 +810,7 @@ export const serializeAws_json1_1ListResolverConfigsCommand = async ( input: ListResolverConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListResolverConfigs", - }; + const headers: __HeaderBag = sharedHeaders("ListResolverConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResolverConfigsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -946,10 +820,7 @@ export const serializeAws_json1_1ListResolverDnssecConfigsCommand = async ( input: ListResolverDnssecConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListResolverDnssecConfigs", - }; + const headers: __HeaderBag = sharedHeaders("ListResolverDnssecConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResolverDnssecConfigsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -959,10 +830,7 @@ export const serializeAws_json1_1ListResolverEndpointIpAddressesCommand = async input: ListResolverEndpointIpAddressesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListResolverEndpointIpAddresses", - }; + const headers: __HeaderBag = sharedHeaders("ListResolverEndpointIpAddresses"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResolverEndpointIpAddressesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -972,10 +840,7 @@ export const serializeAws_json1_1ListResolverEndpointsCommand = async ( input: ListResolverEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListResolverEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("ListResolverEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResolverEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -985,10 +850,7 @@ export const serializeAws_json1_1ListResolverQueryLogConfigAssociationsCommand = input: ListResolverQueryLogConfigAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListResolverQueryLogConfigAssociations", - }; + const headers: __HeaderBag = sharedHeaders("ListResolverQueryLogConfigAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResolverQueryLogConfigAssociationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -998,10 +860,7 @@ export const serializeAws_json1_1ListResolverQueryLogConfigsCommand = async ( input: ListResolverQueryLogConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListResolverQueryLogConfigs", - }; + const headers: __HeaderBag = sharedHeaders("ListResolverQueryLogConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResolverQueryLogConfigsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1011,10 +870,7 @@ export const serializeAws_json1_1ListResolverRuleAssociationsCommand = async ( input: ListResolverRuleAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListResolverRuleAssociations", - }; + const headers: __HeaderBag = sharedHeaders("ListResolverRuleAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResolverRuleAssociationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1024,10 +880,7 @@ export const serializeAws_json1_1ListResolverRulesCommand = async ( input: ListResolverRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListResolverRules", - }; + const headers: __HeaderBag = sharedHeaders("ListResolverRules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResolverRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1037,10 +890,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1050,10 +900,7 @@ export const serializeAws_json1_1PutFirewallRuleGroupPolicyCommand = async ( input: PutFirewallRuleGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.PutFirewallRuleGroupPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutFirewallRuleGroupPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutFirewallRuleGroupPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1063,10 +910,7 @@ export const serializeAws_json1_1PutResolverQueryLogConfigPolicyCommand = async input: PutResolverQueryLogConfigPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.PutResolverQueryLogConfigPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResolverQueryLogConfigPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResolverQueryLogConfigPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1076,10 +920,7 @@ export const serializeAws_json1_1PutResolverRulePolicyCommand = async ( input: PutResolverRulePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.PutResolverRulePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResolverRulePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResolverRulePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1089,10 +930,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1102,10 +940,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1115,10 +950,7 @@ export const serializeAws_json1_1UpdateFirewallConfigCommand = async ( input: UpdateFirewallConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.UpdateFirewallConfig", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFirewallConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFirewallConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1128,10 +960,7 @@ export const serializeAws_json1_1UpdateFirewallDomainsCommand = async ( input: UpdateFirewallDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.UpdateFirewallDomains", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFirewallDomains"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFirewallDomainsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1141,10 +970,7 @@ export const serializeAws_json1_1UpdateFirewallRuleCommand = async ( input: UpdateFirewallRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.UpdateFirewallRule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFirewallRule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFirewallRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1154,10 +980,7 @@ export const serializeAws_json1_1UpdateFirewallRuleGroupAssociationCommand = asy input: UpdateFirewallRuleGroupAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.UpdateFirewallRuleGroupAssociation", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFirewallRuleGroupAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFirewallRuleGroupAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1167,10 +990,7 @@ export const serializeAws_json1_1UpdateResolverConfigCommand = async ( input: UpdateResolverConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.UpdateResolverConfig", - }; + const headers: __HeaderBag = sharedHeaders("UpdateResolverConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateResolverConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1180,10 +1000,7 @@ export const serializeAws_json1_1UpdateResolverDnssecConfigCommand = async ( input: UpdateResolverDnssecConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.UpdateResolverDnssecConfig", - }; + const headers: __HeaderBag = sharedHeaders("UpdateResolverDnssecConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateResolverDnssecConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1193,10 +1010,7 @@ export const serializeAws_json1_1UpdateResolverEndpointCommand = async ( input: UpdateResolverEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.UpdateResolverEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("UpdateResolverEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateResolverEndpointRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1206,10 +1020,7 @@ export const serializeAws_json1_1UpdateResolverRuleCommand = async ( input: UpdateResolverRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53Resolver.UpdateResolverRule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateResolverRule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateResolverRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -7021,6 +6832,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `Route53Resolver.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-sagemaker/src/protocols/Aws_json1_1.ts b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts index b1d48016dac6b..515030a58c716 100644 --- a/clients/client-sagemaker/src/protocols/Aws_json1_1.ts +++ b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts @@ -1844,10 +1844,7 @@ export const serializeAws_json1_1AddAssociationCommand = async ( input: AddAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.AddAssociation", - }; + const headers: __HeaderBag = sharedHeaders("AddAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1AddAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1857,10 +1854,7 @@ export const serializeAws_json1_1AddTagsCommand = async ( input: AddTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.AddTags", - }; + const headers: __HeaderBag = sharedHeaders("AddTags"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1870,10 +1864,7 @@ export const serializeAws_json1_1AssociateTrialComponentCommand = async ( input: AssociateTrialComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.AssociateTrialComponent", - }; + const headers: __HeaderBag = sharedHeaders("AssociateTrialComponent"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateTrialComponentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1883,10 +1874,7 @@ export const serializeAws_json1_1BatchDescribeModelPackageCommand = async ( input: BatchDescribeModelPackageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.BatchDescribeModelPackage", - }; + const headers: __HeaderBag = sharedHeaders("BatchDescribeModelPackage"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchDescribeModelPackageInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1896,10 +1884,7 @@ export const serializeAws_json1_1CreateActionCommand = async ( input: CreateActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateAction", - }; + const headers: __HeaderBag = sharedHeaders("CreateAction"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1909,10 +1894,7 @@ export const serializeAws_json1_1CreateAlgorithmCommand = async ( input: CreateAlgorithmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateAlgorithm", - }; + const headers: __HeaderBag = sharedHeaders("CreateAlgorithm"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAlgorithmInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1922,10 +1904,7 @@ export const serializeAws_json1_1CreateAppCommand = async ( input: CreateAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateApp", - }; + const headers: __HeaderBag = sharedHeaders("CreateApp"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1935,10 +1914,7 @@ export const serializeAws_json1_1CreateAppImageConfigCommand = async ( input: CreateAppImageConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateAppImageConfig", - }; + const headers: __HeaderBag = sharedHeaders("CreateAppImageConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAppImageConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1948,10 +1924,7 @@ export const serializeAws_json1_1CreateArtifactCommand = async ( input: CreateArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateArtifact", - }; + const headers: __HeaderBag = sharedHeaders("CreateArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateArtifactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1961,10 +1934,7 @@ export const serializeAws_json1_1CreateAutoMLJobCommand = async ( input: CreateAutoMLJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateAutoMLJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateAutoMLJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAutoMLJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1974,10 +1944,7 @@ export const serializeAws_json1_1CreateAutoMLJobV2Command = async ( input: CreateAutoMLJobV2CommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateAutoMLJobV2", - }; + const headers: __HeaderBag = sharedHeaders("CreateAutoMLJobV2"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAutoMLJobV2Request(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1987,10 +1954,7 @@ export const serializeAws_json1_1CreateCodeRepositoryCommand = async ( input: CreateCodeRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateCodeRepository", - }; + const headers: __HeaderBag = sharedHeaders("CreateCodeRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCodeRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2000,10 +1964,7 @@ export const serializeAws_json1_1CreateCompilationJobCommand = async ( input: CreateCompilationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateCompilationJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateCompilationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCompilationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2013,10 +1974,7 @@ export const serializeAws_json1_1CreateContextCommand = async ( input: CreateContextCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateContext", - }; + const headers: __HeaderBag = sharedHeaders("CreateContext"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateContextRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2026,10 +1984,7 @@ export const serializeAws_json1_1CreateDataQualityJobDefinitionCommand = async ( input: CreateDataQualityJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateDataQualityJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("CreateDataQualityJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDataQualityJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2039,10 +1994,7 @@ export const serializeAws_json1_1CreateDeviceFleetCommand = async ( input: CreateDeviceFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateDeviceFleet", - }; + const headers: __HeaderBag = sharedHeaders("CreateDeviceFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDeviceFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2052,10 +2004,7 @@ export const serializeAws_json1_1CreateDomainCommand = async ( input: CreateDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateDomain", - }; + const headers: __HeaderBag = sharedHeaders("CreateDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2065,10 +2014,7 @@ export const serializeAws_json1_1CreateEdgeDeploymentPlanCommand = async ( input: CreateEdgeDeploymentPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateEdgeDeploymentPlan", - }; + const headers: __HeaderBag = sharedHeaders("CreateEdgeDeploymentPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEdgeDeploymentPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2078,10 +2024,7 @@ export const serializeAws_json1_1CreateEdgeDeploymentStageCommand = async ( input: CreateEdgeDeploymentStageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateEdgeDeploymentStage", - }; + const headers: __HeaderBag = sharedHeaders("CreateEdgeDeploymentStage"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEdgeDeploymentStageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2091,10 +2034,7 @@ export const serializeAws_json1_1CreateEdgePackagingJobCommand = async ( input: CreateEdgePackagingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateEdgePackagingJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateEdgePackagingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEdgePackagingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2104,10 +2044,7 @@ export const serializeAws_json1_1CreateEndpointCommand = async ( input: CreateEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("CreateEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEndpointInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2117,10 +2054,7 @@ export const serializeAws_json1_1CreateEndpointConfigCommand = async ( input: CreateEndpointConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateEndpointConfig", - }; + const headers: __HeaderBag = sharedHeaders("CreateEndpointConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateEndpointConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2130,10 +2064,7 @@ export const serializeAws_json1_1CreateExperimentCommand = async ( input: CreateExperimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateExperiment", - }; + const headers: __HeaderBag = sharedHeaders("CreateExperiment"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateExperimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2143,10 +2074,7 @@ export const serializeAws_json1_1CreateFeatureGroupCommand = async ( input: CreateFeatureGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateFeatureGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateFeatureGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFeatureGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2156,10 +2084,7 @@ export const serializeAws_json1_1CreateFlowDefinitionCommand = async ( input: CreateFlowDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateFlowDefinition", - }; + const headers: __HeaderBag = sharedHeaders("CreateFlowDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateFlowDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2169,10 +2094,7 @@ export const serializeAws_json1_1CreateHubCommand = async ( input: CreateHubCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateHub", - }; + const headers: __HeaderBag = sharedHeaders("CreateHub"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHubRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2182,10 +2104,7 @@ export const serializeAws_json1_1CreateHumanTaskUiCommand = async ( input: CreateHumanTaskUiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateHumanTaskUi", - }; + const headers: __HeaderBag = sharedHeaders("CreateHumanTaskUi"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHumanTaskUiRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2195,10 +2114,7 @@ export const serializeAws_json1_1CreateHyperParameterTuningJobCommand = async ( input: CreateHyperParameterTuningJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateHyperParameterTuningJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateHyperParameterTuningJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHyperParameterTuningJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2208,10 +2124,7 @@ export const serializeAws_json1_1CreateImageCommand = async ( input: CreateImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateImage", - }; + const headers: __HeaderBag = sharedHeaders("CreateImage"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2221,10 +2134,7 @@ export const serializeAws_json1_1CreateImageVersionCommand = async ( input: CreateImageVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateImageVersion", - }; + const headers: __HeaderBag = sharedHeaders("CreateImageVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateImageVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2234,10 +2144,7 @@ export const serializeAws_json1_1CreateInferenceExperimentCommand = async ( input: CreateInferenceExperimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateInferenceExperiment", - }; + const headers: __HeaderBag = sharedHeaders("CreateInferenceExperiment"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateInferenceExperimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2247,10 +2154,7 @@ export const serializeAws_json1_1CreateInferenceRecommendationsJobCommand = asyn input: CreateInferenceRecommendationsJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateInferenceRecommendationsJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateInferenceRecommendationsJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateInferenceRecommendationsJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2260,10 +2164,7 @@ export const serializeAws_json1_1CreateLabelingJobCommand = async ( input: CreateLabelingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateLabelingJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateLabelingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLabelingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2273,10 +2174,7 @@ export const serializeAws_json1_1CreateModelCommand = async ( input: CreateModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateModel", - }; + const headers: __HeaderBag = sharedHeaders("CreateModel"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateModelInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2286,10 +2184,7 @@ export const serializeAws_json1_1CreateModelBiasJobDefinitionCommand = async ( input: CreateModelBiasJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateModelBiasJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("CreateModelBiasJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateModelBiasJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2299,10 +2194,7 @@ export const serializeAws_json1_1CreateModelCardCommand = async ( input: CreateModelCardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateModelCard", - }; + const headers: __HeaderBag = sharedHeaders("CreateModelCard"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateModelCardRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2312,10 +2204,7 @@ export const serializeAws_json1_1CreateModelCardExportJobCommand = async ( input: CreateModelCardExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateModelCardExportJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateModelCardExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateModelCardExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2325,10 +2214,7 @@ export const serializeAws_json1_1CreateModelExplainabilityJobDefinitionCommand = input: CreateModelExplainabilityJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateModelExplainabilityJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("CreateModelExplainabilityJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateModelExplainabilityJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2338,10 +2224,7 @@ export const serializeAws_json1_1CreateModelPackageCommand = async ( input: CreateModelPackageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateModelPackage", - }; + const headers: __HeaderBag = sharedHeaders("CreateModelPackage"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateModelPackageInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2351,10 +2234,7 @@ export const serializeAws_json1_1CreateModelPackageGroupCommand = async ( input: CreateModelPackageGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateModelPackageGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateModelPackageGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateModelPackageGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2364,10 +2244,7 @@ export const serializeAws_json1_1CreateModelQualityJobDefinitionCommand = async input: CreateModelQualityJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateModelQualityJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("CreateModelQualityJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateModelQualityJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2377,10 +2254,7 @@ export const serializeAws_json1_1CreateMonitoringScheduleCommand = async ( input: CreateMonitoringScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateMonitoringSchedule", - }; + const headers: __HeaderBag = sharedHeaders("CreateMonitoringSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMonitoringScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2390,10 +2264,7 @@ export const serializeAws_json1_1CreateNotebookInstanceCommand = async ( input: CreateNotebookInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateNotebookInstance", - }; + const headers: __HeaderBag = sharedHeaders("CreateNotebookInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateNotebookInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2403,10 +2274,7 @@ export const serializeAws_json1_1CreateNotebookInstanceLifecycleConfigCommand = input: CreateNotebookInstanceLifecycleConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateNotebookInstanceLifecycleConfig", - }; + const headers: __HeaderBag = sharedHeaders("CreateNotebookInstanceLifecycleConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateNotebookInstanceLifecycleConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2416,10 +2284,7 @@ export const serializeAws_json1_1CreatePipelineCommand = async ( input: CreatePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreatePipeline", - }; + const headers: __HeaderBag = sharedHeaders("CreatePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePipelineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2429,10 +2294,7 @@ export const serializeAws_json1_1CreatePresignedDomainUrlCommand = async ( input: CreatePresignedDomainUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreatePresignedDomainUrl", - }; + const headers: __HeaderBag = sharedHeaders("CreatePresignedDomainUrl"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePresignedDomainUrlRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2442,10 +2304,7 @@ export const serializeAws_json1_1CreatePresignedNotebookInstanceUrlCommand = asy input: CreatePresignedNotebookInstanceUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreatePresignedNotebookInstanceUrl", - }; + const headers: __HeaderBag = sharedHeaders("CreatePresignedNotebookInstanceUrl"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePresignedNotebookInstanceUrlInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2455,10 +2314,7 @@ export const serializeAws_json1_1CreateProcessingJobCommand = async ( input: CreateProcessingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateProcessingJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateProcessingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProcessingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2468,10 +2324,7 @@ export const serializeAws_json1_1CreateProjectCommand = async ( input: CreateProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateProject", - }; + const headers: __HeaderBag = sharedHeaders("CreateProject"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProjectInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2481,10 +2334,7 @@ export const serializeAws_json1_1CreateSpaceCommand = async ( input: CreateSpaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateSpace", - }; + const headers: __HeaderBag = sharedHeaders("CreateSpace"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSpaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2494,10 +2344,7 @@ export const serializeAws_json1_1CreateStudioLifecycleConfigCommand = async ( input: CreateStudioLifecycleConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateStudioLifecycleConfig", - }; + const headers: __HeaderBag = sharedHeaders("CreateStudioLifecycleConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStudioLifecycleConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2507,10 +2354,7 @@ export const serializeAws_json1_1CreateTrainingJobCommand = async ( input: CreateTrainingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateTrainingJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateTrainingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTrainingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2520,10 +2364,7 @@ export const serializeAws_json1_1CreateTransformJobCommand = async ( input: CreateTransformJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateTransformJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateTransformJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTransformJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2533,10 +2374,7 @@ export const serializeAws_json1_1CreateTrialCommand = async ( input: CreateTrialCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateTrial", - }; + const headers: __HeaderBag = sharedHeaders("CreateTrial"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTrialRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2546,10 +2384,7 @@ export const serializeAws_json1_1CreateTrialComponentCommand = async ( input: CreateTrialComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateTrialComponent", - }; + const headers: __HeaderBag = sharedHeaders("CreateTrialComponent"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTrialComponentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2559,10 +2394,7 @@ export const serializeAws_json1_1CreateUserProfileCommand = async ( input: CreateUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("CreateUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2572,10 +2404,7 @@ export const serializeAws_json1_1CreateWorkforceCommand = async ( input: CreateWorkforceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateWorkforce", - }; + const headers: __HeaderBag = sharedHeaders("CreateWorkforce"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWorkforceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2585,10 +2414,7 @@ export const serializeAws_json1_1CreateWorkteamCommand = async ( input: CreateWorkteamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.CreateWorkteam", - }; + const headers: __HeaderBag = sharedHeaders("CreateWorkteam"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWorkteamRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2598,10 +2424,7 @@ export const serializeAws_json1_1DeleteActionCommand = async ( input: DeleteActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteAction", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAction"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2611,10 +2434,7 @@ export const serializeAws_json1_1DeleteAlgorithmCommand = async ( input: DeleteAlgorithmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteAlgorithm", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAlgorithm"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAlgorithmInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2624,10 +2444,7 @@ export const serializeAws_json1_1DeleteAppCommand = async ( input: DeleteAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteApp", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApp"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2637,10 +2454,7 @@ export const serializeAws_json1_1DeleteAppImageConfigCommand = async ( input: DeleteAppImageConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteAppImageConfig", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAppImageConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAppImageConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2650,10 +2464,7 @@ export const serializeAws_json1_1DeleteArtifactCommand = async ( input: DeleteArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteArtifact", - }; + const headers: __HeaderBag = sharedHeaders("DeleteArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteArtifactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2663,10 +2474,7 @@ export const serializeAws_json1_1DeleteAssociationCommand = async ( input: DeleteAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteAssociation", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2676,10 +2484,7 @@ export const serializeAws_json1_1DeleteCodeRepositoryCommand = async ( input: DeleteCodeRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteCodeRepository", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCodeRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCodeRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2689,10 +2494,7 @@ export const serializeAws_json1_1DeleteContextCommand = async ( input: DeleteContextCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteContext", - }; + const headers: __HeaderBag = sharedHeaders("DeleteContext"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteContextRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2702,10 +2504,7 @@ export const serializeAws_json1_1DeleteDataQualityJobDefinitionCommand = async ( input: DeleteDataQualityJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteDataQualityJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDataQualityJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDataQualityJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2715,10 +2514,7 @@ export const serializeAws_json1_1DeleteDeviceFleetCommand = async ( input: DeleteDeviceFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteDeviceFleet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDeviceFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDeviceFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2728,10 +2524,7 @@ export const serializeAws_json1_1DeleteDomainCommand = async ( input: DeleteDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteDomain", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2741,10 +2534,7 @@ export const serializeAws_json1_1DeleteEdgeDeploymentPlanCommand = async ( input: DeleteEdgeDeploymentPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteEdgeDeploymentPlan", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEdgeDeploymentPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEdgeDeploymentPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2754,10 +2544,7 @@ export const serializeAws_json1_1DeleteEdgeDeploymentStageCommand = async ( input: DeleteEdgeDeploymentStageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteEdgeDeploymentStage", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEdgeDeploymentStage"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEdgeDeploymentStageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2767,10 +2554,7 @@ export const serializeAws_json1_1DeleteEndpointCommand = async ( input: DeleteEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEndpointInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2780,10 +2564,7 @@ export const serializeAws_json1_1DeleteEndpointConfigCommand = async ( input: DeleteEndpointConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteEndpointConfig", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEndpointConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEndpointConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2793,10 +2574,7 @@ export const serializeAws_json1_1DeleteExperimentCommand = async ( input: DeleteExperimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteExperiment", - }; + const headers: __HeaderBag = sharedHeaders("DeleteExperiment"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteExperimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2806,10 +2584,7 @@ export const serializeAws_json1_1DeleteFeatureGroupCommand = async ( input: DeleteFeatureGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteFeatureGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFeatureGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFeatureGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2819,10 +2594,7 @@ export const serializeAws_json1_1DeleteFlowDefinitionCommand = async ( input: DeleteFlowDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteFlowDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFlowDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFlowDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2832,10 +2604,7 @@ export const serializeAws_json1_1DeleteHubCommand = async ( input: DeleteHubCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteHub", - }; + const headers: __HeaderBag = sharedHeaders("DeleteHub"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteHubRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2845,10 +2614,7 @@ export const serializeAws_json1_1DeleteHubContentCommand = async ( input: DeleteHubContentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteHubContent", - }; + const headers: __HeaderBag = sharedHeaders("DeleteHubContent"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteHubContentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2858,10 +2624,7 @@ export const serializeAws_json1_1DeleteHumanTaskUiCommand = async ( input: DeleteHumanTaskUiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteHumanTaskUi", - }; + const headers: __HeaderBag = sharedHeaders("DeleteHumanTaskUi"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteHumanTaskUiRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2871,10 +2634,7 @@ export const serializeAws_json1_1DeleteImageCommand = async ( input: DeleteImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteImage", - }; + const headers: __HeaderBag = sharedHeaders("DeleteImage"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2884,10 +2644,7 @@ export const serializeAws_json1_1DeleteImageVersionCommand = async ( input: DeleteImageVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteImageVersion", - }; + const headers: __HeaderBag = sharedHeaders("DeleteImageVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteImageVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2897,10 +2654,7 @@ export const serializeAws_json1_1DeleteInferenceExperimentCommand = async ( input: DeleteInferenceExperimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteInferenceExperiment", - }; + const headers: __HeaderBag = sharedHeaders("DeleteInferenceExperiment"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteInferenceExperimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2910,10 +2664,7 @@ export const serializeAws_json1_1DeleteModelCommand = async ( input: DeleteModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteModel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteModelInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2923,10 +2674,7 @@ export const serializeAws_json1_1DeleteModelBiasJobDefinitionCommand = async ( input: DeleteModelBiasJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteModelBiasJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModelBiasJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteModelBiasJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2936,10 +2684,7 @@ export const serializeAws_json1_1DeleteModelCardCommand = async ( input: DeleteModelCardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteModelCard", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModelCard"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteModelCardRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2949,10 +2694,7 @@ export const serializeAws_json1_1DeleteModelExplainabilityJobDefinitionCommand = input: DeleteModelExplainabilityJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteModelExplainabilityJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModelExplainabilityJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteModelExplainabilityJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2962,10 +2704,7 @@ export const serializeAws_json1_1DeleteModelPackageCommand = async ( input: DeleteModelPackageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteModelPackage", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModelPackage"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteModelPackageInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2975,10 +2714,7 @@ export const serializeAws_json1_1DeleteModelPackageGroupCommand = async ( input: DeleteModelPackageGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteModelPackageGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModelPackageGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteModelPackageGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2988,10 +2724,7 @@ export const serializeAws_json1_1DeleteModelPackageGroupPolicyCommand = async ( input: DeleteModelPackageGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteModelPackageGroupPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModelPackageGroupPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteModelPackageGroupPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3001,10 +2734,7 @@ export const serializeAws_json1_1DeleteModelQualityJobDefinitionCommand = async input: DeleteModelQualityJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteModelQualityJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DeleteModelQualityJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteModelQualityJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3014,10 +2744,7 @@ export const serializeAws_json1_1DeleteMonitoringScheduleCommand = async ( input: DeleteMonitoringScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteMonitoringSchedule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMonitoringSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMonitoringScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3027,10 +2754,7 @@ export const serializeAws_json1_1DeleteNotebookInstanceCommand = async ( input: DeleteNotebookInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteNotebookInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNotebookInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNotebookInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3040,10 +2764,7 @@ export const serializeAws_json1_1DeleteNotebookInstanceLifecycleConfigCommand = input: DeleteNotebookInstanceLifecycleConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteNotebookInstanceLifecycleConfig", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNotebookInstanceLifecycleConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNotebookInstanceLifecycleConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3053,10 +2774,7 @@ export const serializeAws_json1_1DeletePipelineCommand = async ( input: DeletePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeletePipeline", - }; + const headers: __HeaderBag = sharedHeaders("DeletePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePipelineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3066,10 +2784,7 @@ export const serializeAws_json1_1DeleteProjectCommand = async ( input: DeleteProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteProject", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProject"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProjectInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3079,10 +2794,7 @@ export const serializeAws_json1_1DeleteSpaceCommand = async ( input: DeleteSpaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteSpace", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSpace"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSpaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3092,10 +2804,7 @@ export const serializeAws_json1_1DeleteStudioLifecycleConfigCommand = async ( input: DeleteStudioLifecycleConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteStudioLifecycleConfig", - }; + const headers: __HeaderBag = sharedHeaders("DeleteStudioLifecycleConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteStudioLifecycleConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3105,10 +2814,7 @@ export const serializeAws_json1_1DeleteTagsCommand = async ( input: DeleteTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteTags", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTags"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTagsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3118,10 +2824,7 @@ export const serializeAws_json1_1DeleteTrialCommand = async ( input: DeleteTrialCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteTrial", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTrial"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTrialRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3131,10 +2834,7 @@ export const serializeAws_json1_1DeleteTrialComponentCommand = async ( input: DeleteTrialComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteTrialComponent", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTrialComponent"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTrialComponentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3144,10 +2844,7 @@ export const serializeAws_json1_1DeleteUserProfileCommand = async ( input: DeleteUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3157,10 +2854,7 @@ export const serializeAws_json1_1DeleteWorkforceCommand = async ( input: DeleteWorkforceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteWorkforce", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWorkforce"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWorkforceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3170,10 +2864,7 @@ export const serializeAws_json1_1DeleteWorkteamCommand = async ( input: DeleteWorkteamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeleteWorkteam", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWorkteam"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWorkteamRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3183,10 +2874,7 @@ export const serializeAws_json1_1DeregisterDevicesCommand = async ( input: DeregisterDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DeregisterDevices", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterDevices"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterDevicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3196,10 +2884,7 @@ export const serializeAws_json1_1DescribeActionCommand = async ( input: DescribeActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeAction", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAction"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3209,10 +2894,7 @@ export const serializeAws_json1_1DescribeAlgorithmCommand = async ( input: DescribeAlgorithmCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeAlgorithm", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAlgorithm"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAlgorithmInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3222,10 +2904,7 @@ export const serializeAws_json1_1DescribeAppCommand = async ( input: DescribeAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeApp", - }; + const headers: __HeaderBag = sharedHeaders("DescribeApp"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3235,10 +2914,7 @@ export const serializeAws_json1_1DescribeAppImageConfigCommand = async ( input: DescribeAppImageConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeAppImageConfig", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAppImageConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAppImageConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3248,10 +2924,7 @@ export const serializeAws_json1_1DescribeArtifactCommand = async ( input: DescribeArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeArtifact", - }; + const headers: __HeaderBag = sharedHeaders("DescribeArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeArtifactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3261,10 +2934,7 @@ export const serializeAws_json1_1DescribeAutoMLJobCommand = async ( input: DescribeAutoMLJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeAutoMLJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAutoMLJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAutoMLJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3274,10 +2944,7 @@ export const serializeAws_json1_1DescribeAutoMLJobV2Command = async ( input: DescribeAutoMLJobV2CommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeAutoMLJobV2", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAutoMLJobV2"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAutoMLJobV2Request(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3287,10 +2954,7 @@ export const serializeAws_json1_1DescribeCodeRepositoryCommand = async ( input: DescribeCodeRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeCodeRepository", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCodeRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCodeRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3300,10 +2964,7 @@ export const serializeAws_json1_1DescribeCompilationJobCommand = async ( input: DescribeCompilationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeCompilationJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCompilationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCompilationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3313,10 +2974,7 @@ export const serializeAws_json1_1DescribeContextCommand = async ( input: DescribeContextCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeContext", - }; + const headers: __HeaderBag = sharedHeaders("DescribeContext"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeContextRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3326,10 +2984,7 @@ export const serializeAws_json1_1DescribeDataQualityJobDefinitionCommand = async input: DescribeDataQualityJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeDataQualityJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDataQualityJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDataQualityJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3339,10 +2994,7 @@ export const serializeAws_json1_1DescribeDeviceCommand = async ( input: DescribeDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeDevice", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDevice"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDeviceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3352,10 +3004,7 @@ export const serializeAws_json1_1DescribeDeviceFleetCommand = async ( input: DescribeDeviceFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeDeviceFleet", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDeviceFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDeviceFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3365,10 +3014,7 @@ export const serializeAws_json1_1DescribeDomainCommand = async ( input: DescribeDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeDomain", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3378,10 +3024,7 @@ export const serializeAws_json1_1DescribeEdgeDeploymentPlanCommand = async ( input: DescribeEdgeDeploymentPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeEdgeDeploymentPlan", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEdgeDeploymentPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEdgeDeploymentPlanRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3391,10 +3034,7 @@ export const serializeAws_json1_1DescribeEdgePackagingJobCommand = async ( input: DescribeEdgePackagingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeEdgePackagingJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEdgePackagingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEdgePackagingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3404,10 +3044,7 @@ export const serializeAws_json1_1DescribeEndpointCommand = async ( input: DescribeEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEndpointInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3417,10 +3054,7 @@ export const serializeAws_json1_1DescribeEndpointConfigCommand = async ( input: DescribeEndpointConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeEndpointConfig", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpointConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEndpointConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3430,10 +3064,7 @@ export const serializeAws_json1_1DescribeExperimentCommand = async ( input: DescribeExperimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeExperiment", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExperiment"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeExperimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3443,10 +3074,7 @@ export const serializeAws_json1_1DescribeFeatureGroupCommand = async ( input: DescribeFeatureGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeFeatureGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFeatureGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFeatureGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3456,10 +3084,7 @@ export const serializeAws_json1_1DescribeFeatureMetadataCommand = async ( input: DescribeFeatureMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeFeatureMetadata", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFeatureMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFeatureMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3469,10 +3094,7 @@ export const serializeAws_json1_1DescribeFlowDefinitionCommand = async ( input: DescribeFlowDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeFlowDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFlowDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFlowDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3482,10 +3104,7 @@ export const serializeAws_json1_1DescribeHubCommand = async ( input: DescribeHubCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeHub", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHub"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeHubRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3495,10 +3114,7 @@ export const serializeAws_json1_1DescribeHubContentCommand = async ( input: DescribeHubContentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeHubContent", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHubContent"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeHubContentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3508,10 +3124,7 @@ export const serializeAws_json1_1DescribeHumanTaskUiCommand = async ( input: DescribeHumanTaskUiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeHumanTaskUi", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHumanTaskUi"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeHumanTaskUiRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3521,10 +3134,7 @@ export const serializeAws_json1_1DescribeHyperParameterTuningJobCommand = async input: DescribeHyperParameterTuningJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeHyperParameterTuningJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHyperParameterTuningJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeHyperParameterTuningJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3534,10 +3144,7 @@ export const serializeAws_json1_1DescribeImageCommand = async ( input: DescribeImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeImage", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImage"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3547,10 +3154,7 @@ export const serializeAws_json1_1DescribeImageVersionCommand = async ( input: DescribeImageVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeImageVersion", - }; + const headers: __HeaderBag = sharedHeaders("DescribeImageVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeImageVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3560,10 +3164,7 @@ export const serializeAws_json1_1DescribeInferenceExperimentCommand = async ( input: DescribeInferenceExperimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeInferenceExperiment", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInferenceExperiment"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInferenceExperimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3573,10 +3174,7 @@ export const serializeAws_json1_1DescribeInferenceRecommendationsJobCommand = as input: DescribeInferenceRecommendationsJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeInferenceRecommendationsJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInferenceRecommendationsJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInferenceRecommendationsJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3586,10 +3184,7 @@ export const serializeAws_json1_1DescribeLabelingJobCommand = async ( input: DescribeLabelingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeLabelingJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLabelingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLabelingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3599,10 +3194,7 @@ export const serializeAws_json1_1DescribeLineageGroupCommand = async ( input: DescribeLineageGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeLineageGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLineageGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLineageGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3612,10 +3204,7 @@ export const serializeAws_json1_1DescribeModelCommand = async ( input: DescribeModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeModel", - }; + const headers: __HeaderBag = sharedHeaders("DescribeModel"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeModelInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3625,10 +3214,7 @@ export const serializeAws_json1_1DescribeModelBiasJobDefinitionCommand = async ( input: DescribeModelBiasJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeModelBiasJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DescribeModelBiasJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeModelBiasJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3638,10 +3224,7 @@ export const serializeAws_json1_1DescribeModelCardCommand = async ( input: DescribeModelCardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeModelCard", - }; + const headers: __HeaderBag = sharedHeaders("DescribeModelCard"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeModelCardRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3651,10 +3234,7 @@ export const serializeAws_json1_1DescribeModelCardExportJobCommand = async ( input: DescribeModelCardExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeModelCardExportJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeModelCardExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeModelCardExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3664,10 +3244,7 @@ export const serializeAws_json1_1DescribeModelExplainabilityJobDefinitionCommand input: DescribeModelExplainabilityJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeModelExplainabilityJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DescribeModelExplainabilityJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeModelExplainabilityJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3677,10 +3254,7 @@ export const serializeAws_json1_1DescribeModelPackageCommand = async ( input: DescribeModelPackageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeModelPackage", - }; + const headers: __HeaderBag = sharedHeaders("DescribeModelPackage"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeModelPackageInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3690,10 +3264,7 @@ export const serializeAws_json1_1DescribeModelPackageGroupCommand = async ( input: DescribeModelPackageGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeModelPackageGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeModelPackageGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeModelPackageGroupInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3703,10 +3274,7 @@ export const serializeAws_json1_1DescribeModelQualityJobDefinitionCommand = asyn input: DescribeModelQualityJobDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeModelQualityJobDefinition", - }; + const headers: __HeaderBag = sharedHeaders("DescribeModelQualityJobDefinition"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeModelQualityJobDefinitionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3716,10 +3284,7 @@ export const serializeAws_json1_1DescribeMonitoringScheduleCommand = async ( input: DescribeMonitoringScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeMonitoringSchedule", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMonitoringSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMonitoringScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3729,10 +3294,7 @@ export const serializeAws_json1_1DescribeNotebookInstanceCommand = async ( input: DescribeNotebookInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeNotebookInstance", - }; + const headers: __HeaderBag = sharedHeaders("DescribeNotebookInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeNotebookInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3742,10 +3304,7 @@ export const serializeAws_json1_1DescribeNotebookInstanceLifecycleConfigCommand input: DescribeNotebookInstanceLifecycleConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeNotebookInstanceLifecycleConfig", - }; + const headers: __HeaderBag = sharedHeaders("DescribeNotebookInstanceLifecycleConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeNotebookInstanceLifecycleConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3755,10 +3314,7 @@ export const serializeAws_json1_1DescribePipelineCommand = async ( input: DescribePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribePipeline", - }; + const headers: __HeaderBag = sharedHeaders("DescribePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePipelineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3768,10 +3324,7 @@ export const serializeAws_json1_1DescribePipelineDefinitionForExecutionCommand = input: DescribePipelineDefinitionForExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribePipelineDefinitionForExecution", - }; + const headers: __HeaderBag = sharedHeaders("DescribePipelineDefinitionForExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePipelineDefinitionForExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3781,10 +3334,7 @@ export const serializeAws_json1_1DescribePipelineExecutionCommand = async ( input: DescribePipelineExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribePipelineExecution", - }; + const headers: __HeaderBag = sharedHeaders("DescribePipelineExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePipelineExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3794,10 +3344,7 @@ export const serializeAws_json1_1DescribeProcessingJobCommand = async ( input: DescribeProcessingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeProcessingJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProcessingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProcessingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3807,10 +3354,7 @@ export const serializeAws_json1_1DescribeProjectCommand = async ( input: DescribeProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeProject", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProject"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProjectInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3820,10 +3364,7 @@ export const serializeAws_json1_1DescribeSpaceCommand = async ( input: DescribeSpaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeSpace", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSpace"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSpaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3833,10 +3374,7 @@ export const serializeAws_json1_1DescribeStudioLifecycleConfigCommand = async ( input: DescribeStudioLifecycleConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeStudioLifecycleConfig", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStudioLifecycleConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStudioLifecycleConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3846,10 +3384,7 @@ export const serializeAws_json1_1DescribeSubscribedWorkteamCommand = async ( input: DescribeSubscribedWorkteamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeSubscribedWorkteam", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSubscribedWorkteam"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSubscribedWorkteamRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3859,10 +3394,7 @@ export const serializeAws_json1_1DescribeTrainingJobCommand = async ( input: DescribeTrainingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeTrainingJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTrainingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTrainingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3872,10 +3404,7 @@ export const serializeAws_json1_1DescribeTransformJobCommand = async ( input: DescribeTransformJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeTransformJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTransformJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTransformJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3885,10 +3414,7 @@ export const serializeAws_json1_1DescribeTrialCommand = async ( input: DescribeTrialCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeTrial", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTrial"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTrialRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3898,10 +3424,7 @@ export const serializeAws_json1_1DescribeTrialComponentCommand = async ( input: DescribeTrialComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeTrialComponent", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTrialComponent"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTrialComponentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3911,10 +3434,7 @@ export const serializeAws_json1_1DescribeUserProfileCommand = async ( input: DescribeUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3924,10 +3444,7 @@ export const serializeAws_json1_1DescribeWorkforceCommand = async ( input: DescribeWorkforceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeWorkforce", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkforce"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkforceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3937,10 +3454,7 @@ export const serializeAws_json1_1DescribeWorkteamCommand = async ( input: DescribeWorkteamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DescribeWorkteam", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkteam"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkteamRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3950,10 +3464,7 @@ export const serializeAws_json1_1DisableSagemakerServicecatalogPortfolioCommand input: DisableSagemakerServicecatalogPortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DisableSagemakerServicecatalogPortfolio", - }; + const headers: __HeaderBag = sharedHeaders("DisableSagemakerServicecatalogPortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableSagemakerServicecatalogPortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3963,10 +3474,7 @@ export const serializeAws_json1_1DisassociateTrialComponentCommand = async ( input: DisassociateTrialComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.DisassociateTrialComponent", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateTrialComponent"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateTrialComponentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3976,10 +3484,7 @@ export const serializeAws_json1_1EnableSagemakerServicecatalogPortfolioCommand = input: EnableSagemakerServicecatalogPortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.EnableSagemakerServicecatalogPortfolio", - }; + const headers: __HeaderBag = sharedHeaders("EnableSagemakerServicecatalogPortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableSagemakerServicecatalogPortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3989,10 +3494,7 @@ export const serializeAws_json1_1GetDeviceFleetReportCommand = async ( input: GetDeviceFleetReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.GetDeviceFleetReport", - }; + const headers: __HeaderBag = sharedHeaders("GetDeviceFleetReport"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeviceFleetReportRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4002,10 +3504,7 @@ export const serializeAws_json1_1GetLineageGroupPolicyCommand = async ( input: GetLineageGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.GetLineageGroupPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetLineageGroupPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLineageGroupPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4015,10 +3514,7 @@ export const serializeAws_json1_1GetModelPackageGroupPolicyCommand = async ( input: GetModelPackageGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.GetModelPackageGroupPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetModelPackageGroupPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetModelPackageGroupPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4028,10 +3524,7 @@ export const serializeAws_json1_1GetSagemakerServicecatalogPortfolioStatusComman input: GetSagemakerServicecatalogPortfolioStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.GetSagemakerServicecatalogPortfolioStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetSagemakerServicecatalogPortfolioStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSagemakerServicecatalogPortfolioStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4041,10 +3534,7 @@ export const serializeAws_json1_1GetSearchSuggestionsCommand = async ( input: GetSearchSuggestionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.GetSearchSuggestions", - }; + const headers: __HeaderBag = sharedHeaders("GetSearchSuggestions"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSearchSuggestionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4054,10 +3544,7 @@ export const serializeAws_json1_1ImportHubContentCommand = async ( input: ImportHubContentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ImportHubContent", - }; + const headers: __HeaderBag = sharedHeaders("ImportHubContent"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportHubContentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4067,10 +3554,7 @@ export const serializeAws_json1_1ListActionsCommand = async ( input: ListActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListActions", - }; + const headers: __HeaderBag = sharedHeaders("ListActions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListActionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4080,10 +3564,7 @@ export const serializeAws_json1_1ListAlgorithmsCommand = async ( input: ListAlgorithmsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListAlgorithms", - }; + const headers: __HeaderBag = sharedHeaders("ListAlgorithms"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAlgorithmsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4093,10 +3574,7 @@ export const serializeAws_json1_1ListAliasesCommand = async ( input: ListAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListAliases", - }; + const headers: __HeaderBag = sharedHeaders("ListAliases"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAliasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4106,10 +3584,7 @@ export const serializeAws_json1_1ListAppImageConfigsCommand = async ( input: ListAppImageConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListAppImageConfigs", - }; + const headers: __HeaderBag = sharedHeaders("ListAppImageConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAppImageConfigsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4119,10 +3594,7 @@ export const serializeAws_json1_1ListAppsCommand = async ( input: ListAppsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListApps", - }; + const headers: __HeaderBag = sharedHeaders("ListApps"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAppsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4132,10 +3604,7 @@ export const serializeAws_json1_1ListArtifactsCommand = async ( input: ListArtifactsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListArtifacts", - }; + const headers: __HeaderBag = sharedHeaders("ListArtifacts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListArtifactsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4145,10 +3614,7 @@ export const serializeAws_json1_1ListAssociationsCommand = async ( input: ListAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListAssociations", - }; + const headers: __HeaderBag = sharedHeaders("ListAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssociationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4158,10 +3624,7 @@ export const serializeAws_json1_1ListAutoMLJobsCommand = async ( input: ListAutoMLJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListAutoMLJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListAutoMLJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAutoMLJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4171,10 +3634,7 @@ export const serializeAws_json1_1ListCandidatesForAutoMLJobCommand = async ( input: ListCandidatesForAutoMLJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListCandidatesForAutoMLJob", - }; + const headers: __HeaderBag = sharedHeaders("ListCandidatesForAutoMLJob"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCandidatesForAutoMLJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4184,10 +3644,7 @@ export const serializeAws_json1_1ListCodeRepositoriesCommand = async ( input: ListCodeRepositoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListCodeRepositories", - }; + const headers: __HeaderBag = sharedHeaders("ListCodeRepositories"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCodeRepositoriesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4197,10 +3654,7 @@ export const serializeAws_json1_1ListCompilationJobsCommand = async ( input: ListCompilationJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListCompilationJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListCompilationJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCompilationJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4210,10 +3664,7 @@ export const serializeAws_json1_1ListContextsCommand = async ( input: ListContextsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListContexts", - }; + const headers: __HeaderBag = sharedHeaders("ListContexts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListContextsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4223,10 +3674,7 @@ export const serializeAws_json1_1ListDataQualityJobDefinitionsCommand = async ( input: ListDataQualityJobDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListDataQualityJobDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("ListDataQualityJobDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDataQualityJobDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4236,10 +3684,7 @@ export const serializeAws_json1_1ListDeviceFleetsCommand = async ( input: ListDeviceFleetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListDeviceFleets", - }; + const headers: __HeaderBag = sharedHeaders("ListDeviceFleets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDeviceFleetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4249,10 +3694,7 @@ export const serializeAws_json1_1ListDevicesCommand = async ( input: ListDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListDevices", - }; + const headers: __HeaderBag = sharedHeaders("ListDevices"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDevicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4262,10 +3704,7 @@ export const serializeAws_json1_1ListDomainsCommand = async ( input: ListDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListDomains", - }; + const headers: __HeaderBag = sharedHeaders("ListDomains"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDomainsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4275,10 +3714,7 @@ export const serializeAws_json1_1ListEdgeDeploymentPlansCommand = async ( input: ListEdgeDeploymentPlansCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListEdgeDeploymentPlans", - }; + const headers: __HeaderBag = sharedHeaders("ListEdgeDeploymentPlans"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEdgeDeploymentPlansRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4288,10 +3724,7 @@ export const serializeAws_json1_1ListEdgePackagingJobsCommand = async ( input: ListEdgePackagingJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListEdgePackagingJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListEdgePackagingJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEdgePackagingJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4301,10 +3734,7 @@ export const serializeAws_json1_1ListEndpointConfigsCommand = async ( input: ListEndpointConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListEndpointConfigs", - }; + const headers: __HeaderBag = sharedHeaders("ListEndpointConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEndpointConfigsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4314,10 +3744,7 @@ export const serializeAws_json1_1ListEndpointsCommand = async ( input: ListEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("ListEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEndpointsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4327,10 +3754,7 @@ export const serializeAws_json1_1ListExperimentsCommand = async ( input: ListExperimentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListExperiments", - }; + const headers: __HeaderBag = sharedHeaders("ListExperiments"); let body: any; body = JSON.stringify(serializeAws_json1_1ListExperimentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4340,10 +3764,7 @@ export const serializeAws_json1_1ListFeatureGroupsCommand = async ( input: ListFeatureGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListFeatureGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListFeatureGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFeatureGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4353,10 +3774,7 @@ export const serializeAws_json1_1ListFlowDefinitionsCommand = async ( input: ListFlowDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListFlowDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("ListFlowDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFlowDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4366,10 +3784,7 @@ export const serializeAws_json1_1ListHubContentsCommand = async ( input: ListHubContentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListHubContents", - }; + const headers: __HeaderBag = sharedHeaders("ListHubContents"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHubContentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4379,10 +3794,7 @@ export const serializeAws_json1_1ListHubContentVersionsCommand = async ( input: ListHubContentVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListHubContentVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListHubContentVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHubContentVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4392,10 +3804,7 @@ export const serializeAws_json1_1ListHubsCommand = async ( input: ListHubsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListHubs", - }; + const headers: __HeaderBag = sharedHeaders("ListHubs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHubsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4405,10 +3814,7 @@ export const serializeAws_json1_1ListHumanTaskUisCommand = async ( input: ListHumanTaskUisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListHumanTaskUis", - }; + const headers: __HeaderBag = sharedHeaders("ListHumanTaskUis"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHumanTaskUisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4418,10 +3824,7 @@ export const serializeAws_json1_1ListHyperParameterTuningJobsCommand = async ( input: ListHyperParameterTuningJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListHyperParameterTuningJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListHyperParameterTuningJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHyperParameterTuningJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4431,10 +3834,7 @@ export const serializeAws_json1_1ListImagesCommand = async ( input: ListImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListImages", - }; + const headers: __HeaderBag = sharedHeaders("ListImages"); let body: any; body = JSON.stringify(serializeAws_json1_1ListImagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4444,10 +3844,7 @@ export const serializeAws_json1_1ListImageVersionsCommand = async ( input: ListImageVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListImageVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListImageVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListImageVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4457,10 +3854,7 @@ export const serializeAws_json1_1ListInferenceExperimentsCommand = async ( input: ListInferenceExperimentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListInferenceExperiments", - }; + const headers: __HeaderBag = sharedHeaders("ListInferenceExperiments"); let body: any; body = JSON.stringify(serializeAws_json1_1ListInferenceExperimentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4470,10 +3864,7 @@ export const serializeAws_json1_1ListInferenceRecommendationsJobsCommand = async input: ListInferenceRecommendationsJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListInferenceRecommendationsJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListInferenceRecommendationsJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListInferenceRecommendationsJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4483,10 +3874,7 @@ export const serializeAws_json1_1ListInferenceRecommendationsJobStepsCommand = a input: ListInferenceRecommendationsJobStepsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListInferenceRecommendationsJobSteps", - }; + const headers: __HeaderBag = sharedHeaders("ListInferenceRecommendationsJobSteps"); let body: any; body = JSON.stringify(serializeAws_json1_1ListInferenceRecommendationsJobStepsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4496,10 +3884,7 @@ export const serializeAws_json1_1ListLabelingJobsCommand = async ( input: ListLabelingJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListLabelingJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListLabelingJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLabelingJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4509,10 +3894,7 @@ export const serializeAws_json1_1ListLabelingJobsForWorkteamCommand = async ( input: ListLabelingJobsForWorkteamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListLabelingJobsForWorkteam", - }; + const headers: __HeaderBag = sharedHeaders("ListLabelingJobsForWorkteam"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLabelingJobsForWorkteamRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4522,10 +3904,7 @@ export const serializeAws_json1_1ListLineageGroupsCommand = async ( input: ListLineageGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListLineageGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListLineageGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLineageGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4535,10 +3914,7 @@ export const serializeAws_json1_1ListModelBiasJobDefinitionsCommand = async ( input: ListModelBiasJobDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListModelBiasJobDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("ListModelBiasJobDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListModelBiasJobDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4548,10 +3924,7 @@ export const serializeAws_json1_1ListModelCardExportJobsCommand = async ( input: ListModelCardExportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListModelCardExportJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListModelCardExportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListModelCardExportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4561,10 +3934,7 @@ export const serializeAws_json1_1ListModelCardsCommand = async ( input: ListModelCardsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListModelCards", - }; + const headers: __HeaderBag = sharedHeaders("ListModelCards"); let body: any; body = JSON.stringify(serializeAws_json1_1ListModelCardsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4574,10 +3944,7 @@ export const serializeAws_json1_1ListModelCardVersionsCommand = async ( input: ListModelCardVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListModelCardVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListModelCardVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListModelCardVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4587,10 +3954,7 @@ export const serializeAws_json1_1ListModelExplainabilityJobDefinitionsCommand = input: ListModelExplainabilityJobDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListModelExplainabilityJobDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("ListModelExplainabilityJobDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListModelExplainabilityJobDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4600,10 +3964,7 @@ export const serializeAws_json1_1ListModelMetadataCommand = async ( input: ListModelMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListModelMetadata", - }; + const headers: __HeaderBag = sharedHeaders("ListModelMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1ListModelMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4613,10 +3974,7 @@ export const serializeAws_json1_1ListModelPackageGroupsCommand = async ( input: ListModelPackageGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListModelPackageGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListModelPackageGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListModelPackageGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4626,10 +3984,7 @@ export const serializeAws_json1_1ListModelPackagesCommand = async ( input: ListModelPackagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListModelPackages", - }; + const headers: __HeaderBag = sharedHeaders("ListModelPackages"); let body: any; body = JSON.stringify(serializeAws_json1_1ListModelPackagesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4639,10 +3994,7 @@ export const serializeAws_json1_1ListModelQualityJobDefinitionsCommand = async ( input: ListModelQualityJobDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListModelQualityJobDefinitions", - }; + const headers: __HeaderBag = sharedHeaders("ListModelQualityJobDefinitions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListModelQualityJobDefinitionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4652,10 +4004,7 @@ export const serializeAws_json1_1ListModelsCommand = async ( input: ListModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListModels", - }; + const headers: __HeaderBag = sharedHeaders("ListModels"); let body: any; body = JSON.stringify(serializeAws_json1_1ListModelsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4665,10 +4014,7 @@ export const serializeAws_json1_1ListMonitoringAlertHistoryCommand = async ( input: ListMonitoringAlertHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListMonitoringAlertHistory", - }; + const headers: __HeaderBag = sharedHeaders("ListMonitoringAlertHistory"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMonitoringAlertHistoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4678,10 +4024,7 @@ export const serializeAws_json1_1ListMonitoringAlertsCommand = async ( input: ListMonitoringAlertsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListMonitoringAlerts", - }; + const headers: __HeaderBag = sharedHeaders("ListMonitoringAlerts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMonitoringAlertsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4691,10 +4034,7 @@ export const serializeAws_json1_1ListMonitoringExecutionsCommand = async ( input: ListMonitoringExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListMonitoringExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListMonitoringExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMonitoringExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4704,10 +4044,7 @@ export const serializeAws_json1_1ListMonitoringSchedulesCommand = async ( input: ListMonitoringSchedulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListMonitoringSchedules", - }; + const headers: __HeaderBag = sharedHeaders("ListMonitoringSchedules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMonitoringSchedulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4717,10 +4054,7 @@ export const serializeAws_json1_1ListNotebookInstanceLifecycleConfigsCommand = a input: ListNotebookInstanceLifecycleConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListNotebookInstanceLifecycleConfigs", - }; + const headers: __HeaderBag = sharedHeaders("ListNotebookInstanceLifecycleConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListNotebookInstanceLifecycleConfigsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4730,10 +4064,7 @@ export const serializeAws_json1_1ListNotebookInstancesCommand = async ( input: ListNotebookInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListNotebookInstances", - }; + const headers: __HeaderBag = sharedHeaders("ListNotebookInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1ListNotebookInstancesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4743,10 +4074,7 @@ export const serializeAws_json1_1ListPipelineExecutionsCommand = async ( input: ListPipelineExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListPipelineExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListPipelineExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPipelineExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4756,10 +4084,7 @@ export const serializeAws_json1_1ListPipelineExecutionStepsCommand = async ( input: ListPipelineExecutionStepsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListPipelineExecutionSteps", - }; + const headers: __HeaderBag = sharedHeaders("ListPipelineExecutionSteps"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPipelineExecutionStepsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4769,10 +4094,7 @@ export const serializeAws_json1_1ListPipelineParametersForExecutionCommand = asy input: ListPipelineParametersForExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListPipelineParametersForExecution", - }; + const headers: __HeaderBag = sharedHeaders("ListPipelineParametersForExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPipelineParametersForExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4782,10 +4104,7 @@ export const serializeAws_json1_1ListPipelinesCommand = async ( input: ListPipelinesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListPipelines", - }; + const headers: __HeaderBag = sharedHeaders("ListPipelines"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPipelinesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4795,10 +4114,7 @@ export const serializeAws_json1_1ListProcessingJobsCommand = async ( input: ListProcessingJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListProcessingJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListProcessingJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProcessingJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4808,10 +4124,7 @@ export const serializeAws_json1_1ListProjectsCommand = async ( input: ListProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListProjects", - }; + const headers: __HeaderBag = sharedHeaders("ListProjects"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProjectsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4821,10 +4134,7 @@ export const serializeAws_json1_1ListSpacesCommand = async ( input: ListSpacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListSpaces", - }; + const headers: __HeaderBag = sharedHeaders("ListSpaces"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSpacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4834,10 +4144,7 @@ export const serializeAws_json1_1ListStageDevicesCommand = async ( input: ListStageDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListStageDevices", - }; + const headers: __HeaderBag = sharedHeaders("ListStageDevices"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStageDevicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4847,10 +4154,7 @@ export const serializeAws_json1_1ListStudioLifecycleConfigsCommand = async ( input: ListStudioLifecycleConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListStudioLifecycleConfigs", - }; + const headers: __HeaderBag = sharedHeaders("ListStudioLifecycleConfigs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStudioLifecycleConfigsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4860,10 +4164,7 @@ export const serializeAws_json1_1ListSubscribedWorkteamsCommand = async ( input: ListSubscribedWorkteamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListSubscribedWorkteams", - }; + const headers: __HeaderBag = sharedHeaders("ListSubscribedWorkteams"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSubscribedWorkteamsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4873,10 +4174,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListTags", - }; + const headers: __HeaderBag = sharedHeaders("ListTags"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4886,10 +4184,7 @@ export const serializeAws_json1_1ListTrainingJobsCommand = async ( input: ListTrainingJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListTrainingJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListTrainingJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTrainingJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4899,10 +4194,7 @@ export const serializeAws_json1_1ListTrainingJobsForHyperParameterTuningJobComma input: ListTrainingJobsForHyperParameterTuningJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListTrainingJobsForHyperParameterTuningJob", - }; + const headers: __HeaderBag = sharedHeaders("ListTrainingJobsForHyperParameterTuningJob"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTrainingJobsForHyperParameterTuningJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4912,10 +4204,7 @@ export const serializeAws_json1_1ListTransformJobsCommand = async ( input: ListTransformJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListTransformJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListTransformJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTransformJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4925,10 +4214,7 @@ export const serializeAws_json1_1ListTrialComponentsCommand = async ( input: ListTrialComponentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListTrialComponents", - }; + const headers: __HeaderBag = sharedHeaders("ListTrialComponents"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTrialComponentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4938,10 +4224,7 @@ export const serializeAws_json1_1ListTrialsCommand = async ( input: ListTrialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListTrials", - }; + const headers: __HeaderBag = sharedHeaders("ListTrials"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTrialsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4951,10 +4234,7 @@ export const serializeAws_json1_1ListUserProfilesCommand = async ( input: ListUserProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListUserProfiles", - }; + const headers: __HeaderBag = sharedHeaders("ListUserProfiles"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUserProfilesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4964,10 +4244,7 @@ export const serializeAws_json1_1ListWorkforcesCommand = async ( input: ListWorkforcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListWorkforces", - }; + const headers: __HeaderBag = sharedHeaders("ListWorkforces"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWorkforcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4977,10 +4254,7 @@ export const serializeAws_json1_1ListWorkteamsCommand = async ( input: ListWorkteamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.ListWorkteams", - }; + const headers: __HeaderBag = sharedHeaders("ListWorkteams"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWorkteamsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4990,10 +4264,7 @@ export const serializeAws_json1_1PutModelPackageGroupPolicyCommand = async ( input: PutModelPackageGroupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.PutModelPackageGroupPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutModelPackageGroupPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutModelPackageGroupPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5003,10 +4274,7 @@ export const serializeAws_json1_1QueryLineageCommand = async ( input: QueryLineageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.QueryLineage", - }; + const headers: __HeaderBag = sharedHeaders("QueryLineage"); let body: any; body = JSON.stringify(serializeAws_json1_1QueryLineageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5016,10 +4284,7 @@ export const serializeAws_json1_1RegisterDevicesCommand = async ( input: RegisterDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.RegisterDevices", - }; + const headers: __HeaderBag = sharedHeaders("RegisterDevices"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterDevicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5029,10 +4294,7 @@ export const serializeAws_json1_1RenderUiTemplateCommand = async ( input: RenderUiTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.RenderUiTemplate", - }; + const headers: __HeaderBag = sharedHeaders("RenderUiTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1RenderUiTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5042,10 +4304,7 @@ export const serializeAws_json1_1RetryPipelineExecutionCommand = async ( input: RetryPipelineExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.RetryPipelineExecution", - }; + const headers: __HeaderBag = sharedHeaders("RetryPipelineExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1RetryPipelineExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5055,10 +4314,7 @@ export const serializeAws_json1_1SearchCommand = async ( input: SearchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.Search", - }; + const headers: __HeaderBag = sharedHeaders("Search"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5068,10 +4324,7 @@ export const serializeAws_json1_1SendPipelineExecutionStepFailureCommand = async input: SendPipelineExecutionStepFailureCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.SendPipelineExecutionStepFailure", - }; + const headers: __HeaderBag = sharedHeaders("SendPipelineExecutionStepFailure"); let body: any; body = JSON.stringify(serializeAws_json1_1SendPipelineExecutionStepFailureRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5081,10 +4334,7 @@ export const serializeAws_json1_1SendPipelineExecutionStepSuccessCommand = async input: SendPipelineExecutionStepSuccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.SendPipelineExecutionStepSuccess", - }; + const headers: __HeaderBag = sharedHeaders("SendPipelineExecutionStepSuccess"); let body: any; body = JSON.stringify(serializeAws_json1_1SendPipelineExecutionStepSuccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5094,10 +4344,7 @@ export const serializeAws_json1_1StartEdgeDeploymentStageCommand = async ( input: StartEdgeDeploymentStageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StartEdgeDeploymentStage", - }; + const headers: __HeaderBag = sharedHeaders("StartEdgeDeploymentStage"); let body: any; body = JSON.stringify(serializeAws_json1_1StartEdgeDeploymentStageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5107,10 +4354,7 @@ export const serializeAws_json1_1StartInferenceExperimentCommand = async ( input: StartInferenceExperimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StartInferenceExperiment", - }; + const headers: __HeaderBag = sharedHeaders("StartInferenceExperiment"); let body: any; body = JSON.stringify(serializeAws_json1_1StartInferenceExperimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5120,10 +4364,7 @@ export const serializeAws_json1_1StartMonitoringScheduleCommand = async ( input: StartMonitoringScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StartMonitoringSchedule", - }; + const headers: __HeaderBag = sharedHeaders("StartMonitoringSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1StartMonitoringScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5133,10 +4374,7 @@ export const serializeAws_json1_1StartNotebookInstanceCommand = async ( input: StartNotebookInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StartNotebookInstance", - }; + const headers: __HeaderBag = sharedHeaders("StartNotebookInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1StartNotebookInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5146,10 +4384,7 @@ export const serializeAws_json1_1StartPipelineExecutionCommand = async ( input: StartPipelineExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StartPipelineExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartPipelineExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StartPipelineExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5159,10 +4394,7 @@ export const serializeAws_json1_1StopAutoMLJobCommand = async ( input: StopAutoMLJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopAutoMLJob", - }; + const headers: __HeaderBag = sharedHeaders("StopAutoMLJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopAutoMLJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5172,10 +4404,7 @@ export const serializeAws_json1_1StopCompilationJobCommand = async ( input: StopCompilationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopCompilationJob", - }; + const headers: __HeaderBag = sharedHeaders("StopCompilationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopCompilationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5185,10 +4414,7 @@ export const serializeAws_json1_1StopEdgeDeploymentStageCommand = async ( input: StopEdgeDeploymentStageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopEdgeDeploymentStage", - }; + const headers: __HeaderBag = sharedHeaders("StopEdgeDeploymentStage"); let body: any; body = JSON.stringify(serializeAws_json1_1StopEdgeDeploymentStageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5198,10 +4424,7 @@ export const serializeAws_json1_1StopEdgePackagingJobCommand = async ( input: StopEdgePackagingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopEdgePackagingJob", - }; + const headers: __HeaderBag = sharedHeaders("StopEdgePackagingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopEdgePackagingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5211,10 +4434,7 @@ export const serializeAws_json1_1StopHyperParameterTuningJobCommand = async ( input: StopHyperParameterTuningJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopHyperParameterTuningJob", - }; + const headers: __HeaderBag = sharedHeaders("StopHyperParameterTuningJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopHyperParameterTuningJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5224,10 +4444,7 @@ export const serializeAws_json1_1StopInferenceExperimentCommand = async ( input: StopInferenceExperimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopInferenceExperiment", - }; + const headers: __HeaderBag = sharedHeaders("StopInferenceExperiment"); let body: any; body = JSON.stringify(serializeAws_json1_1StopInferenceExperimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5237,10 +4454,7 @@ export const serializeAws_json1_1StopInferenceRecommendationsJobCommand = async input: StopInferenceRecommendationsJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopInferenceRecommendationsJob", - }; + const headers: __HeaderBag = sharedHeaders("StopInferenceRecommendationsJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopInferenceRecommendationsJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5250,10 +4464,7 @@ export const serializeAws_json1_1StopLabelingJobCommand = async ( input: StopLabelingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopLabelingJob", - }; + const headers: __HeaderBag = sharedHeaders("StopLabelingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopLabelingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5263,10 +4474,7 @@ export const serializeAws_json1_1StopMonitoringScheduleCommand = async ( input: StopMonitoringScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopMonitoringSchedule", - }; + const headers: __HeaderBag = sharedHeaders("StopMonitoringSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1StopMonitoringScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5276,10 +4484,7 @@ export const serializeAws_json1_1StopNotebookInstanceCommand = async ( input: StopNotebookInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopNotebookInstance", - }; + const headers: __HeaderBag = sharedHeaders("StopNotebookInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1StopNotebookInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5289,10 +4494,7 @@ export const serializeAws_json1_1StopPipelineExecutionCommand = async ( input: StopPipelineExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopPipelineExecution", - }; + const headers: __HeaderBag = sharedHeaders("StopPipelineExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StopPipelineExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5302,10 +4504,7 @@ export const serializeAws_json1_1StopProcessingJobCommand = async ( input: StopProcessingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopProcessingJob", - }; + const headers: __HeaderBag = sharedHeaders("StopProcessingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopProcessingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5315,10 +4514,7 @@ export const serializeAws_json1_1StopTrainingJobCommand = async ( input: StopTrainingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopTrainingJob", - }; + const headers: __HeaderBag = sharedHeaders("StopTrainingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopTrainingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5328,10 +4524,7 @@ export const serializeAws_json1_1StopTransformJobCommand = async ( input: StopTransformJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.StopTransformJob", - }; + const headers: __HeaderBag = sharedHeaders("StopTransformJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopTransformJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5341,10 +4534,7 @@ export const serializeAws_json1_1UpdateActionCommand = async ( input: UpdateActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateAction", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAction"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateActionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5354,10 +4544,7 @@ export const serializeAws_json1_1UpdateAppImageConfigCommand = async ( input: UpdateAppImageConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateAppImageConfig", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAppImageConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAppImageConfigRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5367,10 +4554,7 @@ export const serializeAws_json1_1UpdateArtifactCommand = async ( input: UpdateArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateArtifact", - }; + const headers: __HeaderBag = sharedHeaders("UpdateArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateArtifactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5380,10 +4564,7 @@ export const serializeAws_json1_1UpdateCodeRepositoryCommand = async ( input: UpdateCodeRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateCodeRepository", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCodeRepository"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCodeRepositoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5393,10 +4574,7 @@ export const serializeAws_json1_1UpdateContextCommand = async ( input: UpdateContextCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateContext", - }; + const headers: __HeaderBag = sharedHeaders("UpdateContext"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateContextRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5406,10 +4584,7 @@ export const serializeAws_json1_1UpdateDeviceFleetCommand = async ( input: UpdateDeviceFleetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateDeviceFleet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDeviceFleet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDeviceFleetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5419,10 +4594,7 @@ export const serializeAws_json1_1UpdateDevicesCommand = async ( input: UpdateDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateDevices", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDevices"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDevicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5432,10 +4604,7 @@ export const serializeAws_json1_1UpdateDomainCommand = async ( input: UpdateDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateDomain", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5445,10 +4614,7 @@ export const serializeAws_json1_1UpdateEndpointCommand = async ( input: UpdateEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateEndpoint", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEndpoint"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEndpointInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5458,10 +4624,7 @@ export const serializeAws_json1_1UpdateEndpointWeightsAndCapacitiesCommand = asy input: UpdateEndpointWeightsAndCapacitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateEndpointWeightsAndCapacities", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEndpointWeightsAndCapacities"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEndpointWeightsAndCapacitiesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5471,10 +4634,7 @@ export const serializeAws_json1_1UpdateExperimentCommand = async ( input: UpdateExperimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateExperiment", - }; + const headers: __HeaderBag = sharedHeaders("UpdateExperiment"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateExperimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5484,10 +4644,7 @@ export const serializeAws_json1_1UpdateFeatureGroupCommand = async ( input: UpdateFeatureGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateFeatureGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFeatureGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFeatureGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5497,10 +4654,7 @@ export const serializeAws_json1_1UpdateFeatureMetadataCommand = async ( input: UpdateFeatureMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateFeatureMetadata", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFeatureMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFeatureMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5510,10 +4664,7 @@ export const serializeAws_json1_1UpdateHubCommand = async ( input: UpdateHubCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateHub", - }; + const headers: __HeaderBag = sharedHeaders("UpdateHub"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateHubRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5523,10 +4674,7 @@ export const serializeAws_json1_1UpdateImageCommand = async ( input: UpdateImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateImage", - }; + const headers: __HeaderBag = sharedHeaders("UpdateImage"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5536,10 +4684,7 @@ export const serializeAws_json1_1UpdateImageVersionCommand = async ( input: UpdateImageVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateImageVersion", - }; + const headers: __HeaderBag = sharedHeaders("UpdateImageVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateImageVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5549,10 +4694,7 @@ export const serializeAws_json1_1UpdateInferenceExperimentCommand = async ( input: UpdateInferenceExperimentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateInferenceExperiment", - }; + const headers: __HeaderBag = sharedHeaders("UpdateInferenceExperiment"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateInferenceExperimentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5562,10 +4704,7 @@ export const serializeAws_json1_1UpdateModelCardCommand = async ( input: UpdateModelCardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateModelCard", - }; + const headers: __HeaderBag = sharedHeaders("UpdateModelCard"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateModelCardRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5575,10 +4714,7 @@ export const serializeAws_json1_1UpdateModelPackageCommand = async ( input: UpdateModelPackageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateModelPackage", - }; + const headers: __HeaderBag = sharedHeaders("UpdateModelPackage"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateModelPackageInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5588,10 +4724,7 @@ export const serializeAws_json1_1UpdateMonitoringAlertCommand = async ( input: UpdateMonitoringAlertCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateMonitoringAlert", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMonitoringAlert"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMonitoringAlertRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5601,10 +4734,7 @@ export const serializeAws_json1_1UpdateMonitoringScheduleCommand = async ( input: UpdateMonitoringScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateMonitoringSchedule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMonitoringSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMonitoringScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5614,10 +4744,7 @@ export const serializeAws_json1_1UpdateNotebookInstanceCommand = async ( input: UpdateNotebookInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateNotebookInstance", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNotebookInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNotebookInstanceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5627,10 +4754,7 @@ export const serializeAws_json1_1UpdateNotebookInstanceLifecycleConfigCommand = input: UpdateNotebookInstanceLifecycleConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateNotebookInstanceLifecycleConfig", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNotebookInstanceLifecycleConfig"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNotebookInstanceLifecycleConfigInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5640,10 +4764,7 @@ export const serializeAws_json1_1UpdatePipelineCommand = async ( input: UpdatePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdatePipeline", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePipeline"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePipelineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5653,10 +4774,7 @@ export const serializeAws_json1_1UpdatePipelineExecutionCommand = async ( input: UpdatePipelineExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdatePipelineExecution", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePipelineExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePipelineExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5666,10 +4784,7 @@ export const serializeAws_json1_1UpdateProjectCommand = async ( input: UpdateProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateProject", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProject"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProjectInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5679,10 +4794,7 @@ export const serializeAws_json1_1UpdateSpaceCommand = async ( input: UpdateSpaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateSpace", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSpace"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSpaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5692,10 +4804,7 @@ export const serializeAws_json1_1UpdateTrainingJobCommand = async ( input: UpdateTrainingJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateTrainingJob", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTrainingJob"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTrainingJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5705,10 +4814,7 @@ export const serializeAws_json1_1UpdateTrialCommand = async ( input: UpdateTrialCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateTrial", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTrial"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTrialRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5718,10 +4824,7 @@ export const serializeAws_json1_1UpdateTrialComponentCommand = async ( input: UpdateTrialComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateTrialComponent", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTrialComponent"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTrialComponentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5731,10 +4834,7 @@ export const serializeAws_json1_1UpdateUserProfileCommand = async ( input: UpdateUserProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateUserProfile", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUserProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5744,10 +4844,7 @@ export const serializeAws_json1_1UpdateWorkforceCommand = async ( input: UpdateWorkforceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateWorkforce", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWorkforce"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWorkforceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -5757,10 +4854,7 @@ export const serializeAws_json1_1UpdateWorkteamCommand = async ( input: UpdateWorkteamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SageMaker.UpdateWorkteam", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWorkteam"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWorkteamRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -39518,6 +38612,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `SageMaker.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts index e8fd2ccac504e..642da49b0ea44 100644 --- a/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts +++ b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts @@ -131,10 +131,7 @@ export const serializeAws_json1_1CancelRotateSecretCommand = async ( input: CancelRotateSecretCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.CancelRotateSecret", - }; + const headers: __HeaderBag = sharedHeaders("CancelRotateSecret"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelRotateSecretRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -144,10 +141,7 @@ export const serializeAws_json1_1CreateSecretCommand = async ( input: CreateSecretCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.CreateSecret", - }; + const headers: __HeaderBag = sharedHeaders("CreateSecret"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSecretRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -157,10 +151,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.DeleteResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -170,10 +161,7 @@ export const serializeAws_json1_1DeleteSecretCommand = async ( input: DeleteSecretCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.DeleteSecret", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSecret"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSecretRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -183,10 +171,7 @@ export const serializeAws_json1_1DescribeSecretCommand = async ( input: DescribeSecretCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.DescribeSecret", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSecret"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSecretRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -196,10 +181,7 @@ export const serializeAws_json1_1GetRandomPasswordCommand = async ( input: GetRandomPasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.GetRandomPassword", - }; + const headers: __HeaderBag = sharedHeaders("GetRandomPassword"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRandomPasswordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -209,10 +191,7 @@ export const serializeAws_json1_1GetResourcePolicyCommand = async ( input: GetResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.GetResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -222,10 +201,7 @@ export const serializeAws_json1_1GetSecretValueCommand = async ( input: GetSecretValueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.GetSecretValue", - }; + const headers: __HeaderBag = sharedHeaders("GetSecretValue"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSecretValueRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -235,10 +211,7 @@ export const serializeAws_json1_1ListSecretsCommand = async ( input: ListSecretsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.ListSecrets", - }; + const headers: __HeaderBag = sharedHeaders("ListSecrets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSecretsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -248,10 +221,7 @@ export const serializeAws_json1_1ListSecretVersionIdsCommand = async ( input: ListSecretVersionIdsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.ListSecretVersionIds", - }; + const headers: __HeaderBag = sharedHeaders("ListSecretVersionIds"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSecretVersionIdsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -261,10 +231,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( input: PutResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.PutResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -274,10 +241,7 @@ export const serializeAws_json1_1PutSecretValueCommand = async ( input: PutSecretValueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.PutSecretValue", - }; + const headers: __HeaderBag = sharedHeaders("PutSecretValue"); let body: any; body = JSON.stringify(serializeAws_json1_1PutSecretValueRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -287,10 +251,7 @@ export const serializeAws_json1_1RemoveRegionsFromReplicationCommand = async ( input: RemoveRegionsFromReplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.RemoveRegionsFromReplication", - }; + const headers: __HeaderBag = sharedHeaders("RemoveRegionsFromReplication"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveRegionsFromReplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -300,10 +261,7 @@ export const serializeAws_json1_1ReplicateSecretToRegionsCommand = async ( input: ReplicateSecretToRegionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.ReplicateSecretToRegions", - }; + const headers: __HeaderBag = sharedHeaders("ReplicateSecretToRegions"); let body: any; body = JSON.stringify(serializeAws_json1_1ReplicateSecretToRegionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -313,10 +271,7 @@ export const serializeAws_json1_1RestoreSecretCommand = async ( input: RestoreSecretCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.RestoreSecret", - }; + const headers: __HeaderBag = sharedHeaders("RestoreSecret"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreSecretRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -326,10 +281,7 @@ export const serializeAws_json1_1RotateSecretCommand = async ( input: RotateSecretCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.RotateSecret", - }; + const headers: __HeaderBag = sharedHeaders("RotateSecret"); let body: any; body = JSON.stringify(serializeAws_json1_1RotateSecretRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -339,10 +291,7 @@ export const serializeAws_json1_1StopReplicationToReplicaCommand = async ( input: StopReplicationToReplicaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.StopReplicationToReplica", - }; + const headers: __HeaderBag = sharedHeaders("StopReplicationToReplica"); let body: any; body = JSON.stringify(serializeAws_json1_1StopReplicationToReplicaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -352,10 +301,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -365,10 +311,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -378,10 +321,7 @@ export const serializeAws_json1_1UpdateSecretCommand = async ( input: UpdateSecretCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.UpdateSecret", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSecret"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSecretRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -391,10 +331,7 @@ export const serializeAws_json1_1UpdateSecretVersionStageCommand = async ( input: UpdateSecretVersionStageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.UpdateSecretVersionStage", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSecretVersionStage"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSecretVersionStageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -404,10 +341,7 @@ export const serializeAws_json1_1ValidateResourcePolicyCommand = async ( input: ValidateResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "secretsmanager.ValidateResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("ValidateResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1ValidateResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2626,6 +2560,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `secretsmanager.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts index 4028f738d0e45..97d1681330078 100644 --- a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts @@ -546,10 +546,7 @@ export const serializeAws_json1_1AcceptPortfolioShareCommand = async ( input: AcceptPortfolioShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.AcceptPortfolioShare", - }; + const headers: __HeaderBag = sharedHeaders("AcceptPortfolioShare"); let body: any; body = JSON.stringify(serializeAws_json1_1AcceptPortfolioShareInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -559,10 +556,7 @@ export const serializeAws_json1_1AssociateBudgetWithResourceCommand = async ( input: AssociateBudgetWithResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.AssociateBudgetWithResource", - }; + const headers: __HeaderBag = sharedHeaders("AssociateBudgetWithResource"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateBudgetWithResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -572,10 +566,7 @@ export const serializeAws_json1_1AssociatePrincipalWithPortfolioCommand = async input: AssociatePrincipalWithPortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.AssociatePrincipalWithPortfolio", - }; + const headers: __HeaderBag = sharedHeaders("AssociatePrincipalWithPortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociatePrincipalWithPortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -585,10 +576,7 @@ export const serializeAws_json1_1AssociateProductWithPortfolioCommand = async ( input: AssociateProductWithPortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.AssociateProductWithPortfolio", - }; + const headers: __HeaderBag = sharedHeaders("AssociateProductWithPortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateProductWithPortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -598,10 +586,7 @@ export const serializeAws_json1_1AssociateServiceActionWithProvisioningArtifactC input: AssociateServiceActionWithProvisioningArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.AssociateServiceActionWithProvisioningArtifact", - }; + const headers: __HeaderBag = sharedHeaders("AssociateServiceActionWithProvisioningArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateServiceActionWithProvisioningArtifactInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -611,10 +596,7 @@ export const serializeAws_json1_1AssociateTagOptionWithResourceCommand = async ( input: AssociateTagOptionWithResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.AssociateTagOptionWithResource", - }; + const headers: __HeaderBag = sharedHeaders("AssociateTagOptionWithResource"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateTagOptionWithResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -624,10 +606,7 @@ export const serializeAws_json1_1BatchAssociateServiceActionWithProvisioningArti input: BatchAssociateServiceActionWithProvisioningArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.BatchAssociateServiceActionWithProvisioningArtifact", - }; + const headers: __HeaderBag = sharedHeaders("BatchAssociateServiceActionWithProvisioningArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1BatchAssociateServiceActionWithProvisioningArtifactInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -637,10 +616,7 @@ export const serializeAws_json1_1BatchDisassociateServiceActionFromProvisioningA input: BatchDisassociateServiceActionFromProvisioningArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.BatchDisassociateServiceActionFromProvisioningArtifact", - }; + const headers: __HeaderBag = sharedHeaders("BatchDisassociateServiceActionFromProvisioningArtifact"); let body: any; body = JSON.stringify( serializeAws_json1_1BatchDisassociateServiceActionFromProvisioningArtifactInput(input, context) @@ -652,10 +628,7 @@ export const serializeAws_json1_1CopyProductCommand = async ( input: CopyProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.CopyProduct", - }; + const headers: __HeaderBag = sharedHeaders("CopyProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1CopyProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -665,10 +638,7 @@ export const serializeAws_json1_1CreateConstraintCommand = async ( input: CreateConstraintCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.CreateConstraint", - }; + const headers: __HeaderBag = sharedHeaders("CreateConstraint"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateConstraintInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -678,10 +648,7 @@ export const serializeAws_json1_1CreatePortfolioCommand = async ( input: CreatePortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.CreatePortfolio", - }; + const headers: __HeaderBag = sharedHeaders("CreatePortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -691,10 +658,7 @@ export const serializeAws_json1_1CreatePortfolioShareCommand = async ( input: CreatePortfolioShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.CreatePortfolioShare", - }; + const headers: __HeaderBag = sharedHeaders("CreatePortfolioShare"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePortfolioShareInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -704,10 +668,7 @@ export const serializeAws_json1_1CreateProductCommand = async ( input: CreateProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.CreateProduct", - }; + const headers: __HeaderBag = sharedHeaders("CreateProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -717,10 +678,7 @@ export const serializeAws_json1_1CreateProvisionedProductPlanCommand = async ( input: CreateProvisionedProductPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.CreateProvisionedProductPlan", - }; + const headers: __HeaderBag = sharedHeaders("CreateProvisionedProductPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProvisionedProductPlanInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -730,10 +688,7 @@ export const serializeAws_json1_1CreateProvisioningArtifactCommand = async ( input: CreateProvisioningArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.CreateProvisioningArtifact", - }; + const headers: __HeaderBag = sharedHeaders("CreateProvisioningArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProvisioningArtifactInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -743,10 +698,7 @@ export const serializeAws_json1_1CreateServiceActionCommand = async ( input: CreateServiceActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.CreateServiceAction", - }; + const headers: __HeaderBag = sharedHeaders("CreateServiceAction"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateServiceActionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -756,10 +708,7 @@ export const serializeAws_json1_1CreateTagOptionCommand = async ( input: CreateTagOptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.CreateTagOption", - }; + const headers: __HeaderBag = sharedHeaders("CreateTagOption"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTagOptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -769,10 +718,7 @@ export const serializeAws_json1_1DeleteConstraintCommand = async ( input: DeleteConstraintCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DeleteConstraint", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConstraint"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConstraintInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -782,10 +728,7 @@ export const serializeAws_json1_1DeletePortfolioCommand = async ( input: DeletePortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DeletePortfolio", - }; + const headers: __HeaderBag = sharedHeaders("DeletePortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -795,10 +738,7 @@ export const serializeAws_json1_1DeletePortfolioShareCommand = async ( input: DeletePortfolioShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DeletePortfolioShare", - }; + const headers: __HeaderBag = sharedHeaders("DeletePortfolioShare"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePortfolioShareInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -808,10 +748,7 @@ export const serializeAws_json1_1DeleteProductCommand = async ( input: DeleteProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DeleteProduct", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -821,10 +758,7 @@ export const serializeAws_json1_1DeleteProvisionedProductPlanCommand = async ( input: DeleteProvisionedProductPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DeleteProvisionedProductPlan", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProvisionedProductPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProvisionedProductPlanInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -834,10 +768,7 @@ export const serializeAws_json1_1DeleteProvisioningArtifactCommand = async ( input: DeleteProvisioningArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DeleteProvisioningArtifact", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProvisioningArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProvisioningArtifactInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -847,10 +778,7 @@ export const serializeAws_json1_1DeleteServiceActionCommand = async ( input: DeleteServiceActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DeleteServiceAction", - }; + const headers: __HeaderBag = sharedHeaders("DeleteServiceAction"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteServiceActionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -860,10 +788,7 @@ export const serializeAws_json1_1DeleteTagOptionCommand = async ( input: DeleteTagOptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DeleteTagOption", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTagOption"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTagOptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -873,10 +798,7 @@ export const serializeAws_json1_1DescribeConstraintCommand = async ( input: DescribeConstraintCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeConstraint", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConstraint"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConstraintInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -886,10 +808,7 @@ export const serializeAws_json1_1DescribeCopyProductStatusCommand = async ( input: DescribeCopyProductStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeCopyProductStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCopyProductStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCopyProductStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -899,10 +818,7 @@ export const serializeAws_json1_1DescribePortfolioCommand = async ( input: DescribePortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribePortfolio", - }; + const headers: __HeaderBag = sharedHeaders("DescribePortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -912,10 +828,7 @@ export const serializeAws_json1_1DescribePortfolioSharesCommand = async ( input: DescribePortfolioSharesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribePortfolioShares", - }; + const headers: __HeaderBag = sharedHeaders("DescribePortfolioShares"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePortfolioSharesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -925,10 +838,7 @@ export const serializeAws_json1_1DescribePortfolioShareStatusCommand = async ( input: DescribePortfolioShareStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribePortfolioShareStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribePortfolioShareStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePortfolioShareStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -938,10 +848,7 @@ export const serializeAws_json1_1DescribeProductCommand = async ( input: DescribeProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeProduct", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -951,10 +858,7 @@ export const serializeAws_json1_1DescribeProductAsAdminCommand = async ( input: DescribeProductAsAdminCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeProductAsAdmin", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProductAsAdmin"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProductAsAdminInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -964,10 +868,7 @@ export const serializeAws_json1_1DescribeProductViewCommand = async ( input: DescribeProductViewCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeProductView", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProductView"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProductViewInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -977,10 +878,7 @@ export const serializeAws_json1_1DescribeProvisionedProductCommand = async ( input: DescribeProvisionedProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeProvisionedProduct", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProvisionedProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProvisionedProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -990,10 +888,7 @@ export const serializeAws_json1_1DescribeProvisionedProductPlanCommand = async ( input: DescribeProvisionedProductPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeProvisionedProductPlan", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProvisionedProductPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProvisionedProductPlanInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1003,10 +898,7 @@ export const serializeAws_json1_1DescribeProvisioningArtifactCommand = async ( input: DescribeProvisioningArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeProvisioningArtifact", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProvisioningArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProvisioningArtifactInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1016,10 +908,7 @@ export const serializeAws_json1_1DescribeProvisioningParametersCommand = async ( input: DescribeProvisioningParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeProvisioningParameters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProvisioningParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProvisioningParametersInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1029,10 +918,7 @@ export const serializeAws_json1_1DescribeRecordCommand = async ( input: DescribeRecordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeRecord", - }; + const headers: __HeaderBag = sharedHeaders("DescribeRecord"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeRecordInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1042,10 +928,7 @@ export const serializeAws_json1_1DescribeServiceActionCommand = async ( input: DescribeServiceActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeServiceAction", - }; + const headers: __HeaderBag = sharedHeaders("DescribeServiceAction"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeServiceActionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1055,10 +938,7 @@ export const serializeAws_json1_1DescribeServiceActionExecutionParametersCommand input: DescribeServiceActionExecutionParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeServiceActionExecutionParameters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeServiceActionExecutionParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeServiceActionExecutionParametersInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1068,10 +948,7 @@ export const serializeAws_json1_1DescribeTagOptionCommand = async ( input: DescribeTagOptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DescribeTagOption", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTagOption"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTagOptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1081,10 +958,7 @@ export const serializeAws_json1_1DisableAWSOrganizationsAccessCommand = async ( input: DisableAWSOrganizationsAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DisableAWSOrganizationsAccess", - }; + const headers: __HeaderBag = sharedHeaders("DisableAWSOrganizationsAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableAWSOrganizationsAccessInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1094,10 +968,7 @@ export const serializeAws_json1_1DisassociateBudgetFromResourceCommand = async ( input: DisassociateBudgetFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DisassociateBudgetFromResource", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateBudgetFromResource"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateBudgetFromResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1107,10 +978,7 @@ export const serializeAws_json1_1DisassociatePrincipalFromPortfolioCommand = asy input: DisassociatePrincipalFromPortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DisassociatePrincipalFromPortfolio", - }; + const headers: __HeaderBag = sharedHeaders("DisassociatePrincipalFromPortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociatePrincipalFromPortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1120,10 +988,7 @@ export const serializeAws_json1_1DisassociateProductFromPortfolioCommand = async input: DisassociateProductFromPortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DisassociateProductFromPortfolio", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateProductFromPortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateProductFromPortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1133,10 +998,7 @@ export const serializeAws_json1_1DisassociateServiceActionFromProvisioningArtifa input: DisassociateServiceActionFromProvisioningArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DisassociateServiceActionFromProvisioningArtifact", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateServiceActionFromProvisioningArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateServiceActionFromProvisioningArtifactInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1146,10 +1008,7 @@ export const serializeAws_json1_1DisassociateTagOptionFromResourceCommand = asyn input: DisassociateTagOptionFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.DisassociateTagOptionFromResource", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateTagOptionFromResource"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateTagOptionFromResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1159,10 +1018,7 @@ export const serializeAws_json1_1EnableAWSOrganizationsAccessCommand = async ( input: EnableAWSOrganizationsAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.EnableAWSOrganizationsAccess", - }; + const headers: __HeaderBag = sharedHeaders("EnableAWSOrganizationsAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableAWSOrganizationsAccessInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1172,10 +1028,7 @@ export const serializeAws_json1_1ExecuteProvisionedProductPlanCommand = async ( input: ExecuteProvisionedProductPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ExecuteProvisionedProductPlan", - }; + const headers: __HeaderBag = sharedHeaders("ExecuteProvisionedProductPlan"); let body: any; body = JSON.stringify(serializeAws_json1_1ExecuteProvisionedProductPlanInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1185,10 +1038,7 @@ export const serializeAws_json1_1ExecuteProvisionedProductServiceActionCommand = input: ExecuteProvisionedProductServiceActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ExecuteProvisionedProductServiceAction", - }; + const headers: __HeaderBag = sharedHeaders("ExecuteProvisionedProductServiceAction"); let body: any; body = JSON.stringify(serializeAws_json1_1ExecuteProvisionedProductServiceActionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1198,10 +1048,7 @@ export const serializeAws_json1_1GetAWSOrganizationsAccessStatusCommand = async input: GetAWSOrganizationsAccessStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.GetAWSOrganizationsAccessStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetAWSOrganizationsAccessStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAWSOrganizationsAccessStatusInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1211,10 +1058,7 @@ export const serializeAws_json1_1GetProvisionedProductOutputsCommand = async ( input: GetProvisionedProductOutputsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.GetProvisionedProductOutputs", - }; + const headers: __HeaderBag = sharedHeaders("GetProvisionedProductOutputs"); let body: any; body = JSON.stringify(serializeAws_json1_1GetProvisionedProductOutputsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1224,10 +1068,7 @@ export const serializeAws_json1_1ImportAsProvisionedProductCommand = async ( input: ImportAsProvisionedProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ImportAsProvisionedProduct", - }; + const headers: __HeaderBag = sharedHeaders("ImportAsProvisionedProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportAsProvisionedProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1237,10 +1078,7 @@ export const serializeAws_json1_1ListAcceptedPortfolioSharesCommand = async ( input: ListAcceptedPortfolioSharesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListAcceptedPortfolioShares", - }; + const headers: __HeaderBag = sharedHeaders("ListAcceptedPortfolioShares"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAcceptedPortfolioSharesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1250,10 +1088,7 @@ export const serializeAws_json1_1ListBudgetsForResourceCommand = async ( input: ListBudgetsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListBudgetsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListBudgetsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListBudgetsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1263,10 +1098,7 @@ export const serializeAws_json1_1ListConstraintsForPortfolioCommand = async ( input: ListConstraintsForPortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListConstraintsForPortfolio", - }; + const headers: __HeaderBag = sharedHeaders("ListConstraintsForPortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1ListConstraintsForPortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1276,10 +1108,7 @@ export const serializeAws_json1_1ListLaunchPathsCommand = async ( input: ListLaunchPathsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListLaunchPaths", - }; + const headers: __HeaderBag = sharedHeaders("ListLaunchPaths"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLaunchPathsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1289,10 +1118,7 @@ export const serializeAws_json1_1ListOrganizationPortfolioAccessCommand = async input: ListOrganizationPortfolioAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListOrganizationPortfolioAccess", - }; + const headers: __HeaderBag = sharedHeaders("ListOrganizationPortfolioAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOrganizationPortfolioAccessInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1302,10 +1128,7 @@ export const serializeAws_json1_1ListPortfolioAccessCommand = async ( input: ListPortfolioAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListPortfolioAccess", - }; + const headers: __HeaderBag = sharedHeaders("ListPortfolioAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPortfolioAccessInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1315,10 +1138,7 @@ export const serializeAws_json1_1ListPortfoliosCommand = async ( input: ListPortfoliosCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListPortfolios", - }; + const headers: __HeaderBag = sharedHeaders("ListPortfolios"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPortfoliosInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1328,10 +1148,7 @@ export const serializeAws_json1_1ListPortfoliosForProductCommand = async ( input: ListPortfoliosForProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListPortfoliosForProduct", - }; + const headers: __HeaderBag = sharedHeaders("ListPortfoliosForProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPortfoliosForProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1341,10 +1158,7 @@ export const serializeAws_json1_1ListPrincipalsForPortfolioCommand = async ( input: ListPrincipalsForPortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListPrincipalsForPortfolio", - }; + const headers: __HeaderBag = sharedHeaders("ListPrincipalsForPortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPrincipalsForPortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1354,10 +1168,7 @@ export const serializeAws_json1_1ListProvisionedProductPlansCommand = async ( input: ListProvisionedProductPlansCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListProvisionedProductPlans", - }; + const headers: __HeaderBag = sharedHeaders("ListProvisionedProductPlans"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProvisionedProductPlansInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1367,10 +1178,7 @@ export const serializeAws_json1_1ListProvisioningArtifactsCommand = async ( input: ListProvisioningArtifactsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListProvisioningArtifacts", - }; + const headers: __HeaderBag = sharedHeaders("ListProvisioningArtifacts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProvisioningArtifactsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1380,10 +1188,7 @@ export const serializeAws_json1_1ListProvisioningArtifactsForServiceActionComman input: ListProvisioningArtifactsForServiceActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListProvisioningArtifactsForServiceAction", - }; + const headers: __HeaderBag = sharedHeaders("ListProvisioningArtifactsForServiceAction"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProvisioningArtifactsForServiceActionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1393,10 +1198,7 @@ export const serializeAws_json1_1ListRecordHistoryCommand = async ( input: ListRecordHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListRecordHistory", - }; + const headers: __HeaderBag = sharedHeaders("ListRecordHistory"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRecordHistoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1406,10 +1208,7 @@ export const serializeAws_json1_1ListResourcesForTagOptionCommand = async ( input: ListResourcesForTagOptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListResourcesForTagOption", - }; + const headers: __HeaderBag = sharedHeaders("ListResourcesForTagOption"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourcesForTagOptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1419,10 +1218,7 @@ export const serializeAws_json1_1ListServiceActionsCommand = async ( input: ListServiceActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListServiceActions", - }; + const headers: __HeaderBag = sharedHeaders("ListServiceActions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServiceActionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1432,10 +1228,7 @@ export const serializeAws_json1_1ListServiceActionsForProvisioningArtifactComman input: ListServiceActionsForProvisioningArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListServiceActionsForProvisioningArtifact", - }; + const headers: __HeaderBag = sharedHeaders("ListServiceActionsForProvisioningArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServiceActionsForProvisioningArtifactInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1445,10 +1238,7 @@ export const serializeAws_json1_1ListStackInstancesForProvisionedProductCommand input: ListStackInstancesForProvisionedProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListStackInstancesForProvisionedProduct", - }; + const headers: __HeaderBag = sharedHeaders("ListStackInstancesForProvisionedProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1ListStackInstancesForProvisionedProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1458,10 +1248,7 @@ export const serializeAws_json1_1ListTagOptionsCommand = async ( input: ListTagOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ListTagOptions", - }; + const headers: __HeaderBag = sharedHeaders("ListTagOptions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagOptionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1471,10 +1258,7 @@ export const serializeAws_json1_1ProvisionProductCommand = async ( input: ProvisionProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ProvisionProduct", - }; + const headers: __HeaderBag = sharedHeaders("ProvisionProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1ProvisionProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1484,10 +1268,7 @@ export const serializeAws_json1_1RejectPortfolioShareCommand = async ( input: RejectPortfolioShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.RejectPortfolioShare", - }; + const headers: __HeaderBag = sharedHeaders("RejectPortfolioShare"); let body: any; body = JSON.stringify(serializeAws_json1_1RejectPortfolioShareInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1497,10 +1278,7 @@ export const serializeAws_json1_1ScanProvisionedProductsCommand = async ( input: ScanProvisionedProductsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.ScanProvisionedProducts", - }; + const headers: __HeaderBag = sharedHeaders("ScanProvisionedProducts"); let body: any; body = JSON.stringify(serializeAws_json1_1ScanProvisionedProductsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1510,10 +1288,7 @@ export const serializeAws_json1_1SearchProductsCommand = async ( input: SearchProductsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.SearchProducts", - }; + const headers: __HeaderBag = sharedHeaders("SearchProducts"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchProductsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1523,10 +1298,7 @@ export const serializeAws_json1_1SearchProductsAsAdminCommand = async ( input: SearchProductsAsAdminCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.SearchProductsAsAdmin", - }; + const headers: __HeaderBag = sharedHeaders("SearchProductsAsAdmin"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchProductsAsAdminInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1536,10 +1308,7 @@ export const serializeAws_json1_1SearchProvisionedProductsCommand = async ( input: SearchProvisionedProductsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.SearchProvisionedProducts", - }; + const headers: __HeaderBag = sharedHeaders("SearchProvisionedProducts"); let body: any; body = JSON.stringify(serializeAws_json1_1SearchProvisionedProductsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1549,10 +1318,7 @@ export const serializeAws_json1_1TerminateProvisionedProductCommand = async ( input: TerminateProvisionedProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.TerminateProvisionedProduct", - }; + const headers: __HeaderBag = sharedHeaders("TerminateProvisionedProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1TerminateProvisionedProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1562,10 +1328,7 @@ export const serializeAws_json1_1UpdateConstraintCommand = async ( input: UpdateConstraintCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.UpdateConstraint", - }; + const headers: __HeaderBag = sharedHeaders("UpdateConstraint"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateConstraintInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1575,10 +1338,7 @@ export const serializeAws_json1_1UpdatePortfolioCommand = async ( input: UpdatePortfolioCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.UpdatePortfolio", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePortfolio"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePortfolioInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1588,10 +1348,7 @@ export const serializeAws_json1_1UpdatePortfolioShareCommand = async ( input: UpdatePortfolioShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.UpdatePortfolioShare", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePortfolioShare"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePortfolioShareInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1601,10 +1358,7 @@ export const serializeAws_json1_1UpdateProductCommand = async ( input: UpdateProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.UpdateProduct", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1614,10 +1368,7 @@ export const serializeAws_json1_1UpdateProvisionedProductCommand = async ( input: UpdateProvisionedProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.UpdateProvisionedProduct", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProvisionedProduct"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProvisionedProductInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1627,10 +1378,7 @@ export const serializeAws_json1_1UpdateProvisionedProductPropertiesCommand = asy input: UpdateProvisionedProductPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.UpdateProvisionedProductProperties", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProvisionedProductProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProvisionedProductPropertiesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1640,10 +1388,7 @@ export const serializeAws_json1_1UpdateProvisioningArtifactCommand = async ( input: UpdateProvisioningArtifactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.UpdateProvisioningArtifact", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProvisioningArtifact"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProvisioningArtifactInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1653,10 +1398,7 @@ export const serializeAws_json1_1UpdateServiceActionCommand = async ( input: UpdateServiceActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.UpdateServiceAction", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServiceAction"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateServiceActionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1666,10 +1408,7 @@ export const serializeAws_json1_1UpdateTagOptionCommand = async ( input: UpdateTagOptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWS242ServiceCatalogService.UpdateTagOption", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTagOption"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateTagOptionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -9476,6 +9215,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWS242ServiceCatalogService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-service-quotas/src/protocols/Aws_json1_1.ts b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts index 25769df9b4b6b..4c1039b59be48 100644 --- a/clients/client-service-quotas/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts @@ -151,10 +151,7 @@ export const serializeAws_json1_1AssociateServiceQuotaTemplateCommand = async ( input: AssociateServiceQuotaTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.AssociateServiceQuotaTemplate", - }; + const headers: __HeaderBag = sharedHeaders("AssociateServiceQuotaTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateServiceQuotaTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -164,10 +161,7 @@ export const serializeAws_json1_1DeleteServiceQuotaIncreaseRequestFromTemplateCo input: DeleteServiceQuotaIncreaseRequestFromTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.DeleteServiceQuotaIncreaseRequestFromTemplate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteServiceQuotaIncreaseRequestFromTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteServiceQuotaIncreaseRequestFromTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -177,10 +171,7 @@ export const serializeAws_json1_1DisassociateServiceQuotaTemplateCommand = async input: DisassociateServiceQuotaTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.DisassociateServiceQuotaTemplate", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateServiceQuotaTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateServiceQuotaTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -190,10 +181,7 @@ export const serializeAws_json1_1GetAssociationForServiceQuotaTemplateCommand = input: GetAssociationForServiceQuotaTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.GetAssociationForServiceQuotaTemplate", - }; + const headers: __HeaderBag = sharedHeaders("GetAssociationForServiceQuotaTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAssociationForServiceQuotaTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -203,10 +191,7 @@ export const serializeAws_json1_1GetAWSDefaultServiceQuotaCommand = async ( input: GetAWSDefaultServiceQuotaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.GetAWSDefaultServiceQuota", - }; + const headers: __HeaderBag = sharedHeaders("GetAWSDefaultServiceQuota"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAWSDefaultServiceQuotaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -216,10 +201,7 @@ export const serializeAws_json1_1GetRequestedServiceQuotaChangeCommand = async ( input: GetRequestedServiceQuotaChangeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.GetRequestedServiceQuotaChange", - }; + const headers: __HeaderBag = sharedHeaders("GetRequestedServiceQuotaChange"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRequestedServiceQuotaChangeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -229,10 +211,7 @@ export const serializeAws_json1_1GetServiceQuotaCommand = async ( input: GetServiceQuotaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.GetServiceQuota", - }; + const headers: __HeaderBag = sharedHeaders("GetServiceQuota"); let body: any; body = JSON.stringify(serializeAws_json1_1GetServiceQuotaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -242,10 +221,7 @@ export const serializeAws_json1_1GetServiceQuotaIncreaseRequestFromTemplateComma input: GetServiceQuotaIncreaseRequestFromTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.GetServiceQuotaIncreaseRequestFromTemplate", - }; + const headers: __HeaderBag = sharedHeaders("GetServiceQuotaIncreaseRequestFromTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1GetServiceQuotaIncreaseRequestFromTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -255,10 +231,7 @@ export const serializeAws_json1_1ListAWSDefaultServiceQuotasCommand = async ( input: ListAWSDefaultServiceQuotasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.ListAWSDefaultServiceQuotas", - }; + const headers: __HeaderBag = sharedHeaders("ListAWSDefaultServiceQuotas"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAWSDefaultServiceQuotasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -268,10 +241,7 @@ export const serializeAws_json1_1ListRequestedServiceQuotaChangeHistoryCommand = input: ListRequestedServiceQuotaChangeHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.ListRequestedServiceQuotaChangeHistory", - }; + const headers: __HeaderBag = sharedHeaders("ListRequestedServiceQuotaChangeHistory"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRequestedServiceQuotaChangeHistoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -281,10 +251,7 @@ export const serializeAws_json1_1ListRequestedServiceQuotaChangeHistoryByQuotaCo input: ListRequestedServiceQuotaChangeHistoryByQuotaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.ListRequestedServiceQuotaChangeHistoryByQuota", - }; + const headers: __HeaderBag = sharedHeaders("ListRequestedServiceQuotaChangeHistoryByQuota"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRequestedServiceQuotaChangeHistoryByQuotaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -294,10 +261,7 @@ export const serializeAws_json1_1ListServiceQuotaIncreaseRequestsInTemplateComma input: ListServiceQuotaIncreaseRequestsInTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.ListServiceQuotaIncreaseRequestsInTemplate", - }; + const headers: __HeaderBag = sharedHeaders("ListServiceQuotaIncreaseRequestsInTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServiceQuotaIncreaseRequestsInTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -307,10 +271,7 @@ export const serializeAws_json1_1ListServiceQuotasCommand = async ( input: ListServiceQuotasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.ListServiceQuotas", - }; + const headers: __HeaderBag = sharedHeaders("ListServiceQuotas"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServiceQuotasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -320,10 +281,7 @@ export const serializeAws_json1_1ListServicesCommand = async ( input: ListServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.ListServices", - }; + const headers: __HeaderBag = sharedHeaders("ListServices"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -333,10 +291,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -346,10 +301,7 @@ export const serializeAws_json1_1PutServiceQuotaIncreaseRequestIntoTemplateComma input: PutServiceQuotaIncreaseRequestIntoTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.PutServiceQuotaIncreaseRequestIntoTemplate", - }; + const headers: __HeaderBag = sharedHeaders("PutServiceQuotaIncreaseRequestIntoTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1PutServiceQuotaIncreaseRequestIntoTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -359,10 +311,7 @@ export const serializeAws_json1_1RequestServiceQuotaIncreaseCommand = async ( input: RequestServiceQuotaIncreaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.RequestServiceQuotaIncrease", - }; + const headers: __HeaderBag = sharedHeaders("RequestServiceQuotaIncrease"); let body: any; body = JSON.stringify(serializeAws_json1_1RequestServiceQuotaIncreaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -372,10 +321,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -385,10 +331,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "ServiceQuotasV20190624.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2486,6 +2429,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `ServiceQuotasV20190624.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts index 610c05050145c..e03155ff3aa4f 100644 --- a/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts +++ b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts @@ -185,10 +185,7 @@ export const serializeAws_json1_1CreateHttpNamespaceCommand = async ( input: CreateHttpNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.CreateHttpNamespace", - }; + const headers: __HeaderBag = sharedHeaders("CreateHttpNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateHttpNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -198,10 +195,7 @@ export const serializeAws_json1_1CreatePrivateDnsNamespaceCommand = async ( input: CreatePrivateDnsNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.CreatePrivateDnsNamespace", - }; + const headers: __HeaderBag = sharedHeaders("CreatePrivateDnsNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePrivateDnsNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -211,10 +205,7 @@ export const serializeAws_json1_1CreatePublicDnsNamespaceCommand = async ( input: CreatePublicDnsNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.CreatePublicDnsNamespace", - }; + const headers: __HeaderBag = sharedHeaders("CreatePublicDnsNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePublicDnsNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -224,10 +215,7 @@ export const serializeAws_json1_1CreateServiceCommand = async ( input: CreateServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.CreateService", - }; + const headers: __HeaderBag = sharedHeaders("CreateService"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -237,10 +225,7 @@ export const serializeAws_json1_1DeleteNamespaceCommand = async ( input: DeleteNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.DeleteNamespace", - }; + const headers: __HeaderBag = sharedHeaders("DeleteNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -250,10 +235,7 @@ export const serializeAws_json1_1DeleteServiceCommand = async ( input: DeleteServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.DeleteService", - }; + const headers: __HeaderBag = sharedHeaders("DeleteService"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -263,10 +245,7 @@ export const serializeAws_json1_1DeregisterInstanceCommand = async ( input: DeregisterInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.DeregisterInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -276,10 +255,7 @@ export const serializeAws_json1_1DiscoverInstancesCommand = async ( input: DiscoverInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.DiscoverInstances", - }; + const headers: __HeaderBag = sharedHeaders("DiscoverInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1DiscoverInstancesRequest(input, context)); let { hostname: resolvedHostname } = await context.endpoint(); @@ -296,10 +272,7 @@ export const serializeAws_json1_1GetInstanceCommand = async ( input: GetInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.GetInstance", - }; + const headers: __HeaderBag = sharedHeaders("GetInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -309,10 +282,7 @@ export const serializeAws_json1_1GetInstancesHealthStatusCommand = async ( input: GetInstancesHealthStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.GetInstancesHealthStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetInstancesHealthStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInstancesHealthStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -322,10 +292,7 @@ export const serializeAws_json1_1GetNamespaceCommand = async ( input: GetNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.GetNamespace", - }; + const headers: __HeaderBag = sharedHeaders("GetNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1GetNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -335,10 +302,7 @@ export const serializeAws_json1_1GetOperationCommand = async ( input: GetOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.GetOperation", - }; + const headers: __HeaderBag = sharedHeaders("GetOperation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOperationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -348,10 +312,7 @@ export const serializeAws_json1_1GetServiceCommand = async ( input: GetServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.GetService", - }; + const headers: __HeaderBag = sharedHeaders("GetService"); let body: any; body = JSON.stringify(serializeAws_json1_1GetServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -361,10 +322,7 @@ export const serializeAws_json1_1ListInstancesCommand = async ( input: ListInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.ListInstances", - }; + const headers: __HeaderBag = sharedHeaders("ListInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1ListInstancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -374,10 +332,7 @@ export const serializeAws_json1_1ListNamespacesCommand = async ( input: ListNamespacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.ListNamespaces", - }; + const headers: __HeaderBag = sharedHeaders("ListNamespaces"); let body: any; body = JSON.stringify(serializeAws_json1_1ListNamespacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -387,10 +342,7 @@ export const serializeAws_json1_1ListOperationsCommand = async ( input: ListOperationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.ListOperations", - }; + const headers: __HeaderBag = sharedHeaders("ListOperations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOperationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -400,10 +352,7 @@ export const serializeAws_json1_1ListServicesCommand = async ( input: ListServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.ListServices", - }; + const headers: __HeaderBag = sharedHeaders("ListServices"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -413,10 +362,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -426,10 +372,7 @@ export const serializeAws_json1_1RegisterInstanceCommand = async ( input: RegisterInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.RegisterInstance", - }; + const headers: __HeaderBag = sharedHeaders("RegisterInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -439,10 +382,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -452,10 +392,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -465,10 +402,7 @@ export const serializeAws_json1_1UpdateHttpNamespaceCommand = async ( input: UpdateHttpNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.UpdateHttpNamespace", - }; + const headers: __HeaderBag = sharedHeaders("UpdateHttpNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateHttpNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -478,10 +412,7 @@ export const serializeAws_json1_1UpdateInstanceCustomHealthStatusCommand = async input: UpdateInstanceCustomHealthStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.UpdateInstanceCustomHealthStatus", - }; + const headers: __HeaderBag = sharedHeaders("UpdateInstanceCustomHealthStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateInstanceCustomHealthStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -491,10 +422,7 @@ export const serializeAws_json1_1UpdatePrivateDnsNamespaceCommand = async ( input: UpdatePrivateDnsNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.UpdatePrivateDnsNamespace", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePrivateDnsNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePrivateDnsNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -504,10 +432,7 @@ export const serializeAws_json1_1UpdatePublicDnsNamespaceCommand = async ( input: UpdatePublicDnsNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.UpdatePublicDnsNamespace", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePublicDnsNamespace"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePublicDnsNamespaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -517,10 +442,7 @@ export const serializeAws_json1_1UpdateServiceCommand = async ( input: UpdateServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Route53AutoNaming_v20170314.UpdateService", - }; + const headers: __HeaderBag = sharedHeaders("UpdateService"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateServiceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3112,6 +3034,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `Route53AutoNaming_v20170314.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-ses/src/protocols/Aws_query.ts b/clients/client-ses/src/protocols/Aws_query.ts index 81bff2668dea3..a67063d911f20 100644 --- a/clients/client-ses/src/protocols/Aws_query.ts +++ b/clients/client-ses/src/protocols/Aws_query.ts @@ -457,9 +457,7 @@ export const serializeAws_queryCloneReceiptRuleSetCommand = async ( input: CloneReceiptRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCloneReceiptRuleSetRequest(input, context), @@ -473,9 +471,7 @@ export const serializeAws_queryCreateConfigurationSetCommand = async ( input: CreateConfigurationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateConfigurationSetRequest(input, context), @@ -489,9 +485,7 @@ export const serializeAws_queryCreateConfigurationSetEventDestinationCommand = a input: CreateConfigurationSetEventDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateConfigurationSetEventDestinationRequest(input, context), @@ -505,9 +499,7 @@ export const serializeAws_queryCreateConfigurationSetTrackingOptionsCommand = as input: CreateConfigurationSetTrackingOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateConfigurationSetTrackingOptionsRequest(input, context), @@ -521,9 +513,7 @@ export const serializeAws_queryCreateCustomVerificationEmailTemplateCommand = as input: CreateCustomVerificationEmailTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateCustomVerificationEmailTemplateRequest(input, context), @@ -537,9 +527,7 @@ export const serializeAws_queryCreateReceiptFilterCommand = async ( input: CreateReceiptFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateReceiptFilterRequest(input, context), @@ -553,9 +541,7 @@ export const serializeAws_queryCreateReceiptRuleCommand = async ( input: CreateReceiptRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateReceiptRuleRequest(input, context), @@ -569,9 +555,7 @@ export const serializeAws_queryCreateReceiptRuleSetCommand = async ( input: CreateReceiptRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateReceiptRuleSetRequest(input, context), @@ -585,9 +569,7 @@ export const serializeAws_queryCreateTemplateCommand = async ( input: CreateTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateTemplateRequest(input, context), @@ -601,9 +583,7 @@ export const serializeAws_queryDeleteConfigurationSetCommand = async ( input: DeleteConfigurationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteConfigurationSetRequest(input, context), @@ -617,9 +597,7 @@ export const serializeAws_queryDeleteConfigurationSetEventDestinationCommand = a input: DeleteConfigurationSetEventDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteConfigurationSetEventDestinationRequest(input, context), @@ -633,9 +611,7 @@ export const serializeAws_queryDeleteConfigurationSetTrackingOptionsCommand = as input: DeleteConfigurationSetTrackingOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteConfigurationSetTrackingOptionsRequest(input, context), @@ -649,9 +625,7 @@ export const serializeAws_queryDeleteCustomVerificationEmailTemplateCommand = as input: DeleteCustomVerificationEmailTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteCustomVerificationEmailTemplateRequest(input, context), @@ -665,9 +639,7 @@ export const serializeAws_queryDeleteIdentityCommand = async ( input: DeleteIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteIdentityRequest(input, context), @@ -681,9 +653,7 @@ export const serializeAws_queryDeleteIdentityPolicyCommand = async ( input: DeleteIdentityPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteIdentityPolicyRequest(input, context), @@ -697,9 +667,7 @@ export const serializeAws_queryDeleteReceiptFilterCommand = async ( input: DeleteReceiptFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteReceiptFilterRequest(input, context), @@ -713,9 +681,7 @@ export const serializeAws_queryDeleteReceiptRuleCommand = async ( input: DeleteReceiptRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteReceiptRuleRequest(input, context), @@ -729,9 +695,7 @@ export const serializeAws_queryDeleteReceiptRuleSetCommand = async ( input: DeleteReceiptRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteReceiptRuleSetRequest(input, context), @@ -745,9 +709,7 @@ export const serializeAws_queryDeleteTemplateCommand = async ( input: DeleteTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteTemplateRequest(input, context), @@ -761,9 +723,7 @@ export const serializeAws_queryDeleteVerifiedEmailAddressCommand = async ( input: DeleteVerifiedEmailAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteVerifiedEmailAddressRequest(input, context), @@ -777,9 +737,7 @@ export const serializeAws_queryDescribeActiveReceiptRuleSetCommand = async ( input: DescribeActiveReceiptRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeActiveReceiptRuleSetRequest(input, context), @@ -793,9 +751,7 @@ export const serializeAws_queryDescribeConfigurationSetCommand = async ( input: DescribeConfigurationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeConfigurationSetRequest(input, context), @@ -809,9 +765,7 @@ export const serializeAws_queryDescribeReceiptRuleCommand = async ( input: DescribeReceiptRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeReceiptRuleRequest(input, context), @@ -825,9 +779,7 @@ export const serializeAws_queryDescribeReceiptRuleSetCommand = async ( input: DescribeReceiptRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDescribeReceiptRuleSetRequest(input, context), @@ -841,9 +793,7 @@ export const serializeAws_queryGetAccountSendingEnabledCommand = async ( input: GetAccountSendingEnabledCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "GetAccountSendingEnabled", Version: "2010-12-01", @@ -855,9 +805,7 @@ export const serializeAws_queryGetCustomVerificationEmailTemplateCommand = async input: GetCustomVerificationEmailTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetCustomVerificationEmailTemplateRequest(input, context), @@ -871,9 +819,7 @@ export const serializeAws_queryGetIdentityDkimAttributesCommand = async ( input: GetIdentityDkimAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetIdentityDkimAttributesRequest(input, context), @@ -887,9 +833,7 @@ export const serializeAws_queryGetIdentityMailFromDomainAttributesCommand = asyn input: GetIdentityMailFromDomainAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetIdentityMailFromDomainAttributesRequest(input, context), @@ -903,9 +847,7 @@ export const serializeAws_queryGetIdentityNotificationAttributesCommand = async input: GetIdentityNotificationAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetIdentityNotificationAttributesRequest(input, context), @@ -919,9 +861,7 @@ export const serializeAws_queryGetIdentityPoliciesCommand = async ( input: GetIdentityPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetIdentityPoliciesRequest(input, context), @@ -935,9 +875,7 @@ export const serializeAws_queryGetIdentityVerificationAttributesCommand = async input: GetIdentityVerificationAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetIdentityVerificationAttributesRequest(input, context), @@ -951,9 +889,7 @@ export const serializeAws_queryGetSendQuotaCommand = async ( input: GetSendQuotaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "GetSendQuota", Version: "2010-12-01", @@ -965,9 +901,7 @@ export const serializeAws_queryGetSendStatisticsCommand = async ( input: GetSendStatisticsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "GetSendStatistics", Version: "2010-12-01", @@ -979,9 +913,7 @@ export const serializeAws_queryGetTemplateCommand = async ( input: GetTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetTemplateRequest(input, context), @@ -995,9 +927,7 @@ export const serializeAws_queryListConfigurationSetsCommand = async ( input: ListConfigurationSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListConfigurationSetsRequest(input, context), @@ -1011,9 +941,7 @@ export const serializeAws_queryListCustomVerificationEmailTemplatesCommand = asy input: ListCustomVerificationEmailTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListCustomVerificationEmailTemplatesRequest(input, context), @@ -1027,9 +955,7 @@ export const serializeAws_queryListIdentitiesCommand = async ( input: ListIdentitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListIdentitiesRequest(input, context), @@ -1043,9 +969,7 @@ export const serializeAws_queryListIdentityPoliciesCommand = async ( input: ListIdentityPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListIdentityPoliciesRequest(input, context), @@ -1059,9 +983,7 @@ export const serializeAws_queryListReceiptFiltersCommand = async ( input: ListReceiptFiltersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListReceiptFiltersRequest(input, context), @@ -1075,9 +997,7 @@ export const serializeAws_queryListReceiptRuleSetsCommand = async ( input: ListReceiptRuleSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListReceiptRuleSetsRequest(input, context), @@ -1091,9 +1011,7 @@ export const serializeAws_queryListTemplatesCommand = async ( input: ListTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTemplatesRequest(input, context), @@ -1107,9 +1025,7 @@ export const serializeAws_queryListVerifiedEmailAddressesCommand = async ( input: ListVerifiedEmailAddressesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "ListVerifiedEmailAddresses", Version: "2010-12-01", @@ -1121,9 +1037,7 @@ export const serializeAws_queryPutConfigurationSetDeliveryOptionsCommand = async input: PutConfigurationSetDeliveryOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutConfigurationSetDeliveryOptionsRequest(input, context), @@ -1137,9 +1051,7 @@ export const serializeAws_queryPutIdentityPolicyCommand = async ( input: PutIdentityPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutIdentityPolicyRequest(input, context), @@ -1153,9 +1065,7 @@ export const serializeAws_queryReorderReceiptRuleSetCommand = async ( input: ReorderReceiptRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryReorderReceiptRuleSetRequest(input, context), @@ -1169,9 +1079,7 @@ export const serializeAws_querySendBounceCommand = async ( input: SendBounceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySendBounceRequest(input, context), @@ -1185,9 +1093,7 @@ export const serializeAws_querySendBulkTemplatedEmailCommand = async ( input: SendBulkTemplatedEmailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySendBulkTemplatedEmailRequest(input, context), @@ -1201,9 +1107,7 @@ export const serializeAws_querySendCustomVerificationEmailCommand = async ( input: SendCustomVerificationEmailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySendCustomVerificationEmailRequest(input, context), @@ -1217,9 +1121,7 @@ export const serializeAws_querySendEmailCommand = async ( input: SendEmailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySendEmailRequest(input, context), @@ -1233,9 +1135,7 @@ export const serializeAws_querySendRawEmailCommand = async ( input: SendRawEmailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySendRawEmailRequest(input, context), @@ -1249,9 +1149,7 @@ export const serializeAws_querySendTemplatedEmailCommand = async ( input: SendTemplatedEmailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySendTemplatedEmailRequest(input, context), @@ -1265,9 +1163,7 @@ export const serializeAws_querySetActiveReceiptRuleSetCommand = async ( input: SetActiveReceiptRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetActiveReceiptRuleSetRequest(input, context), @@ -1281,9 +1177,7 @@ export const serializeAws_querySetIdentityDkimEnabledCommand = async ( input: SetIdentityDkimEnabledCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetIdentityDkimEnabledRequest(input, context), @@ -1297,9 +1191,7 @@ export const serializeAws_querySetIdentityFeedbackForwardingEnabledCommand = asy input: SetIdentityFeedbackForwardingEnabledCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetIdentityFeedbackForwardingEnabledRequest(input, context), @@ -1313,9 +1205,7 @@ export const serializeAws_querySetIdentityHeadersInNotificationsEnabledCommand = input: SetIdentityHeadersInNotificationsEnabledCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetIdentityHeadersInNotificationsEnabledRequest(input, context), @@ -1329,9 +1219,7 @@ export const serializeAws_querySetIdentityMailFromDomainCommand = async ( input: SetIdentityMailFromDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetIdentityMailFromDomainRequest(input, context), @@ -1345,9 +1233,7 @@ export const serializeAws_querySetIdentityNotificationTopicCommand = async ( input: SetIdentityNotificationTopicCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetIdentityNotificationTopicRequest(input, context), @@ -1361,9 +1247,7 @@ export const serializeAws_querySetReceiptRulePositionCommand = async ( input: SetReceiptRulePositionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetReceiptRulePositionRequest(input, context), @@ -1377,9 +1261,7 @@ export const serializeAws_queryTestRenderTemplateCommand = async ( input: TestRenderTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTestRenderTemplateRequest(input, context), @@ -1393,9 +1275,7 @@ export const serializeAws_queryUpdateAccountSendingEnabledCommand = async ( input: UpdateAccountSendingEnabledCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateAccountSendingEnabledRequest(input, context), @@ -1409,9 +1289,7 @@ export const serializeAws_queryUpdateConfigurationSetEventDestinationCommand = a input: UpdateConfigurationSetEventDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateConfigurationSetEventDestinationRequest(input, context), @@ -1425,9 +1303,7 @@ export const serializeAws_queryUpdateConfigurationSetReputationMetricsEnabledCom input: UpdateConfigurationSetReputationMetricsEnabledCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateConfigurationSetReputationMetricsEnabledRequest(input, context), @@ -1441,9 +1317,7 @@ export const serializeAws_queryUpdateConfigurationSetSendingEnabledCommand = asy input: UpdateConfigurationSetSendingEnabledCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateConfigurationSetSendingEnabledRequest(input, context), @@ -1457,9 +1331,7 @@ export const serializeAws_queryUpdateConfigurationSetTrackingOptionsCommand = as input: UpdateConfigurationSetTrackingOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateConfigurationSetTrackingOptionsRequest(input, context), @@ -1473,9 +1345,7 @@ export const serializeAws_queryUpdateCustomVerificationEmailTemplateCommand = as input: UpdateCustomVerificationEmailTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateCustomVerificationEmailTemplateRequest(input, context), @@ -1489,9 +1359,7 @@ export const serializeAws_queryUpdateReceiptRuleCommand = async ( input: UpdateReceiptRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateReceiptRuleRequest(input, context), @@ -1505,9 +1373,7 @@ export const serializeAws_queryUpdateTemplateCommand = async ( input: UpdateTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUpdateTemplateRequest(input, context), @@ -1521,9 +1387,7 @@ export const serializeAws_queryVerifyDomainDkimCommand = async ( input: VerifyDomainDkimCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryVerifyDomainDkimRequest(input, context), @@ -1537,9 +1401,7 @@ export const serializeAws_queryVerifyDomainIdentityCommand = async ( input: VerifyDomainIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryVerifyDomainIdentityRequest(input, context), @@ -1553,9 +1415,7 @@ export const serializeAws_queryVerifyEmailAddressCommand = async ( input: VerifyEmailAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryVerifyEmailAddressRequest(input, context), @@ -1569,9 +1429,7 @@ export const serializeAws_queryVerifyEmailIdentityCommand = async ( input: VerifyEmailIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryVerifyEmailIdentityRequest(input, context), @@ -8765,6 +8623,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-sfn/src/protocols/Aws_json1_0.ts b/clients/client-sfn/src/protocols/Aws_json1_0.ts index 2c8d95f06a6c3..6da6854a0d395 100644 --- a/clients/client-sfn/src/protocols/Aws_json1_0.ts +++ b/clients/client-sfn/src/protocols/Aws_json1_0.ts @@ -194,10 +194,7 @@ export const serializeAws_json1_0CreateActivityCommand = async ( input: CreateActivityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.CreateActivity", - }; + const headers: __HeaderBag = sharedHeaders("CreateActivity"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateActivityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -207,10 +204,7 @@ export const serializeAws_json1_0CreateStateMachineCommand = async ( input: CreateStateMachineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.CreateStateMachine", - }; + const headers: __HeaderBag = sharedHeaders("CreateStateMachine"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateStateMachineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -220,10 +214,7 @@ export const serializeAws_json1_0DeleteActivityCommand = async ( input: DeleteActivityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.DeleteActivity", - }; + const headers: __HeaderBag = sharedHeaders("DeleteActivity"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteActivityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -233,10 +224,7 @@ export const serializeAws_json1_0DeleteStateMachineCommand = async ( input: DeleteStateMachineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.DeleteStateMachine", - }; + const headers: __HeaderBag = sharedHeaders("DeleteStateMachine"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteStateMachineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -246,10 +234,7 @@ export const serializeAws_json1_0DescribeActivityCommand = async ( input: DescribeActivityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.DescribeActivity", - }; + const headers: __HeaderBag = sharedHeaders("DescribeActivity"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeActivityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -259,10 +244,7 @@ export const serializeAws_json1_0DescribeExecutionCommand = async ( input: DescribeExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.DescribeExecution", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExecution"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -272,10 +254,7 @@ export const serializeAws_json1_0DescribeMapRunCommand = async ( input: DescribeMapRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.DescribeMapRun", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMapRun"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeMapRunInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -285,10 +264,7 @@ export const serializeAws_json1_0DescribeStateMachineCommand = async ( input: DescribeStateMachineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.DescribeStateMachine", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStateMachine"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeStateMachineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -298,10 +274,7 @@ export const serializeAws_json1_0DescribeStateMachineForExecutionCommand = async input: DescribeStateMachineForExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.DescribeStateMachineForExecution", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStateMachineForExecution"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeStateMachineForExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -311,10 +284,7 @@ export const serializeAws_json1_0GetActivityTaskCommand = async ( input: GetActivityTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.GetActivityTask", - }; + const headers: __HeaderBag = sharedHeaders("GetActivityTask"); let body: any; body = JSON.stringify(serializeAws_json1_0GetActivityTaskInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -324,10 +294,7 @@ export const serializeAws_json1_0GetExecutionHistoryCommand = async ( input: GetExecutionHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.GetExecutionHistory", - }; + const headers: __HeaderBag = sharedHeaders("GetExecutionHistory"); let body: any; body = JSON.stringify(serializeAws_json1_0GetExecutionHistoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -337,10 +304,7 @@ export const serializeAws_json1_0ListActivitiesCommand = async ( input: ListActivitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.ListActivities", - }; + const headers: __HeaderBag = sharedHeaders("ListActivities"); let body: any; body = JSON.stringify(serializeAws_json1_0ListActivitiesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -350,10 +314,7 @@ export const serializeAws_json1_0ListExecutionsCommand = async ( input: ListExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.ListExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_0ListExecutionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -363,10 +324,7 @@ export const serializeAws_json1_0ListMapRunsCommand = async ( input: ListMapRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.ListMapRuns", - }; + const headers: __HeaderBag = sharedHeaders("ListMapRuns"); let body: any; body = JSON.stringify(serializeAws_json1_0ListMapRunsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -376,10 +334,7 @@ export const serializeAws_json1_0ListStateMachinesCommand = async ( input: ListStateMachinesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.ListStateMachines", - }; + const headers: __HeaderBag = sharedHeaders("ListStateMachines"); let body: any; body = JSON.stringify(serializeAws_json1_0ListStateMachinesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -389,10 +344,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -402,10 +354,7 @@ export const serializeAws_json1_0SendTaskFailureCommand = async ( input: SendTaskFailureCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.SendTaskFailure", - }; + const headers: __HeaderBag = sharedHeaders("SendTaskFailure"); let body: any; body = JSON.stringify(serializeAws_json1_0SendTaskFailureInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -415,10 +364,7 @@ export const serializeAws_json1_0SendTaskHeartbeatCommand = async ( input: SendTaskHeartbeatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.SendTaskHeartbeat", - }; + const headers: __HeaderBag = sharedHeaders("SendTaskHeartbeat"); let body: any; body = JSON.stringify(serializeAws_json1_0SendTaskHeartbeatInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -428,10 +374,7 @@ export const serializeAws_json1_0SendTaskSuccessCommand = async ( input: SendTaskSuccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.SendTaskSuccess", - }; + const headers: __HeaderBag = sharedHeaders("SendTaskSuccess"); let body: any; body = JSON.stringify(serializeAws_json1_0SendTaskSuccessInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -441,10 +384,7 @@ export const serializeAws_json1_0StartExecutionCommand = async ( input: StartExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.StartExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartExecution"); let body: any; body = JSON.stringify(serializeAws_json1_0StartExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -454,10 +394,7 @@ export const serializeAws_json1_0StartSyncExecutionCommand = async ( input: StartSyncExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.StartSyncExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartSyncExecution"); let body: any; body = JSON.stringify(serializeAws_json1_0StartSyncExecutionInput(input, context)); let { hostname: resolvedHostname } = await context.endpoint(); @@ -474,10 +411,7 @@ export const serializeAws_json1_0StopExecutionCommand = async ( input: StopExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.StopExecution", - }; + const headers: __HeaderBag = sharedHeaders("StopExecution"); let body: any; body = JSON.stringify(serializeAws_json1_0StopExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -487,10 +421,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -500,10 +431,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -513,10 +441,7 @@ export const serializeAws_json1_0UpdateMapRunCommand = async ( input: UpdateMapRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.UpdateMapRun", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMapRun"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateMapRunInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -526,10 +451,7 @@ export const serializeAws_json1_0UpdateStateMachineCommand = async ( input: UpdateStateMachineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "AWSStepFunctions.UpdateStateMachine", - }; + const headers: __HeaderBag = sharedHeaders("UpdateStateMachine"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateStateMachineInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3646,6 +3568,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `AWSStepFunctions.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-shield/src/protocols/Aws_json1_1.ts b/clients/client-shield/src/protocols/Aws_json1_1.ts index b54ce9892b5d7..0346db5794635 100644 --- a/clients/client-shield/src/protocols/Aws_json1_1.ts +++ b/clients/client-shield/src/protocols/Aws_json1_1.ts @@ -250,10 +250,7 @@ export const serializeAws_json1_1AssociateDRTLogBucketCommand = async ( input: AssociateDRTLogBucketCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.AssociateDRTLogBucket", - }; + const headers: __HeaderBag = sharedHeaders("AssociateDRTLogBucket"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateDRTLogBucketRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -263,10 +260,7 @@ export const serializeAws_json1_1AssociateDRTRoleCommand = async ( input: AssociateDRTRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.AssociateDRTRole", - }; + const headers: __HeaderBag = sharedHeaders("AssociateDRTRole"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateDRTRoleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -276,10 +270,7 @@ export const serializeAws_json1_1AssociateHealthCheckCommand = async ( input: AssociateHealthCheckCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.AssociateHealthCheck", - }; + const headers: __HeaderBag = sharedHeaders("AssociateHealthCheck"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateHealthCheckRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -289,10 +280,7 @@ export const serializeAws_json1_1AssociateProactiveEngagementDetailsCommand = as input: AssociateProactiveEngagementDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.AssociateProactiveEngagementDetails", - }; + const headers: __HeaderBag = sharedHeaders("AssociateProactiveEngagementDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateProactiveEngagementDetailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -302,10 +290,7 @@ export const serializeAws_json1_1CreateProtectionCommand = async ( input: CreateProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.CreateProtection", - }; + const headers: __HeaderBag = sharedHeaders("CreateProtection"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProtectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -315,10 +300,7 @@ export const serializeAws_json1_1CreateProtectionGroupCommand = async ( input: CreateProtectionGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.CreateProtectionGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateProtectionGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProtectionGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -328,10 +310,7 @@ export const serializeAws_json1_1CreateSubscriptionCommand = async ( input: CreateSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.CreateSubscription", - }; + const headers: __HeaderBag = sharedHeaders("CreateSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -341,10 +320,7 @@ export const serializeAws_json1_1DeleteProtectionCommand = async ( input: DeleteProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DeleteProtection", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProtection"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProtectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -354,10 +330,7 @@ export const serializeAws_json1_1DeleteProtectionGroupCommand = async ( input: DeleteProtectionGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DeleteProtectionGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProtectionGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProtectionGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -367,10 +340,7 @@ export const serializeAws_json1_1DeleteSubscriptionCommand = async ( input: DeleteSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DeleteSubscription", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -380,10 +350,7 @@ export const serializeAws_json1_1DescribeAttackCommand = async ( input: DescribeAttackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DescribeAttack", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAttack"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAttackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -393,10 +360,7 @@ export const serializeAws_json1_1DescribeAttackStatisticsCommand = async ( input: DescribeAttackStatisticsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DescribeAttackStatistics", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAttackStatistics"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAttackStatisticsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -406,10 +370,7 @@ export const serializeAws_json1_1DescribeDRTAccessCommand = async ( input: DescribeDRTAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DescribeDRTAccess", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDRTAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDRTAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -419,10 +380,7 @@ export const serializeAws_json1_1DescribeEmergencyContactSettingsCommand = async input: DescribeEmergencyContactSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DescribeEmergencyContactSettings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEmergencyContactSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEmergencyContactSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -432,10 +390,7 @@ export const serializeAws_json1_1DescribeProtectionCommand = async ( input: DescribeProtectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DescribeProtection", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProtection"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProtectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -445,10 +400,7 @@ export const serializeAws_json1_1DescribeProtectionGroupCommand = async ( input: DescribeProtectionGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DescribeProtectionGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProtectionGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProtectionGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -458,10 +410,7 @@ export const serializeAws_json1_1DescribeSubscriptionCommand = async ( input: DescribeSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DescribeSubscription", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -471,10 +420,7 @@ export const serializeAws_json1_1DisableApplicationLayerAutomaticResponseCommand input: DisableApplicationLayerAutomaticResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DisableApplicationLayerAutomaticResponse", - }; + const headers: __HeaderBag = sharedHeaders("DisableApplicationLayerAutomaticResponse"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableApplicationLayerAutomaticResponseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -484,10 +430,7 @@ export const serializeAws_json1_1DisableProactiveEngagementCommand = async ( input: DisableProactiveEngagementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DisableProactiveEngagement", - }; + const headers: __HeaderBag = sharedHeaders("DisableProactiveEngagement"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableProactiveEngagementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -497,10 +440,7 @@ export const serializeAws_json1_1DisassociateDRTLogBucketCommand = async ( input: DisassociateDRTLogBucketCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DisassociateDRTLogBucket", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateDRTLogBucket"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateDRTLogBucketRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -510,10 +450,7 @@ export const serializeAws_json1_1DisassociateDRTRoleCommand = async ( input: DisassociateDRTRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DisassociateDRTRole", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateDRTRole"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateDRTRoleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -523,10 +460,7 @@ export const serializeAws_json1_1DisassociateHealthCheckCommand = async ( input: DisassociateHealthCheckCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.DisassociateHealthCheck", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateHealthCheck"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateHealthCheckRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -536,10 +470,7 @@ export const serializeAws_json1_1EnableApplicationLayerAutomaticResponseCommand input: EnableApplicationLayerAutomaticResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.EnableApplicationLayerAutomaticResponse", - }; + const headers: __HeaderBag = sharedHeaders("EnableApplicationLayerAutomaticResponse"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableApplicationLayerAutomaticResponseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -549,10 +480,7 @@ export const serializeAws_json1_1EnableProactiveEngagementCommand = async ( input: EnableProactiveEngagementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.EnableProactiveEngagement", - }; + const headers: __HeaderBag = sharedHeaders("EnableProactiveEngagement"); let body: any; body = JSON.stringify(serializeAws_json1_1EnableProactiveEngagementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -562,10 +490,7 @@ export const serializeAws_json1_1GetSubscriptionStateCommand = async ( input: GetSubscriptionStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.GetSubscriptionState", - }; + const headers: __HeaderBag = sharedHeaders("GetSubscriptionState"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSubscriptionStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -575,10 +500,7 @@ export const serializeAws_json1_1ListAttacksCommand = async ( input: ListAttacksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.ListAttacks", - }; + const headers: __HeaderBag = sharedHeaders("ListAttacks"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAttacksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -588,10 +510,7 @@ export const serializeAws_json1_1ListProtectionGroupsCommand = async ( input: ListProtectionGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.ListProtectionGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListProtectionGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProtectionGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -601,10 +520,7 @@ export const serializeAws_json1_1ListProtectionsCommand = async ( input: ListProtectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.ListProtections", - }; + const headers: __HeaderBag = sharedHeaders("ListProtections"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProtectionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -614,10 +530,7 @@ export const serializeAws_json1_1ListResourcesInProtectionGroupCommand = async ( input: ListResourcesInProtectionGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.ListResourcesInProtectionGroup", - }; + const headers: __HeaderBag = sharedHeaders("ListResourcesInProtectionGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourcesInProtectionGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -627,10 +540,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -640,10 +550,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -653,10 +560,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -666,10 +570,7 @@ export const serializeAws_json1_1UpdateApplicationLayerAutomaticResponseCommand input: UpdateApplicationLayerAutomaticResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.UpdateApplicationLayerAutomaticResponse", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApplicationLayerAutomaticResponse"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateApplicationLayerAutomaticResponseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -679,10 +580,7 @@ export const serializeAws_json1_1UpdateEmergencyContactSettingsCommand = async ( input: UpdateEmergencyContactSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.UpdateEmergencyContactSettings", - }; + const headers: __HeaderBag = sharedHeaders("UpdateEmergencyContactSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateEmergencyContactSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -692,10 +590,7 @@ export const serializeAws_json1_1UpdateProtectionGroupCommand = async ( input: UpdateProtectionGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.UpdateProtectionGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProtectionGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProtectionGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -705,10 +600,7 @@ export const serializeAws_json1_1UpdateSubscriptionCommand = async ( input: UpdateSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShield_20160616.UpdateSubscription", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSubscription"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSubscriptionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4172,6 +4064,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSShield_20160616.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-sms/src/protocols/Aws_json1_1.ts b/clients/client-sms/src/protocols/Aws_json1_1.ts index 1b2c3db37ca99..177a8e73d6ef7 100644 --- a/clients/client-sms/src/protocols/Aws_json1_1.ts +++ b/clients/client-sms/src/protocols/Aws_json1_1.ts @@ -232,10 +232,7 @@ export const serializeAws_json1_1CreateAppCommand = async ( input: CreateAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.CreateApp", - }; + const headers: __HeaderBag = sharedHeaders("CreateApp"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -245,10 +242,7 @@ export const serializeAws_json1_1CreateReplicationJobCommand = async ( input: CreateReplicationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.CreateReplicationJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateReplicationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateReplicationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -258,10 +252,7 @@ export const serializeAws_json1_1DeleteAppCommand = async ( input: DeleteAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.DeleteApp", - }; + const headers: __HeaderBag = sharedHeaders("DeleteApp"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -271,10 +262,7 @@ export const serializeAws_json1_1DeleteAppLaunchConfigurationCommand = async ( input: DeleteAppLaunchConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.DeleteAppLaunchConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAppLaunchConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAppLaunchConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -284,10 +272,7 @@ export const serializeAws_json1_1DeleteAppReplicationConfigurationCommand = asyn input: DeleteAppReplicationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.DeleteAppReplicationConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAppReplicationConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAppReplicationConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -297,10 +282,7 @@ export const serializeAws_json1_1DeleteAppValidationConfigurationCommand = async input: DeleteAppValidationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.DeleteAppValidationConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAppValidationConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAppValidationConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -310,10 +292,7 @@ export const serializeAws_json1_1DeleteReplicationJobCommand = async ( input: DeleteReplicationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.DeleteReplicationJob", - }; + const headers: __HeaderBag = sharedHeaders("DeleteReplicationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteReplicationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -323,10 +302,7 @@ export const serializeAws_json1_1DeleteServerCatalogCommand = async ( input: DeleteServerCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.DeleteServerCatalog", - }; + const headers: __HeaderBag = sharedHeaders("DeleteServerCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteServerCatalogRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -336,10 +312,7 @@ export const serializeAws_json1_1DisassociateConnectorCommand = async ( input: DisassociateConnectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.DisassociateConnector", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateConnector"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateConnectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -349,10 +322,7 @@ export const serializeAws_json1_1GenerateChangeSetCommand = async ( input: GenerateChangeSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GenerateChangeSet", - }; + const headers: __HeaderBag = sharedHeaders("GenerateChangeSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GenerateChangeSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -362,10 +332,7 @@ export const serializeAws_json1_1GenerateTemplateCommand = async ( input: GenerateTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GenerateTemplate", - }; + const headers: __HeaderBag = sharedHeaders("GenerateTemplate"); let body: any; body = JSON.stringify(serializeAws_json1_1GenerateTemplateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -375,10 +342,7 @@ export const serializeAws_json1_1GetAppCommand = async ( input: GetAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GetApp", - }; + const headers: __HeaderBag = sharedHeaders("GetApp"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -388,10 +352,7 @@ export const serializeAws_json1_1GetAppLaunchConfigurationCommand = async ( input: GetAppLaunchConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GetAppLaunchConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetAppLaunchConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAppLaunchConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -401,10 +362,7 @@ export const serializeAws_json1_1GetAppReplicationConfigurationCommand = async ( input: GetAppReplicationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GetAppReplicationConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetAppReplicationConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAppReplicationConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -414,10 +372,7 @@ export const serializeAws_json1_1GetAppValidationConfigurationCommand = async ( input: GetAppValidationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GetAppValidationConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetAppValidationConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAppValidationConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -427,10 +382,7 @@ export const serializeAws_json1_1GetAppValidationOutputCommand = async ( input: GetAppValidationOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GetAppValidationOutput", - }; + const headers: __HeaderBag = sharedHeaders("GetAppValidationOutput"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAppValidationOutputRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -440,10 +392,7 @@ export const serializeAws_json1_1GetConnectorsCommand = async ( input: GetConnectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GetConnectors", - }; + const headers: __HeaderBag = sharedHeaders("GetConnectors"); let body: any; body = JSON.stringify(serializeAws_json1_1GetConnectorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -453,10 +402,7 @@ export const serializeAws_json1_1GetReplicationJobsCommand = async ( input: GetReplicationJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GetReplicationJobs", - }; + const headers: __HeaderBag = sharedHeaders("GetReplicationJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1GetReplicationJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -466,10 +412,7 @@ export const serializeAws_json1_1GetReplicationRunsCommand = async ( input: GetReplicationRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GetReplicationRuns", - }; + const headers: __HeaderBag = sharedHeaders("GetReplicationRuns"); let body: any; body = JSON.stringify(serializeAws_json1_1GetReplicationRunsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -479,10 +422,7 @@ export const serializeAws_json1_1GetServersCommand = async ( input: GetServersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.GetServers", - }; + const headers: __HeaderBag = sharedHeaders("GetServers"); let body: any; body = JSON.stringify(serializeAws_json1_1GetServersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -492,10 +432,7 @@ export const serializeAws_json1_1ImportAppCatalogCommand = async ( input: ImportAppCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.ImportAppCatalog", - }; + const headers: __HeaderBag = sharedHeaders("ImportAppCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportAppCatalogRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -505,10 +442,7 @@ export const serializeAws_json1_1ImportServerCatalogCommand = async ( input: ImportServerCatalogCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.ImportServerCatalog", - }; + const headers: __HeaderBag = sharedHeaders("ImportServerCatalog"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportServerCatalogRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -518,10 +452,7 @@ export const serializeAws_json1_1LaunchAppCommand = async ( input: LaunchAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.LaunchApp", - }; + const headers: __HeaderBag = sharedHeaders("LaunchApp"); let body: any; body = JSON.stringify(serializeAws_json1_1LaunchAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -531,10 +462,7 @@ export const serializeAws_json1_1ListAppsCommand = async ( input: ListAppsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.ListApps", - }; + const headers: __HeaderBag = sharedHeaders("ListApps"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAppsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -544,10 +472,7 @@ export const serializeAws_json1_1NotifyAppValidationOutputCommand = async ( input: NotifyAppValidationOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.NotifyAppValidationOutput", - }; + const headers: __HeaderBag = sharedHeaders("NotifyAppValidationOutput"); let body: any; body = JSON.stringify(serializeAws_json1_1NotifyAppValidationOutputRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -557,10 +482,7 @@ export const serializeAws_json1_1PutAppLaunchConfigurationCommand = async ( input: PutAppLaunchConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.PutAppLaunchConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutAppLaunchConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAppLaunchConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -570,10 +492,7 @@ export const serializeAws_json1_1PutAppReplicationConfigurationCommand = async ( input: PutAppReplicationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.PutAppReplicationConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutAppReplicationConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAppReplicationConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -583,10 +502,7 @@ export const serializeAws_json1_1PutAppValidationConfigurationCommand = async ( input: PutAppValidationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.PutAppValidationConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutAppValidationConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAppValidationConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -596,10 +512,7 @@ export const serializeAws_json1_1StartAppReplicationCommand = async ( input: StartAppReplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.StartAppReplication", - }; + const headers: __HeaderBag = sharedHeaders("StartAppReplication"); let body: any; body = JSON.stringify(serializeAws_json1_1StartAppReplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -609,10 +522,7 @@ export const serializeAws_json1_1StartOnDemandAppReplicationCommand = async ( input: StartOnDemandAppReplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.StartOnDemandAppReplication", - }; + const headers: __HeaderBag = sharedHeaders("StartOnDemandAppReplication"); let body: any; body = JSON.stringify(serializeAws_json1_1StartOnDemandAppReplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -622,10 +532,7 @@ export const serializeAws_json1_1StartOnDemandReplicationRunCommand = async ( input: StartOnDemandReplicationRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.StartOnDemandReplicationRun", - }; + const headers: __HeaderBag = sharedHeaders("StartOnDemandReplicationRun"); let body: any; body = JSON.stringify(serializeAws_json1_1StartOnDemandReplicationRunRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -635,10 +542,7 @@ export const serializeAws_json1_1StopAppReplicationCommand = async ( input: StopAppReplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.StopAppReplication", - }; + const headers: __HeaderBag = sharedHeaders("StopAppReplication"); let body: any; body = JSON.stringify(serializeAws_json1_1StopAppReplicationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -648,10 +552,7 @@ export const serializeAws_json1_1TerminateAppCommand = async ( input: TerminateAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.TerminateApp", - }; + const headers: __HeaderBag = sharedHeaders("TerminateApp"); let body: any; body = JSON.stringify(serializeAws_json1_1TerminateAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -661,10 +562,7 @@ export const serializeAws_json1_1UpdateAppCommand = async ( input: UpdateAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.UpdateApp", - }; + const headers: __HeaderBag = sharedHeaders("UpdateApp"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAppRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -674,10 +572,7 @@ export const serializeAws_json1_1UpdateReplicationJobCommand = async ( input: UpdateReplicationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSServerMigrationService_V2016_10_24.UpdateReplicationJob", - }; + const headers: __HeaderBag = sharedHeaders("UpdateReplicationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateReplicationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4423,6 +4318,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSServerMigrationService_V2016_10_24.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-snowball/src/protocols/Aws_json1_1.ts b/clients/client-snowball/src/protocols/Aws_json1_1.ts index 64eca5b04de8c..e1c9a43256b2e 100644 --- a/clients/client-snowball/src/protocols/Aws_json1_1.ts +++ b/clients/client-snowball/src/protocols/Aws_json1_1.ts @@ -170,10 +170,7 @@ export const serializeAws_json1_1CancelClusterCommand = async ( input: CancelClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.CancelCluster", - }; + const headers: __HeaderBag = sharedHeaders("CancelCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -183,10 +180,7 @@ export const serializeAws_json1_1CancelJobCommand = async ( input: CancelJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.CancelJob", - }; + const headers: __HeaderBag = sharedHeaders("CancelJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -196,10 +190,7 @@ export const serializeAws_json1_1CreateAddressCommand = async ( input: CreateAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.CreateAddress", - }; + const headers: __HeaderBag = sharedHeaders("CreateAddress"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAddressRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -209,10 +200,7 @@ export const serializeAws_json1_1CreateClusterCommand = async ( input: CreateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.CreateCluster", - }; + const headers: __HeaderBag = sharedHeaders("CreateCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -222,10 +210,7 @@ export const serializeAws_json1_1CreateJobCommand = async ( input: CreateJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.CreateJob", - }; + const headers: __HeaderBag = sharedHeaders("CreateJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -235,10 +220,7 @@ export const serializeAws_json1_1CreateLongTermPricingCommand = async ( input: CreateLongTermPricingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.CreateLongTermPricing", - }; + const headers: __HeaderBag = sharedHeaders("CreateLongTermPricing"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLongTermPricingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -248,10 +230,7 @@ export const serializeAws_json1_1CreateReturnShippingLabelCommand = async ( input: CreateReturnShippingLabelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.CreateReturnShippingLabel", - }; + const headers: __HeaderBag = sharedHeaders("CreateReturnShippingLabel"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateReturnShippingLabelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -261,10 +240,7 @@ export const serializeAws_json1_1DescribeAddressCommand = async ( input: DescribeAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.DescribeAddress", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAddress"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAddressRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -274,10 +250,7 @@ export const serializeAws_json1_1DescribeAddressesCommand = async ( input: DescribeAddressesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.DescribeAddresses", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAddresses"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAddressesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -287,10 +260,7 @@ export const serializeAws_json1_1DescribeClusterCommand = async ( input: DescribeClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.DescribeCluster", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -300,10 +270,7 @@ export const serializeAws_json1_1DescribeJobCommand = async ( input: DescribeJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.DescribeJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -313,10 +280,7 @@ export const serializeAws_json1_1DescribeReturnShippingLabelCommand = async ( input: DescribeReturnShippingLabelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.DescribeReturnShippingLabel", - }; + const headers: __HeaderBag = sharedHeaders("DescribeReturnShippingLabel"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeReturnShippingLabelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -326,10 +290,7 @@ export const serializeAws_json1_1GetJobManifestCommand = async ( input: GetJobManifestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.GetJobManifest", - }; + const headers: __HeaderBag = sharedHeaders("GetJobManifest"); let body: any; body = JSON.stringify(serializeAws_json1_1GetJobManifestRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -339,10 +300,7 @@ export const serializeAws_json1_1GetJobUnlockCodeCommand = async ( input: GetJobUnlockCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.GetJobUnlockCode", - }; + const headers: __HeaderBag = sharedHeaders("GetJobUnlockCode"); let body: any; body = JSON.stringify(serializeAws_json1_1GetJobUnlockCodeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -352,10 +310,7 @@ export const serializeAws_json1_1GetSnowballUsageCommand = async ( input: GetSnowballUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.GetSnowballUsage", - }; + const headers: __HeaderBag = sharedHeaders("GetSnowballUsage"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSnowballUsageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -365,10 +320,7 @@ export const serializeAws_json1_1GetSoftwareUpdatesCommand = async ( input: GetSoftwareUpdatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.GetSoftwareUpdates", - }; + const headers: __HeaderBag = sharedHeaders("GetSoftwareUpdates"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSoftwareUpdatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -378,10 +330,7 @@ export const serializeAws_json1_1ListClusterJobsCommand = async ( input: ListClusterJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.ListClusterJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListClusterJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListClusterJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -391,10 +340,7 @@ export const serializeAws_json1_1ListClustersCommand = async ( input: ListClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.ListClusters", - }; + const headers: __HeaderBag = sharedHeaders("ListClusters"); let body: any; body = JSON.stringify(serializeAws_json1_1ListClustersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -404,10 +350,7 @@ export const serializeAws_json1_1ListCompatibleImagesCommand = async ( input: ListCompatibleImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.ListCompatibleImages", - }; + const headers: __HeaderBag = sharedHeaders("ListCompatibleImages"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCompatibleImagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -417,10 +360,7 @@ export const serializeAws_json1_1ListJobsCommand = async ( input: ListJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.ListJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -430,10 +370,7 @@ export const serializeAws_json1_1ListLongTermPricingCommand = async ( input: ListLongTermPricingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.ListLongTermPricing", - }; + const headers: __HeaderBag = sharedHeaders("ListLongTermPricing"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLongTermPricingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -443,10 +380,7 @@ export const serializeAws_json1_1ListServiceVersionsCommand = async ( input: ListServiceVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.ListServiceVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListServiceVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServiceVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -456,10 +390,7 @@ export const serializeAws_json1_1UpdateClusterCommand = async ( input: UpdateClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.UpdateCluster", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCluster"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateClusterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -469,10 +400,7 @@ export const serializeAws_json1_1UpdateJobCommand = async ( input: UpdateJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.UpdateJob", - }; + const headers: __HeaderBag = sharedHeaders("UpdateJob"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -482,10 +410,7 @@ export const serializeAws_json1_1UpdateJobShipmentStateCommand = async ( input: UpdateJobShipmentStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.UpdateJobShipmentState", - }; + const headers: __HeaderBag = sharedHeaders("UpdateJobShipmentState"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateJobShipmentStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -495,10 +420,7 @@ export const serializeAws_json1_1UpdateLongTermPricingCommand = async ( input: UpdateLongTermPricingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSIESnowballJobManagementService.UpdateLongTermPricing", - }; + const headers: __HeaderBag = sharedHeaders("UpdateLongTermPricing"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateLongTermPricingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3245,6 +3167,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSIESnowballJobManagementService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-sns/src/protocols/Aws_query.ts b/clients/client-sns/src/protocols/Aws_query.ts index 01a4054ac6a86..ef1a2240d4965 100644 --- a/clients/client-sns/src/protocols/Aws_query.ts +++ b/clients/client-sns/src/protocols/Aws_query.ts @@ -258,9 +258,7 @@ export const serializeAws_queryAddPermissionCommand = async ( input: AddPermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddPermissionInput(input, context), @@ -274,9 +272,7 @@ export const serializeAws_queryCheckIfPhoneNumberIsOptedOutCommand = async ( input: CheckIfPhoneNumberIsOptedOutCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCheckIfPhoneNumberIsOptedOutInput(input, context), @@ -290,9 +286,7 @@ export const serializeAws_queryConfirmSubscriptionCommand = async ( input: ConfirmSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryConfirmSubscriptionInput(input, context), @@ -306,9 +300,7 @@ export const serializeAws_queryCreatePlatformApplicationCommand = async ( input: CreatePlatformApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreatePlatformApplicationInput(input, context), @@ -322,9 +314,7 @@ export const serializeAws_queryCreatePlatformEndpointCommand = async ( input: CreatePlatformEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreatePlatformEndpointInput(input, context), @@ -338,9 +328,7 @@ export const serializeAws_queryCreateSMSSandboxPhoneNumberCommand = async ( input: CreateSMSSandboxPhoneNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateSMSSandboxPhoneNumberInput(input, context), @@ -354,9 +342,7 @@ export const serializeAws_queryCreateTopicCommand = async ( input: CreateTopicCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateTopicInput(input, context), @@ -370,9 +356,7 @@ export const serializeAws_queryDeleteEndpointCommand = async ( input: DeleteEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteEndpointInput(input, context), @@ -386,9 +370,7 @@ export const serializeAws_queryDeletePlatformApplicationCommand = async ( input: DeletePlatformApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeletePlatformApplicationInput(input, context), @@ -402,9 +384,7 @@ export const serializeAws_queryDeleteSMSSandboxPhoneNumberCommand = async ( input: DeleteSMSSandboxPhoneNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteSMSSandboxPhoneNumberInput(input, context), @@ -418,9 +398,7 @@ export const serializeAws_queryDeleteTopicCommand = async ( input: DeleteTopicCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteTopicInput(input, context), @@ -434,9 +412,7 @@ export const serializeAws_queryGetDataProtectionPolicyCommand = async ( input: GetDataProtectionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetDataProtectionPolicyInput(input, context), @@ -450,9 +426,7 @@ export const serializeAws_queryGetEndpointAttributesCommand = async ( input: GetEndpointAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetEndpointAttributesInput(input, context), @@ -466,9 +440,7 @@ export const serializeAws_queryGetPlatformApplicationAttributesCommand = async ( input: GetPlatformApplicationAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetPlatformApplicationAttributesInput(input, context), @@ -482,9 +454,7 @@ export const serializeAws_queryGetSMSAttributesCommand = async ( input: GetSMSAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetSMSAttributesInput(input, context), @@ -498,9 +468,7 @@ export const serializeAws_queryGetSMSSandboxAccountStatusCommand = async ( input: GetSMSSandboxAccountStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetSMSSandboxAccountStatusInput(input, context), @@ -514,9 +482,7 @@ export const serializeAws_queryGetSubscriptionAttributesCommand = async ( input: GetSubscriptionAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetSubscriptionAttributesInput(input, context), @@ -530,9 +496,7 @@ export const serializeAws_queryGetTopicAttributesCommand = async ( input: GetTopicAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetTopicAttributesInput(input, context), @@ -546,9 +510,7 @@ export const serializeAws_queryListEndpointsByPlatformApplicationCommand = async input: ListEndpointsByPlatformApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListEndpointsByPlatformApplicationInput(input, context), @@ -562,9 +524,7 @@ export const serializeAws_queryListOriginationNumbersCommand = async ( input: ListOriginationNumbersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListOriginationNumbersRequest(input, context), @@ -578,9 +538,7 @@ export const serializeAws_queryListPhoneNumbersOptedOutCommand = async ( input: ListPhoneNumbersOptedOutCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListPhoneNumbersOptedOutInput(input, context), @@ -594,9 +552,7 @@ export const serializeAws_queryListPlatformApplicationsCommand = async ( input: ListPlatformApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListPlatformApplicationsInput(input, context), @@ -610,9 +566,7 @@ export const serializeAws_queryListSMSSandboxPhoneNumbersCommand = async ( input: ListSMSSandboxPhoneNumbersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListSMSSandboxPhoneNumbersInput(input, context), @@ -626,9 +580,7 @@ export const serializeAws_queryListSubscriptionsCommand = async ( input: ListSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListSubscriptionsInput(input, context), @@ -642,9 +594,7 @@ export const serializeAws_queryListSubscriptionsByTopicCommand = async ( input: ListSubscriptionsByTopicCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListSubscriptionsByTopicInput(input, context), @@ -658,9 +608,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTagsForResourceRequest(input, context), @@ -674,9 +622,7 @@ export const serializeAws_queryListTopicsCommand = async ( input: ListTopicsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListTopicsInput(input, context), @@ -690,9 +636,7 @@ export const serializeAws_queryOptInPhoneNumberCommand = async ( input: OptInPhoneNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryOptInPhoneNumberInput(input, context), @@ -706,9 +650,7 @@ export const serializeAws_queryPublishCommand = async ( input: PublishCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPublishInput(input, context), @@ -722,9 +664,7 @@ export const serializeAws_queryPublishBatchCommand = async ( input: PublishBatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPublishBatchInput(input, context), @@ -738,9 +678,7 @@ export const serializeAws_queryPutDataProtectionPolicyCommand = async ( input: PutDataProtectionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPutDataProtectionPolicyInput(input, context), @@ -754,9 +692,7 @@ export const serializeAws_queryRemovePermissionCommand = async ( input: RemovePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemovePermissionInput(input, context), @@ -770,9 +706,7 @@ export const serializeAws_querySetEndpointAttributesCommand = async ( input: SetEndpointAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetEndpointAttributesInput(input, context), @@ -786,9 +720,7 @@ export const serializeAws_querySetPlatformApplicationAttributesCommand = async ( input: SetPlatformApplicationAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetPlatformApplicationAttributesInput(input, context), @@ -802,9 +734,7 @@ export const serializeAws_querySetSMSAttributesCommand = async ( input: SetSMSAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetSMSAttributesInput(input, context), @@ -818,9 +748,7 @@ export const serializeAws_querySetSubscriptionAttributesCommand = async ( input: SetSubscriptionAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetSubscriptionAttributesInput(input, context), @@ -834,9 +762,7 @@ export const serializeAws_querySetTopicAttributesCommand = async ( input: SetTopicAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetTopicAttributesInput(input, context), @@ -850,9 +776,7 @@ export const serializeAws_querySubscribeCommand = async ( input: SubscribeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySubscribeInput(input, context), @@ -866,9 +790,7 @@ export const serializeAws_queryTagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagResourceRequest(input, context), @@ -882,9 +804,7 @@ export const serializeAws_queryUnsubscribeCommand = async ( input: UnsubscribeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUnsubscribeInput(input, context), @@ -898,9 +818,7 @@ export const serializeAws_queryUntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagResourceRequest(input, context), @@ -914,9 +832,7 @@ export const serializeAws_queryVerifySMSSandboxPhoneNumberCommand = async ( input: VerifySMSSandboxPhoneNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryVerifySMSSandboxPhoneNumberInput(input, context), @@ -5426,6 +5342,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-sqs/src/protocols/Aws_query.ts b/clients/client-sqs/src/protocols/Aws_query.ts index 7b6a48ec05e56..1206d1002c031 100644 --- a/clients/client-sqs/src/protocols/Aws_query.ts +++ b/clients/client-sqs/src/protocols/Aws_query.ts @@ -112,9 +112,7 @@ export const serializeAws_queryAddPermissionCommand = async ( input: AddPermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAddPermissionRequest(input, context), @@ -128,9 +126,7 @@ export const serializeAws_queryChangeMessageVisibilityCommand = async ( input: ChangeMessageVisibilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryChangeMessageVisibilityRequest(input, context), @@ -144,9 +140,7 @@ export const serializeAws_queryChangeMessageVisibilityBatchCommand = async ( input: ChangeMessageVisibilityBatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryChangeMessageVisibilityBatchRequest(input, context), @@ -160,9 +154,7 @@ export const serializeAws_queryCreateQueueCommand = async ( input: CreateQueueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryCreateQueueRequest(input, context), @@ -176,9 +168,7 @@ export const serializeAws_queryDeleteMessageCommand = async ( input: DeleteMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteMessageRequest(input, context), @@ -192,9 +182,7 @@ export const serializeAws_queryDeleteMessageBatchCommand = async ( input: DeleteMessageBatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteMessageBatchRequest(input, context), @@ -208,9 +196,7 @@ export const serializeAws_queryDeleteQueueCommand = async ( input: DeleteQueueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDeleteQueueRequest(input, context), @@ -224,9 +210,7 @@ export const serializeAws_queryGetQueueAttributesCommand = async ( input: GetQueueAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetQueueAttributesRequest(input, context), @@ -240,9 +224,7 @@ export const serializeAws_queryGetQueueUrlCommand = async ( input: GetQueueUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetQueueUrlRequest(input, context), @@ -256,9 +238,7 @@ export const serializeAws_queryListDeadLetterSourceQueuesCommand = async ( input: ListDeadLetterSourceQueuesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListDeadLetterSourceQueuesRequest(input, context), @@ -272,9 +252,7 @@ export const serializeAws_queryListQueuesCommand = async ( input: ListQueuesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListQueuesRequest(input, context), @@ -288,9 +266,7 @@ export const serializeAws_queryListQueueTagsCommand = async ( input: ListQueueTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryListQueueTagsRequest(input, context), @@ -304,9 +280,7 @@ export const serializeAws_queryPurgeQueueCommand = async ( input: PurgeQueueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryPurgeQueueRequest(input, context), @@ -320,9 +294,7 @@ export const serializeAws_queryReceiveMessageCommand = async ( input: ReceiveMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryReceiveMessageRequest(input, context), @@ -336,9 +308,7 @@ export const serializeAws_queryRemovePermissionCommand = async ( input: RemovePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryRemovePermissionRequest(input, context), @@ -352,9 +322,7 @@ export const serializeAws_querySendMessageCommand = async ( input: SendMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySendMessageRequest(input, context), @@ -368,9 +336,7 @@ export const serializeAws_querySendMessageBatchCommand = async ( input: SendMessageBatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySendMessageBatchRequest(input, context), @@ -384,9 +350,7 @@ export const serializeAws_querySetQueueAttributesCommand = async ( input: SetQueueAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySetQueueAttributesRequest(input, context), @@ -400,9 +364,7 @@ export const serializeAws_queryTagQueueCommand = async ( input: TagQueueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryTagQueueRequest(input, context), @@ -416,9 +378,7 @@ export const serializeAws_queryUntagQueueCommand = async ( input: UntagQueueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryUntagQueueRequest(input, context), @@ -2706,6 +2666,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts index 837222d69e399..3887e7ea5b628 100644 --- a/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts +++ b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts @@ -220,10 +220,7 @@ export const serializeAws_json1_1AcceptPageCommand = async ( input: AcceptPageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.AcceptPage", - }; + const headers: __HeaderBag = sharedHeaders("AcceptPage"); let body: any; body = JSON.stringify(serializeAws_json1_1AcceptPageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -233,10 +230,7 @@ export const serializeAws_json1_1ActivateContactChannelCommand = async ( input: ActivateContactChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ActivateContactChannel", - }; + const headers: __HeaderBag = sharedHeaders("ActivateContactChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1ActivateContactChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -246,10 +240,7 @@ export const serializeAws_json1_1CreateContactCommand = async ( input: CreateContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.CreateContact", - }; + const headers: __HeaderBag = sharedHeaders("CreateContact"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateContactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -259,10 +250,7 @@ export const serializeAws_json1_1CreateContactChannelCommand = async ( input: CreateContactChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.CreateContactChannel", - }; + const headers: __HeaderBag = sharedHeaders("CreateContactChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateContactChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -272,10 +260,7 @@ export const serializeAws_json1_1CreateRotationCommand = async ( input: CreateRotationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.CreateRotation", - }; + const headers: __HeaderBag = sharedHeaders("CreateRotation"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRotationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -285,10 +270,7 @@ export const serializeAws_json1_1CreateRotationOverrideCommand = async ( input: CreateRotationOverrideCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.CreateRotationOverride", - }; + const headers: __HeaderBag = sharedHeaders("CreateRotationOverride"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRotationOverrideRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -298,10 +280,7 @@ export const serializeAws_json1_1DeactivateContactChannelCommand = async ( input: DeactivateContactChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.DeactivateContactChannel", - }; + const headers: __HeaderBag = sharedHeaders("DeactivateContactChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeactivateContactChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -311,10 +290,7 @@ export const serializeAws_json1_1DeleteContactCommand = async ( input: DeleteContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.DeleteContact", - }; + const headers: __HeaderBag = sharedHeaders("DeleteContact"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteContactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -324,10 +300,7 @@ export const serializeAws_json1_1DeleteContactChannelCommand = async ( input: DeleteContactChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.DeleteContactChannel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteContactChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteContactChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -337,10 +310,7 @@ export const serializeAws_json1_1DeleteRotationCommand = async ( input: DeleteRotationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.DeleteRotation", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRotation"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRotationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -350,10 +320,7 @@ export const serializeAws_json1_1DeleteRotationOverrideCommand = async ( input: DeleteRotationOverrideCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.DeleteRotationOverride", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRotationOverride"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRotationOverrideRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -363,10 +330,7 @@ export const serializeAws_json1_1DescribeEngagementCommand = async ( input: DescribeEngagementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.DescribeEngagement", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEngagement"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEngagementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -376,10 +340,7 @@ export const serializeAws_json1_1DescribePageCommand = async ( input: DescribePageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.DescribePage", - }; + const headers: __HeaderBag = sharedHeaders("DescribePage"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -389,10 +350,7 @@ export const serializeAws_json1_1GetContactCommand = async ( input: GetContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.GetContact", - }; + const headers: __HeaderBag = sharedHeaders("GetContact"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -402,10 +360,7 @@ export const serializeAws_json1_1GetContactChannelCommand = async ( input: GetContactChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.GetContactChannel", - }; + const headers: __HeaderBag = sharedHeaders("GetContactChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContactChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -415,10 +370,7 @@ export const serializeAws_json1_1GetContactPolicyCommand = async ( input: GetContactPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.GetContactPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetContactPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetContactPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -428,10 +380,7 @@ export const serializeAws_json1_1GetRotationCommand = async ( input: GetRotationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.GetRotation", - }; + const headers: __HeaderBag = sharedHeaders("GetRotation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRotationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -441,10 +390,7 @@ export const serializeAws_json1_1GetRotationOverrideCommand = async ( input: GetRotationOverrideCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.GetRotationOverride", - }; + const headers: __HeaderBag = sharedHeaders("GetRotationOverride"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRotationOverrideRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -454,10 +400,7 @@ export const serializeAws_json1_1ListContactChannelsCommand = async ( input: ListContactChannelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListContactChannels", - }; + const headers: __HeaderBag = sharedHeaders("ListContactChannels"); let body: any; body = JSON.stringify(serializeAws_json1_1ListContactChannelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -467,10 +410,7 @@ export const serializeAws_json1_1ListContactsCommand = async ( input: ListContactsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListContacts", - }; + const headers: __HeaderBag = sharedHeaders("ListContacts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListContactsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -480,10 +420,7 @@ export const serializeAws_json1_1ListEngagementsCommand = async ( input: ListEngagementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListEngagements", - }; + const headers: __HeaderBag = sharedHeaders("ListEngagements"); let body: any; body = JSON.stringify(serializeAws_json1_1ListEngagementsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -493,10 +430,7 @@ export const serializeAws_json1_1ListPageReceiptsCommand = async ( input: ListPageReceiptsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListPageReceipts", - }; + const headers: __HeaderBag = sharedHeaders("ListPageReceipts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPageReceiptsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -506,10 +440,7 @@ export const serializeAws_json1_1ListPageResolutionsCommand = async ( input: ListPageResolutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListPageResolutions", - }; + const headers: __HeaderBag = sharedHeaders("ListPageResolutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPageResolutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -519,10 +450,7 @@ export const serializeAws_json1_1ListPagesByContactCommand = async ( input: ListPagesByContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListPagesByContact", - }; + const headers: __HeaderBag = sharedHeaders("ListPagesByContact"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPagesByContactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -532,10 +460,7 @@ export const serializeAws_json1_1ListPagesByEngagementCommand = async ( input: ListPagesByEngagementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListPagesByEngagement", - }; + const headers: __HeaderBag = sharedHeaders("ListPagesByEngagement"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPagesByEngagementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -545,10 +470,7 @@ export const serializeAws_json1_1ListPreviewRotationShiftsCommand = async ( input: ListPreviewRotationShiftsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListPreviewRotationShifts", - }; + const headers: __HeaderBag = sharedHeaders("ListPreviewRotationShifts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPreviewRotationShiftsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -558,10 +480,7 @@ export const serializeAws_json1_1ListRotationOverridesCommand = async ( input: ListRotationOverridesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListRotationOverrides", - }; + const headers: __HeaderBag = sharedHeaders("ListRotationOverrides"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRotationOverridesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -571,10 +490,7 @@ export const serializeAws_json1_1ListRotationsCommand = async ( input: ListRotationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListRotations", - }; + const headers: __HeaderBag = sharedHeaders("ListRotations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRotationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -584,10 +500,7 @@ export const serializeAws_json1_1ListRotationShiftsCommand = async ( input: ListRotationShiftsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListRotationShifts", - }; + const headers: __HeaderBag = sharedHeaders("ListRotationShifts"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRotationShiftsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -597,10 +510,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -610,10 +520,7 @@ export const serializeAws_json1_1PutContactPolicyCommand = async ( input: PutContactPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.PutContactPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutContactPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutContactPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -623,10 +530,7 @@ export const serializeAws_json1_1SendActivationCodeCommand = async ( input: SendActivationCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.SendActivationCode", - }; + const headers: __HeaderBag = sharedHeaders("SendActivationCode"); let body: any; body = JSON.stringify(serializeAws_json1_1SendActivationCodeRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -636,10 +540,7 @@ export const serializeAws_json1_1StartEngagementCommand = async ( input: StartEngagementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.StartEngagement", - }; + const headers: __HeaderBag = sharedHeaders("StartEngagement"); let body: any; body = JSON.stringify(serializeAws_json1_1StartEngagementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -649,10 +550,7 @@ export const serializeAws_json1_1StopEngagementCommand = async ( input: StopEngagementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.StopEngagement", - }; + const headers: __HeaderBag = sharedHeaders("StopEngagement"); let body: any; body = JSON.stringify(serializeAws_json1_1StopEngagementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -662,10 +560,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -675,10 +570,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -688,10 +580,7 @@ export const serializeAws_json1_1UpdateContactCommand = async ( input: UpdateContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.UpdateContact", - }; + const headers: __HeaderBag = sharedHeaders("UpdateContact"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateContactRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -701,10 +590,7 @@ export const serializeAws_json1_1UpdateContactChannelCommand = async ( input: UpdateContactChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.UpdateContactChannel", - }; + const headers: __HeaderBag = sharedHeaders("UpdateContactChannel"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateContactChannelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -714,10 +600,7 @@ export const serializeAws_json1_1UpdateRotationCommand = async ( input: UpdateRotationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SSMContacts.UpdateRotation", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRotation"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRotationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4553,6 +4436,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `SSMContacts.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-ssm/src/protocols/Aws_json1_1.ts b/clients/client-ssm/src/protocols/Aws_json1_1.ts index 855821504ee9a..956ad3dbf1acd 100644 --- a/clients/client-ssm/src/protocols/Aws_json1_1.ts +++ b/clients/client-ssm/src/protocols/Aws_json1_1.ts @@ -1004,10 +1004,7 @@ export const serializeAws_json1_1AddTagsToResourceCommand = async ( input: AddTagsToResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.AddTagsToResource", - }; + const headers: __HeaderBag = sharedHeaders("AddTagsToResource"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsToResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1017,10 +1014,7 @@ export const serializeAws_json1_1AssociateOpsItemRelatedItemCommand = async ( input: AssociateOpsItemRelatedItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.AssociateOpsItemRelatedItem", - }; + const headers: __HeaderBag = sharedHeaders("AssociateOpsItemRelatedItem"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateOpsItemRelatedItemRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1030,10 +1024,7 @@ export const serializeAws_json1_1CancelCommandCommand = async ( input: CancelCommandCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CancelCommand", - }; + const headers: __HeaderBag = sharedHeaders("CancelCommand"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelCommandRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1043,10 +1034,7 @@ export const serializeAws_json1_1CancelMaintenanceWindowExecutionCommand = async input: CancelMaintenanceWindowExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CancelMaintenanceWindowExecution", - }; + const headers: __HeaderBag = sharedHeaders("CancelMaintenanceWindowExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelMaintenanceWindowExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1056,10 +1044,7 @@ export const serializeAws_json1_1CreateActivationCommand = async ( input: CreateActivationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CreateActivation", - }; + const headers: __HeaderBag = sharedHeaders("CreateActivation"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateActivationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1069,10 +1054,7 @@ export const serializeAws_json1_1CreateAssociationCommand = async ( input: CreateAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CreateAssociation", - }; + const headers: __HeaderBag = sharedHeaders("CreateAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1082,10 +1064,7 @@ export const serializeAws_json1_1CreateAssociationBatchCommand = async ( input: CreateAssociationBatchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CreateAssociationBatch", - }; + const headers: __HeaderBag = sharedHeaders("CreateAssociationBatch"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAssociationBatchRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1095,10 +1074,7 @@ export const serializeAws_json1_1CreateDocumentCommand = async ( input: CreateDocumentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CreateDocument", - }; + const headers: __HeaderBag = sharedHeaders("CreateDocument"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateDocumentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1108,10 +1084,7 @@ export const serializeAws_json1_1CreateMaintenanceWindowCommand = async ( input: CreateMaintenanceWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CreateMaintenanceWindow", - }; + const headers: __HeaderBag = sharedHeaders("CreateMaintenanceWindow"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMaintenanceWindowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1121,10 +1094,7 @@ export const serializeAws_json1_1CreateOpsItemCommand = async ( input: CreateOpsItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CreateOpsItem", - }; + const headers: __HeaderBag = sharedHeaders("CreateOpsItem"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateOpsItemRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1134,10 +1104,7 @@ export const serializeAws_json1_1CreateOpsMetadataCommand = async ( input: CreateOpsMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CreateOpsMetadata", - }; + const headers: __HeaderBag = sharedHeaders("CreateOpsMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateOpsMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1147,10 +1114,7 @@ export const serializeAws_json1_1CreatePatchBaselineCommand = async ( input: CreatePatchBaselineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CreatePatchBaseline", - }; + const headers: __HeaderBag = sharedHeaders("CreatePatchBaseline"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePatchBaselineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1160,10 +1124,7 @@ export const serializeAws_json1_1CreateResourceDataSyncCommand = async ( input: CreateResourceDataSyncCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.CreateResourceDataSync", - }; + const headers: __HeaderBag = sharedHeaders("CreateResourceDataSync"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateResourceDataSyncRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1173,10 +1134,7 @@ export const serializeAws_json1_1DeleteActivationCommand = async ( input: DeleteActivationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeleteActivation", - }; + const headers: __HeaderBag = sharedHeaders("DeleteActivation"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteActivationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1186,10 +1144,7 @@ export const serializeAws_json1_1DeleteAssociationCommand = async ( input: DeleteAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeleteAssociation", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1199,10 +1154,7 @@ export const serializeAws_json1_1DeleteDocumentCommand = async ( input: DeleteDocumentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeleteDocument", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDocument"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteDocumentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1212,10 +1164,7 @@ export const serializeAws_json1_1DeleteInventoryCommand = async ( input: DeleteInventoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeleteInventory", - }; + const headers: __HeaderBag = sharedHeaders("DeleteInventory"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteInventoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1225,10 +1174,7 @@ export const serializeAws_json1_1DeleteMaintenanceWindowCommand = async ( input: DeleteMaintenanceWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeleteMaintenanceWindow", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMaintenanceWindow"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMaintenanceWindowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1238,10 +1184,7 @@ export const serializeAws_json1_1DeleteOpsMetadataCommand = async ( input: DeleteOpsMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeleteOpsMetadata", - }; + const headers: __HeaderBag = sharedHeaders("DeleteOpsMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteOpsMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1251,10 +1194,7 @@ export const serializeAws_json1_1DeleteParameterCommand = async ( input: DeleteParameterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeleteParameter", - }; + const headers: __HeaderBag = sharedHeaders("DeleteParameter"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteParameterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1264,10 +1204,7 @@ export const serializeAws_json1_1DeleteParametersCommand = async ( input: DeleteParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeleteParameters", - }; + const headers: __HeaderBag = sharedHeaders("DeleteParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteParametersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1277,10 +1214,7 @@ export const serializeAws_json1_1DeletePatchBaselineCommand = async ( input: DeletePatchBaselineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeletePatchBaseline", - }; + const headers: __HeaderBag = sharedHeaders("DeletePatchBaseline"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePatchBaselineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1290,10 +1224,7 @@ export const serializeAws_json1_1DeleteResourceDataSyncCommand = async ( input: DeleteResourceDataSyncCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeleteResourceDataSync", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourceDataSync"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourceDataSyncRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1303,10 +1234,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeleteResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1316,10 +1244,7 @@ export const serializeAws_json1_1DeregisterManagedInstanceCommand = async ( input: DeregisterManagedInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeregisterManagedInstance", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterManagedInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterManagedInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1329,10 +1254,7 @@ export const serializeAws_json1_1DeregisterPatchBaselineForPatchGroupCommand = a input: DeregisterPatchBaselineForPatchGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeregisterPatchBaselineForPatchGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterPatchBaselineForPatchGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterPatchBaselineForPatchGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1342,10 +1264,7 @@ export const serializeAws_json1_1DeregisterTargetFromMaintenanceWindowCommand = input: DeregisterTargetFromMaintenanceWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeregisterTargetFromMaintenanceWindow", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterTargetFromMaintenanceWindow"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterTargetFromMaintenanceWindowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1355,10 +1274,7 @@ export const serializeAws_json1_1DeregisterTaskFromMaintenanceWindowCommand = as input: DeregisterTaskFromMaintenanceWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DeregisterTaskFromMaintenanceWindow", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterTaskFromMaintenanceWindow"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterTaskFromMaintenanceWindowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1368,10 +1284,7 @@ export const serializeAws_json1_1DescribeActivationsCommand = async ( input: DescribeActivationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeActivations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeActivations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeActivationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1381,10 +1294,7 @@ export const serializeAws_json1_1DescribeAssociationCommand = async ( input: DescribeAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeAssociation", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1394,10 +1304,7 @@ export const serializeAws_json1_1DescribeAssociationExecutionsCommand = async ( input: DescribeAssociationExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeAssociationExecutions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAssociationExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAssociationExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1407,10 +1314,7 @@ export const serializeAws_json1_1DescribeAssociationExecutionTargetsCommand = as input: DescribeAssociationExecutionTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeAssociationExecutionTargets", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAssociationExecutionTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAssociationExecutionTargetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1420,10 +1324,7 @@ export const serializeAws_json1_1DescribeAutomationExecutionsCommand = async ( input: DescribeAutomationExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeAutomationExecutions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAutomationExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAutomationExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1433,10 +1334,7 @@ export const serializeAws_json1_1DescribeAutomationStepExecutionsCommand = async input: DescribeAutomationStepExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeAutomationStepExecutions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAutomationStepExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAutomationStepExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1446,10 +1344,7 @@ export const serializeAws_json1_1DescribeAvailablePatchesCommand = async ( input: DescribeAvailablePatchesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeAvailablePatches", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAvailablePatches"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAvailablePatchesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1459,10 +1354,7 @@ export const serializeAws_json1_1DescribeDocumentCommand = async ( input: DescribeDocumentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeDocument", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDocument"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDocumentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1472,10 +1364,7 @@ export const serializeAws_json1_1DescribeDocumentPermissionCommand = async ( input: DescribeDocumentPermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeDocumentPermission", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDocumentPermission"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeDocumentPermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1485,10 +1374,7 @@ export const serializeAws_json1_1DescribeEffectiveInstanceAssociationsCommand = input: DescribeEffectiveInstanceAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeEffectiveInstanceAssociations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEffectiveInstanceAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEffectiveInstanceAssociationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1498,10 +1384,7 @@ export const serializeAws_json1_1DescribeEffectivePatchesForPatchBaselineCommand input: DescribeEffectivePatchesForPatchBaselineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeEffectivePatchesForPatchBaseline", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEffectivePatchesForPatchBaseline"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEffectivePatchesForPatchBaselineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1511,10 +1394,7 @@ export const serializeAws_json1_1DescribeInstanceAssociationsStatusCommand = asy input: DescribeInstanceAssociationsStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeInstanceAssociationsStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInstanceAssociationsStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInstanceAssociationsStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1524,10 +1404,7 @@ export const serializeAws_json1_1DescribeInstanceInformationCommand = async ( input: DescribeInstanceInformationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeInstanceInformation", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInstanceInformation"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInstanceInformationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1537,10 +1414,7 @@ export const serializeAws_json1_1DescribeInstancePatchesCommand = async ( input: DescribeInstancePatchesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeInstancePatches", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInstancePatches"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInstancePatchesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1550,10 +1424,7 @@ export const serializeAws_json1_1DescribeInstancePatchStatesCommand = async ( input: DescribeInstancePatchStatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeInstancePatchStates", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInstancePatchStates"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInstancePatchStatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1563,10 +1434,7 @@ export const serializeAws_json1_1DescribeInstancePatchStatesForPatchGroupCommand input: DescribeInstancePatchStatesForPatchGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeInstancePatchStatesForPatchGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInstancePatchStatesForPatchGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInstancePatchStatesForPatchGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1576,10 +1444,7 @@ export const serializeAws_json1_1DescribeInventoryDeletionsCommand = async ( input: DescribeInventoryDeletionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeInventoryDeletions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInventoryDeletions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInventoryDeletionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1589,10 +1454,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowExecutionsCommand = as input: DescribeMaintenanceWindowExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeMaintenanceWindowExecutions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMaintenanceWindowExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMaintenanceWindowExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1602,10 +1464,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowExecutionTaskInvocatio input: DescribeMaintenanceWindowExecutionTaskInvocationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMaintenanceWindowExecutionTaskInvocations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMaintenanceWindowExecutionTaskInvocationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1615,10 +1474,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowExecutionTasksCommand input: DescribeMaintenanceWindowExecutionTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeMaintenanceWindowExecutionTasks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMaintenanceWindowExecutionTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMaintenanceWindowExecutionTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1628,10 +1484,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowsCommand = async ( input: DescribeMaintenanceWindowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeMaintenanceWindows", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMaintenanceWindows"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMaintenanceWindowsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1641,10 +1494,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowScheduleCommand = asyn input: DescribeMaintenanceWindowScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeMaintenanceWindowSchedule", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMaintenanceWindowSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMaintenanceWindowScheduleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1654,10 +1504,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowsForTargetCommand = as input: DescribeMaintenanceWindowsForTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeMaintenanceWindowsForTarget", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMaintenanceWindowsForTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMaintenanceWindowsForTargetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1667,10 +1514,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowTargetsCommand = async input: DescribeMaintenanceWindowTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeMaintenanceWindowTargets", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMaintenanceWindowTargets"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMaintenanceWindowTargetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1680,10 +1524,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowTasksCommand = async ( input: DescribeMaintenanceWindowTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeMaintenanceWindowTasks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMaintenanceWindowTasks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMaintenanceWindowTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1693,10 +1534,7 @@ export const serializeAws_json1_1DescribeOpsItemsCommand = async ( input: DescribeOpsItemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeOpsItems", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOpsItems"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeOpsItemsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1706,10 +1544,7 @@ export const serializeAws_json1_1DescribeParametersCommand = async ( input: DescribeParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeParameters", - }; + const headers: __HeaderBag = sharedHeaders("DescribeParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeParametersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1719,10 +1554,7 @@ export const serializeAws_json1_1DescribePatchBaselinesCommand = async ( input: DescribePatchBaselinesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribePatchBaselines", - }; + const headers: __HeaderBag = sharedHeaders("DescribePatchBaselines"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePatchBaselinesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1732,10 +1564,7 @@ export const serializeAws_json1_1DescribePatchGroupsCommand = async ( input: DescribePatchGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribePatchGroups", - }; + const headers: __HeaderBag = sharedHeaders("DescribePatchGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePatchGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1745,10 +1574,7 @@ export const serializeAws_json1_1DescribePatchGroupStateCommand = async ( input: DescribePatchGroupStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribePatchGroupState", - }; + const headers: __HeaderBag = sharedHeaders("DescribePatchGroupState"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePatchGroupStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1758,10 +1584,7 @@ export const serializeAws_json1_1DescribePatchPropertiesCommand = async ( input: DescribePatchPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribePatchProperties", - }; + const headers: __HeaderBag = sharedHeaders("DescribePatchProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePatchPropertiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1771,10 +1594,7 @@ export const serializeAws_json1_1DescribeSessionsCommand = async ( input: DescribeSessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DescribeSessions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSessions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSessionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1784,10 +1604,7 @@ export const serializeAws_json1_1DisassociateOpsItemRelatedItemCommand = async ( input: DisassociateOpsItemRelatedItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.DisassociateOpsItemRelatedItem", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateOpsItemRelatedItem"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateOpsItemRelatedItemRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1797,10 +1614,7 @@ export const serializeAws_json1_1GetAutomationExecutionCommand = async ( input: GetAutomationExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetAutomationExecution", - }; + const headers: __HeaderBag = sharedHeaders("GetAutomationExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAutomationExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1810,10 +1624,7 @@ export const serializeAws_json1_1GetCalendarStateCommand = async ( input: GetCalendarStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetCalendarState", - }; + const headers: __HeaderBag = sharedHeaders("GetCalendarState"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCalendarStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1823,10 +1634,7 @@ export const serializeAws_json1_1GetCommandInvocationCommand = async ( input: GetCommandInvocationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetCommandInvocation", - }; + const headers: __HeaderBag = sharedHeaders("GetCommandInvocation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCommandInvocationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1836,10 +1644,7 @@ export const serializeAws_json1_1GetConnectionStatusCommand = async ( input: GetConnectionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetConnectionStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetConnectionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetConnectionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1849,10 +1654,7 @@ export const serializeAws_json1_1GetDefaultPatchBaselineCommand = async ( input: GetDefaultPatchBaselineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetDefaultPatchBaseline", - }; + const headers: __HeaderBag = sharedHeaders("GetDefaultPatchBaseline"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDefaultPatchBaselineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1862,10 +1664,7 @@ export const serializeAws_json1_1GetDeployablePatchSnapshotForInstanceCommand = input: GetDeployablePatchSnapshotForInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetDeployablePatchSnapshotForInstance", - }; + const headers: __HeaderBag = sharedHeaders("GetDeployablePatchSnapshotForInstance"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDeployablePatchSnapshotForInstanceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1875,10 +1674,7 @@ export const serializeAws_json1_1GetDocumentCommand = async ( input: GetDocumentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetDocument", - }; + const headers: __HeaderBag = sharedHeaders("GetDocument"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDocumentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1888,10 +1684,7 @@ export const serializeAws_json1_1GetInventoryCommand = async ( input: GetInventoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetInventory", - }; + const headers: __HeaderBag = sharedHeaders("GetInventory"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInventoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1901,10 +1694,7 @@ export const serializeAws_json1_1GetInventorySchemaCommand = async ( input: GetInventorySchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetInventorySchema", - }; + const headers: __HeaderBag = sharedHeaders("GetInventorySchema"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInventorySchemaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1914,10 +1704,7 @@ export const serializeAws_json1_1GetMaintenanceWindowCommand = async ( input: GetMaintenanceWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetMaintenanceWindow", - }; + const headers: __HeaderBag = sharedHeaders("GetMaintenanceWindow"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMaintenanceWindowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1927,10 +1714,7 @@ export const serializeAws_json1_1GetMaintenanceWindowExecutionCommand = async ( input: GetMaintenanceWindowExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetMaintenanceWindowExecution", - }; + const headers: __HeaderBag = sharedHeaders("GetMaintenanceWindowExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMaintenanceWindowExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1940,10 +1724,7 @@ export const serializeAws_json1_1GetMaintenanceWindowExecutionTaskCommand = asyn input: GetMaintenanceWindowExecutionTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetMaintenanceWindowExecutionTask", - }; + const headers: __HeaderBag = sharedHeaders("GetMaintenanceWindowExecutionTask"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMaintenanceWindowExecutionTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1953,10 +1734,7 @@ export const serializeAws_json1_1GetMaintenanceWindowExecutionTaskInvocationComm input: GetMaintenanceWindowExecutionTaskInvocationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation", - }; + const headers: __HeaderBag = sharedHeaders("GetMaintenanceWindowExecutionTaskInvocation"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMaintenanceWindowExecutionTaskInvocationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1966,10 +1744,7 @@ export const serializeAws_json1_1GetMaintenanceWindowTaskCommand = async ( input: GetMaintenanceWindowTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetMaintenanceWindowTask", - }; + const headers: __HeaderBag = sharedHeaders("GetMaintenanceWindowTask"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMaintenanceWindowTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1979,10 +1754,7 @@ export const serializeAws_json1_1GetOpsItemCommand = async ( input: GetOpsItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetOpsItem", - }; + const headers: __HeaderBag = sharedHeaders("GetOpsItem"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOpsItemRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1992,10 +1764,7 @@ export const serializeAws_json1_1GetOpsMetadataCommand = async ( input: GetOpsMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetOpsMetadata", - }; + const headers: __HeaderBag = sharedHeaders("GetOpsMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOpsMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2005,10 +1774,7 @@ export const serializeAws_json1_1GetOpsSummaryCommand = async ( input: GetOpsSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetOpsSummary", - }; + const headers: __HeaderBag = sharedHeaders("GetOpsSummary"); let body: any; body = JSON.stringify(serializeAws_json1_1GetOpsSummaryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2018,10 +1784,7 @@ export const serializeAws_json1_1GetParameterCommand = async ( input: GetParameterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetParameter", - }; + const headers: __HeaderBag = sharedHeaders("GetParameter"); let body: any; body = JSON.stringify(serializeAws_json1_1GetParameterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2031,10 +1794,7 @@ export const serializeAws_json1_1GetParameterHistoryCommand = async ( input: GetParameterHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetParameterHistory", - }; + const headers: __HeaderBag = sharedHeaders("GetParameterHistory"); let body: any; body = JSON.stringify(serializeAws_json1_1GetParameterHistoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2044,10 +1804,7 @@ export const serializeAws_json1_1GetParametersCommand = async ( input: GetParametersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetParameters", - }; + const headers: __HeaderBag = sharedHeaders("GetParameters"); let body: any; body = JSON.stringify(serializeAws_json1_1GetParametersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2057,10 +1814,7 @@ export const serializeAws_json1_1GetParametersByPathCommand = async ( input: GetParametersByPathCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetParametersByPath", - }; + const headers: __HeaderBag = sharedHeaders("GetParametersByPath"); let body: any; body = JSON.stringify(serializeAws_json1_1GetParametersByPathRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2070,10 +1824,7 @@ export const serializeAws_json1_1GetPatchBaselineCommand = async ( input: GetPatchBaselineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetPatchBaseline", - }; + const headers: __HeaderBag = sharedHeaders("GetPatchBaseline"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPatchBaselineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2083,10 +1834,7 @@ export const serializeAws_json1_1GetPatchBaselineForPatchGroupCommand = async ( input: GetPatchBaselineForPatchGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetPatchBaselineForPatchGroup", - }; + const headers: __HeaderBag = sharedHeaders("GetPatchBaselineForPatchGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPatchBaselineForPatchGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2096,10 +1844,7 @@ export const serializeAws_json1_1GetResourcePoliciesCommand = async ( input: GetResourcePoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetResourcePolicies", - }; + const headers: __HeaderBag = sharedHeaders("GetResourcePolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1GetResourcePoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2109,10 +1854,7 @@ export const serializeAws_json1_1GetServiceSettingCommand = async ( input: GetServiceSettingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.GetServiceSetting", - }; + const headers: __HeaderBag = sharedHeaders("GetServiceSetting"); let body: any; body = JSON.stringify(serializeAws_json1_1GetServiceSettingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2122,10 +1864,7 @@ export const serializeAws_json1_1LabelParameterVersionCommand = async ( input: LabelParameterVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.LabelParameterVersion", - }; + const headers: __HeaderBag = sharedHeaders("LabelParameterVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1LabelParameterVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2135,10 +1874,7 @@ export const serializeAws_json1_1ListAssociationsCommand = async ( input: ListAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListAssociations", - }; + const headers: __HeaderBag = sharedHeaders("ListAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssociationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2148,10 +1884,7 @@ export const serializeAws_json1_1ListAssociationVersionsCommand = async ( input: ListAssociationVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListAssociationVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListAssociationVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAssociationVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2161,10 +1894,7 @@ export const serializeAws_json1_1ListCommandInvocationsCommand = async ( input: ListCommandInvocationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListCommandInvocations", - }; + const headers: __HeaderBag = sharedHeaders("ListCommandInvocations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCommandInvocationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2174,10 +1904,7 @@ export const serializeAws_json1_1ListCommandsCommand = async ( input: ListCommandsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListCommands", - }; + const headers: __HeaderBag = sharedHeaders("ListCommands"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCommandsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2187,10 +1914,7 @@ export const serializeAws_json1_1ListComplianceItemsCommand = async ( input: ListComplianceItemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListComplianceItems", - }; + const headers: __HeaderBag = sharedHeaders("ListComplianceItems"); let body: any; body = JSON.stringify(serializeAws_json1_1ListComplianceItemsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2200,10 +1924,7 @@ export const serializeAws_json1_1ListComplianceSummariesCommand = async ( input: ListComplianceSummariesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListComplianceSummaries", - }; + const headers: __HeaderBag = sharedHeaders("ListComplianceSummaries"); let body: any; body = JSON.stringify(serializeAws_json1_1ListComplianceSummariesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2213,10 +1934,7 @@ export const serializeAws_json1_1ListDocumentMetadataHistoryCommand = async ( input: ListDocumentMetadataHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListDocumentMetadataHistory", - }; + const headers: __HeaderBag = sharedHeaders("ListDocumentMetadataHistory"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDocumentMetadataHistoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2226,10 +1944,7 @@ export const serializeAws_json1_1ListDocumentsCommand = async ( input: ListDocumentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListDocuments", - }; + const headers: __HeaderBag = sharedHeaders("ListDocuments"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDocumentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2239,10 +1954,7 @@ export const serializeAws_json1_1ListDocumentVersionsCommand = async ( input: ListDocumentVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListDocumentVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListDocumentVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListDocumentVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2252,10 +1964,7 @@ export const serializeAws_json1_1ListInventoryEntriesCommand = async ( input: ListInventoryEntriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListInventoryEntries", - }; + const headers: __HeaderBag = sharedHeaders("ListInventoryEntries"); let body: any; body = JSON.stringify(serializeAws_json1_1ListInventoryEntriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2265,10 +1974,7 @@ export const serializeAws_json1_1ListOpsItemEventsCommand = async ( input: ListOpsItemEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListOpsItemEvents", - }; + const headers: __HeaderBag = sharedHeaders("ListOpsItemEvents"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOpsItemEventsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2278,10 +1984,7 @@ export const serializeAws_json1_1ListOpsItemRelatedItemsCommand = async ( input: ListOpsItemRelatedItemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListOpsItemRelatedItems", - }; + const headers: __HeaderBag = sharedHeaders("ListOpsItemRelatedItems"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOpsItemRelatedItemsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2291,10 +1994,7 @@ export const serializeAws_json1_1ListOpsMetadataCommand = async ( input: ListOpsMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListOpsMetadata", - }; + const headers: __HeaderBag = sharedHeaders("ListOpsMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOpsMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2304,10 +2004,7 @@ export const serializeAws_json1_1ListResourceComplianceSummariesCommand = async input: ListResourceComplianceSummariesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListResourceComplianceSummaries", - }; + const headers: __HeaderBag = sharedHeaders("ListResourceComplianceSummaries"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourceComplianceSummariesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2317,10 +2014,7 @@ export const serializeAws_json1_1ListResourceDataSyncCommand = async ( input: ListResourceDataSyncCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListResourceDataSync", - }; + const headers: __HeaderBag = sharedHeaders("ListResourceDataSync"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourceDataSyncRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2330,10 +2024,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2343,10 +2034,7 @@ export const serializeAws_json1_1ModifyDocumentPermissionCommand = async ( input: ModifyDocumentPermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ModifyDocumentPermission", - }; + const headers: __HeaderBag = sharedHeaders("ModifyDocumentPermission"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyDocumentPermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2356,10 +2044,7 @@ export const serializeAws_json1_1PutComplianceItemsCommand = async ( input: PutComplianceItemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.PutComplianceItems", - }; + const headers: __HeaderBag = sharedHeaders("PutComplianceItems"); let body: any; body = JSON.stringify(serializeAws_json1_1PutComplianceItemsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2369,10 +2054,7 @@ export const serializeAws_json1_1PutInventoryCommand = async ( input: PutInventoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.PutInventory", - }; + const headers: __HeaderBag = sharedHeaders("PutInventory"); let body: any; body = JSON.stringify(serializeAws_json1_1PutInventoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2382,10 +2064,7 @@ export const serializeAws_json1_1PutParameterCommand = async ( input: PutParameterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.PutParameter", - }; + const headers: __HeaderBag = sharedHeaders("PutParameter"); let body: any; body = JSON.stringify(serializeAws_json1_1PutParameterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2395,10 +2074,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( input: PutResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.PutResourcePolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutResourcePolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2408,10 +2084,7 @@ export const serializeAws_json1_1RegisterDefaultPatchBaselineCommand = async ( input: RegisterDefaultPatchBaselineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.RegisterDefaultPatchBaseline", - }; + const headers: __HeaderBag = sharedHeaders("RegisterDefaultPatchBaseline"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterDefaultPatchBaselineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2421,10 +2094,7 @@ export const serializeAws_json1_1RegisterPatchBaselineForPatchGroupCommand = asy input: RegisterPatchBaselineForPatchGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.RegisterPatchBaselineForPatchGroup", - }; + const headers: __HeaderBag = sharedHeaders("RegisterPatchBaselineForPatchGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterPatchBaselineForPatchGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2434,10 +2104,7 @@ export const serializeAws_json1_1RegisterTargetWithMaintenanceWindowCommand = as input: RegisterTargetWithMaintenanceWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.RegisterTargetWithMaintenanceWindow", - }; + const headers: __HeaderBag = sharedHeaders("RegisterTargetWithMaintenanceWindow"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterTargetWithMaintenanceWindowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2447,10 +2114,7 @@ export const serializeAws_json1_1RegisterTaskWithMaintenanceWindowCommand = asyn input: RegisterTaskWithMaintenanceWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.RegisterTaskWithMaintenanceWindow", - }; + const headers: __HeaderBag = sharedHeaders("RegisterTaskWithMaintenanceWindow"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterTaskWithMaintenanceWindowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2460,10 +2124,7 @@ export const serializeAws_json1_1RemoveTagsFromResourceCommand = async ( input: RemoveTagsFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.RemoveTagsFromResource", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTagsFromResource"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsFromResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2473,10 +2134,7 @@ export const serializeAws_json1_1ResetServiceSettingCommand = async ( input: ResetServiceSettingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ResetServiceSetting", - }; + const headers: __HeaderBag = sharedHeaders("ResetServiceSetting"); let body: any; body = JSON.stringify(serializeAws_json1_1ResetServiceSettingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2486,10 +2144,7 @@ export const serializeAws_json1_1ResumeSessionCommand = async ( input: ResumeSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.ResumeSession", - }; + const headers: __HeaderBag = sharedHeaders("ResumeSession"); let body: any; body = JSON.stringify(serializeAws_json1_1ResumeSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2499,10 +2154,7 @@ export const serializeAws_json1_1SendAutomationSignalCommand = async ( input: SendAutomationSignalCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.SendAutomationSignal", - }; + const headers: __HeaderBag = sharedHeaders("SendAutomationSignal"); let body: any; body = JSON.stringify(serializeAws_json1_1SendAutomationSignalRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2512,10 +2164,7 @@ export const serializeAws_json1_1SendCommandCommand = async ( input: SendCommandCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.SendCommand", - }; + const headers: __HeaderBag = sharedHeaders("SendCommand"); let body: any; body = JSON.stringify(serializeAws_json1_1SendCommandRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2525,10 +2174,7 @@ export const serializeAws_json1_1StartAssociationsOnceCommand = async ( input: StartAssociationsOnceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.StartAssociationsOnce", - }; + const headers: __HeaderBag = sharedHeaders("StartAssociationsOnce"); let body: any; body = JSON.stringify(serializeAws_json1_1StartAssociationsOnceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2538,10 +2184,7 @@ export const serializeAws_json1_1StartAutomationExecutionCommand = async ( input: StartAutomationExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.StartAutomationExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartAutomationExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StartAutomationExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2551,10 +2194,7 @@ export const serializeAws_json1_1StartChangeRequestExecutionCommand = async ( input: StartChangeRequestExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.StartChangeRequestExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartChangeRequestExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StartChangeRequestExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2564,10 +2204,7 @@ export const serializeAws_json1_1StartSessionCommand = async ( input: StartSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.StartSession", - }; + const headers: __HeaderBag = sharedHeaders("StartSession"); let body: any; body = JSON.stringify(serializeAws_json1_1StartSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2577,10 +2214,7 @@ export const serializeAws_json1_1StopAutomationExecutionCommand = async ( input: StopAutomationExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.StopAutomationExecution", - }; + const headers: __HeaderBag = sharedHeaders("StopAutomationExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1StopAutomationExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2590,10 +2224,7 @@ export const serializeAws_json1_1TerminateSessionCommand = async ( input: TerminateSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.TerminateSession", - }; + const headers: __HeaderBag = sharedHeaders("TerminateSession"); let body: any; body = JSON.stringify(serializeAws_json1_1TerminateSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2603,10 +2234,7 @@ export const serializeAws_json1_1UnlabelParameterVersionCommand = async ( input: UnlabelParameterVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UnlabelParameterVersion", - }; + const headers: __HeaderBag = sharedHeaders("UnlabelParameterVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1UnlabelParameterVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2616,10 +2244,7 @@ export const serializeAws_json1_1UpdateAssociationCommand = async ( input: UpdateAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateAssociation", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAssociationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2629,10 +2254,7 @@ export const serializeAws_json1_1UpdateAssociationStatusCommand = async ( input: UpdateAssociationStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateAssociationStatus", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAssociationStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAssociationStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2642,10 +2264,7 @@ export const serializeAws_json1_1UpdateDocumentCommand = async ( input: UpdateDocumentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateDocument", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDocument"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDocumentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2655,10 +2274,7 @@ export const serializeAws_json1_1UpdateDocumentDefaultVersionCommand = async ( input: UpdateDocumentDefaultVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateDocumentDefaultVersion", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDocumentDefaultVersion"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDocumentDefaultVersionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2668,10 +2284,7 @@ export const serializeAws_json1_1UpdateDocumentMetadataCommand = async ( input: UpdateDocumentMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateDocumentMetadata", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDocumentMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDocumentMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2681,10 +2294,7 @@ export const serializeAws_json1_1UpdateMaintenanceWindowCommand = async ( input: UpdateMaintenanceWindowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateMaintenanceWindow", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMaintenanceWindow"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMaintenanceWindowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2694,10 +2304,7 @@ export const serializeAws_json1_1UpdateMaintenanceWindowTargetCommand = async ( input: UpdateMaintenanceWindowTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateMaintenanceWindowTarget", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMaintenanceWindowTarget"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMaintenanceWindowTargetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2707,10 +2314,7 @@ export const serializeAws_json1_1UpdateMaintenanceWindowTaskCommand = async ( input: UpdateMaintenanceWindowTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateMaintenanceWindowTask", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMaintenanceWindowTask"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMaintenanceWindowTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2720,10 +2324,7 @@ export const serializeAws_json1_1UpdateManagedInstanceRoleCommand = async ( input: UpdateManagedInstanceRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateManagedInstanceRole", - }; + const headers: __HeaderBag = sharedHeaders("UpdateManagedInstanceRole"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateManagedInstanceRoleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2733,10 +2334,7 @@ export const serializeAws_json1_1UpdateOpsItemCommand = async ( input: UpdateOpsItemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateOpsItem", - }; + const headers: __HeaderBag = sharedHeaders("UpdateOpsItem"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateOpsItemRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2746,10 +2344,7 @@ export const serializeAws_json1_1UpdateOpsMetadataCommand = async ( input: UpdateOpsMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateOpsMetadata", - }; + const headers: __HeaderBag = sharedHeaders("UpdateOpsMetadata"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateOpsMetadataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2759,10 +2354,7 @@ export const serializeAws_json1_1UpdatePatchBaselineCommand = async ( input: UpdatePatchBaselineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdatePatchBaseline", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePatchBaseline"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePatchBaselineRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2772,10 +2364,7 @@ export const serializeAws_json1_1UpdateResourceDataSyncCommand = async ( input: UpdateResourceDataSyncCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateResourceDataSync", - }; + const headers: __HeaderBag = sharedHeaders("UpdateResourceDataSync"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateResourceDataSyncRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2785,10 +2374,7 @@ export const serializeAws_json1_1UpdateServiceSettingCommand = async ( input: UpdateServiceSettingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AmazonSSM.UpdateServiceSetting", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServiceSetting"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateServiceSettingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -20826,6 +20412,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonSSM.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-sso-admin/src/protocols/Aws_json1_1.ts b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts index 8fb746fd6741a..71bff39a20e12 100644 --- a/clients/client-sso-admin/src/protocols/Aws_json1_1.ts +++ b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts @@ -255,10 +255,7 @@ export const serializeAws_json1_1AttachCustomerManagedPolicyReferenceToPermissio input: AttachCustomerManagedPolicyReferenceToPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.AttachCustomerManagedPolicyReferenceToPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("AttachCustomerManagedPolicyReferenceToPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1AttachCustomerManagedPolicyReferenceToPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -268,10 +265,7 @@ export const serializeAws_json1_1AttachManagedPolicyToPermissionSetCommand = asy input: AttachManagedPolicyToPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.AttachManagedPolicyToPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("AttachManagedPolicyToPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1AttachManagedPolicyToPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -281,10 +275,7 @@ export const serializeAws_json1_1CreateAccountAssignmentCommand = async ( input: CreateAccountAssignmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.CreateAccountAssignment", - }; + const headers: __HeaderBag = sharedHeaders("CreateAccountAssignment"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAccountAssignmentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -294,10 +285,7 @@ export const serializeAws_json1_1CreateInstanceAccessControlAttributeConfigurati input: CreateInstanceAccessControlAttributeConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.CreateInstanceAccessControlAttributeConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("CreateInstanceAccessControlAttributeConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -307,10 +295,7 @@ export const serializeAws_json1_1CreatePermissionSetCommand = async ( input: CreatePermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.CreatePermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("CreatePermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreatePermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -320,10 +305,7 @@ export const serializeAws_json1_1DeleteAccountAssignmentCommand = async ( input: DeleteAccountAssignmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DeleteAccountAssignment", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAccountAssignment"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAccountAssignmentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -333,10 +315,7 @@ export const serializeAws_json1_1DeleteInlinePolicyFromPermissionSetCommand = as input: DeleteInlinePolicyFromPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DeleteInlinePolicyFromPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteInlinePolicyFromPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteInlinePolicyFromPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -346,10 +325,7 @@ export const serializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurati input: DeleteInstanceAccessControlAttributeConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DeleteInstanceAccessControlAttributeConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteInstanceAccessControlAttributeConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -359,10 +335,7 @@ export const serializeAws_json1_1DeletePermissionsBoundaryFromPermissionSetComma input: DeletePermissionsBoundaryFromPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DeletePermissionsBoundaryFromPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("DeletePermissionsBoundaryFromPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePermissionsBoundaryFromPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -372,10 +345,7 @@ export const serializeAws_json1_1DeletePermissionSetCommand = async ( input: DeletePermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DeletePermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("DeletePermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -385,10 +355,7 @@ export const serializeAws_json1_1DescribeAccountAssignmentCreationStatusCommand input: DescribeAccountAssignmentCreationStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DescribeAccountAssignmentCreationStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccountAssignmentCreationStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAccountAssignmentCreationStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -398,10 +365,7 @@ export const serializeAws_json1_1DescribeAccountAssignmentDeletionStatusCommand input: DescribeAccountAssignmentDeletionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DescribeAccountAssignmentDeletionStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccountAssignmentDeletionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAccountAssignmentDeletionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -411,10 +375,7 @@ export const serializeAws_json1_1DescribeInstanceAccessControlAttributeConfigura input: DescribeInstanceAccessControlAttributeConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DescribeInstanceAccessControlAttributeConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInstanceAccessControlAttributeConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -424,10 +385,7 @@ export const serializeAws_json1_1DescribePermissionSetCommand = async ( input: DescribePermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DescribePermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("DescribePermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -437,10 +395,7 @@ export const serializeAws_json1_1DescribePermissionSetProvisioningStatusCommand input: DescribePermissionSetProvisioningStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DescribePermissionSetProvisioningStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribePermissionSetProvisioningStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribePermissionSetProvisioningStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -450,10 +405,7 @@ export const serializeAws_json1_1DetachCustomerManagedPolicyReferenceFromPermiss input: DetachCustomerManagedPolicyReferenceFromPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DetachCustomerManagedPolicyReferenceFromPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("DetachCustomerManagedPolicyReferenceFromPermissionSet"); let body: any; body = JSON.stringify( serializeAws_json1_1DetachCustomerManagedPolicyReferenceFromPermissionSetRequest(input, context) @@ -465,10 +417,7 @@ export const serializeAws_json1_1DetachManagedPolicyFromPermissionSetCommand = a input: DetachManagedPolicyFromPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.DetachManagedPolicyFromPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("DetachManagedPolicyFromPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DetachManagedPolicyFromPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -478,10 +427,7 @@ export const serializeAws_json1_1GetInlinePolicyForPermissionSetCommand = async input: GetInlinePolicyForPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.GetInlinePolicyForPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("GetInlinePolicyForPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetInlinePolicyForPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -491,10 +437,7 @@ export const serializeAws_json1_1GetPermissionsBoundaryForPermissionSetCommand = input: GetPermissionsBoundaryForPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.GetPermissionsBoundaryForPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("GetPermissionsBoundaryForPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPermissionsBoundaryForPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -504,10 +447,7 @@ export const serializeAws_json1_1ListAccountAssignmentCreationStatusCommand = as input: ListAccountAssignmentCreationStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListAccountAssignmentCreationStatus", - }; + const headers: __HeaderBag = sharedHeaders("ListAccountAssignmentCreationStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAccountAssignmentCreationStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -517,10 +457,7 @@ export const serializeAws_json1_1ListAccountAssignmentDeletionStatusCommand = as input: ListAccountAssignmentDeletionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListAccountAssignmentDeletionStatus", - }; + const headers: __HeaderBag = sharedHeaders("ListAccountAssignmentDeletionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAccountAssignmentDeletionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -530,10 +467,7 @@ export const serializeAws_json1_1ListAccountAssignmentsCommand = async ( input: ListAccountAssignmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListAccountAssignments", - }; + const headers: __HeaderBag = sharedHeaders("ListAccountAssignments"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAccountAssignmentsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -543,10 +477,7 @@ export const serializeAws_json1_1ListAccountsForProvisionedPermissionSetCommand input: ListAccountsForProvisionedPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListAccountsForProvisionedPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("ListAccountsForProvisionedPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAccountsForProvisionedPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -556,10 +487,7 @@ export const serializeAws_json1_1ListCustomerManagedPolicyReferencesInPermission input: ListCustomerManagedPolicyReferencesInPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListCustomerManagedPolicyReferencesInPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("ListCustomerManagedPolicyReferencesInPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCustomerManagedPolicyReferencesInPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -569,10 +497,7 @@ export const serializeAws_json1_1ListInstancesCommand = async ( input: ListInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListInstances", - }; + const headers: __HeaderBag = sharedHeaders("ListInstances"); let body: any; body = JSON.stringify(serializeAws_json1_1ListInstancesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -582,10 +507,7 @@ export const serializeAws_json1_1ListManagedPoliciesInPermissionSetCommand = asy input: ListManagedPoliciesInPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListManagedPoliciesInPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("ListManagedPoliciesInPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1ListManagedPoliciesInPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -595,10 +517,7 @@ export const serializeAws_json1_1ListPermissionSetProvisioningStatusCommand = as input: ListPermissionSetProvisioningStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListPermissionSetProvisioningStatus", - }; + const headers: __HeaderBag = sharedHeaders("ListPermissionSetProvisioningStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPermissionSetProvisioningStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -608,10 +527,7 @@ export const serializeAws_json1_1ListPermissionSetsCommand = async ( input: ListPermissionSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListPermissionSets", - }; + const headers: __HeaderBag = sharedHeaders("ListPermissionSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPermissionSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -621,10 +537,7 @@ export const serializeAws_json1_1ListPermissionSetsProvisionedToAccountCommand = input: ListPermissionSetsProvisionedToAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListPermissionSetsProvisionedToAccount", - }; + const headers: __HeaderBag = sharedHeaders("ListPermissionSetsProvisionedToAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1ListPermissionSetsProvisionedToAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -634,10 +547,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -647,10 +557,7 @@ export const serializeAws_json1_1ProvisionPermissionSetCommand = async ( input: ProvisionPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.ProvisionPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("ProvisionPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1ProvisionPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -660,10 +567,7 @@ export const serializeAws_json1_1PutInlinePolicyToPermissionSetCommand = async ( input: PutInlinePolicyToPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.PutInlinePolicyToPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("PutInlinePolicyToPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1PutInlinePolicyToPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -673,10 +577,7 @@ export const serializeAws_json1_1PutPermissionsBoundaryToPermissionSetCommand = input: PutPermissionsBoundaryToPermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.PutPermissionsBoundaryToPermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("PutPermissionsBoundaryToPermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPermissionsBoundaryToPermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -686,10 +587,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -699,10 +597,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -712,10 +607,7 @@ export const serializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurati input: UpdateInstanceAccessControlAttributeConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.UpdateInstanceAccessControlAttributeConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateInstanceAccessControlAttributeConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -725,10 +617,7 @@ export const serializeAws_json1_1UpdatePermissionSetCommand = async ( input: UpdatePermissionSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "SWBExternalService.UpdatePermissionSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePermissionSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePermissionSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4152,6 +4041,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `SWBExternalService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts index 3a10974d102b4..7f2e039e19d90 100644 --- a/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts +++ b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts @@ -485,10 +485,7 @@ export const serializeAws_json1_1ActivateGatewayCommand = async ( input: ActivateGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ActivateGateway", - }; + const headers: __HeaderBag = sharedHeaders("ActivateGateway"); let body: any; body = JSON.stringify(serializeAws_json1_1ActivateGatewayInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -498,10 +495,7 @@ export const serializeAws_json1_1AddCacheCommand = async ( input: AddCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.AddCache", - }; + const headers: __HeaderBag = sharedHeaders("AddCache"); let body: any; body = JSON.stringify(serializeAws_json1_1AddCacheInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -511,10 +505,7 @@ export const serializeAws_json1_1AddTagsToResourceCommand = async ( input: AddTagsToResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.AddTagsToResource", - }; + const headers: __HeaderBag = sharedHeaders("AddTagsToResource"); let body: any; body = JSON.stringify(serializeAws_json1_1AddTagsToResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -524,10 +515,7 @@ export const serializeAws_json1_1AddUploadBufferCommand = async ( input: AddUploadBufferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.AddUploadBuffer", - }; + const headers: __HeaderBag = sharedHeaders("AddUploadBuffer"); let body: any; body = JSON.stringify(serializeAws_json1_1AddUploadBufferInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -537,10 +525,7 @@ export const serializeAws_json1_1AddWorkingStorageCommand = async ( input: AddWorkingStorageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.AddWorkingStorage", - }; + const headers: __HeaderBag = sharedHeaders("AddWorkingStorage"); let body: any; body = JSON.stringify(serializeAws_json1_1AddWorkingStorageInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -550,10 +535,7 @@ export const serializeAws_json1_1AssignTapePoolCommand = async ( input: AssignTapePoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.AssignTapePool", - }; + const headers: __HeaderBag = sharedHeaders("AssignTapePool"); let body: any; body = JSON.stringify(serializeAws_json1_1AssignTapePoolInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -563,10 +545,7 @@ export const serializeAws_json1_1AssociateFileSystemCommand = async ( input: AssociateFileSystemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.AssociateFileSystem", - }; + const headers: __HeaderBag = sharedHeaders("AssociateFileSystem"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateFileSystemInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -576,10 +555,7 @@ export const serializeAws_json1_1AttachVolumeCommand = async ( input: AttachVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.AttachVolume", - }; + const headers: __HeaderBag = sharedHeaders("AttachVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1AttachVolumeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -589,10 +565,7 @@ export const serializeAws_json1_1CancelArchivalCommand = async ( input: CancelArchivalCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CancelArchival", - }; + const headers: __HeaderBag = sharedHeaders("CancelArchival"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelArchivalInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -602,10 +575,7 @@ export const serializeAws_json1_1CancelRetrievalCommand = async ( input: CancelRetrievalCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CancelRetrieval", - }; + const headers: __HeaderBag = sharedHeaders("CancelRetrieval"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelRetrievalInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -615,10 +585,7 @@ export const serializeAws_json1_1CreateCachediSCSIVolumeCommand = async ( input: CreateCachediSCSIVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CreateCachediSCSIVolume", - }; + const headers: __HeaderBag = sharedHeaders("CreateCachediSCSIVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCachediSCSIVolumeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -628,10 +595,7 @@ export const serializeAws_json1_1CreateNFSFileShareCommand = async ( input: CreateNFSFileShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CreateNFSFileShare", - }; + const headers: __HeaderBag = sharedHeaders("CreateNFSFileShare"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateNFSFileShareInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -641,10 +605,7 @@ export const serializeAws_json1_1CreateSMBFileShareCommand = async ( input: CreateSMBFileShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CreateSMBFileShare", - }; + const headers: __HeaderBag = sharedHeaders("CreateSMBFileShare"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSMBFileShareInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -654,10 +615,7 @@ export const serializeAws_json1_1CreateSnapshotCommand = async ( input: CreateSnapshotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CreateSnapshot", - }; + const headers: __HeaderBag = sharedHeaders("CreateSnapshot"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSnapshotInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -667,10 +625,7 @@ export const serializeAws_json1_1CreateSnapshotFromVolumeRecoveryPointCommand = input: CreateSnapshotFromVolumeRecoveryPointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CreateSnapshotFromVolumeRecoveryPoint", - }; + const headers: __HeaderBag = sharedHeaders("CreateSnapshotFromVolumeRecoveryPoint"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSnapshotFromVolumeRecoveryPointInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -680,10 +635,7 @@ export const serializeAws_json1_1CreateStorediSCSIVolumeCommand = async ( input: CreateStorediSCSIVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CreateStorediSCSIVolume", - }; + const headers: __HeaderBag = sharedHeaders("CreateStorediSCSIVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStorediSCSIVolumeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -693,10 +645,7 @@ export const serializeAws_json1_1CreateTapePoolCommand = async ( input: CreateTapePoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CreateTapePool", - }; + const headers: __HeaderBag = sharedHeaders("CreateTapePool"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTapePoolInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -706,10 +655,7 @@ export const serializeAws_json1_1CreateTapesCommand = async ( input: CreateTapesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CreateTapes", - }; + const headers: __HeaderBag = sharedHeaders("CreateTapes"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTapesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -719,10 +665,7 @@ export const serializeAws_json1_1CreateTapeWithBarcodeCommand = async ( input: CreateTapeWithBarcodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.CreateTapeWithBarcode", - }; + const headers: __HeaderBag = sharedHeaders("CreateTapeWithBarcode"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTapeWithBarcodeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -732,10 +675,7 @@ export const serializeAws_json1_1DeleteAutomaticTapeCreationPolicyCommand = asyn input: DeleteAutomaticTapeCreationPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DeleteAutomaticTapeCreationPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAutomaticTapeCreationPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAutomaticTapeCreationPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -745,10 +685,7 @@ export const serializeAws_json1_1DeleteBandwidthRateLimitCommand = async ( input: DeleteBandwidthRateLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DeleteBandwidthRateLimit", - }; + const headers: __HeaderBag = sharedHeaders("DeleteBandwidthRateLimit"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteBandwidthRateLimitInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -758,10 +695,7 @@ export const serializeAws_json1_1DeleteChapCredentialsCommand = async ( input: DeleteChapCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DeleteChapCredentials", - }; + const headers: __HeaderBag = sharedHeaders("DeleteChapCredentials"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteChapCredentialsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -771,10 +705,7 @@ export const serializeAws_json1_1DeleteFileShareCommand = async ( input: DeleteFileShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DeleteFileShare", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFileShare"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFileShareInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -784,10 +715,7 @@ export const serializeAws_json1_1DeleteGatewayCommand = async ( input: DeleteGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DeleteGateway", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGateway"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGatewayInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -797,10 +725,7 @@ export const serializeAws_json1_1DeleteSnapshotScheduleCommand = async ( input: DeleteSnapshotScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DeleteSnapshotSchedule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSnapshotSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSnapshotScheduleInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -810,10 +735,7 @@ export const serializeAws_json1_1DeleteTapeCommand = async ( input: DeleteTapeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DeleteTape", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTape"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTapeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -823,10 +745,7 @@ export const serializeAws_json1_1DeleteTapeArchiveCommand = async ( input: DeleteTapeArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DeleteTapeArchive", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTapeArchive"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTapeArchiveInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -836,10 +755,7 @@ export const serializeAws_json1_1DeleteTapePoolCommand = async ( input: DeleteTapePoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DeleteTapePool", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTapePool"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTapePoolInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -849,10 +765,7 @@ export const serializeAws_json1_1DeleteVolumeCommand = async ( input: DeleteVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DeleteVolume", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteVolumeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -862,10 +775,7 @@ export const serializeAws_json1_1DescribeAvailabilityMonitorTestCommand = async input: DescribeAvailabilityMonitorTestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeAvailabilityMonitorTest", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAvailabilityMonitorTest"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAvailabilityMonitorTestInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -875,10 +785,7 @@ export const serializeAws_json1_1DescribeBandwidthRateLimitCommand = async ( input: DescribeBandwidthRateLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeBandwidthRateLimit", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBandwidthRateLimit"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBandwidthRateLimitInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -888,10 +795,7 @@ export const serializeAws_json1_1DescribeBandwidthRateLimitScheduleCommand = asy input: DescribeBandwidthRateLimitScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeBandwidthRateLimitSchedule", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBandwidthRateLimitSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeBandwidthRateLimitScheduleInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -901,10 +805,7 @@ export const serializeAws_json1_1DescribeCacheCommand = async ( input: DescribeCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeCache", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCache"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCacheInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -914,10 +815,7 @@ export const serializeAws_json1_1DescribeCachediSCSIVolumesCommand = async ( input: DescribeCachediSCSIVolumesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeCachediSCSIVolumes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCachediSCSIVolumes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCachediSCSIVolumesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -927,10 +825,7 @@ export const serializeAws_json1_1DescribeChapCredentialsCommand = async ( input: DescribeChapCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeChapCredentials", - }; + const headers: __HeaderBag = sharedHeaders("DescribeChapCredentials"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeChapCredentialsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -940,10 +835,7 @@ export const serializeAws_json1_1DescribeFileSystemAssociationsCommand = async ( input: DescribeFileSystemAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeFileSystemAssociations", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFileSystemAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeFileSystemAssociationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -953,10 +845,7 @@ export const serializeAws_json1_1DescribeGatewayInformationCommand = async ( input: DescribeGatewayInformationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeGatewayInformation", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGatewayInformation"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGatewayInformationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -966,10 +855,7 @@ export const serializeAws_json1_1DescribeMaintenanceStartTimeCommand = async ( input: DescribeMaintenanceStartTimeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeMaintenanceStartTime", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMaintenanceStartTime"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMaintenanceStartTimeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -979,10 +865,7 @@ export const serializeAws_json1_1DescribeNFSFileSharesCommand = async ( input: DescribeNFSFileSharesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeNFSFileShares", - }; + const headers: __HeaderBag = sharedHeaders("DescribeNFSFileShares"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeNFSFileSharesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -992,10 +875,7 @@ export const serializeAws_json1_1DescribeSMBFileSharesCommand = async ( input: DescribeSMBFileSharesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeSMBFileShares", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSMBFileShares"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSMBFileSharesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1005,10 +885,7 @@ export const serializeAws_json1_1DescribeSMBSettingsCommand = async ( input: DescribeSMBSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeSMBSettings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSMBSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSMBSettingsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1018,10 +895,7 @@ export const serializeAws_json1_1DescribeSnapshotScheduleCommand = async ( input: DescribeSnapshotScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeSnapshotSchedule", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSnapshotSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSnapshotScheduleInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1031,10 +905,7 @@ export const serializeAws_json1_1DescribeStorediSCSIVolumesCommand = async ( input: DescribeStorediSCSIVolumesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeStorediSCSIVolumes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeStorediSCSIVolumes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeStorediSCSIVolumesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1044,10 +915,7 @@ export const serializeAws_json1_1DescribeTapeArchivesCommand = async ( input: DescribeTapeArchivesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeTapeArchives", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTapeArchives"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTapeArchivesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1057,10 +925,7 @@ export const serializeAws_json1_1DescribeTapeRecoveryPointsCommand = async ( input: DescribeTapeRecoveryPointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeTapeRecoveryPoints", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTapeRecoveryPoints"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTapeRecoveryPointsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1070,10 +935,7 @@ export const serializeAws_json1_1DescribeTapesCommand = async ( input: DescribeTapesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeTapes", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTapes"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTapesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1083,10 +945,7 @@ export const serializeAws_json1_1DescribeUploadBufferCommand = async ( input: DescribeUploadBufferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeUploadBuffer", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUploadBuffer"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUploadBufferInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1096,10 +955,7 @@ export const serializeAws_json1_1DescribeVTLDevicesCommand = async ( input: DescribeVTLDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeVTLDevices", - }; + const headers: __HeaderBag = sharedHeaders("DescribeVTLDevices"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeVTLDevicesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1109,10 +965,7 @@ export const serializeAws_json1_1DescribeWorkingStorageCommand = async ( input: DescribeWorkingStorageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DescribeWorkingStorage", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkingStorage"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkingStorageInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1122,10 +975,7 @@ export const serializeAws_json1_1DetachVolumeCommand = async ( input: DetachVolumeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DetachVolume", - }; + const headers: __HeaderBag = sharedHeaders("DetachVolume"); let body: any; body = JSON.stringify(serializeAws_json1_1DetachVolumeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1135,10 +985,7 @@ export const serializeAws_json1_1DisableGatewayCommand = async ( input: DisableGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DisableGateway", - }; + const headers: __HeaderBag = sharedHeaders("DisableGateway"); let body: any; body = JSON.stringify(serializeAws_json1_1DisableGatewayInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1148,10 +995,7 @@ export const serializeAws_json1_1DisassociateFileSystemCommand = async ( input: DisassociateFileSystemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.DisassociateFileSystem", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateFileSystem"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateFileSystemInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1161,10 +1005,7 @@ export const serializeAws_json1_1JoinDomainCommand = async ( input: JoinDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.JoinDomain", - }; + const headers: __HeaderBag = sharedHeaders("JoinDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1JoinDomainInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1174,10 +1015,7 @@ export const serializeAws_json1_1ListAutomaticTapeCreationPoliciesCommand = asyn input: ListAutomaticTapeCreationPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListAutomaticTapeCreationPolicies", - }; + const headers: __HeaderBag = sharedHeaders("ListAutomaticTapeCreationPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAutomaticTapeCreationPoliciesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1187,10 +1025,7 @@ export const serializeAws_json1_1ListFileSharesCommand = async ( input: ListFileSharesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListFileShares", - }; + const headers: __HeaderBag = sharedHeaders("ListFileShares"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFileSharesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1200,10 +1035,7 @@ export const serializeAws_json1_1ListFileSystemAssociationsCommand = async ( input: ListFileSystemAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListFileSystemAssociations", - }; + const headers: __HeaderBag = sharedHeaders("ListFileSystemAssociations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListFileSystemAssociationsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1213,10 +1045,7 @@ export const serializeAws_json1_1ListGatewaysCommand = async ( input: ListGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListGateways", - }; + const headers: __HeaderBag = sharedHeaders("ListGateways"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGatewaysInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1226,10 +1055,7 @@ export const serializeAws_json1_1ListLocalDisksCommand = async ( input: ListLocalDisksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListLocalDisks", - }; + const headers: __HeaderBag = sharedHeaders("ListLocalDisks"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLocalDisksInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1239,10 +1065,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1252,10 +1075,7 @@ export const serializeAws_json1_1ListTapePoolsCommand = async ( input: ListTapePoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListTapePools", - }; + const headers: __HeaderBag = sharedHeaders("ListTapePools"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTapePoolsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1265,10 +1085,7 @@ export const serializeAws_json1_1ListTapesCommand = async ( input: ListTapesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListTapes", - }; + const headers: __HeaderBag = sharedHeaders("ListTapes"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTapesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1278,10 +1095,7 @@ export const serializeAws_json1_1ListVolumeInitiatorsCommand = async ( input: ListVolumeInitiatorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListVolumeInitiators", - }; + const headers: __HeaderBag = sharedHeaders("ListVolumeInitiators"); let body: any; body = JSON.stringify(serializeAws_json1_1ListVolumeInitiatorsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1291,10 +1105,7 @@ export const serializeAws_json1_1ListVolumeRecoveryPointsCommand = async ( input: ListVolumeRecoveryPointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListVolumeRecoveryPoints", - }; + const headers: __HeaderBag = sharedHeaders("ListVolumeRecoveryPoints"); let body: any; body = JSON.stringify(serializeAws_json1_1ListVolumeRecoveryPointsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1304,10 +1115,7 @@ export const serializeAws_json1_1ListVolumesCommand = async ( input: ListVolumesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ListVolumes", - }; + const headers: __HeaderBag = sharedHeaders("ListVolumes"); let body: any; body = JSON.stringify(serializeAws_json1_1ListVolumesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1317,10 +1125,7 @@ export const serializeAws_json1_1NotifyWhenUploadedCommand = async ( input: NotifyWhenUploadedCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.NotifyWhenUploaded", - }; + const headers: __HeaderBag = sharedHeaders("NotifyWhenUploaded"); let body: any; body = JSON.stringify(serializeAws_json1_1NotifyWhenUploadedInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1330,10 +1135,7 @@ export const serializeAws_json1_1RefreshCacheCommand = async ( input: RefreshCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.RefreshCache", - }; + const headers: __HeaderBag = sharedHeaders("RefreshCache"); let body: any; body = JSON.stringify(serializeAws_json1_1RefreshCacheInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1343,10 +1145,7 @@ export const serializeAws_json1_1RemoveTagsFromResourceCommand = async ( input: RemoveTagsFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.RemoveTagsFromResource", - }; + const headers: __HeaderBag = sharedHeaders("RemoveTagsFromResource"); let body: any; body = JSON.stringify(serializeAws_json1_1RemoveTagsFromResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1356,10 +1155,7 @@ export const serializeAws_json1_1ResetCacheCommand = async ( input: ResetCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ResetCache", - }; + const headers: __HeaderBag = sharedHeaders("ResetCache"); let body: any; body = JSON.stringify(serializeAws_json1_1ResetCacheInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1369,10 +1165,7 @@ export const serializeAws_json1_1RetrieveTapeArchiveCommand = async ( input: RetrieveTapeArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.RetrieveTapeArchive", - }; + const headers: __HeaderBag = sharedHeaders("RetrieveTapeArchive"); let body: any; body = JSON.stringify(serializeAws_json1_1RetrieveTapeArchiveInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1382,10 +1175,7 @@ export const serializeAws_json1_1RetrieveTapeRecoveryPointCommand = async ( input: RetrieveTapeRecoveryPointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.RetrieveTapeRecoveryPoint", - }; + const headers: __HeaderBag = sharedHeaders("RetrieveTapeRecoveryPoint"); let body: any; body = JSON.stringify(serializeAws_json1_1RetrieveTapeRecoveryPointInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1395,10 +1185,7 @@ export const serializeAws_json1_1SetLocalConsolePasswordCommand = async ( input: SetLocalConsolePasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.SetLocalConsolePassword", - }; + const headers: __HeaderBag = sharedHeaders("SetLocalConsolePassword"); let body: any; body = JSON.stringify(serializeAws_json1_1SetLocalConsolePasswordInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1408,10 +1195,7 @@ export const serializeAws_json1_1SetSMBGuestPasswordCommand = async ( input: SetSMBGuestPasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.SetSMBGuestPassword", - }; + const headers: __HeaderBag = sharedHeaders("SetSMBGuestPassword"); let body: any; body = JSON.stringify(serializeAws_json1_1SetSMBGuestPasswordInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1421,10 +1205,7 @@ export const serializeAws_json1_1ShutdownGatewayCommand = async ( input: ShutdownGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.ShutdownGateway", - }; + const headers: __HeaderBag = sharedHeaders("ShutdownGateway"); let body: any; body = JSON.stringify(serializeAws_json1_1ShutdownGatewayInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1434,10 +1215,7 @@ export const serializeAws_json1_1StartAvailabilityMonitorTestCommand = async ( input: StartAvailabilityMonitorTestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.StartAvailabilityMonitorTest", - }; + const headers: __HeaderBag = sharedHeaders("StartAvailabilityMonitorTest"); let body: any; body = JSON.stringify(serializeAws_json1_1StartAvailabilityMonitorTestInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1447,10 +1225,7 @@ export const serializeAws_json1_1StartGatewayCommand = async ( input: StartGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.StartGateway", - }; + const headers: __HeaderBag = sharedHeaders("StartGateway"); let body: any; body = JSON.stringify(serializeAws_json1_1StartGatewayInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1460,10 +1235,7 @@ export const serializeAws_json1_1UpdateAutomaticTapeCreationPolicyCommand = asyn input: UpdateAutomaticTapeCreationPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateAutomaticTapeCreationPolicy", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAutomaticTapeCreationPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAutomaticTapeCreationPolicyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1473,10 +1245,7 @@ export const serializeAws_json1_1UpdateBandwidthRateLimitCommand = async ( input: UpdateBandwidthRateLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateBandwidthRateLimit", - }; + const headers: __HeaderBag = sharedHeaders("UpdateBandwidthRateLimit"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateBandwidthRateLimitInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1486,10 +1255,7 @@ export const serializeAws_json1_1UpdateBandwidthRateLimitScheduleCommand = async input: UpdateBandwidthRateLimitScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateBandwidthRateLimitSchedule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateBandwidthRateLimitSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateBandwidthRateLimitScheduleInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1499,10 +1265,7 @@ export const serializeAws_json1_1UpdateChapCredentialsCommand = async ( input: UpdateChapCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateChapCredentials", - }; + const headers: __HeaderBag = sharedHeaders("UpdateChapCredentials"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateChapCredentialsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1512,10 +1275,7 @@ export const serializeAws_json1_1UpdateFileSystemAssociationCommand = async ( input: UpdateFileSystemAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateFileSystemAssociation", - }; + const headers: __HeaderBag = sharedHeaders("UpdateFileSystemAssociation"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateFileSystemAssociationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1525,10 +1285,7 @@ export const serializeAws_json1_1UpdateGatewayInformationCommand = async ( input: UpdateGatewayInformationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateGatewayInformation", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGatewayInformation"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGatewayInformationInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1538,10 +1295,7 @@ export const serializeAws_json1_1UpdateGatewaySoftwareNowCommand = async ( input: UpdateGatewaySoftwareNowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateGatewaySoftwareNow", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGatewaySoftwareNow"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGatewaySoftwareNowInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1551,10 +1305,7 @@ export const serializeAws_json1_1UpdateMaintenanceStartTimeCommand = async ( input: UpdateMaintenanceStartTimeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateMaintenanceStartTime", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMaintenanceStartTime"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMaintenanceStartTimeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1564,10 +1315,7 @@ export const serializeAws_json1_1UpdateNFSFileShareCommand = async ( input: UpdateNFSFileShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateNFSFileShare", - }; + const headers: __HeaderBag = sharedHeaders("UpdateNFSFileShare"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateNFSFileShareInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1577,10 +1325,7 @@ export const serializeAws_json1_1UpdateSMBFileShareCommand = async ( input: UpdateSMBFileShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateSMBFileShare", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSMBFileShare"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSMBFileShareInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1590,10 +1335,7 @@ export const serializeAws_json1_1UpdateSMBFileShareVisibilityCommand = async ( input: UpdateSMBFileShareVisibilityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateSMBFileShareVisibility", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSMBFileShareVisibility"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSMBFileShareVisibilityInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1603,10 +1345,7 @@ export const serializeAws_json1_1UpdateSMBLocalGroupsCommand = async ( input: UpdateSMBLocalGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateSMBLocalGroups", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSMBLocalGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSMBLocalGroupsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1616,10 +1355,7 @@ export const serializeAws_json1_1UpdateSMBSecurityStrategyCommand = async ( input: UpdateSMBSecurityStrategyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateSMBSecurityStrategy", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSMBSecurityStrategy"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSMBSecurityStrategyInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1629,10 +1365,7 @@ export const serializeAws_json1_1UpdateSnapshotScheduleCommand = async ( input: UpdateSnapshotScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateSnapshotSchedule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSnapshotSchedule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSnapshotScheduleInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1642,10 +1375,7 @@ export const serializeAws_json1_1UpdateVTLDeviceTypeCommand = async ( input: UpdateVTLDeviceTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "StorageGateway_20130630.UpdateVTLDeviceType", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVTLDeviceType"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateVTLDeviceTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -8660,6 +8390,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `StorageGateway_20130630.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-sts/src/protocols/Aws_query.ts b/clients/client-sts/src/protocols/Aws_query.ts index 9146988433048..8bed05aa9df2c 100644 --- a/clients/client-sts/src/protocols/Aws_query.ts +++ b/clients/client-sts/src/protocols/Aws_query.ts @@ -69,9 +69,7 @@ export const serializeAws_queryAssumeRoleCommand = async ( input: AssumeRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAssumeRoleRequest(input, context), @@ -85,9 +83,7 @@ export const serializeAws_queryAssumeRoleWithSAMLCommand = async ( input: AssumeRoleWithSAMLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAssumeRoleWithSAMLRequest(input, context), @@ -101,9 +97,7 @@ export const serializeAws_queryAssumeRoleWithWebIdentityCommand = async ( input: AssumeRoleWithWebIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryAssumeRoleWithWebIdentityRequest(input, context), @@ -117,9 +111,7 @@ export const serializeAws_queryDecodeAuthorizationMessageCommand = async ( input: DecodeAuthorizationMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryDecodeAuthorizationMessageRequest(input, context), @@ -133,9 +125,7 @@ export const serializeAws_queryGetAccessKeyInfoCommand = async ( input: GetAccessKeyInfoCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetAccessKeyInfoRequest(input, context), @@ -149,9 +139,7 @@ export const serializeAws_queryGetCallerIdentityCommand = async ( input: GetCallerIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetCallerIdentityRequest(input, context), @@ -165,9 +153,7 @@ export const serializeAws_queryGetFederationTokenCommand = async ( input: GetFederationTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetFederationTokenRequest(input, context), @@ -181,9 +167,7 @@ export const serializeAws_queryGetSessionTokenCommand = async ( input: GetSessionTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryGetSessionTokenRequest(input, context), @@ -1238,6 +1222,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-support/src/protocols/Aws_json1_1.ts b/clients/client-support/src/protocols/Aws_json1_1.ts index f30cfded313f7..d6f8836b77289 100644 --- a/clients/client-support/src/protocols/Aws_json1_1.ts +++ b/clients/client-support/src/protocols/Aws_json1_1.ts @@ -117,10 +117,7 @@ export const serializeAws_json1_1AddAttachmentsToSetCommand = async ( input: AddAttachmentsToSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.AddAttachmentsToSet", - }; + const headers: __HeaderBag = sharedHeaders("AddAttachmentsToSet"); let body: any; body = JSON.stringify(serializeAws_json1_1AddAttachmentsToSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -130,10 +127,7 @@ export const serializeAws_json1_1AddCommunicationToCaseCommand = async ( input: AddCommunicationToCaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.AddCommunicationToCase", - }; + const headers: __HeaderBag = sharedHeaders("AddCommunicationToCase"); let body: any; body = JSON.stringify(serializeAws_json1_1AddCommunicationToCaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -143,10 +137,7 @@ export const serializeAws_json1_1CreateCaseCommand = async ( input: CreateCaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.CreateCase", - }; + const headers: __HeaderBag = sharedHeaders("CreateCase"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -156,10 +147,7 @@ export const serializeAws_json1_1DescribeAttachmentCommand = async ( input: DescribeAttachmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.DescribeAttachment", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAttachment"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAttachmentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -169,10 +157,7 @@ export const serializeAws_json1_1DescribeCasesCommand = async ( input: DescribeCasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.DescribeCases", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCases"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -182,10 +167,7 @@ export const serializeAws_json1_1DescribeCommunicationsCommand = async ( input: DescribeCommunicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.DescribeCommunications", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCommunications"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCommunicationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -195,10 +177,7 @@ export const serializeAws_json1_1DescribeServicesCommand = async ( input: DescribeServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.DescribeServices", - }; + const headers: __HeaderBag = sharedHeaders("DescribeServices"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeServicesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -208,10 +187,7 @@ export const serializeAws_json1_1DescribeSeverityLevelsCommand = async ( input: DescribeSeverityLevelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.DescribeSeverityLevels", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSeverityLevels"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSeverityLevelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -221,10 +197,7 @@ export const serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesComma input: DescribeTrustedAdvisorCheckRefreshStatusesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckRefreshStatuses", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTrustedAdvisorCheckRefreshStatuses"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -234,10 +207,7 @@ export const serializeAws_json1_1DescribeTrustedAdvisorCheckResultCommand = asyn input: DescribeTrustedAdvisorCheckResultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckResult", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTrustedAdvisorCheckResult"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorCheckResultRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -247,10 +217,7 @@ export const serializeAws_json1_1DescribeTrustedAdvisorChecksCommand = async ( input: DescribeTrustedAdvisorChecksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorChecks", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTrustedAdvisorChecks"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorChecksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -260,10 +227,7 @@ export const serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommand = a input: DescribeTrustedAdvisorCheckSummariesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckSummaries", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTrustedAdvisorCheckSummaries"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -273,10 +237,7 @@ export const serializeAws_json1_1RefreshTrustedAdvisorCheckCommand = async ( input: RefreshTrustedAdvisorCheckCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.RefreshTrustedAdvisorCheck", - }; + const headers: __HeaderBag = sharedHeaders("RefreshTrustedAdvisorCheck"); let body: any; body = JSON.stringify(serializeAws_json1_1RefreshTrustedAdvisorCheckRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -286,10 +247,7 @@ export const serializeAws_json1_1ResolveCaseCommand = async ( input: ResolveCaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSSupport_20130415.ResolveCase", - }; + const headers: __HeaderBag = sharedHeaders("ResolveCase"); let body: any; body = JSON.stringify(serializeAws_json1_1ResolveCaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1825,6 +1783,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSSupport_20130415.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-swf/src/protocols/Aws_json1_0.ts b/clients/client-swf/src/protocols/Aws_json1_0.ts index 3c925d6698604..2f3c958fa751d 100644 --- a/clients/client-swf/src/protocols/Aws_json1_0.ts +++ b/clients/client-swf/src/protocols/Aws_json1_0.ts @@ -298,10 +298,7 @@ export const serializeAws_json1_0CountClosedWorkflowExecutionsCommand = async ( input: CountClosedWorkflowExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.CountClosedWorkflowExecutions", - }; + const headers: __HeaderBag = sharedHeaders("CountClosedWorkflowExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_0CountClosedWorkflowExecutionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -311,10 +308,7 @@ export const serializeAws_json1_0CountOpenWorkflowExecutionsCommand = async ( input: CountOpenWorkflowExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.CountOpenWorkflowExecutions", - }; + const headers: __HeaderBag = sharedHeaders("CountOpenWorkflowExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_0CountOpenWorkflowExecutionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -324,10 +318,7 @@ export const serializeAws_json1_0CountPendingActivityTasksCommand = async ( input: CountPendingActivityTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.CountPendingActivityTasks", - }; + const headers: __HeaderBag = sharedHeaders("CountPendingActivityTasks"); let body: any; body = JSON.stringify(serializeAws_json1_0CountPendingActivityTasksInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -337,10 +328,7 @@ export const serializeAws_json1_0CountPendingDecisionTasksCommand = async ( input: CountPendingDecisionTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.CountPendingDecisionTasks", - }; + const headers: __HeaderBag = sharedHeaders("CountPendingDecisionTasks"); let body: any; body = JSON.stringify(serializeAws_json1_0CountPendingDecisionTasksInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -350,10 +338,7 @@ export const serializeAws_json1_0DeprecateActivityTypeCommand = async ( input: DeprecateActivityTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.DeprecateActivityType", - }; + const headers: __HeaderBag = sharedHeaders("DeprecateActivityType"); let body: any; body = JSON.stringify(serializeAws_json1_0DeprecateActivityTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -363,10 +348,7 @@ export const serializeAws_json1_0DeprecateDomainCommand = async ( input: DeprecateDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.DeprecateDomain", - }; + const headers: __HeaderBag = sharedHeaders("DeprecateDomain"); let body: any; body = JSON.stringify(serializeAws_json1_0DeprecateDomainInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -376,10 +358,7 @@ export const serializeAws_json1_0DeprecateWorkflowTypeCommand = async ( input: DeprecateWorkflowTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.DeprecateWorkflowType", - }; + const headers: __HeaderBag = sharedHeaders("DeprecateWorkflowType"); let body: any; body = JSON.stringify(serializeAws_json1_0DeprecateWorkflowTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -389,10 +368,7 @@ export const serializeAws_json1_0DescribeActivityTypeCommand = async ( input: DescribeActivityTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.DescribeActivityType", - }; + const headers: __HeaderBag = sharedHeaders("DescribeActivityType"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeActivityTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -402,10 +378,7 @@ export const serializeAws_json1_0DescribeDomainCommand = async ( input: DescribeDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.DescribeDomain", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDomain"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeDomainInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -415,10 +388,7 @@ export const serializeAws_json1_0DescribeWorkflowExecutionCommand = async ( input: DescribeWorkflowExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.DescribeWorkflowExecution", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkflowExecution"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeWorkflowExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -428,10 +398,7 @@ export const serializeAws_json1_0DescribeWorkflowTypeCommand = async ( input: DescribeWorkflowTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.DescribeWorkflowType", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkflowType"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeWorkflowTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -441,10 +408,7 @@ export const serializeAws_json1_0GetWorkflowExecutionHistoryCommand = async ( input: GetWorkflowExecutionHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.GetWorkflowExecutionHistory", - }; + const headers: __HeaderBag = sharedHeaders("GetWorkflowExecutionHistory"); let body: any; body = JSON.stringify(serializeAws_json1_0GetWorkflowExecutionHistoryInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -454,10 +418,7 @@ export const serializeAws_json1_0ListActivityTypesCommand = async ( input: ListActivityTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.ListActivityTypes", - }; + const headers: __HeaderBag = sharedHeaders("ListActivityTypes"); let body: any; body = JSON.stringify(serializeAws_json1_0ListActivityTypesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -467,10 +428,7 @@ export const serializeAws_json1_0ListClosedWorkflowExecutionsCommand = async ( input: ListClosedWorkflowExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.ListClosedWorkflowExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListClosedWorkflowExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_0ListClosedWorkflowExecutionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -480,10 +438,7 @@ export const serializeAws_json1_0ListDomainsCommand = async ( input: ListDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.ListDomains", - }; + const headers: __HeaderBag = sharedHeaders("ListDomains"); let body: any; body = JSON.stringify(serializeAws_json1_0ListDomainsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -493,10 +448,7 @@ export const serializeAws_json1_0ListOpenWorkflowExecutionsCommand = async ( input: ListOpenWorkflowExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.ListOpenWorkflowExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListOpenWorkflowExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_0ListOpenWorkflowExecutionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -506,10 +458,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -519,10 +468,7 @@ export const serializeAws_json1_0ListWorkflowTypesCommand = async ( input: ListWorkflowTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.ListWorkflowTypes", - }; + const headers: __HeaderBag = sharedHeaders("ListWorkflowTypes"); let body: any; body = JSON.stringify(serializeAws_json1_0ListWorkflowTypesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -532,10 +478,7 @@ export const serializeAws_json1_0PollForActivityTaskCommand = async ( input: PollForActivityTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.PollForActivityTask", - }; + const headers: __HeaderBag = sharedHeaders("PollForActivityTask"); let body: any; body = JSON.stringify(serializeAws_json1_0PollForActivityTaskInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -545,10 +488,7 @@ export const serializeAws_json1_0PollForDecisionTaskCommand = async ( input: PollForDecisionTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.PollForDecisionTask", - }; + const headers: __HeaderBag = sharedHeaders("PollForDecisionTask"); let body: any; body = JSON.stringify(serializeAws_json1_0PollForDecisionTaskInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -558,10 +498,7 @@ export const serializeAws_json1_0RecordActivityTaskHeartbeatCommand = async ( input: RecordActivityTaskHeartbeatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.RecordActivityTaskHeartbeat", - }; + const headers: __HeaderBag = sharedHeaders("RecordActivityTaskHeartbeat"); let body: any; body = JSON.stringify(serializeAws_json1_0RecordActivityTaskHeartbeatInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -571,10 +508,7 @@ export const serializeAws_json1_0RegisterActivityTypeCommand = async ( input: RegisterActivityTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.RegisterActivityType", - }; + const headers: __HeaderBag = sharedHeaders("RegisterActivityType"); let body: any; body = JSON.stringify(serializeAws_json1_0RegisterActivityTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -584,10 +518,7 @@ export const serializeAws_json1_0RegisterDomainCommand = async ( input: RegisterDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.RegisterDomain", - }; + const headers: __HeaderBag = sharedHeaders("RegisterDomain"); let body: any; body = JSON.stringify(serializeAws_json1_0RegisterDomainInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -597,10 +528,7 @@ export const serializeAws_json1_0RegisterWorkflowTypeCommand = async ( input: RegisterWorkflowTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.RegisterWorkflowType", - }; + const headers: __HeaderBag = sharedHeaders("RegisterWorkflowType"); let body: any; body = JSON.stringify(serializeAws_json1_0RegisterWorkflowTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -610,10 +538,7 @@ export const serializeAws_json1_0RequestCancelWorkflowExecutionCommand = async ( input: RequestCancelWorkflowExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.RequestCancelWorkflowExecution", - }; + const headers: __HeaderBag = sharedHeaders("RequestCancelWorkflowExecution"); let body: any; body = JSON.stringify(serializeAws_json1_0RequestCancelWorkflowExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -623,10 +548,7 @@ export const serializeAws_json1_0RespondActivityTaskCanceledCommand = async ( input: RespondActivityTaskCanceledCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.RespondActivityTaskCanceled", - }; + const headers: __HeaderBag = sharedHeaders("RespondActivityTaskCanceled"); let body: any; body = JSON.stringify(serializeAws_json1_0RespondActivityTaskCanceledInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -636,10 +558,7 @@ export const serializeAws_json1_0RespondActivityTaskCompletedCommand = async ( input: RespondActivityTaskCompletedCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.RespondActivityTaskCompleted", - }; + const headers: __HeaderBag = sharedHeaders("RespondActivityTaskCompleted"); let body: any; body = JSON.stringify(serializeAws_json1_0RespondActivityTaskCompletedInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -649,10 +568,7 @@ export const serializeAws_json1_0RespondActivityTaskFailedCommand = async ( input: RespondActivityTaskFailedCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.RespondActivityTaskFailed", - }; + const headers: __HeaderBag = sharedHeaders("RespondActivityTaskFailed"); let body: any; body = JSON.stringify(serializeAws_json1_0RespondActivityTaskFailedInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -662,10 +578,7 @@ export const serializeAws_json1_0RespondDecisionTaskCompletedCommand = async ( input: RespondDecisionTaskCompletedCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.RespondDecisionTaskCompleted", - }; + const headers: __HeaderBag = sharedHeaders("RespondDecisionTaskCompleted"); let body: any; body = JSON.stringify(serializeAws_json1_0RespondDecisionTaskCompletedInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -675,10 +588,7 @@ export const serializeAws_json1_0SignalWorkflowExecutionCommand = async ( input: SignalWorkflowExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.SignalWorkflowExecution", - }; + const headers: __HeaderBag = sharedHeaders("SignalWorkflowExecution"); let body: any; body = JSON.stringify(serializeAws_json1_0SignalWorkflowExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -688,10 +598,7 @@ export const serializeAws_json1_0StartWorkflowExecutionCommand = async ( input: StartWorkflowExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.StartWorkflowExecution", - }; + const headers: __HeaderBag = sharedHeaders("StartWorkflowExecution"); let body: any; body = JSON.stringify(serializeAws_json1_0StartWorkflowExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -701,10 +608,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -714,10 +618,7 @@ export const serializeAws_json1_0TerminateWorkflowExecutionCommand = async ( input: TerminateWorkflowExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.TerminateWorkflowExecution", - }; + const headers: __HeaderBag = sharedHeaders("TerminateWorkflowExecution"); let body: any; body = JSON.stringify(serializeAws_json1_0TerminateWorkflowExecutionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -727,10 +628,7 @@ export const serializeAws_json1_0UndeprecateActivityTypeCommand = async ( input: UndeprecateActivityTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.UndeprecateActivityType", - }; + const headers: __HeaderBag = sharedHeaders("UndeprecateActivityType"); let body: any; body = JSON.stringify(serializeAws_json1_0UndeprecateActivityTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -740,10 +638,7 @@ export const serializeAws_json1_0UndeprecateDomainCommand = async ( input: UndeprecateDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.UndeprecateDomain", - }; + const headers: __HeaderBag = sharedHeaders("UndeprecateDomain"); let body: any; body = JSON.stringify(serializeAws_json1_0UndeprecateDomainInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -753,10 +648,7 @@ export const serializeAws_json1_0UndeprecateWorkflowTypeCommand = async ( input: UndeprecateWorkflowTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.UndeprecateWorkflowType", - }; + const headers: __HeaderBag = sharedHeaders("UndeprecateWorkflowType"); let body: any; body = JSON.stringify(serializeAws_json1_0UndeprecateWorkflowTypeInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -766,10 +658,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "SimpleWorkflowService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4913,6 +4802,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `SimpleWorkflowService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-textract/src/protocols/Aws_json1_1.ts b/clients/client-textract/src/protocols/Aws_json1_1.ts index 6d9912421f51f..302062f3d8332 100644 --- a/clients/client-textract/src/protocols/Aws_json1_1.ts +++ b/clients/client-textract/src/protocols/Aws_json1_1.ts @@ -142,10 +142,7 @@ export const serializeAws_json1_1AnalyzeDocumentCommand = async ( input: AnalyzeDocumentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.AnalyzeDocument", - }; + const headers: __HeaderBag = sharedHeaders("AnalyzeDocument"); let body: any; body = JSON.stringify(serializeAws_json1_1AnalyzeDocumentRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -155,10 +152,7 @@ export const serializeAws_json1_1AnalyzeExpenseCommand = async ( input: AnalyzeExpenseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.AnalyzeExpense", - }; + const headers: __HeaderBag = sharedHeaders("AnalyzeExpense"); let body: any; body = JSON.stringify(serializeAws_json1_1AnalyzeExpenseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -168,10 +162,7 @@ export const serializeAws_json1_1AnalyzeIDCommand = async ( input: AnalyzeIDCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.AnalyzeID", - }; + const headers: __HeaderBag = sharedHeaders("AnalyzeID"); let body: any; body = JSON.stringify(serializeAws_json1_1AnalyzeIDRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -181,10 +172,7 @@ export const serializeAws_json1_1DetectDocumentTextCommand = async ( input: DetectDocumentTextCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.DetectDocumentText", - }; + const headers: __HeaderBag = sharedHeaders("DetectDocumentText"); let body: any; body = JSON.stringify(serializeAws_json1_1DetectDocumentTextRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -194,10 +182,7 @@ export const serializeAws_json1_1GetDocumentAnalysisCommand = async ( input: GetDocumentAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.GetDocumentAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("GetDocumentAnalysis"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDocumentAnalysisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -207,10 +192,7 @@ export const serializeAws_json1_1GetDocumentTextDetectionCommand = async ( input: GetDocumentTextDetectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.GetDocumentTextDetection", - }; + const headers: __HeaderBag = sharedHeaders("GetDocumentTextDetection"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDocumentTextDetectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -220,10 +202,7 @@ export const serializeAws_json1_1GetExpenseAnalysisCommand = async ( input: GetExpenseAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.GetExpenseAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("GetExpenseAnalysis"); let body: any; body = JSON.stringify(serializeAws_json1_1GetExpenseAnalysisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -233,10 +212,7 @@ export const serializeAws_json1_1GetLendingAnalysisCommand = async ( input: GetLendingAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.GetLendingAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("GetLendingAnalysis"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLendingAnalysisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -246,10 +222,7 @@ export const serializeAws_json1_1GetLendingAnalysisSummaryCommand = async ( input: GetLendingAnalysisSummaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.GetLendingAnalysisSummary", - }; + const headers: __HeaderBag = sharedHeaders("GetLendingAnalysisSummary"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLendingAnalysisSummaryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -259,10 +232,7 @@ export const serializeAws_json1_1StartDocumentAnalysisCommand = async ( input: StartDocumentAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.StartDocumentAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("StartDocumentAnalysis"); let body: any; body = JSON.stringify(serializeAws_json1_1StartDocumentAnalysisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -272,10 +242,7 @@ export const serializeAws_json1_1StartDocumentTextDetectionCommand = async ( input: StartDocumentTextDetectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.StartDocumentTextDetection", - }; + const headers: __HeaderBag = sharedHeaders("StartDocumentTextDetection"); let body: any; body = JSON.stringify(serializeAws_json1_1StartDocumentTextDetectionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -285,10 +252,7 @@ export const serializeAws_json1_1StartExpenseAnalysisCommand = async ( input: StartExpenseAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.StartExpenseAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("StartExpenseAnalysis"); let body: any; body = JSON.stringify(serializeAws_json1_1StartExpenseAnalysisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -298,10 +262,7 @@ export const serializeAws_json1_1StartLendingAnalysisCommand = async ( input: StartLendingAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Textract.StartLendingAnalysis", - }; + const headers: __HeaderBag = sharedHeaders("StartLendingAnalysis"); let body: any; body = JSON.stringify(serializeAws_json1_1StartLendingAnalysisRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2681,6 +2642,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `Textract.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-timestream-query/src/protocols/Aws_json1_0.ts b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts index a55378f22feb9..e95d8044f8e82 100644 --- a/clients/client-timestream-query/src/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts @@ -122,10 +122,7 @@ export const serializeAws_json1_0CancelQueryCommand = async ( input: CancelQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.CancelQuery", - }; + const headers: __HeaderBag = sharedHeaders("CancelQuery"); let body: any; body = JSON.stringify(serializeAws_json1_0CancelQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -135,10 +132,7 @@ export const serializeAws_json1_0CreateScheduledQueryCommand = async ( input: CreateScheduledQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.CreateScheduledQuery", - }; + const headers: __HeaderBag = sharedHeaders("CreateScheduledQuery"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateScheduledQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -148,10 +142,7 @@ export const serializeAws_json1_0DeleteScheduledQueryCommand = async ( input: DeleteScheduledQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.DeleteScheduledQuery", - }; + const headers: __HeaderBag = sharedHeaders("DeleteScheduledQuery"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteScheduledQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -161,10 +152,7 @@ export const serializeAws_json1_0DescribeEndpointsCommand = async ( input: DescribeEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.DescribeEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -174,10 +162,7 @@ export const serializeAws_json1_0DescribeScheduledQueryCommand = async ( input: DescribeScheduledQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.DescribeScheduledQuery", - }; + const headers: __HeaderBag = sharedHeaders("DescribeScheduledQuery"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeScheduledQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -187,10 +172,7 @@ export const serializeAws_json1_0ExecuteScheduledQueryCommand = async ( input: ExecuteScheduledQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.ExecuteScheduledQuery", - }; + const headers: __HeaderBag = sharedHeaders("ExecuteScheduledQuery"); let body: any; body = JSON.stringify(serializeAws_json1_0ExecuteScheduledQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -200,10 +182,7 @@ export const serializeAws_json1_0ListScheduledQueriesCommand = async ( input: ListScheduledQueriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.ListScheduledQueries", - }; + const headers: __HeaderBag = sharedHeaders("ListScheduledQueries"); let body: any; body = JSON.stringify(serializeAws_json1_0ListScheduledQueriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -213,10 +192,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -226,10 +202,7 @@ export const serializeAws_json1_0PrepareQueryCommand = async ( input: PrepareQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.PrepareQuery", - }; + const headers: __HeaderBag = sharedHeaders("PrepareQuery"); let body: any; body = JSON.stringify(serializeAws_json1_0PrepareQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -239,10 +212,7 @@ export const serializeAws_json1_0QueryCommand = async ( input: QueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.Query", - }; + const headers: __HeaderBag = sharedHeaders("Query"); let body: any; body = JSON.stringify(serializeAws_json1_0QueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -252,10 +222,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -265,10 +232,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -278,10 +242,7 @@ export const serializeAws_json1_0UpdateScheduledQueryCommand = async ( input: UpdateScheduledQueryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.UpdateScheduledQuery", - }; + const headers: __HeaderBag = sharedHeaders("UpdateScheduledQuery"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateScheduledQueryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2108,6 +2069,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `Timestream_20181101.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-timestream-write/src/protocols/Aws_json1_0.ts b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts index 15041895214ad..98456ebc251ae 100644 --- a/clients/client-timestream-write/src/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts @@ -131,10 +131,7 @@ export const serializeAws_json1_0CreateBatchLoadTaskCommand = async ( input: CreateBatchLoadTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.CreateBatchLoadTask", - }; + const headers: __HeaderBag = sharedHeaders("CreateBatchLoadTask"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateBatchLoadTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -144,10 +141,7 @@ export const serializeAws_json1_0CreateDatabaseCommand = async ( input: CreateDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.CreateDatabase", - }; + const headers: __HeaderBag = sharedHeaders("CreateDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -157,10 +151,7 @@ export const serializeAws_json1_0CreateTableCommand = async ( input: CreateTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.CreateTable", - }; + const headers: __HeaderBag = sharedHeaders("CreateTable"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -170,10 +161,7 @@ export const serializeAws_json1_0DeleteDatabaseCommand = async ( input: DeleteDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.DeleteDatabase", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -183,10 +171,7 @@ export const serializeAws_json1_0DeleteTableCommand = async ( input: DeleteTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.DeleteTable", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTable"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -196,10 +181,7 @@ export const serializeAws_json1_0DescribeBatchLoadTaskCommand = async ( input: DescribeBatchLoadTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.DescribeBatchLoadTask", - }; + const headers: __HeaderBag = sharedHeaders("DescribeBatchLoadTask"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeBatchLoadTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -209,10 +191,7 @@ export const serializeAws_json1_0DescribeDatabaseCommand = async ( input: DescribeDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.DescribeDatabase", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -222,10 +201,7 @@ export const serializeAws_json1_0DescribeEndpointsCommand = async ( input: DescribeEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.DescribeEndpoints", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEndpoints"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeEndpointsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -235,10 +211,7 @@ export const serializeAws_json1_0DescribeTableCommand = async ( input: DescribeTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.DescribeTable", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTable"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -248,10 +221,7 @@ export const serializeAws_json1_0ListBatchLoadTasksCommand = async ( input: ListBatchLoadTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.ListBatchLoadTasks", - }; + const headers: __HeaderBag = sharedHeaders("ListBatchLoadTasks"); let body: any; body = JSON.stringify(serializeAws_json1_0ListBatchLoadTasksRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -261,10 +231,7 @@ export const serializeAws_json1_0ListDatabasesCommand = async ( input: ListDatabasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.ListDatabases", - }; + const headers: __HeaderBag = sharedHeaders("ListDatabases"); let body: any; body = JSON.stringify(serializeAws_json1_0ListDatabasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -274,10 +241,7 @@ export const serializeAws_json1_0ListTablesCommand = async ( input: ListTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.ListTables", - }; + const headers: __HeaderBag = sharedHeaders("ListTables"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTablesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -287,10 +251,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -300,10 +261,7 @@ export const serializeAws_json1_0ResumeBatchLoadTaskCommand = async ( input: ResumeBatchLoadTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.ResumeBatchLoadTask", - }; + const headers: __HeaderBag = sharedHeaders("ResumeBatchLoadTask"); let body: any; body = JSON.stringify(serializeAws_json1_0ResumeBatchLoadTaskRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -313,10 +271,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -326,10 +281,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -339,10 +291,7 @@ export const serializeAws_json1_0UpdateDatabaseCommand = async ( input: UpdateDatabaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.UpdateDatabase", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDatabase"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateDatabaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -352,10 +301,7 @@ export const serializeAws_json1_0UpdateTableCommand = async ( input: UpdateTableCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.UpdateTable", - }; + const headers: __HeaderBag = sharedHeaders("UpdateTable"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateTableRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -365,10 +311,7 @@ export const serializeAws_json1_0WriteRecordsCommand = async ( input: WriteRecordsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "Timestream_20181101.WriteRecords", - }; + const headers: __HeaderBag = sharedHeaders("WriteRecords"); let body: any; body = JSON.stringify(serializeAws_json1_0WriteRecordsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2689,6 +2632,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `Timestream_20181101.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-transcribe/src/protocols/Aws_json1_1.ts b/clients/client-transcribe/src/protocols/Aws_json1_1.ts index 258cbe31fb255..c35303be29f8a 100644 --- a/clients/client-transcribe/src/protocols/Aws_json1_1.ts +++ b/clients/client-transcribe/src/protocols/Aws_json1_1.ts @@ -274,10 +274,7 @@ export const serializeAws_json1_1CreateCallAnalyticsCategoryCommand = async ( input: CreateCallAnalyticsCategoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.CreateCallAnalyticsCategory", - }; + const headers: __HeaderBag = sharedHeaders("CreateCallAnalyticsCategory"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateCallAnalyticsCategoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -287,10 +284,7 @@ export const serializeAws_json1_1CreateLanguageModelCommand = async ( input: CreateLanguageModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.CreateLanguageModel", - }; + const headers: __HeaderBag = sharedHeaders("CreateLanguageModel"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateLanguageModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -300,10 +294,7 @@ export const serializeAws_json1_1CreateMedicalVocabularyCommand = async ( input: CreateMedicalVocabularyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.CreateMedicalVocabulary", - }; + const headers: __HeaderBag = sharedHeaders("CreateMedicalVocabulary"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMedicalVocabularyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -313,10 +304,7 @@ export const serializeAws_json1_1CreateVocabularyCommand = async ( input: CreateVocabularyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.CreateVocabulary", - }; + const headers: __HeaderBag = sharedHeaders("CreateVocabulary"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateVocabularyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -326,10 +314,7 @@ export const serializeAws_json1_1CreateVocabularyFilterCommand = async ( input: CreateVocabularyFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.CreateVocabularyFilter", - }; + const headers: __HeaderBag = sharedHeaders("CreateVocabularyFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateVocabularyFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -339,10 +324,7 @@ export const serializeAws_json1_1DeleteCallAnalyticsCategoryCommand = async ( input: DeleteCallAnalyticsCategoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.DeleteCallAnalyticsCategory", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCallAnalyticsCategory"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCallAnalyticsCategoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -352,10 +334,7 @@ export const serializeAws_json1_1DeleteCallAnalyticsJobCommand = async ( input: DeleteCallAnalyticsJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.DeleteCallAnalyticsJob", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCallAnalyticsJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCallAnalyticsJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -365,10 +344,7 @@ export const serializeAws_json1_1DeleteLanguageModelCommand = async ( input: DeleteLanguageModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.DeleteLanguageModel", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLanguageModel"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLanguageModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -378,10 +354,7 @@ export const serializeAws_json1_1DeleteMedicalTranscriptionJobCommand = async ( input: DeleteMedicalTranscriptionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.DeleteMedicalTranscriptionJob", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMedicalTranscriptionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMedicalTranscriptionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -391,10 +364,7 @@ export const serializeAws_json1_1DeleteMedicalVocabularyCommand = async ( input: DeleteMedicalVocabularyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.DeleteMedicalVocabulary", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMedicalVocabulary"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMedicalVocabularyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -404,10 +374,7 @@ export const serializeAws_json1_1DeleteTranscriptionJobCommand = async ( input: DeleteTranscriptionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.DeleteTranscriptionJob", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTranscriptionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTranscriptionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -417,10 +384,7 @@ export const serializeAws_json1_1DeleteVocabularyCommand = async ( input: DeleteVocabularyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.DeleteVocabulary", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVocabulary"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteVocabularyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -430,10 +394,7 @@ export const serializeAws_json1_1DeleteVocabularyFilterCommand = async ( input: DeleteVocabularyFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.DeleteVocabularyFilter", - }; + const headers: __HeaderBag = sharedHeaders("DeleteVocabularyFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteVocabularyFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -443,10 +404,7 @@ export const serializeAws_json1_1DescribeLanguageModelCommand = async ( input: DescribeLanguageModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.DescribeLanguageModel", - }; + const headers: __HeaderBag = sharedHeaders("DescribeLanguageModel"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeLanguageModelRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -456,10 +414,7 @@ export const serializeAws_json1_1GetCallAnalyticsCategoryCommand = async ( input: GetCallAnalyticsCategoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.GetCallAnalyticsCategory", - }; + const headers: __HeaderBag = sharedHeaders("GetCallAnalyticsCategory"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCallAnalyticsCategoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -469,10 +424,7 @@ export const serializeAws_json1_1GetCallAnalyticsJobCommand = async ( input: GetCallAnalyticsJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.GetCallAnalyticsJob", - }; + const headers: __HeaderBag = sharedHeaders("GetCallAnalyticsJob"); let body: any; body = JSON.stringify(serializeAws_json1_1GetCallAnalyticsJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -482,10 +434,7 @@ export const serializeAws_json1_1GetMedicalTranscriptionJobCommand = async ( input: GetMedicalTranscriptionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.GetMedicalTranscriptionJob", - }; + const headers: __HeaderBag = sharedHeaders("GetMedicalTranscriptionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMedicalTranscriptionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -495,10 +444,7 @@ export const serializeAws_json1_1GetMedicalVocabularyCommand = async ( input: GetMedicalVocabularyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.GetMedicalVocabulary", - }; + const headers: __HeaderBag = sharedHeaders("GetMedicalVocabulary"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMedicalVocabularyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -508,10 +454,7 @@ export const serializeAws_json1_1GetTranscriptionJobCommand = async ( input: GetTranscriptionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.GetTranscriptionJob", - }; + const headers: __HeaderBag = sharedHeaders("GetTranscriptionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTranscriptionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -521,10 +464,7 @@ export const serializeAws_json1_1GetVocabularyCommand = async ( input: GetVocabularyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.GetVocabulary", - }; + const headers: __HeaderBag = sharedHeaders("GetVocabulary"); let body: any; body = JSON.stringify(serializeAws_json1_1GetVocabularyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -534,10 +474,7 @@ export const serializeAws_json1_1GetVocabularyFilterCommand = async ( input: GetVocabularyFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.GetVocabularyFilter", - }; + const headers: __HeaderBag = sharedHeaders("GetVocabularyFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1GetVocabularyFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -547,10 +484,7 @@ export const serializeAws_json1_1ListCallAnalyticsCategoriesCommand = async ( input: ListCallAnalyticsCategoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.ListCallAnalyticsCategories", - }; + const headers: __HeaderBag = sharedHeaders("ListCallAnalyticsCategories"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCallAnalyticsCategoriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -560,10 +494,7 @@ export const serializeAws_json1_1ListCallAnalyticsJobsCommand = async ( input: ListCallAnalyticsJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.ListCallAnalyticsJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListCallAnalyticsJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCallAnalyticsJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -573,10 +504,7 @@ export const serializeAws_json1_1ListLanguageModelsCommand = async ( input: ListLanguageModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.ListLanguageModels", - }; + const headers: __HeaderBag = sharedHeaders("ListLanguageModels"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLanguageModelsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -586,10 +514,7 @@ export const serializeAws_json1_1ListMedicalTranscriptionJobsCommand = async ( input: ListMedicalTranscriptionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.ListMedicalTranscriptionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListMedicalTranscriptionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMedicalTranscriptionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -599,10 +524,7 @@ export const serializeAws_json1_1ListMedicalVocabulariesCommand = async ( input: ListMedicalVocabulariesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.ListMedicalVocabularies", - }; + const headers: __HeaderBag = sharedHeaders("ListMedicalVocabularies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMedicalVocabulariesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -612,10 +534,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -625,10 +544,7 @@ export const serializeAws_json1_1ListTranscriptionJobsCommand = async ( input: ListTranscriptionJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.ListTranscriptionJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListTranscriptionJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTranscriptionJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -638,10 +554,7 @@ export const serializeAws_json1_1ListVocabulariesCommand = async ( input: ListVocabulariesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.ListVocabularies", - }; + const headers: __HeaderBag = sharedHeaders("ListVocabularies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListVocabulariesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -651,10 +564,7 @@ export const serializeAws_json1_1ListVocabularyFiltersCommand = async ( input: ListVocabularyFiltersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.ListVocabularyFilters", - }; + const headers: __HeaderBag = sharedHeaders("ListVocabularyFilters"); let body: any; body = JSON.stringify(serializeAws_json1_1ListVocabularyFiltersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -664,10 +574,7 @@ export const serializeAws_json1_1StartCallAnalyticsJobCommand = async ( input: StartCallAnalyticsJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.StartCallAnalyticsJob", - }; + const headers: __HeaderBag = sharedHeaders("StartCallAnalyticsJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartCallAnalyticsJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -677,10 +584,7 @@ export const serializeAws_json1_1StartMedicalTranscriptionJobCommand = async ( input: StartMedicalTranscriptionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.StartMedicalTranscriptionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartMedicalTranscriptionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartMedicalTranscriptionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -690,10 +594,7 @@ export const serializeAws_json1_1StartTranscriptionJobCommand = async ( input: StartTranscriptionJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.StartTranscriptionJob", - }; + const headers: __HeaderBag = sharedHeaders("StartTranscriptionJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartTranscriptionJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -703,10 +604,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -716,10 +614,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -729,10 +624,7 @@ export const serializeAws_json1_1UpdateCallAnalyticsCategoryCommand = async ( input: UpdateCallAnalyticsCategoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.UpdateCallAnalyticsCategory", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCallAnalyticsCategory"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCallAnalyticsCategoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -742,10 +634,7 @@ export const serializeAws_json1_1UpdateMedicalVocabularyCommand = async ( input: UpdateMedicalVocabularyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.UpdateMedicalVocabulary", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMedicalVocabulary"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMedicalVocabularyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -755,10 +644,7 @@ export const serializeAws_json1_1UpdateVocabularyCommand = async ( input: UpdateVocabularyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.UpdateVocabulary", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVocabulary"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateVocabularyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -768,10 +654,7 @@ export const serializeAws_json1_1UpdateVocabularyFilterCommand = async ( input: UpdateVocabularyFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "Transcribe.UpdateVocabularyFilter", - }; + const headers: __HeaderBag = sharedHeaders("UpdateVocabularyFilter"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateVocabularyFilterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -4721,6 +4604,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `Transcribe.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-transfer/src/protocols/Aws_json1_1.ts b/clients/client-transfer/src/protocols/Aws_json1_1.ts index a9dd9e06420d2..721e19a3d9544 100644 --- a/clients/client-transfer/src/protocols/Aws_json1_1.ts +++ b/clients/client-transfer/src/protocols/Aws_json1_1.ts @@ -264,10 +264,7 @@ export const serializeAws_json1_1CreateAccessCommand = async ( input: CreateAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.CreateAccess", - }; + const headers: __HeaderBag = sharedHeaders("CreateAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -277,10 +274,7 @@ export const serializeAws_json1_1CreateAgreementCommand = async ( input: CreateAgreementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.CreateAgreement", - }; + const headers: __HeaderBag = sharedHeaders("CreateAgreement"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAgreementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -290,10 +284,7 @@ export const serializeAws_json1_1CreateConnectorCommand = async ( input: CreateConnectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.CreateConnector", - }; + const headers: __HeaderBag = sharedHeaders("CreateConnector"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateConnectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -303,10 +294,7 @@ export const serializeAws_json1_1CreateProfileCommand = async ( input: CreateProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.CreateProfile", - }; + const headers: __HeaderBag = sharedHeaders("CreateProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -316,10 +304,7 @@ export const serializeAws_json1_1CreateServerCommand = async ( input: CreateServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.CreateServer", - }; + const headers: __HeaderBag = sharedHeaders("CreateServer"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -329,10 +314,7 @@ export const serializeAws_json1_1CreateUserCommand = async ( input: CreateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.CreateUser", - }; + const headers: __HeaderBag = sharedHeaders("CreateUser"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -342,10 +324,7 @@ export const serializeAws_json1_1CreateWorkflowCommand = async ( input: CreateWorkflowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.CreateWorkflow", - }; + const headers: __HeaderBag = sharedHeaders("CreateWorkflow"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWorkflowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -355,10 +334,7 @@ export const serializeAws_json1_1DeleteAccessCommand = async ( input: DeleteAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DeleteAccess", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -368,10 +344,7 @@ export const serializeAws_json1_1DeleteAgreementCommand = async ( input: DeleteAgreementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DeleteAgreement", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAgreement"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAgreementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -381,10 +354,7 @@ export const serializeAws_json1_1DeleteCertificateCommand = async ( input: DeleteCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DeleteCertificate", - }; + const headers: __HeaderBag = sharedHeaders("DeleteCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -394,10 +364,7 @@ export const serializeAws_json1_1DeleteConnectorCommand = async ( input: DeleteConnectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DeleteConnector", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConnector"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConnectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -407,10 +374,7 @@ export const serializeAws_json1_1DeleteHostKeyCommand = async ( input: DeleteHostKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DeleteHostKey", - }; + const headers: __HeaderBag = sharedHeaders("DeleteHostKey"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteHostKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -420,10 +384,7 @@ export const serializeAws_json1_1DeleteProfileCommand = async ( input: DeleteProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DeleteProfile", - }; + const headers: __HeaderBag = sharedHeaders("DeleteProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -433,10 +394,7 @@ export const serializeAws_json1_1DeleteServerCommand = async ( input: DeleteServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DeleteServer", - }; + const headers: __HeaderBag = sharedHeaders("DeleteServer"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -446,10 +404,7 @@ export const serializeAws_json1_1DeleteSshPublicKeyCommand = async ( input: DeleteSshPublicKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DeleteSshPublicKey", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSshPublicKey"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSshPublicKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -459,10 +414,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DeleteUser", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -472,10 +424,7 @@ export const serializeAws_json1_1DeleteWorkflowCommand = async ( input: DeleteWorkflowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DeleteWorkflow", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWorkflow"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWorkflowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -485,10 +434,7 @@ export const serializeAws_json1_1DescribeAccessCommand = async ( input: DescribeAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeAccess", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -498,10 +444,7 @@ export const serializeAws_json1_1DescribeAgreementCommand = async ( input: DescribeAgreementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeAgreement", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAgreement"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAgreementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -511,10 +454,7 @@ export const serializeAws_json1_1DescribeCertificateCommand = async ( input: DescribeCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeCertificate", - }; + const headers: __HeaderBag = sharedHeaders("DescribeCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -524,10 +464,7 @@ export const serializeAws_json1_1DescribeConnectorCommand = async ( input: DescribeConnectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeConnector", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConnector"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConnectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -537,10 +474,7 @@ export const serializeAws_json1_1DescribeExecutionCommand = async ( input: DescribeExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeExecution", - }; + const headers: __HeaderBag = sharedHeaders("DescribeExecution"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeExecutionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -550,10 +484,7 @@ export const serializeAws_json1_1DescribeHostKeyCommand = async ( input: DescribeHostKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeHostKey", - }; + const headers: __HeaderBag = sharedHeaders("DescribeHostKey"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeHostKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -563,10 +494,7 @@ export const serializeAws_json1_1DescribeProfileCommand = async ( input: DescribeProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeProfile", - }; + const headers: __HeaderBag = sharedHeaders("DescribeProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -576,10 +504,7 @@ export const serializeAws_json1_1DescribeSecurityPolicyCommand = async ( input: DescribeSecurityPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeSecurityPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSecurityPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeSecurityPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -589,10 +514,7 @@ export const serializeAws_json1_1DescribeServerCommand = async ( input: DescribeServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeServer", - }; + const headers: __HeaderBag = sharedHeaders("DescribeServer"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -602,10 +524,7 @@ export const serializeAws_json1_1DescribeUserCommand = async ( input: DescribeUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeUser", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -615,10 +534,7 @@ export const serializeAws_json1_1DescribeWorkflowCommand = async ( input: DescribeWorkflowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.DescribeWorkflow", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkflow"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkflowRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -628,10 +544,7 @@ export const serializeAws_json1_1ImportCertificateCommand = async ( input: ImportCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ImportCertificate", - }; + const headers: __HeaderBag = sharedHeaders("ImportCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -641,10 +554,7 @@ export const serializeAws_json1_1ImportHostKeyCommand = async ( input: ImportHostKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ImportHostKey", - }; + const headers: __HeaderBag = sharedHeaders("ImportHostKey"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportHostKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -654,10 +564,7 @@ export const serializeAws_json1_1ImportSshPublicKeyCommand = async ( input: ImportSshPublicKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ImportSshPublicKey", - }; + const headers: __HeaderBag = sharedHeaders("ImportSshPublicKey"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportSshPublicKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -667,10 +574,7 @@ export const serializeAws_json1_1ListAccessesCommand = async ( input: ListAccessesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListAccesses", - }; + const headers: __HeaderBag = sharedHeaders("ListAccesses"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAccessesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -680,10 +584,7 @@ export const serializeAws_json1_1ListAgreementsCommand = async ( input: ListAgreementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListAgreements", - }; + const headers: __HeaderBag = sharedHeaders("ListAgreements"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAgreementsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -693,10 +594,7 @@ export const serializeAws_json1_1ListCertificatesCommand = async ( input: ListCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListCertificates", - }; + const headers: __HeaderBag = sharedHeaders("ListCertificates"); let body: any; body = JSON.stringify(serializeAws_json1_1ListCertificatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -706,10 +604,7 @@ export const serializeAws_json1_1ListConnectorsCommand = async ( input: ListConnectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListConnectors", - }; + const headers: __HeaderBag = sharedHeaders("ListConnectors"); let body: any; body = JSON.stringify(serializeAws_json1_1ListConnectorsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -719,10 +614,7 @@ export const serializeAws_json1_1ListExecutionsCommand = async ( input: ListExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListExecutions", - }; + const headers: __HeaderBag = sharedHeaders("ListExecutions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListExecutionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -732,10 +624,7 @@ export const serializeAws_json1_1ListHostKeysCommand = async ( input: ListHostKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListHostKeys", - }; + const headers: __HeaderBag = sharedHeaders("ListHostKeys"); let body: any; body = JSON.stringify(serializeAws_json1_1ListHostKeysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -745,10 +634,7 @@ export const serializeAws_json1_1ListProfilesCommand = async ( input: ListProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListProfiles", - }; + const headers: __HeaderBag = sharedHeaders("ListProfiles"); let body: any; body = JSON.stringify(serializeAws_json1_1ListProfilesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -758,10 +644,7 @@ export const serializeAws_json1_1ListSecurityPoliciesCommand = async ( input: ListSecurityPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListSecurityPolicies", - }; + const headers: __HeaderBag = sharedHeaders("ListSecurityPolicies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSecurityPoliciesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -771,10 +654,7 @@ export const serializeAws_json1_1ListServersCommand = async ( input: ListServersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListServers", - }; + const headers: __HeaderBag = sharedHeaders("ListServers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListServersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -784,10 +664,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -797,10 +674,7 @@ export const serializeAws_json1_1ListUsersCommand = async ( input: ListUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListUsers", - }; + const headers: __HeaderBag = sharedHeaders("ListUsers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUsersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -810,10 +684,7 @@ export const serializeAws_json1_1ListWorkflowsCommand = async ( input: ListWorkflowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.ListWorkflows", - }; + const headers: __HeaderBag = sharedHeaders("ListWorkflows"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWorkflowsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -823,10 +694,7 @@ export const serializeAws_json1_1SendWorkflowStepStateCommand = async ( input: SendWorkflowStepStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.SendWorkflowStepState", - }; + const headers: __HeaderBag = sharedHeaders("SendWorkflowStepState"); let body: any; body = JSON.stringify(serializeAws_json1_1SendWorkflowStepStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -836,10 +704,7 @@ export const serializeAws_json1_1StartFileTransferCommand = async ( input: StartFileTransferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.StartFileTransfer", - }; + const headers: __HeaderBag = sharedHeaders("StartFileTransfer"); let body: any; body = JSON.stringify(serializeAws_json1_1StartFileTransferRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -849,10 +714,7 @@ export const serializeAws_json1_1StartServerCommand = async ( input: StartServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.StartServer", - }; + const headers: __HeaderBag = sharedHeaders("StartServer"); let body: any; body = JSON.stringify(serializeAws_json1_1StartServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -862,10 +724,7 @@ export const serializeAws_json1_1StopServerCommand = async ( input: StopServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.StopServer", - }; + const headers: __HeaderBag = sharedHeaders("StopServer"); let body: any; body = JSON.stringify(serializeAws_json1_1StopServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -875,10 +734,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -888,10 +744,7 @@ export const serializeAws_json1_1TestIdentityProviderCommand = async ( input: TestIdentityProviderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.TestIdentityProvider", - }; + const headers: __HeaderBag = sharedHeaders("TestIdentityProvider"); let body: any; body = JSON.stringify(serializeAws_json1_1TestIdentityProviderRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -901,10 +754,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -914,10 +764,7 @@ export const serializeAws_json1_1UpdateAccessCommand = async ( input: UpdateAccessCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.UpdateAccess", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAccess"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAccessRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -927,10 +774,7 @@ export const serializeAws_json1_1UpdateAgreementCommand = async ( input: UpdateAgreementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.UpdateAgreement", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAgreement"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAgreementRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -940,10 +784,7 @@ export const serializeAws_json1_1UpdateCertificateCommand = async ( input: UpdateCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.UpdateCertificate", - }; + const headers: __HeaderBag = sharedHeaders("UpdateCertificate"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateCertificateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -953,10 +794,7 @@ export const serializeAws_json1_1UpdateConnectorCommand = async ( input: UpdateConnectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.UpdateConnector", - }; + const headers: __HeaderBag = sharedHeaders("UpdateConnector"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateConnectorRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -966,10 +804,7 @@ export const serializeAws_json1_1UpdateHostKeyCommand = async ( input: UpdateHostKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.UpdateHostKey", - }; + const headers: __HeaderBag = sharedHeaders("UpdateHostKey"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateHostKeyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -979,10 +814,7 @@ export const serializeAws_json1_1UpdateProfileCommand = async ( input: UpdateProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.UpdateProfile", - }; + const headers: __HeaderBag = sharedHeaders("UpdateProfile"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateProfileRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -992,10 +824,7 @@ export const serializeAws_json1_1UpdateServerCommand = async ( input: UpdateServerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.UpdateServer", - }; + const headers: __HeaderBag = sharedHeaders("UpdateServer"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateServerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1005,10 +834,7 @@ export const serializeAws_json1_1UpdateUserCommand = async ( input: UpdateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "TransferService.UpdateUser", - }; + const headers: __HeaderBag = sharedHeaders("UpdateUser"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -6426,6 +6252,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `TransferService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-translate/src/protocols/Aws_json1_1.ts b/clients/client-translate/src/protocols/Aws_json1_1.ts index 72e40b19af424..805863fd1f742 100644 --- a/clients/client-translate/src/protocols/Aws_json1_1.ts +++ b/clients/client-translate/src/protocols/Aws_json1_1.ts @@ -126,10 +126,7 @@ export const serializeAws_json1_1CreateParallelDataCommand = async ( input: CreateParallelDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.CreateParallelData", - }; + const headers: __HeaderBag = sharedHeaders("CreateParallelData"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateParallelDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -139,10 +136,7 @@ export const serializeAws_json1_1DeleteParallelDataCommand = async ( input: DeleteParallelDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.DeleteParallelData", - }; + const headers: __HeaderBag = sharedHeaders("DeleteParallelData"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteParallelDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -152,10 +146,7 @@ export const serializeAws_json1_1DeleteTerminologyCommand = async ( input: DeleteTerminologyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.DeleteTerminology", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTerminology"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTerminologyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -165,10 +156,7 @@ export const serializeAws_json1_1DescribeTextTranslationJobCommand = async ( input: DescribeTextTranslationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.DescribeTextTranslationJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTextTranslationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTextTranslationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -178,10 +166,7 @@ export const serializeAws_json1_1GetParallelDataCommand = async ( input: GetParallelDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.GetParallelData", - }; + const headers: __HeaderBag = sharedHeaders("GetParallelData"); let body: any; body = JSON.stringify(serializeAws_json1_1GetParallelDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -191,10 +176,7 @@ export const serializeAws_json1_1GetTerminologyCommand = async ( input: GetTerminologyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.GetTerminology", - }; + const headers: __HeaderBag = sharedHeaders("GetTerminology"); let body: any; body = JSON.stringify(serializeAws_json1_1GetTerminologyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -204,10 +186,7 @@ export const serializeAws_json1_1ImportTerminologyCommand = async ( input: ImportTerminologyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.ImportTerminology", - }; + const headers: __HeaderBag = sharedHeaders("ImportTerminology"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportTerminologyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -217,10 +196,7 @@ export const serializeAws_json1_1ListLanguagesCommand = async ( input: ListLanguagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.ListLanguages", - }; + const headers: __HeaderBag = sharedHeaders("ListLanguages"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLanguagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -230,10 +206,7 @@ export const serializeAws_json1_1ListParallelDataCommand = async ( input: ListParallelDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.ListParallelData", - }; + const headers: __HeaderBag = sharedHeaders("ListParallelData"); let body: any; body = JSON.stringify(serializeAws_json1_1ListParallelDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -243,10 +216,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -256,10 +226,7 @@ export const serializeAws_json1_1ListTerminologiesCommand = async ( input: ListTerminologiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.ListTerminologies", - }; + const headers: __HeaderBag = sharedHeaders("ListTerminologies"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTerminologiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -269,10 +236,7 @@ export const serializeAws_json1_1ListTextTranslationJobsCommand = async ( input: ListTextTranslationJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.ListTextTranslationJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListTextTranslationJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTextTranslationJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -282,10 +246,7 @@ export const serializeAws_json1_1StartTextTranslationJobCommand = async ( input: StartTextTranslationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.StartTextTranslationJob", - }; + const headers: __HeaderBag = sharedHeaders("StartTextTranslationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartTextTranslationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -295,10 +256,7 @@ export const serializeAws_json1_1StopTextTranslationJobCommand = async ( input: StopTextTranslationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.StopTextTranslationJob", - }; + const headers: __HeaderBag = sharedHeaders("StopTextTranslationJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StopTextTranslationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -308,10 +266,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -321,10 +276,7 @@ export const serializeAws_json1_1TranslateTextCommand = async ( input: TranslateTextCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.TranslateText", - }; + const headers: __HeaderBag = sharedHeaders("TranslateText"); let body: any; body = JSON.stringify(serializeAws_json1_1TranslateTextRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -334,10 +286,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -347,10 +296,7 @@ export const serializeAws_json1_1UpdateParallelDataCommand = async ( input: UpdateParallelDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSShineFrontendService_20170701.UpdateParallelData", - }; + const headers: __HeaderBag = sharedHeaders("UpdateParallelData"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateParallelDataRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -2484,6 +2430,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSShineFrontendService_20170701.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-voice-id/src/protocols/Aws_json1_0.ts b/clients/client-voice-id/src/protocols/Aws_json1_0.ts index 053cdbbe226c9..1c855c93ad7c0 100644 --- a/clients/client-voice-id/src/protocols/Aws_json1_0.ts +++ b/clients/client-voice-id/src/protocols/Aws_json1_0.ts @@ -171,10 +171,7 @@ export const serializeAws_json1_0AssociateFraudsterCommand = async ( input: AssociateFraudsterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.AssociateFraudster", - }; + const headers: __HeaderBag = sharedHeaders("AssociateFraudster"); let body: any; body = JSON.stringify(serializeAws_json1_0AssociateFraudsterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -184,10 +181,7 @@ export const serializeAws_json1_0CreateDomainCommand = async ( input: CreateDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.CreateDomain", - }; + const headers: __HeaderBag = sharedHeaders("CreateDomain"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -197,10 +191,7 @@ export const serializeAws_json1_0CreateWatchlistCommand = async ( input: CreateWatchlistCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.CreateWatchlist", - }; + const headers: __HeaderBag = sharedHeaders("CreateWatchlist"); let body: any; body = JSON.stringify(serializeAws_json1_0CreateWatchlistRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -210,10 +201,7 @@ export const serializeAws_json1_0DeleteDomainCommand = async ( input: DeleteDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DeleteDomain", - }; + const headers: __HeaderBag = sharedHeaders("DeleteDomain"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -223,10 +211,7 @@ export const serializeAws_json1_0DeleteFraudsterCommand = async ( input: DeleteFraudsterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DeleteFraudster", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFraudster"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteFraudsterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -236,10 +221,7 @@ export const serializeAws_json1_0DeleteSpeakerCommand = async ( input: DeleteSpeakerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DeleteSpeaker", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSpeaker"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteSpeakerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -249,10 +231,7 @@ export const serializeAws_json1_0DeleteWatchlistCommand = async ( input: DeleteWatchlistCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DeleteWatchlist", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWatchlist"); let body: any; body = JSON.stringify(serializeAws_json1_0DeleteWatchlistRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -262,10 +241,7 @@ export const serializeAws_json1_0DescribeDomainCommand = async ( input: DescribeDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DescribeDomain", - }; + const headers: __HeaderBag = sharedHeaders("DescribeDomain"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -275,10 +251,7 @@ export const serializeAws_json1_0DescribeFraudsterCommand = async ( input: DescribeFraudsterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DescribeFraudster", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFraudster"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeFraudsterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -288,10 +261,7 @@ export const serializeAws_json1_0DescribeFraudsterRegistrationJobCommand = async input: DescribeFraudsterRegistrationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DescribeFraudsterRegistrationJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeFraudsterRegistrationJob"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeFraudsterRegistrationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -301,10 +271,7 @@ export const serializeAws_json1_0DescribeSpeakerCommand = async ( input: DescribeSpeakerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DescribeSpeaker", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSpeaker"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeSpeakerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -314,10 +281,7 @@ export const serializeAws_json1_0DescribeSpeakerEnrollmentJobCommand = async ( input: DescribeSpeakerEnrollmentJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DescribeSpeakerEnrollmentJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeSpeakerEnrollmentJob"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeSpeakerEnrollmentJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -327,10 +291,7 @@ export const serializeAws_json1_0DescribeWatchlistCommand = async ( input: DescribeWatchlistCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DescribeWatchlist", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWatchlist"); let body: any; body = JSON.stringify(serializeAws_json1_0DescribeWatchlistRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -340,10 +301,7 @@ export const serializeAws_json1_0DisassociateFraudsterCommand = async ( input: DisassociateFraudsterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.DisassociateFraudster", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateFraudster"); let body: any; body = JSON.stringify(serializeAws_json1_0DisassociateFraudsterRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -353,10 +311,7 @@ export const serializeAws_json1_0EvaluateSessionCommand = async ( input: EvaluateSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.EvaluateSession", - }; + const headers: __HeaderBag = sharedHeaders("EvaluateSession"); let body: any; body = JSON.stringify(serializeAws_json1_0EvaluateSessionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -366,10 +321,7 @@ export const serializeAws_json1_0ListDomainsCommand = async ( input: ListDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.ListDomains", - }; + const headers: __HeaderBag = sharedHeaders("ListDomains"); let body: any; body = JSON.stringify(serializeAws_json1_0ListDomainsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -379,10 +331,7 @@ export const serializeAws_json1_0ListFraudsterRegistrationJobsCommand = async ( input: ListFraudsterRegistrationJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.ListFraudsterRegistrationJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListFraudsterRegistrationJobs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListFraudsterRegistrationJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -392,10 +341,7 @@ export const serializeAws_json1_0ListFraudstersCommand = async ( input: ListFraudstersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.ListFraudsters", - }; + const headers: __HeaderBag = sharedHeaders("ListFraudsters"); let body: any; body = JSON.stringify(serializeAws_json1_0ListFraudstersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -405,10 +351,7 @@ export const serializeAws_json1_0ListSpeakerEnrollmentJobsCommand = async ( input: ListSpeakerEnrollmentJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.ListSpeakerEnrollmentJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListSpeakerEnrollmentJobs"); let body: any; body = JSON.stringify(serializeAws_json1_0ListSpeakerEnrollmentJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -418,10 +361,7 @@ export const serializeAws_json1_0ListSpeakersCommand = async ( input: ListSpeakersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.ListSpeakers", - }; + const headers: __HeaderBag = sharedHeaders("ListSpeakers"); let body: any; body = JSON.stringify(serializeAws_json1_0ListSpeakersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -431,10 +371,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -444,10 +381,7 @@ export const serializeAws_json1_0ListWatchlistsCommand = async ( input: ListWatchlistsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.ListWatchlists", - }; + const headers: __HeaderBag = sharedHeaders("ListWatchlists"); let body: any; body = JSON.stringify(serializeAws_json1_0ListWatchlistsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -457,10 +391,7 @@ export const serializeAws_json1_0OptOutSpeakerCommand = async ( input: OptOutSpeakerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.OptOutSpeaker", - }; + const headers: __HeaderBag = sharedHeaders("OptOutSpeaker"); let body: any; body = JSON.stringify(serializeAws_json1_0OptOutSpeakerRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -470,10 +401,7 @@ export const serializeAws_json1_0StartFraudsterRegistrationJobCommand = async ( input: StartFraudsterRegistrationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.StartFraudsterRegistrationJob", - }; + const headers: __HeaderBag = sharedHeaders("StartFraudsterRegistrationJob"); let body: any; body = JSON.stringify(serializeAws_json1_0StartFraudsterRegistrationJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -483,10 +411,7 @@ export const serializeAws_json1_0StartSpeakerEnrollmentJobCommand = async ( input: StartSpeakerEnrollmentJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.StartSpeakerEnrollmentJob", - }; + const headers: __HeaderBag = sharedHeaders("StartSpeakerEnrollmentJob"); let body: any; body = JSON.stringify(serializeAws_json1_0StartSpeakerEnrollmentJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -496,10 +421,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -509,10 +431,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -522,10 +441,7 @@ export const serializeAws_json1_0UpdateDomainCommand = async ( input: UpdateDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.UpdateDomain", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDomain"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -535,10 +451,7 @@ export const serializeAws_json1_0UpdateWatchlistCommand = async ( input: UpdateWatchlistCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "VoiceID.UpdateWatchlist", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWatchlist"); let body: any; body = JSON.stringify(serializeAws_json1_0UpdateWatchlistRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -3500,6 +3413,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `VoiceID.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-waf-regional/src/protocols/Aws_json1_1.ts b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts index 141b85c172086..5141432c85ef6 100644 --- a/clients/client-waf-regional/src/protocols/Aws_json1_1.ts +++ b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts @@ -449,10 +449,7 @@ export const serializeAws_json1_1AssociateWebACLCommand = async ( input: AssociateWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.AssociateWebACL", - }; + const headers: __HeaderBag = sharedHeaders("AssociateWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -462,10 +459,7 @@ export const serializeAws_json1_1CreateByteMatchSetCommand = async ( input: CreateByteMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateByteMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateByteMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateByteMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -475,10 +469,7 @@ export const serializeAws_json1_1CreateGeoMatchSetCommand = async ( input: CreateGeoMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateGeoMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateGeoMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGeoMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -488,10 +479,7 @@ export const serializeAws_json1_1CreateIPSetCommand = async ( input: CreateIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateIPSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -501,10 +489,7 @@ export const serializeAws_json1_1CreateRateBasedRuleCommand = async ( input: CreateRateBasedRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateRateBasedRule", - }; + const headers: __HeaderBag = sharedHeaders("CreateRateBasedRule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRateBasedRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -514,10 +499,7 @@ export const serializeAws_json1_1CreateRegexMatchSetCommand = async ( input: CreateRegexMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateRegexMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateRegexMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRegexMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -527,10 +509,7 @@ export const serializeAws_json1_1CreateRegexPatternSetCommand = async ( input: CreateRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -540,10 +519,7 @@ export const serializeAws_json1_1CreateRuleCommand = async ( input: CreateRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateRule", - }; + const headers: __HeaderBag = sharedHeaders("CreateRule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -553,10 +529,7 @@ export const serializeAws_json1_1CreateRuleGroupCommand = async ( input: CreateRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -566,10 +539,7 @@ export const serializeAws_json1_1CreateSizeConstraintSetCommand = async ( input: CreateSizeConstraintSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateSizeConstraintSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateSizeConstraintSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSizeConstraintSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -579,10 +549,7 @@ export const serializeAws_json1_1CreateSqlInjectionMatchSetCommand = async ( input: CreateSqlInjectionMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateSqlInjectionMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateSqlInjectionMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSqlInjectionMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -592,10 +559,7 @@ export const serializeAws_json1_1CreateWebACLCommand = async ( input: CreateWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateWebACL", - }; + const headers: __HeaderBag = sharedHeaders("CreateWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -605,10 +569,7 @@ export const serializeAws_json1_1CreateWebACLMigrationStackCommand = async ( input: CreateWebACLMigrationStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateWebACLMigrationStack", - }; + const headers: __HeaderBag = sharedHeaders("CreateWebACLMigrationStack"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWebACLMigrationStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -618,10 +579,7 @@ export const serializeAws_json1_1CreateXssMatchSetCommand = async ( input: CreateXssMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.CreateXssMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateXssMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateXssMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -631,10 +589,7 @@ export const serializeAws_json1_1DeleteByteMatchSetCommand = async ( input: DeleteByteMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteByteMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteByteMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteByteMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -644,10 +599,7 @@ export const serializeAws_json1_1DeleteGeoMatchSetCommand = async ( input: DeleteGeoMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteGeoMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGeoMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGeoMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -657,10 +609,7 @@ export const serializeAws_json1_1DeleteIPSetCommand = async ( input: DeleteIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteIPSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -670,10 +619,7 @@ export const serializeAws_json1_1DeleteLoggingConfigurationCommand = async ( input: DeleteLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -683,10 +629,7 @@ export const serializeAws_json1_1DeletePermissionPolicyCommand = async ( input: DeletePermissionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeletePermissionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeletePermissionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePermissionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -696,10 +639,7 @@ export const serializeAws_json1_1DeleteRateBasedRuleCommand = async ( input: DeleteRateBasedRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteRateBasedRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRateBasedRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRateBasedRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -709,10 +649,7 @@ export const serializeAws_json1_1DeleteRegexMatchSetCommand = async ( input: DeleteRegexMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteRegexMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRegexMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRegexMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -722,10 +659,7 @@ export const serializeAws_json1_1DeleteRegexPatternSetCommand = async ( input: DeleteRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -735,10 +669,7 @@ export const serializeAws_json1_1DeleteRuleCommand = async ( input: DeleteRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -748,10 +679,7 @@ export const serializeAws_json1_1DeleteRuleGroupCommand = async ( input: DeleteRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -761,10 +689,7 @@ export const serializeAws_json1_1DeleteSizeConstraintSetCommand = async ( input: DeleteSizeConstraintSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteSizeConstraintSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSizeConstraintSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSizeConstraintSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -774,10 +699,7 @@ export const serializeAws_json1_1DeleteSqlInjectionMatchSetCommand = async ( input: DeleteSqlInjectionMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteSqlInjectionMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSqlInjectionMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSqlInjectionMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -787,10 +709,7 @@ export const serializeAws_json1_1DeleteWebACLCommand = async ( input: DeleteWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteWebACL", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -800,10 +719,7 @@ export const serializeAws_json1_1DeleteXssMatchSetCommand = async ( input: DeleteXssMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DeleteXssMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteXssMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteXssMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -813,10 +729,7 @@ export const serializeAws_json1_1DisassociateWebACLCommand = async ( input: DisassociateWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.DisassociateWebACL", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -826,10 +739,7 @@ export const serializeAws_json1_1GetByteMatchSetCommand = async ( input: GetByteMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetByteMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("GetByteMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetByteMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -839,10 +749,7 @@ export const serializeAws_json1_1GetChangeTokenCommand = async ( input: GetChangeTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetChangeToken", - }; + const headers: __HeaderBag = sharedHeaders("GetChangeToken"); let body: any; body = JSON.stringify(serializeAws_json1_1GetChangeTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -852,10 +759,7 @@ export const serializeAws_json1_1GetChangeTokenStatusCommand = async ( input: GetChangeTokenStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetChangeTokenStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetChangeTokenStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetChangeTokenStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -865,10 +769,7 @@ export const serializeAws_json1_1GetGeoMatchSetCommand = async ( input: GetGeoMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetGeoMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("GetGeoMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetGeoMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -878,10 +779,7 @@ export const serializeAws_json1_1GetIPSetCommand = async ( input: GetIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetIPSet", - }; + const headers: __HeaderBag = sharedHeaders("GetIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -891,10 +789,7 @@ export const serializeAws_json1_1GetLoggingConfigurationCommand = async ( input: GetLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -904,10 +799,7 @@ export const serializeAws_json1_1GetPermissionPolicyCommand = async ( input: GetPermissionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetPermissionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetPermissionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPermissionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -917,10 +809,7 @@ export const serializeAws_json1_1GetRateBasedRuleCommand = async ( input: GetRateBasedRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetRateBasedRule", - }; + const headers: __HeaderBag = sharedHeaders("GetRateBasedRule"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRateBasedRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -930,10 +819,7 @@ export const serializeAws_json1_1GetRateBasedRuleManagedKeysCommand = async ( input: GetRateBasedRuleManagedKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetRateBasedRuleManagedKeys", - }; + const headers: __HeaderBag = sharedHeaders("GetRateBasedRuleManagedKeys"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRateBasedRuleManagedKeysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -943,10 +829,7 @@ export const serializeAws_json1_1GetRegexMatchSetCommand = async ( input: GetRegexMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetRegexMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("GetRegexMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRegexMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -956,10 +839,7 @@ export const serializeAws_json1_1GetRegexPatternSetCommand = async ( input: GetRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("GetRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -969,10 +849,7 @@ export const serializeAws_json1_1GetRuleCommand = async ( input: GetRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetRule", - }; + const headers: __HeaderBag = sharedHeaders("GetRule"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -982,10 +859,7 @@ export const serializeAws_json1_1GetRuleGroupCommand = async ( input: GetRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("GetRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -995,10 +869,7 @@ export const serializeAws_json1_1GetSampledRequestsCommand = async ( input: GetSampledRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetSampledRequests", - }; + const headers: __HeaderBag = sharedHeaders("GetSampledRequests"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSampledRequestsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1008,10 +879,7 @@ export const serializeAws_json1_1GetSizeConstraintSetCommand = async ( input: GetSizeConstraintSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetSizeConstraintSet", - }; + const headers: __HeaderBag = sharedHeaders("GetSizeConstraintSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSizeConstraintSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1021,10 +889,7 @@ export const serializeAws_json1_1GetSqlInjectionMatchSetCommand = async ( input: GetSqlInjectionMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetSqlInjectionMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("GetSqlInjectionMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSqlInjectionMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1034,10 +899,7 @@ export const serializeAws_json1_1GetWebACLCommand = async ( input: GetWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetWebACL", - }; + const headers: __HeaderBag = sharedHeaders("GetWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1047,10 +909,7 @@ export const serializeAws_json1_1GetWebACLForResourceCommand = async ( input: GetWebACLForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetWebACLForResource", - }; + const headers: __HeaderBag = sharedHeaders("GetWebACLForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWebACLForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1060,10 +919,7 @@ export const serializeAws_json1_1GetXssMatchSetCommand = async ( input: GetXssMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.GetXssMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("GetXssMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetXssMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1073,10 +929,7 @@ export const serializeAws_json1_1ListActivatedRulesInRuleGroupCommand = async ( input: ListActivatedRulesInRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListActivatedRulesInRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("ListActivatedRulesInRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1ListActivatedRulesInRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1086,10 +939,7 @@ export const serializeAws_json1_1ListByteMatchSetsCommand = async ( input: ListByteMatchSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListByteMatchSets", - }; + const headers: __HeaderBag = sharedHeaders("ListByteMatchSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListByteMatchSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1099,10 +949,7 @@ export const serializeAws_json1_1ListGeoMatchSetsCommand = async ( input: ListGeoMatchSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListGeoMatchSets", - }; + const headers: __HeaderBag = sharedHeaders("ListGeoMatchSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGeoMatchSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1112,10 +959,7 @@ export const serializeAws_json1_1ListIPSetsCommand = async ( input: ListIPSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListIPSets", - }; + const headers: __HeaderBag = sharedHeaders("ListIPSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListIPSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1125,10 +969,7 @@ export const serializeAws_json1_1ListLoggingConfigurationsCommand = async ( input: ListLoggingConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListLoggingConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListLoggingConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLoggingConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1138,10 +979,7 @@ export const serializeAws_json1_1ListRateBasedRulesCommand = async ( input: ListRateBasedRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListRateBasedRules", - }; + const headers: __HeaderBag = sharedHeaders("ListRateBasedRules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRateBasedRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1151,10 +989,7 @@ export const serializeAws_json1_1ListRegexMatchSetsCommand = async ( input: ListRegexMatchSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListRegexMatchSets", - }; + const headers: __HeaderBag = sharedHeaders("ListRegexMatchSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRegexMatchSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1164,10 +999,7 @@ export const serializeAws_json1_1ListRegexPatternSetsCommand = async ( input: ListRegexPatternSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListRegexPatternSets", - }; + const headers: __HeaderBag = sharedHeaders("ListRegexPatternSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRegexPatternSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1177,10 +1009,7 @@ export const serializeAws_json1_1ListResourcesForWebACLCommand = async ( input: ListResourcesForWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListResourcesForWebACL", - }; + const headers: __HeaderBag = sharedHeaders("ListResourcesForWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourcesForWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1190,10 +1019,7 @@ export const serializeAws_json1_1ListRuleGroupsCommand = async ( input: ListRuleGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListRuleGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListRuleGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRuleGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1203,10 +1029,7 @@ export const serializeAws_json1_1ListRulesCommand = async ( input: ListRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListRules", - }; + const headers: __HeaderBag = sharedHeaders("ListRules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1216,10 +1039,7 @@ export const serializeAws_json1_1ListSizeConstraintSetsCommand = async ( input: ListSizeConstraintSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListSizeConstraintSets", - }; + const headers: __HeaderBag = sharedHeaders("ListSizeConstraintSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSizeConstraintSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1229,10 +1049,7 @@ export const serializeAws_json1_1ListSqlInjectionMatchSetsCommand = async ( input: ListSqlInjectionMatchSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListSqlInjectionMatchSets", - }; + const headers: __HeaderBag = sharedHeaders("ListSqlInjectionMatchSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSqlInjectionMatchSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1242,10 +1059,7 @@ export const serializeAws_json1_1ListSubscribedRuleGroupsCommand = async ( input: ListSubscribedRuleGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListSubscribedRuleGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListSubscribedRuleGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSubscribedRuleGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1255,10 +1069,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1268,10 +1079,7 @@ export const serializeAws_json1_1ListWebACLsCommand = async ( input: ListWebACLsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListWebACLs", - }; + const headers: __HeaderBag = sharedHeaders("ListWebACLs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWebACLsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1281,10 +1089,7 @@ export const serializeAws_json1_1ListXssMatchSetsCommand = async ( input: ListXssMatchSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.ListXssMatchSets", - }; + const headers: __HeaderBag = sharedHeaders("ListXssMatchSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListXssMatchSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1294,10 +1099,7 @@ export const serializeAws_json1_1PutLoggingConfigurationCommand = async ( input: PutLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.PutLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1307,10 +1109,7 @@ export const serializeAws_json1_1PutPermissionPolicyCommand = async ( input: PutPermissionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.PutPermissionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutPermissionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPermissionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1320,10 +1119,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1333,10 +1129,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1346,10 +1139,7 @@ export const serializeAws_json1_1UpdateByteMatchSetCommand = async ( input: UpdateByteMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateByteMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateByteMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateByteMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1359,10 +1149,7 @@ export const serializeAws_json1_1UpdateGeoMatchSetCommand = async ( input: UpdateGeoMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateGeoMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGeoMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGeoMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1372,10 +1159,7 @@ export const serializeAws_json1_1UpdateIPSetCommand = async ( input: UpdateIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateIPSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1385,10 +1169,7 @@ export const serializeAws_json1_1UpdateRateBasedRuleCommand = async ( input: UpdateRateBasedRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateRateBasedRule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRateBasedRule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRateBasedRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1398,10 +1179,7 @@ export const serializeAws_json1_1UpdateRegexMatchSetCommand = async ( input: UpdateRegexMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateRegexMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRegexMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRegexMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1411,10 +1189,7 @@ export const serializeAws_json1_1UpdateRegexPatternSetCommand = async ( input: UpdateRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1424,10 +1199,7 @@ export const serializeAws_json1_1UpdateRuleCommand = async ( input: UpdateRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateRule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1437,10 +1209,7 @@ export const serializeAws_json1_1UpdateRuleGroupCommand = async ( input: UpdateRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1450,10 +1219,7 @@ export const serializeAws_json1_1UpdateSizeConstraintSetCommand = async ( input: UpdateSizeConstraintSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateSizeConstraintSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSizeConstraintSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSizeConstraintSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1463,10 +1229,7 @@ export const serializeAws_json1_1UpdateSqlInjectionMatchSetCommand = async ( input: UpdateSqlInjectionMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateSqlInjectionMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSqlInjectionMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSqlInjectionMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1476,10 +1239,7 @@ export const serializeAws_json1_1UpdateWebACLCommand = async ( input: UpdateWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateWebACL", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1489,10 +1249,7 @@ export const serializeAws_json1_1UpdateXssMatchSetCommand = async ( input: UpdateXssMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_Regional_20161128.UpdateXssMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateXssMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateXssMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -8850,6 +8607,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSWAF_Regional_20161128.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-waf/src/protocols/Aws_json1_1.ts b/clients/client-waf/src/protocols/Aws_json1_1.ts index 4273da78789d2..d2cea0f17200a 100644 --- a/clients/client-waf/src/protocols/Aws_json1_1.ts +++ b/clients/client-waf/src/protocols/Aws_json1_1.ts @@ -430,10 +430,7 @@ export const serializeAws_json1_1CreateByteMatchSetCommand = async ( input: CreateByteMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateByteMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateByteMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateByteMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -443,10 +440,7 @@ export const serializeAws_json1_1CreateGeoMatchSetCommand = async ( input: CreateGeoMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateGeoMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateGeoMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGeoMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -456,10 +450,7 @@ export const serializeAws_json1_1CreateIPSetCommand = async ( input: CreateIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateIPSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -469,10 +460,7 @@ export const serializeAws_json1_1CreateRateBasedRuleCommand = async ( input: CreateRateBasedRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateRateBasedRule", - }; + const headers: __HeaderBag = sharedHeaders("CreateRateBasedRule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRateBasedRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -482,10 +470,7 @@ export const serializeAws_json1_1CreateRegexMatchSetCommand = async ( input: CreateRegexMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateRegexMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateRegexMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRegexMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -495,10 +480,7 @@ export const serializeAws_json1_1CreateRegexPatternSetCommand = async ( input: CreateRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -508,10 +490,7 @@ export const serializeAws_json1_1CreateRuleCommand = async ( input: CreateRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateRule", - }; + const headers: __HeaderBag = sharedHeaders("CreateRule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -521,10 +500,7 @@ export const serializeAws_json1_1CreateRuleGroupCommand = async ( input: CreateRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -534,10 +510,7 @@ export const serializeAws_json1_1CreateSizeConstraintSetCommand = async ( input: CreateSizeConstraintSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateSizeConstraintSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateSizeConstraintSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSizeConstraintSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -547,10 +520,7 @@ export const serializeAws_json1_1CreateSqlInjectionMatchSetCommand = async ( input: CreateSqlInjectionMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateSqlInjectionMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateSqlInjectionMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateSqlInjectionMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -560,10 +530,7 @@ export const serializeAws_json1_1CreateWebACLCommand = async ( input: CreateWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateWebACL", - }; + const headers: __HeaderBag = sharedHeaders("CreateWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -573,10 +540,7 @@ export const serializeAws_json1_1CreateWebACLMigrationStackCommand = async ( input: CreateWebACLMigrationStackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateWebACLMigrationStack", - }; + const headers: __HeaderBag = sharedHeaders("CreateWebACLMigrationStack"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWebACLMigrationStackRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -586,10 +550,7 @@ export const serializeAws_json1_1CreateXssMatchSetCommand = async ( input: CreateXssMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.CreateXssMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateXssMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateXssMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -599,10 +560,7 @@ export const serializeAws_json1_1DeleteByteMatchSetCommand = async ( input: DeleteByteMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteByteMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteByteMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteByteMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -612,10 +570,7 @@ export const serializeAws_json1_1DeleteGeoMatchSetCommand = async ( input: DeleteGeoMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteGeoMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGeoMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGeoMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -625,10 +580,7 @@ export const serializeAws_json1_1DeleteIPSetCommand = async ( input: DeleteIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteIPSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -638,10 +590,7 @@ export const serializeAws_json1_1DeleteLoggingConfigurationCommand = async ( input: DeleteLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -651,10 +600,7 @@ export const serializeAws_json1_1DeletePermissionPolicyCommand = async ( input: DeletePermissionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeletePermissionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeletePermissionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePermissionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -664,10 +610,7 @@ export const serializeAws_json1_1DeleteRateBasedRuleCommand = async ( input: DeleteRateBasedRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteRateBasedRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRateBasedRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRateBasedRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -677,10 +620,7 @@ export const serializeAws_json1_1DeleteRegexMatchSetCommand = async ( input: DeleteRegexMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteRegexMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRegexMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRegexMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -690,10 +630,7 @@ export const serializeAws_json1_1DeleteRegexPatternSetCommand = async ( input: DeleteRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -703,10 +640,7 @@ export const serializeAws_json1_1DeleteRuleCommand = async ( input: DeleteRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -716,10 +650,7 @@ export const serializeAws_json1_1DeleteRuleGroupCommand = async ( input: DeleteRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -729,10 +660,7 @@ export const serializeAws_json1_1DeleteSizeConstraintSetCommand = async ( input: DeleteSizeConstraintSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteSizeConstraintSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSizeConstraintSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSizeConstraintSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -742,10 +670,7 @@ export const serializeAws_json1_1DeleteSqlInjectionMatchSetCommand = async ( input: DeleteSqlInjectionMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteSqlInjectionMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteSqlInjectionMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteSqlInjectionMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -755,10 +680,7 @@ export const serializeAws_json1_1DeleteWebACLCommand = async ( input: DeleteWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteWebACL", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -768,10 +690,7 @@ export const serializeAws_json1_1DeleteXssMatchSetCommand = async ( input: DeleteXssMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.DeleteXssMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteXssMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteXssMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -781,10 +700,7 @@ export const serializeAws_json1_1GetByteMatchSetCommand = async ( input: GetByteMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetByteMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("GetByteMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetByteMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -794,10 +710,7 @@ export const serializeAws_json1_1GetChangeTokenCommand = async ( input: GetChangeTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetChangeToken", - }; + const headers: __HeaderBag = sharedHeaders("GetChangeToken"); let body: any; body = JSON.stringify(serializeAws_json1_1GetChangeTokenRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -807,10 +720,7 @@ export const serializeAws_json1_1GetChangeTokenStatusCommand = async ( input: GetChangeTokenStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetChangeTokenStatus", - }; + const headers: __HeaderBag = sharedHeaders("GetChangeTokenStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1GetChangeTokenStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -820,10 +730,7 @@ export const serializeAws_json1_1GetGeoMatchSetCommand = async ( input: GetGeoMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetGeoMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("GetGeoMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetGeoMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -833,10 +740,7 @@ export const serializeAws_json1_1GetIPSetCommand = async ( input: GetIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetIPSet", - }; + const headers: __HeaderBag = sharedHeaders("GetIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -846,10 +750,7 @@ export const serializeAws_json1_1GetLoggingConfigurationCommand = async ( input: GetLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -859,10 +760,7 @@ export const serializeAws_json1_1GetPermissionPolicyCommand = async ( input: GetPermissionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetPermissionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetPermissionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPermissionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -872,10 +770,7 @@ export const serializeAws_json1_1GetRateBasedRuleCommand = async ( input: GetRateBasedRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetRateBasedRule", - }; + const headers: __HeaderBag = sharedHeaders("GetRateBasedRule"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRateBasedRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -885,10 +780,7 @@ export const serializeAws_json1_1GetRateBasedRuleManagedKeysCommand = async ( input: GetRateBasedRuleManagedKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetRateBasedRuleManagedKeys", - }; + const headers: __HeaderBag = sharedHeaders("GetRateBasedRuleManagedKeys"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRateBasedRuleManagedKeysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -898,10 +790,7 @@ export const serializeAws_json1_1GetRegexMatchSetCommand = async ( input: GetRegexMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetRegexMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("GetRegexMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRegexMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -911,10 +800,7 @@ export const serializeAws_json1_1GetRegexPatternSetCommand = async ( input: GetRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("GetRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -924,10 +810,7 @@ export const serializeAws_json1_1GetRuleCommand = async ( input: GetRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetRule", - }; + const headers: __HeaderBag = sharedHeaders("GetRule"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -937,10 +820,7 @@ export const serializeAws_json1_1GetRuleGroupCommand = async ( input: GetRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("GetRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -950,10 +830,7 @@ export const serializeAws_json1_1GetSampledRequestsCommand = async ( input: GetSampledRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetSampledRequests", - }; + const headers: __HeaderBag = sharedHeaders("GetSampledRequests"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSampledRequestsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -963,10 +840,7 @@ export const serializeAws_json1_1GetSizeConstraintSetCommand = async ( input: GetSizeConstraintSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetSizeConstraintSet", - }; + const headers: __HeaderBag = sharedHeaders("GetSizeConstraintSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSizeConstraintSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -976,10 +850,7 @@ export const serializeAws_json1_1GetSqlInjectionMatchSetCommand = async ( input: GetSqlInjectionMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetSqlInjectionMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("GetSqlInjectionMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSqlInjectionMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -989,10 +860,7 @@ export const serializeAws_json1_1GetWebACLCommand = async ( input: GetWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetWebACL", - }; + const headers: __HeaderBag = sharedHeaders("GetWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1002,10 +870,7 @@ export const serializeAws_json1_1GetXssMatchSetCommand = async ( input: GetXssMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.GetXssMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("GetXssMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetXssMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1015,10 +880,7 @@ export const serializeAws_json1_1ListActivatedRulesInRuleGroupCommand = async ( input: ListActivatedRulesInRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListActivatedRulesInRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("ListActivatedRulesInRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1ListActivatedRulesInRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1028,10 +890,7 @@ export const serializeAws_json1_1ListByteMatchSetsCommand = async ( input: ListByteMatchSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListByteMatchSets", - }; + const headers: __HeaderBag = sharedHeaders("ListByteMatchSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListByteMatchSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1041,10 +900,7 @@ export const serializeAws_json1_1ListGeoMatchSetsCommand = async ( input: ListGeoMatchSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListGeoMatchSets", - }; + const headers: __HeaderBag = sharedHeaders("ListGeoMatchSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGeoMatchSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1054,10 +910,7 @@ export const serializeAws_json1_1ListIPSetsCommand = async ( input: ListIPSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListIPSets", - }; + const headers: __HeaderBag = sharedHeaders("ListIPSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListIPSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1067,10 +920,7 @@ export const serializeAws_json1_1ListLoggingConfigurationsCommand = async ( input: ListLoggingConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListLoggingConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListLoggingConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLoggingConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1080,10 +930,7 @@ export const serializeAws_json1_1ListRateBasedRulesCommand = async ( input: ListRateBasedRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListRateBasedRules", - }; + const headers: __HeaderBag = sharedHeaders("ListRateBasedRules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRateBasedRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1093,10 +940,7 @@ export const serializeAws_json1_1ListRegexMatchSetsCommand = async ( input: ListRegexMatchSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListRegexMatchSets", - }; + const headers: __HeaderBag = sharedHeaders("ListRegexMatchSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRegexMatchSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1106,10 +950,7 @@ export const serializeAws_json1_1ListRegexPatternSetsCommand = async ( input: ListRegexPatternSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListRegexPatternSets", - }; + const headers: __HeaderBag = sharedHeaders("ListRegexPatternSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRegexPatternSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1119,10 +960,7 @@ export const serializeAws_json1_1ListRuleGroupsCommand = async ( input: ListRuleGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListRuleGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListRuleGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRuleGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1132,10 +970,7 @@ export const serializeAws_json1_1ListRulesCommand = async ( input: ListRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListRules", - }; + const headers: __HeaderBag = sharedHeaders("ListRules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1145,10 +980,7 @@ export const serializeAws_json1_1ListSizeConstraintSetsCommand = async ( input: ListSizeConstraintSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListSizeConstraintSets", - }; + const headers: __HeaderBag = sharedHeaders("ListSizeConstraintSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSizeConstraintSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1158,10 +990,7 @@ export const serializeAws_json1_1ListSqlInjectionMatchSetsCommand = async ( input: ListSqlInjectionMatchSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListSqlInjectionMatchSets", - }; + const headers: __HeaderBag = sharedHeaders("ListSqlInjectionMatchSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSqlInjectionMatchSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1171,10 +1000,7 @@ export const serializeAws_json1_1ListSubscribedRuleGroupsCommand = async ( input: ListSubscribedRuleGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListSubscribedRuleGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListSubscribedRuleGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListSubscribedRuleGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1184,10 +1010,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1197,10 +1020,7 @@ export const serializeAws_json1_1ListWebACLsCommand = async ( input: ListWebACLsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListWebACLs", - }; + const headers: __HeaderBag = sharedHeaders("ListWebACLs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWebACLsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1210,10 +1030,7 @@ export const serializeAws_json1_1ListXssMatchSetsCommand = async ( input: ListXssMatchSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.ListXssMatchSets", - }; + const headers: __HeaderBag = sharedHeaders("ListXssMatchSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListXssMatchSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1223,10 +1040,7 @@ export const serializeAws_json1_1PutLoggingConfigurationCommand = async ( input: PutLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.PutLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1236,10 +1050,7 @@ export const serializeAws_json1_1PutPermissionPolicyCommand = async ( input: PutPermissionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.PutPermissionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutPermissionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPermissionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1249,10 +1060,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1262,10 +1070,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1275,10 +1080,7 @@ export const serializeAws_json1_1UpdateByteMatchSetCommand = async ( input: UpdateByteMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateByteMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateByteMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateByteMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1288,10 +1090,7 @@ export const serializeAws_json1_1UpdateGeoMatchSetCommand = async ( input: UpdateGeoMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateGeoMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateGeoMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateGeoMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1301,10 +1100,7 @@ export const serializeAws_json1_1UpdateIPSetCommand = async ( input: UpdateIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateIPSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1314,10 +1110,7 @@ export const serializeAws_json1_1UpdateRateBasedRuleCommand = async ( input: UpdateRateBasedRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateRateBasedRule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRateBasedRule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRateBasedRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1327,10 +1120,7 @@ export const serializeAws_json1_1UpdateRegexMatchSetCommand = async ( input: UpdateRegexMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateRegexMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRegexMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRegexMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1340,10 +1130,7 @@ export const serializeAws_json1_1UpdateRegexPatternSetCommand = async ( input: UpdateRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1353,10 +1140,7 @@ export const serializeAws_json1_1UpdateRuleCommand = async ( input: UpdateRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateRule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1366,10 +1150,7 @@ export const serializeAws_json1_1UpdateRuleGroupCommand = async ( input: UpdateRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1379,10 +1160,7 @@ export const serializeAws_json1_1UpdateSizeConstraintSetCommand = async ( input: UpdateSizeConstraintSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateSizeConstraintSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSizeConstraintSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSizeConstraintSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1392,10 +1170,7 @@ export const serializeAws_json1_1UpdateSqlInjectionMatchSetCommand = async ( input: UpdateSqlInjectionMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateSqlInjectionMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateSqlInjectionMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateSqlInjectionMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1405,10 +1180,7 @@ export const serializeAws_json1_1UpdateWebACLCommand = async ( input: UpdateWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateWebACL", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1418,10 +1190,7 @@ export const serializeAws_json1_1UpdateXssMatchSetCommand = async ( input: UpdateXssMatchSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20150824.UpdateXssMatchSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateXssMatchSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateXssMatchSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -8470,6 +8239,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSWAF_20150824.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-wafv2/src/protocols/Aws_json1_1.ts b/clients/client-wafv2/src/protocols/Aws_json1_1.ts index f9078a1d4b8f1..5f002b0c5d5be 100644 --- a/clients/client-wafv2/src/protocols/Aws_json1_1.ts +++ b/clients/client-wafv2/src/protocols/Aws_json1_1.ts @@ -366,10 +366,7 @@ export const serializeAws_json1_1AssociateWebACLCommand = async ( input: AssociateWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.AssociateWebACL", - }; + const headers: __HeaderBag = sharedHeaders("AssociateWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -379,10 +376,7 @@ export const serializeAws_json1_1CheckCapacityCommand = async ( input: CheckCapacityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.CheckCapacity", - }; + const headers: __HeaderBag = sharedHeaders("CheckCapacity"); let body: any; body = JSON.stringify(serializeAws_json1_1CheckCapacityRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -392,10 +386,7 @@ export const serializeAws_json1_1CreateIPSetCommand = async ( input: CreateIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.CreateIPSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -405,10 +396,7 @@ export const serializeAws_json1_1CreateRegexPatternSetCommand = async ( input: CreateRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.CreateRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("CreateRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -418,10 +406,7 @@ export const serializeAws_json1_1CreateRuleGroupCommand = async ( input: CreateRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.CreateRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -431,10 +416,7 @@ export const serializeAws_json1_1CreateWebACLCommand = async ( input: CreateWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.CreateWebACL", - }; + const headers: __HeaderBag = sharedHeaders("CreateWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -444,10 +426,7 @@ export const serializeAws_json1_1DeleteFirewallManagerRuleGroupsCommand = async input: DeleteFirewallManagerRuleGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.DeleteFirewallManagerRuleGroups", - }; + const headers: __HeaderBag = sharedHeaders("DeleteFirewallManagerRuleGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteFirewallManagerRuleGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -457,10 +436,7 @@ export const serializeAws_json1_1DeleteIPSetCommand = async ( input: DeleteIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.DeleteIPSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -470,10 +446,7 @@ export const serializeAws_json1_1DeleteLoggingConfigurationCommand = async ( input: DeleteLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.DeleteLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -483,10 +456,7 @@ export const serializeAws_json1_1DeletePermissionPolicyCommand = async ( input: DeletePermissionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.DeletePermissionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeletePermissionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeletePermissionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -496,10 +466,7 @@ export const serializeAws_json1_1DeleteRegexPatternSetCommand = async ( input: DeleteRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.DeleteRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -509,10 +476,7 @@ export const serializeAws_json1_1DeleteRuleGroupCommand = async ( input: DeleteRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.DeleteRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -522,10 +486,7 @@ export const serializeAws_json1_1DeleteWebACLCommand = async ( input: DeleteWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.DeleteWebACL", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -535,10 +496,7 @@ export const serializeAws_json1_1DescribeManagedRuleGroupCommand = async ( input: DescribeManagedRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.DescribeManagedRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeManagedRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeManagedRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -548,10 +506,7 @@ export const serializeAws_json1_1DisassociateWebACLCommand = async ( input: DisassociateWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.DisassociateWebACL", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -561,10 +516,7 @@ export const serializeAws_json1_1GenerateMobileSdkReleaseUrlCommand = async ( input: GenerateMobileSdkReleaseUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GenerateMobileSdkReleaseUrl", - }; + const headers: __HeaderBag = sharedHeaders("GenerateMobileSdkReleaseUrl"); let body: any; body = JSON.stringify(serializeAws_json1_1GenerateMobileSdkReleaseUrlRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -574,10 +526,7 @@ export const serializeAws_json1_1GetIPSetCommand = async ( input: GetIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetIPSet", - }; + const headers: __HeaderBag = sharedHeaders("GetIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -587,10 +536,7 @@ export const serializeAws_json1_1GetLoggingConfigurationCommand = async ( input: GetLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("GetLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1GetLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -600,10 +546,7 @@ export const serializeAws_json1_1GetManagedRuleSetCommand = async ( input: GetManagedRuleSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetManagedRuleSet", - }; + const headers: __HeaderBag = sharedHeaders("GetManagedRuleSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetManagedRuleSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -613,10 +556,7 @@ export const serializeAws_json1_1GetMobileSdkReleaseCommand = async ( input: GetMobileSdkReleaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetMobileSdkRelease", - }; + const headers: __HeaderBag = sharedHeaders("GetMobileSdkRelease"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMobileSdkReleaseRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -626,10 +566,7 @@ export const serializeAws_json1_1GetPermissionPolicyCommand = async ( input: GetPermissionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetPermissionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetPermissionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetPermissionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -639,10 +576,7 @@ export const serializeAws_json1_1GetRateBasedStatementManagedKeysCommand = async input: GetRateBasedStatementManagedKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetRateBasedStatementManagedKeys", - }; + const headers: __HeaderBag = sharedHeaders("GetRateBasedStatementManagedKeys"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRateBasedStatementManagedKeysRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -652,10 +586,7 @@ export const serializeAws_json1_1GetRegexPatternSetCommand = async ( input: GetRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("GetRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -665,10 +596,7 @@ export const serializeAws_json1_1GetRuleGroupCommand = async ( input: GetRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("GetRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1GetRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -678,10 +606,7 @@ export const serializeAws_json1_1GetSampledRequestsCommand = async ( input: GetSampledRequestsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetSampledRequests", - }; + const headers: __HeaderBag = sharedHeaders("GetSampledRequests"); let body: any; body = JSON.stringify(serializeAws_json1_1GetSampledRequestsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -691,10 +616,7 @@ export const serializeAws_json1_1GetWebACLCommand = async ( input: GetWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetWebACL", - }; + const headers: __HeaderBag = sharedHeaders("GetWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -704,10 +626,7 @@ export const serializeAws_json1_1GetWebACLForResourceCommand = async ( input: GetWebACLForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.GetWebACLForResource", - }; + const headers: __HeaderBag = sharedHeaders("GetWebACLForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1GetWebACLForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -717,10 +636,7 @@ export const serializeAws_json1_1ListAvailableManagedRuleGroupsCommand = async ( input: ListAvailableManagedRuleGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListAvailableManagedRuleGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListAvailableManagedRuleGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAvailableManagedRuleGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -730,10 +646,7 @@ export const serializeAws_json1_1ListAvailableManagedRuleGroupVersionsCommand = input: ListAvailableManagedRuleGroupVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListAvailableManagedRuleGroupVersions", - }; + const headers: __HeaderBag = sharedHeaders("ListAvailableManagedRuleGroupVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAvailableManagedRuleGroupVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -743,10 +656,7 @@ export const serializeAws_json1_1ListIPSetsCommand = async ( input: ListIPSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListIPSets", - }; + const headers: __HeaderBag = sharedHeaders("ListIPSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListIPSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -756,10 +666,7 @@ export const serializeAws_json1_1ListLoggingConfigurationsCommand = async ( input: ListLoggingConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListLoggingConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListLoggingConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListLoggingConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -769,10 +676,7 @@ export const serializeAws_json1_1ListManagedRuleSetsCommand = async ( input: ListManagedRuleSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListManagedRuleSets", - }; + const headers: __HeaderBag = sharedHeaders("ListManagedRuleSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListManagedRuleSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -782,10 +686,7 @@ export const serializeAws_json1_1ListMobileSdkReleasesCommand = async ( input: ListMobileSdkReleasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListMobileSdkReleases", - }; + const headers: __HeaderBag = sharedHeaders("ListMobileSdkReleases"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMobileSdkReleasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -795,10 +696,7 @@ export const serializeAws_json1_1ListRegexPatternSetsCommand = async ( input: ListRegexPatternSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListRegexPatternSets", - }; + const headers: __HeaderBag = sharedHeaders("ListRegexPatternSets"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRegexPatternSetsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -808,10 +706,7 @@ export const serializeAws_json1_1ListResourcesForWebACLCommand = async ( input: ListResourcesForWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListResourcesForWebACL", - }; + const headers: __HeaderBag = sharedHeaders("ListResourcesForWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourcesForWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -821,10 +716,7 @@ export const serializeAws_json1_1ListRuleGroupsCommand = async ( input: ListRuleGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListRuleGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListRuleGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListRuleGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -834,10 +726,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -847,10 +736,7 @@ export const serializeAws_json1_1ListWebACLsCommand = async ( input: ListWebACLsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.ListWebACLs", - }; + const headers: __HeaderBag = sharedHeaders("ListWebACLs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListWebACLsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -860,10 +746,7 @@ export const serializeAws_json1_1PutLoggingConfigurationCommand = async ( input: PutLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.PutLoggingConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutLoggingConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutLoggingConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -873,10 +756,7 @@ export const serializeAws_json1_1PutManagedRuleSetVersionsCommand = async ( input: PutManagedRuleSetVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.PutManagedRuleSetVersions", - }; + const headers: __HeaderBag = sharedHeaders("PutManagedRuleSetVersions"); let body: any; body = JSON.stringify(serializeAws_json1_1PutManagedRuleSetVersionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -886,10 +766,7 @@ export const serializeAws_json1_1PutPermissionPolicyCommand = async ( input: PutPermissionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.PutPermissionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutPermissionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutPermissionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -899,10 +776,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -912,10 +786,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -925,10 +796,7 @@ export const serializeAws_json1_1UpdateIPSetCommand = async ( input: UpdateIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.UpdateIPSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateIPSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateIPSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -938,10 +806,7 @@ export const serializeAws_json1_1UpdateManagedRuleSetVersionExpiryDateCommand = input: UpdateManagedRuleSetVersionExpiryDateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.UpdateManagedRuleSetVersionExpiryDate", - }; + const headers: __HeaderBag = sharedHeaders("UpdateManagedRuleSetVersionExpiryDate"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateManagedRuleSetVersionExpiryDateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -951,10 +816,7 @@ export const serializeAws_json1_1UpdateRegexPatternSetCommand = async ( input: UpdateRegexPatternSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.UpdateRegexPatternSet", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRegexPatternSet"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRegexPatternSetRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -964,10 +826,7 @@ export const serializeAws_json1_1UpdateRuleGroupCommand = async ( input: UpdateRuleGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.UpdateRuleGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRuleGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRuleGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -977,10 +836,7 @@ export const serializeAws_json1_1UpdateWebACLCommand = async ( input: UpdateWebACLCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "AWSWAF_20190729.UpdateWebACL", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWebACL"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWebACLRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -7752,6 +7608,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AWSWAF_20190729.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-workmail/src/protocols/Aws_json1_1.ts b/clients/client-workmail/src/protocols/Aws_json1_1.ts index 37d963a3d7732..86d3aafc255b0 100644 --- a/clients/client-workmail/src/protocols/Aws_json1_1.ts +++ b/clients/client-workmail/src/protocols/Aws_json1_1.ts @@ -466,10 +466,7 @@ export const serializeAws_json1_1AssociateDelegateToResourceCommand = async ( input: AssociateDelegateToResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.AssociateDelegateToResource", - }; + const headers: __HeaderBag = sharedHeaders("AssociateDelegateToResource"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateDelegateToResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -479,10 +476,7 @@ export const serializeAws_json1_1AssociateMemberToGroupCommand = async ( input: AssociateMemberToGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.AssociateMemberToGroup", - }; + const headers: __HeaderBag = sharedHeaders("AssociateMemberToGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateMemberToGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -492,10 +486,7 @@ export const serializeAws_json1_1AssumeImpersonationRoleCommand = async ( input: AssumeImpersonationRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.AssumeImpersonationRole", - }; + const headers: __HeaderBag = sharedHeaders("AssumeImpersonationRole"); let body: any; body = JSON.stringify(serializeAws_json1_1AssumeImpersonationRoleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -505,10 +496,7 @@ export const serializeAws_json1_1CancelMailboxExportJobCommand = async ( input: CancelMailboxExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.CancelMailboxExportJob", - }; + const headers: __HeaderBag = sharedHeaders("CancelMailboxExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1CancelMailboxExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -518,10 +506,7 @@ export const serializeAws_json1_1CreateAliasCommand = async ( input: CreateAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.CreateAlias", - }; + const headers: __HeaderBag = sharedHeaders("CreateAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAliasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -531,10 +516,7 @@ export const serializeAws_json1_1CreateAvailabilityConfigurationCommand = async input: CreateAvailabilityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.CreateAvailabilityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("CreateAvailabilityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateAvailabilityConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -544,10 +526,7 @@ export const serializeAws_json1_1CreateGroupCommand = async ( input: CreateGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.CreateGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -557,10 +536,7 @@ export const serializeAws_json1_1CreateImpersonationRoleCommand = async ( input: CreateImpersonationRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.CreateImpersonationRole", - }; + const headers: __HeaderBag = sharedHeaders("CreateImpersonationRole"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateImpersonationRoleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -570,10 +546,7 @@ export const serializeAws_json1_1CreateMobileDeviceAccessRuleCommand = async ( input: CreateMobileDeviceAccessRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.CreateMobileDeviceAccessRule", - }; + const headers: __HeaderBag = sharedHeaders("CreateMobileDeviceAccessRule"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateMobileDeviceAccessRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -583,10 +556,7 @@ export const serializeAws_json1_1CreateOrganizationCommand = async ( input: CreateOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.CreateOrganization", - }; + const headers: __HeaderBag = sharedHeaders("CreateOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -596,10 +566,7 @@ export const serializeAws_json1_1CreateResourceCommand = async ( input: CreateResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.CreateResource", - }; + const headers: __HeaderBag = sharedHeaders("CreateResource"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -609,10 +576,7 @@ export const serializeAws_json1_1CreateUserCommand = async ( input: CreateUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.CreateUser", - }; + const headers: __HeaderBag = sharedHeaders("CreateUser"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -622,10 +586,7 @@ export const serializeAws_json1_1DeleteAccessControlRuleCommand = async ( input: DeleteAccessControlRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteAccessControlRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAccessControlRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAccessControlRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -635,10 +596,7 @@ export const serializeAws_json1_1DeleteAliasCommand = async ( input: DeleteAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteAlias", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAliasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -648,10 +606,7 @@ export const serializeAws_json1_1DeleteAvailabilityConfigurationCommand = async input: DeleteAvailabilityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteAvailabilityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteAvailabilityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteAvailabilityConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -661,10 +616,7 @@ export const serializeAws_json1_1DeleteEmailMonitoringConfigurationCommand = asy input: DeleteEmailMonitoringConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteEmailMonitoringConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DeleteEmailMonitoringConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteEmailMonitoringConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -674,10 +626,7 @@ export const serializeAws_json1_1DeleteGroupCommand = async ( input: DeleteGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -687,10 +636,7 @@ export const serializeAws_json1_1DeleteImpersonationRoleCommand = async ( input: DeleteImpersonationRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteImpersonationRole", - }; + const headers: __HeaderBag = sharedHeaders("DeleteImpersonationRole"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteImpersonationRoleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -700,10 +646,7 @@ export const serializeAws_json1_1DeleteMailboxPermissionsCommand = async ( input: DeleteMailboxPermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteMailboxPermissions", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMailboxPermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMailboxPermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -713,10 +656,7 @@ export const serializeAws_json1_1DeleteMobileDeviceAccessOverrideCommand = async input: DeleteMobileDeviceAccessOverrideCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteMobileDeviceAccessOverride", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMobileDeviceAccessOverride"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMobileDeviceAccessOverrideRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -726,10 +666,7 @@ export const serializeAws_json1_1DeleteMobileDeviceAccessRuleCommand = async ( input: DeleteMobileDeviceAccessRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteMobileDeviceAccessRule", - }; + const headers: __HeaderBag = sharedHeaders("DeleteMobileDeviceAccessRule"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteMobileDeviceAccessRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -739,10 +676,7 @@ export const serializeAws_json1_1DeleteOrganizationCommand = async ( input: DeleteOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteOrganization", - }; + const headers: __HeaderBag = sharedHeaders("DeleteOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -752,10 +686,7 @@ export const serializeAws_json1_1DeleteResourceCommand = async ( input: DeleteResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteResource", - }; + const headers: __HeaderBag = sharedHeaders("DeleteResource"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -765,10 +696,7 @@ export const serializeAws_json1_1DeleteRetentionPolicyCommand = async ( input: DeleteRetentionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteRetentionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("DeleteRetentionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteRetentionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -778,10 +706,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeleteUser", - }; + const headers: __HeaderBag = sharedHeaders("DeleteUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -791,10 +716,7 @@ export const serializeAws_json1_1DeregisterFromWorkMailCommand = async ( input: DeregisterFromWorkMailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeregisterFromWorkMail", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterFromWorkMail"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterFromWorkMailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -804,10 +726,7 @@ export const serializeAws_json1_1DeregisterMailDomainCommand = async ( input: DeregisterMailDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DeregisterMailDomain", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterMailDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterMailDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -817,10 +736,7 @@ export const serializeAws_json1_1DescribeEmailMonitoringConfigurationCommand = a input: DescribeEmailMonitoringConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DescribeEmailMonitoringConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("DescribeEmailMonitoringConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeEmailMonitoringConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -830,10 +746,7 @@ export const serializeAws_json1_1DescribeGroupCommand = async ( input: DescribeGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DescribeGroup", - }; + const headers: __HeaderBag = sharedHeaders("DescribeGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -843,10 +756,7 @@ export const serializeAws_json1_1DescribeInboundDmarcSettingsCommand = async ( input: DescribeInboundDmarcSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DescribeInboundDmarcSettings", - }; + const headers: __HeaderBag = sharedHeaders("DescribeInboundDmarcSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeInboundDmarcSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -856,10 +766,7 @@ export const serializeAws_json1_1DescribeMailboxExportJobCommand = async ( input: DescribeMailboxExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DescribeMailboxExportJob", - }; + const headers: __HeaderBag = sharedHeaders("DescribeMailboxExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeMailboxExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -869,10 +776,7 @@ export const serializeAws_json1_1DescribeOrganizationCommand = async ( input: DescribeOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DescribeOrganization", - }; + const headers: __HeaderBag = sharedHeaders("DescribeOrganization"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeOrganizationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -882,10 +786,7 @@ export const serializeAws_json1_1DescribeResourceCommand = async ( input: DescribeResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DescribeResource", - }; + const headers: __HeaderBag = sharedHeaders("DescribeResource"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -895,10 +796,7 @@ export const serializeAws_json1_1DescribeUserCommand = async ( input: DescribeUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DescribeUser", - }; + const headers: __HeaderBag = sharedHeaders("DescribeUser"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeUserRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -908,10 +806,7 @@ export const serializeAws_json1_1DisassociateDelegateFromResourceCommand = async input: DisassociateDelegateFromResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DisassociateDelegateFromResource", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateDelegateFromResource"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateDelegateFromResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -921,10 +816,7 @@ export const serializeAws_json1_1DisassociateMemberFromGroupCommand = async ( input: DisassociateMemberFromGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.DisassociateMemberFromGroup", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateMemberFromGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateMemberFromGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -934,10 +826,7 @@ export const serializeAws_json1_1GetAccessControlEffectCommand = async ( input: GetAccessControlEffectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.GetAccessControlEffect", - }; + const headers: __HeaderBag = sharedHeaders("GetAccessControlEffect"); let body: any; body = JSON.stringify(serializeAws_json1_1GetAccessControlEffectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -947,10 +836,7 @@ export const serializeAws_json1_1GetDefaultRetentionPolicyCommand = async ( input: GetDefaultRetentionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.GetDefaultRetentionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("GetDefaultRetentionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1GetDefaultRetentionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -960,10 +846,7 @@ export const serializeAws_json1_1GetImpersonationRoleCommand = async ( input: GetImpersonationRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.GetImpersonationRole", - }; + const headers: __HeaderBag = sharedHeaders("GetImpersonationRole"); let body: any; body = JSON.stringify(serializeAws_json1_1GetImpersonationRoleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -973,10 +856,7 @@ export const serializeAws_json1_1GetImpersonationRoleEffectCommand = async ( input: GetImpersonationRoleEffectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.GetImpersonationRoleEffect", - }; + const headers: __HeaderBag = sharedHeaders("GetImpersonationRoleEffect"); let body: any; body = JSON.stringify(serializeAws_json1_1GetImpersonationRoleEffectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -986,10 +866,7 @@ export const serializeAws_json1_1GetMailboxDetailsCommand = async ( input: GetMailboxDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.GetMailboxDetails", - }; + const headers: __HeaderBag = sharedHeaders("GetMailboxDetails"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMailboxDetailsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -999,10 +876,7 @@ export const serializeAws_json1_1GetMailDomainCommand = async ( input: GetMailDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.GetMailDomain", - }; + const headers: __HeaderBag = sharedHeaders("GetMailDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMailDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1012,10 +886,7 @@ export const serializeAws_json1_1GetMobileDeviceAccessEffectCommand = async ( input: GetMobileDeviceAccessEffectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.GetMobileDeviceAccessEffect", - }; + const headers: __HeaderBag = sharedHeaders("GetMobileDeviceAccessEffect"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMobileDeviceAccessEffectRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1025,10 +896,7 @@ export const serializeAws_json1_1GetMobileDeviceAccessOverrideCommand = async ( input: GetMobileDeviceAccessOverrideCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.GetMobileDeviceAccessOverride", - }; + const headers: __HeaderBag = sharedHeaders("GetMobileDeviceAccessOverride"); let body: any; body = JSON.stringify(serializeAws_json1_1GetMobileDeviceAccessOverrideRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1038,10 +906,7 @@ export const serializeAws_json1_1ListAccessControlRulesCommand = async ( input: ListAccessControlRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListAccessControlRules", - }; + const headers: __HeaderBag = sharedHeaders("ListAccessControlRules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAccessControlRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1051,10 +916,7 @@ export const serializeAws_json1_1ListAliasesCommand = async ( input: ListAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListAliases", - }; + const headers: __HeaderBag = sharedHeaders("ListAliases"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAliasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1064,10 +926,7 @@ export const serializeAws_json1_1ListAvailabilityConfigurationsCommand = async ( input: ListAvailabilityConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListAvailabilityConfigurations", - }; + const headers: __HeaderBag = sharedHeaders("ListAvailabilityConfigurations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAvailabilityConfigurationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1077,10 +936,7 @@ export const serializeAws_json1_1ListGroupMembersCommand = async ( input: ListGroupMembersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListGroupMembers", - }; + const headers: __HeaderBag = sharedHeaders("ListGroupMembers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGroupMembersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1090,10 +946,7 @@ export const serializeAws_json1_1ListGroupsCommand = async ( input: ListGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListGroups", - }; + const headers: __HeaderBag = sharedHeaders("ListGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1ListGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1103,10 +956,7 @@ export const serializeAws_json1_1ListImpersonationRolesCommand = async ( input: ListImpersonationRolesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListImpersonationRoles", - }; + const headers: __HeaderBag = sharedHeaders("ListImpersonationRoles"); let body: any; body = JSON.stringify(serializeAws_json1_1ListImpersonationRolesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1116,10 +966,7 @@ export const serializeAws_json1_1ListMailboxExportJobsCommand = async ( input: ListMailboxExportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListMailboxExportJobs", - }; + const headers: __HeaderBag = sharedHeaders("ListMailboxExportJobs"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMailboxExportJobsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1129,10 +976,7 @@ export const serializeAws_json1_1ListMailboxPermissionsCommand = async ( input: ListMailboxPermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListMailboxPermissions", - }; + const headers: __HeaderBag = sharedHeaders("ListMailboxPermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMailboxPermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1142,10 +986,7 @@ export const serializeAws_json1_1ListMailDomainsCommand = async ( input: ListMailDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListMailDomains", - }; + const headers: __HeaderBag = sharedHeaders("ListMailDomains"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMailDomainsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1155,10 +996,7 @@ export const serializeAws_json1_1ListMobileDeviceAccessOverridesCommand = async input: ListMobileDeviceAccessOverridesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListMobileDeviceAccessOverrides", - }; + const headers: __HeaderBag = sharedHeaders("ListMobileDeviceAccessOverrides"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMobileDeviceAccessOverridesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1168,10 +1006,7 @@ export const serializeAws_json1_1ListMobileDeviceAccessRulesCommand = async ( input: ListMobileDeviceAccessRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListMobileDeviceAccessRules", - }; + const headers: __HeaderBag = sharedHeaders("ListMobileDeviceAccessRules"); let body: any; body = JSON.stringify(serializeAws_json1_1ListMobileDeviceAccessRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1181,10 +1016,7 @@ export const serializeAws_json1_1ListOrganizationsCommand = async ( input: ListOrganizationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListOrganizations", - }; + const headers: __HeaderBag = sharedHeaders("ListOrganizations"); let body: any; body = JSON.stringify(serializeAws_json1_1ListOrganizationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1194,10 +1026,7 @@ export const serializeAws_json1_1ListResourceDelegatesCommand = async ( input: ListResourceDelegatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListResourceDelegates", - }; + const headers: __HeaderBag = sharedHeaders("ListResourceDelegates"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourceDelegatesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1207,10 +1036,7 @@ export const serializeAws_json1_1ListResourcesCommand = async ( input: ListResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListResources", - }; + const headers: __HeaderBag = sharedHeaders("ListResources"); let body: any; body = JSON.stringify(serializeAws_json1_1ListResourcesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1220,10 +1046,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListTagsForResource", - }; + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); let body: any; body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1233,10 +1056,7 @@ export const serializeAws_json1_1ListUsersCommand = async ( input: ListUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ListUsers", - }; + const headers: __HeaderBag = sharedHeaders("ListUsers"); let body: any; body = JSON.stringify(serializeAws_json1_1ListUsersRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1246,10 +1066,7 @@ export const serializeAws_json1_1PutAccessControlRuleCommand = async ( input: PutAccessControlRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.PutAccessControlRule", - }; + const headers: __HeaderBag = sharedHeaders("PutAccessControlRule"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAccessControlRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1259,10 +1076,7 @@ export const serializeAws_json1_1PutEmailMonitoringConfigurationCommand = async input: PutEmailMonitoringConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.PutEmailMonitoringConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("PutEmailMonitoringConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1PutEmailMonitoringConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1272,10 +1086,7 @@ export const serializeAws_json1_1PutInboundDmarcSettingsCommand = async ( input: PutInboundDmarcSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.PutInboundDmarcSettings", - }; + const headers: __HeaderBag = sharedHeaders("PutInboundDmarcSettings"); let body: any; body = JSON.stringify(serializeAws_json1_1PutInboundDmarcSettingsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1285,10 +1096,7 @@ export const serializeAws_json1_1PutMailboxPermissionsCommand = async ( input: PutMailboxPermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.PutMailboxPermissions", - }; + const headers: __HeaderBag = sharedHeaders("PutMailboxPermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1PutMailboxPermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1298,10 +1106,7 @@ export const serializeAws_json1_1PutMobileDeviceAccessOverrideCommand = async ( input: PutMobileDeviceAccessOverrideCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.PutMobileDeviceAccessOverride", - }; + const headers: __HeaderBag = sharedHeaders("PutMobileDeviceAccessOverride"); let body: any; body = JSON.stringify(serializeAws_json1_1PutMobileDeviceAccessOverrideRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1311,10 +1116,7 @@ export const serializeAws_json1_1PutRetentionPolicyCommand = async ( input: PutRetentionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.PutRetentionPolicy", - }; + const headers: __HeaderBag = sharedHeaders("PutRetentionPolicy"); let body: any; body = JSON.stringify(serializeAws_json1_1PutRetentionPolicyRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1324,10 +1126,7 @@ export const serializeAws_json1_1RegisterMailDomainCommand = async ( input: RegisterMailDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.RegisterMailDomain", - }; + const headers: __HeaderBag = sharedHeaders("RegisterMailDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterMailDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1337,10 +1136,7 @@ export const serializeAws_json1_1RegisterToWorkMailCommand = async ( input: RegisterToWorkMailCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.RegisterToWorkMail", - }; + const headers: __HeaderBag = sharedHeaders("RegisterToWorkMail"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterToWorkMailRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1350,10 +1146,7 @@ export const serializeAws_json1_1ResetPasswordCommand = async ( input: ResetPasswordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.ResetPassword", - }; + const headers: __HeaderBag = sharedHeaders("ResetPassword"); let body: any; body = JSON.stringify(serializeAws_json1_1ResetPasswordRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1363,10 +1156,7 @@ export const serializeAws_json1_1StartMailboxExportJobCommand = async ( input: StartMailboxExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.StartMailboxExportJob", - }; + const headers: __HeaderBag = sharedHeaders("StartMailboxExportJob"); let body: any; body = JSON.stringify(serializeAws_json1_1StartMailboxExportJobRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1376,10 +1166,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( input: TagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.TagResource", - }; + const headers: __HeaderBag = sharedHeaders("TagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1389,10 +1176,7 @@ export const serializeAws_json1_1TestAvailabilityConfigurationCommand = async ( input: TestAvailabilityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.TestAvailabilityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("TestAvailabilityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1TestAvailabilityConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1402,10 +1186,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.UntagResource", - }; + const headers: __HeaderBag = sharedHeaders("UntagResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1415,10 +1196,7 @@ export const serializeAws_json1_1UpdateAvailabilityConfigurationCommand = async input: UpdateAvailabilityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.UpdateAvailabilityConfiguration", - }; + const headers: __HeaderBag = sharedHeaders("UpdateAvailabilityConfiguration"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateAvailabilityConfigurationRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1428,10 +1206,7 @@ export const serializeAws_json1_1UpdateDefaultMailDomainCommand = async ( input: UpdateDefaultMailDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.UpdateDefaultMailDomain", - }; + const headers: __HeaderBag = sharedHeaders("UpdateDefaultMailDomain"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateDefaultMailDomainRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1441,10 +1216,7 @@ export const serializeAws_json1_1UpdateImpersonationRoleCommand = async ( input: UpdateImpersonationRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.UpdateImpersonationRole", - }; + const headers: __HeaderBag = sharedHeaders("UpdateImpersonationRole"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateImpersonationRoleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1454,10 +1226,7 @@ export const serializeAws_json1_1UpdateMailboxQuotaCommand = async ( input: UpdateMailboxQuotaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.UpdateMailboxQuota", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMailboxQuota"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMailboxQuotaRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1467,10 +1236,7 @@ export const serializeAws_json1_1UpdateMobileDeviceAccessRuleCommand = async ( input: UpdateMobileDeviceAccessRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.UpdateMobileDeviceAccessRule", - }; + const headers: __HeaderBag = sharedHeaders("UpdateMobileDeviceAccessRule"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateMobileDeviceAccessRuleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1480,10 +1246,7 @@ export const serializeAws_json1_1UpdatePrimaryEmailAddressCommand = async ( input: UpdatePrimaryEmailAddressCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.UpdatePrimaryEmailAddress", - }; + const headers: __HeaderBag = sharedHeaders("UpdatePrimaryEmailAddress"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdatePrimaryEmailAddressRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1493,10 +1256,7 @@ export const serializeAws_json1_1UpdateResourceCommand = async ( input: UpdateResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkMailService.UpdateResource", - }; + const headers: __HeaderBag = sharedHeaders("UpdateResource"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateResourceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -8700,6 +8460,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `WorkMailService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/clients/client-workspaces/src/protocols/Aws_json1_1.ts b/clients/client-workspaces/src/protocols/Aws_json1_1.ts index c7150999381c3..10873a3e29db8 100644 --- a/clients/client-workspaces/src/protocols/Aws_json1_1.ts +++ b/clients/client-workspaces/src/protocols/Aws_json1_1.ts @@ -420,10 +420,7 @@ export const serializeAws_json1_1AssociateConnectionAliasCommand = async ( input: AssociateConnectionAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.AssociateConnectionAlias", - }; + const headers: __HeaderBag = sharedHeaders("AssociateConnectionAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateConnectionAliasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -433,10 +430,7 @@ export const serializeAws_json1_1AssociateIpGroupsCommand = async ( input: AssociateIpGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.AssociateIpGroups", - }; + const headers: __HeaderBag = sharedHeaders("AssociateIpGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1AssociateIpGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -446,10 +440,7 @@ export const serializeAws_json1_1AuthorizeIpRulesCommand = async ( input: AuthorizeIpRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.AuthorizeIpRules", - }; + const headers: __HeaderBag = sharedHeaders("AuthorizeIpRules"); let body: any; body = JSON.stringify(serializeAws_json1_1AuthorizeIpRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -459,10 +450,7 @@ export const serializeAws_json1_1CopyWorkspaceImageCommand = async ( input: CopyWorkspaceImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.CopyWorkspaceImage", - }; + const headers: __HeaderBag = sharedHeaders("CopyWorkspaceImage"); let body: any; body = JSON.stringify(serializeAws_json1_1CopyWorkspaceImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -472,10 +460,7 @@ export const serializeAws_json1_1CreateConnectClientAddInCommand = async ( input: CreateConnectClientAddInCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.CreateConnectClientAddIn", - }; + const headers: __HeaderBag = sharedHeaders("CreateConnectClientAddIn"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateConnectClientAddInRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -485,10 +470,7 @@ export const serializeAws_json1_1CreateConnectionAliasCommand = async ( input: CreateConnectionAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.CreateConnectionAlias", - }; + const headers: __HeaderBag = sharedHeaders("CreateConnectionAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateConnectionAliasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -498,10 +480,7 @@ export const serializeAws_json1_1CreateIpGroupCommand = async ( input: CreateIpGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.CreateIpGroup", - }; + const headers: __HeaderBag = sharedHeaders("CreateIpGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateIpGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -511,10 +490,7 @@ export const serializeAws_json1_1CreateStandbyWorkspacesCommand = async ( input: CreateStandbyWorkspacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.CreateStandbyWorkspaces", - }; + const headers: __HeaderBag = sharedHeaders("CreateStandbyWorkspaces"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateStandbyWorkspacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -524,10 +500,7 @@ export const serializeAws_json1_1CreateTagsCommand = async ( input: CreateTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.CreateTags", - }; + const headers: __HeaderBag = sharedHeaders("CreateTags"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -537,10 +510,7 @@ export const serializeAws_json1_1CreateUpdatedWorkspaceImageCommand = async ( input: CreateUpdatedWorkspaceImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.CreateUpdatedWorkspaceImage", - }; + const headers: __HeaderBag = sharedHeaders("CreateUpdatedWorkspaceImage"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateUpdatedWorkspaceImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -550,10 +520,7 @@ export const serializeAws_json1_1CreateWorkspaceBundleCommand = async ( input: CreateWorkspaceBundleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.CreateWorkspaceBundle", - }; + const headers: __HeaderBag = sharedHeaders("CreateWorkspaceBundle"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWorkspaceBundleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -563,10 +530,7 @@ export const serializeAws_json1_1CreateWorkspaceImageCommand = async ( input: CreateWorkspaceImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.CreateWorkspaceImage", - }; + const headers: __HeaderBag = sharedHeaders("CreateWorkspaceImage"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWorkspaceImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -576,10 +540,7 @@ export const serializeAws_json1_1CreateWorkspacesCommand = async ( input: CreateWorkspacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.CreateWorkspaces", - }; + const headers: __HeaderBag = sharedHeaders("CreateWorkspaces"); let body: any; body = JSON.stringify(serializeAws_json1_1CreateWorkspacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -589,10 +550,7 @@ export const serializeAws_json1_1DeleteClientBrandingCommand = async ( input: DeleteClientBrandingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DeleteClientBranding", - }; + const headers: __HeaderBag = sharedHeaders("DeleteClientBranding"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteClientBrandingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -602,10 +560,7 @@ export const serializeAws_json1_1DeleteConnectClientAddInCommand = async ( input: DeleteConnectClientAddInCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DeleteConnectClientAddIn", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConnectClientAddIn"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConnectClientAddInRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -615,10 +570,7 @@ export const serializeAws_json1_1DeleteConnectionAliasCommand = async ( input: DeleteConnectionAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DeleteConnectionAlias", - }; + const headers: __HeaderBag = sharedHeaders("DeleteConnectionAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteConnectionAliasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -628,10 +580,7 @@ export const serializeAws_json1_1DeleteIpGroupCommand = async ( input: DeleteIpGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DeleteIpGroup", - }; + const headers: __HeaderBag = sharedHeaders("DeleteIpGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteIpGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -641,10 +590,7 @@ export const serializeAws_json1_1DeleteTagsCommand = async ( input: DeleteTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DeleteTags", - }; + const headers: __HeaderBag = sharedHeaders("DeleteTags"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -654,10 +600,7 @@ export const serializeAws_json1_1DeleteWorkspaceBundleCommand = async ( input: DeleteWorkspaceBundleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DeleteWorkspaceBundle", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWorkspaceBundle"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWorkspaceBundleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -667,10 +610,7 @@ export const serializeAws_json1_1DeleteWorkspaceImageCommand = async ( input: DeleteWorkspaceImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DeleteWorkspaceImage", - }; + const headers: __HeaderBag = sharedHeaders("DeleteWorkspaceImage"); let body: any; body = JSON.stringify(serializeAws_json1_1DeleteWorkspaceImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -680,10 +620,7 @@ export const serializeAws_json1_1DeregisterWorkspaceDirectoryCommand = async ( input: DeregisterWorkspaceDirectoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DeregisterWorkspaceDirectory", - }; + const headers: __HeaderBag = sharedHeaders("DeregisterWorkspaceDirectory"); let body: any; body = JSON.stringify(serializeAws_json1_1DeregisterWorkspaceDirectoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -693,10 +630,7 @@ export const serializeAws_json1_1DescribeAccountCommand = async ( input: DescribeAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeAccount", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -706,10 +640,7 @@ export const serializeAws_json1_1DescribeAccountModificationsCommand = async ( input: DescribeAccountModificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeAccountModifications", - }; + const headers: __HeaderBag = sharedHeaders("DescribeAccountModifications"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeAccountModificationsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -719,10 +650,7 @@ export const serializeAws_json1_1DescribeClientBrandingCommand = async ( input: DescribeClientBrandingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeClientBranding", - }; + const headers: __HeaderBag = sharedHeaders("DescribeClientBranding"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeClientBrandingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -732,10 +660,7 @@ export const serializeAws_json1_1DescribeClientPropertiesCommand = async ( input: DescribeClientPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeClientProperties", - }; + const headers: __HeaderBag = sharedHeaders("DescribeClientProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeClientPropertiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -745,10 +670,7 @@ export const serializeAws_json1_1DescribeConnectClientAddInsCommand = async ( input: DescribeConnectClientAddInsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeConnectClientAddIns", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConnectClientAddIns"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConnectClientAddInsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -758,10 +680,7 @@ export const serializeAws_json1_1DescribeConnectionAliasesCommand = async ( input: DescribeConnectionAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeConnectionAliases", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConnectionAliases"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConnectionAliasesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -771,10 +690,7 @@ export const serializeAws_json1_1DescribeConnectionAliasPermissionsCommand = asy input: DescribeConnectionAliasPermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeConnectionAliasPermissions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeConnectionAliasPermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeConnectionAliasPermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -784,10 +700,7 @@ export const serializeAws_json1_1DescribeIpGroupsCommand = async ( input: DescribeIpGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeIpGroups", - }; + const headers: __HeaderBag = sharedHeaders("DescribeIpGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeIpGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -797,10 +710,7 @@ export const serializeAws_json1_1DescribeTagsCommand = async ( input: DescribeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeTags", - }; + const headers: __HeaderBag = sharedHeaders("DescribeTags"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeTagsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -810,10 +720,7 @@ export const serializeAws_json1_1DescribeWorkspaceBundlesCommand = async ( input: DescribeWorkspaceBundlesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeWorkspaceBundles", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkspaceBundles"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkspaceBundlesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -823,10 +730,7 @@ export const serializeAws_json1_1DescribeWorkspaceDirectoriesCommand = async ( input: DescribeWorkspaceDirectoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeWorkspaceDirectories", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkspaceDirectories"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkspaceDirectoriesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -836,10 +740,7 @@ export const serializeAws_json1_1DescribeWorkspaceImagePermissionsCommand = asyn input: DescribeWorkspaceImagePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeWorkspaceImagePermissions", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkspaceImagePermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkspaceImagePermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -849,10 +750,7 @@ export const serializeAws_json1_1DescribeWorkspaceImagesCommand = async ( input: DescribeWorkspaceImagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeWorkspaceImages", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkspaceImages"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkspaceImagesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -862,10 +760,7 @@ export const serializeAws_json1_1DescribeWorkspacesCommand = async ( input: DescribeWorkspacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeWorkspaces", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkspaces"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkspacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -875,10 +770,7 @@ export const serializeAws_json1_1DescribeWorkspacesConnectionStatusCommand = asy input: DescribeWorkspacesConnectionStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeWorkspacesConnectionStatus", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkspacesConnectionStatus"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkspacesConnectionStatusRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -888,10 +780,7 @@ export const serializeAws_json1_1DescribeWorkspaceSnapshotsCommand = async ( input: DescribeWorkspaceSnapshotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DescribeWorkspaceSnapshots", - }; + const headers: __HeaderBag = sharedHeaders("DescribeWorkspaceSnapshots"); let body: any; body = JSON.stringify(serializeAws_json1_1DescribeWorkspaceSnapshotsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -901,10 +790,7 @@ export const serializeAws_json1_1DisassociateConnectionAliasCommand = async ( input: DisassociateConnectionAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DisassociateConnectionAlias", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateConnectionAlias"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateConnectionAliasRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -914,10 +800,7 @@ export const serializeAws_json1_1DisassociateIpGroupsCommand = async ( input: DisassociateIpGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.DisassociateIpGroups", - }; + const headers: __HeaderBag = sharedHeaders("DisassociateIpGroups"); let body: any; body = JSON.stringify(serializeAws_json1_1DisassociateIpGroupsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -927,10 +810,7 @@ export const serializeAws_json1_1ImportClientBrandingCommand = async ( input: ImportClientBrandingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ImportClientBranding", - }; + const headers: __HeaderBag = sharedHeaders("ImportClientBranding"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportClientBrandingRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -940,10 +820,7 @@ export const serializeAws_json1_1ImportWorkspaceImageCommand = async ( input: ImportWorkspaceImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ImportWorkspaceImage", - }; + const headers: __HeaderBag = sharedHeaders("ImportWorkspaceImage"); let body: any; body = JSON.stringify(serializeAws_json1_1ImportWorkspaceImageRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -953,10 +830,7 @@ export const serializeAws_json1_1ListAvailableManagementCidrRangesCommand = asyn input: ListAvailableManagementCidrRangesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ListAvailableManagementCidrRanges", - }; + const headers: __HeaderBag = sharedHeaders("ListAvailableManagementCidrRanges"); let body: any; body = JSON.stringify(serializeAws_json1_1ListAvailableManagementCidrRangesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -966,10 +840,7 @@ export const serializeAws_json1_1MigrateWorkspaceCommand = async ( input: MigrateWorkspaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.MigrateWorkspace", - }; + const headers: __HeaderBag = sharedHeaders("MigrateWorkspace"); let body: any; body = JSON.stringify(serializeAws_json1_1MigrateWorkspaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -979,10 +850,7 @@ export const serializeAws_json1_1ModifyAccountCommand = async ( input: ModifyAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ModifyAccount", - }; + const headers: __HeaderBag = sharedHeaders("ModifyAccount"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyAccountRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -992,10 +860,7 @@ export const serializeAws_json1_1ModifyCertificateBasedAuthPropertiesCommand = a input: ModifyCertificateBasedAuthPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ModifyCertificateBasedAuthProperties", - }; + const headers: __HeaderBag = sharedHeaders("ModifyCertificateBasedAuthProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyCertificateBasedAuthPropertiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1005,10 +870,7 @@ export const serializeAws_json1_1ModifyClientPropertiesCommand = async ( input: ModifyClientPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ModifyClientProperties", - }; + const headers: __HeaderBag = sharedHeaders("ModifyClientProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyClientPropertiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1018,10 +880,7 @@ export const serializeAws_json1_1ModifySamlPropertiesCommand = async ( input: ModifySamlPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ModifySamlProperties", - }; + const headers: __HeaderBag = sharedHeaders("ModifySamlProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifySamlPropertiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1031,10 +890,7 @@ export const serializeAws_json1_1ModifySelfservicePermissionsCommand = async ( input: ModifySelfservicePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ModifySelfservicePermissions", - }; + const headers: __HeaderBag = sharedHeaders("ModifySelfservicePermissions"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifySelfservicePermissionsRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1044,10 +900,7 @@ export const serializeAws_json1_1ModifyWorkspaceAccessPropertiesCommand = async input: ModifyWorkspaceAccessPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ModifyWorkspaceAccessProperties", - }; + const headers: __HeaderBag = sharedHeaders("ModifyWorkspaceAccessProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyWorkspaceAccessPropertiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1057,10 +910,7 @@ export const serializeAws_json1_1ModifyWorkspaceCreationPropertiesCommand = asyn input: ModifyWorkspaceCreationPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ModifyWorkspaceCreationProperties", - }; + const headers: __HeaderBag = sharedHeaders("ModifyWorkspaceCreationProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyWorkspaceCreationPropertiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1070,10 +920,7 @@ export const serializeAws_json1_1ModifyWorkspacePropertiesCommand = async ( input: ModifyWorkspacePropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ModifyWorkspaceProperties", - }; + const headers: __HeaderBag = sharedHeaders("ModifyWorkspaceProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyWorkspacePropertiesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1083,10 +930,7 @@ export const serializeAws_json1_1ModifyWorkspaceStateCommand = async ( input: ModifyWorkspaceStateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.ModifyWorkspaceState", - }; + const headers: __HeaderBag = sharedHeaders("ModifyWorkspaceState"); let body: any; body = JSON.stringify(serializeAws_json1_1ModifyWorkspaceStateRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1096,10 +940,7 @@ export const serializeAws_json1_1RebootWorkspacesCommand = async ( input: RebootWorkspacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.RebootWorkspaces", - }; + const headers: __HeaderBag = sharedHeaders("RebootWorkspaces"); let body: any; body = JSON.stringify(serializeAws_json1_1RebootWorkspacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1109,10 +950,7 @@ export const serializeAws_json1_1RebuildWorkspacesCommand = async ( input: RebuildWorkspacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.RebuildWorkspaces", - }; + const headers: __HeaderBag = sharedHeaders("RebuildWorkspaces"); let body: any; body = JSON.stringify(serializeAws_json1_1RebuildWorkspacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1122,10 +960,7 @@ export const serializeAws_json1_1RegisterWorkspaceDirectoryCommand = async ( input: RegisterWorkspaceDirectoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.RegisterWorkspaceDirectory", - }; + const headers: __HeaderBag = sharedHeaders("RegisterWorkspaceDirectory"); let body: any; body = JSON.stringify(serializeAws_json1_1RegisterWorkspaceDirectoryRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1135,10 +970,7 @@ export const serializeAws_json1_1RestoreWorkspaceCommand = async ( input: RestoreWorkspaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.RestoreWorkspace", - }; + const headers: __HeaderBag = sharedHeaders("RestoreWorkspace"); let body: any; body = JSON.stringify(serializeAws_json1_1RestoreWorkspaceRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1148,10 +980,7 @@ export const serializeAws_json1_1RevokeIpRulesCommand = async ( input: RevokeIpRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.RevokeIpRules", - }; + const headers: __HeaderBag = sharedHeaders("RevokeIpRules"); let body: any; body = JSON.stringify(serializeAws_json1_1RevokeIpRulesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1161,10 +990,7 @@ export const serializeAws_json1_1StartWorkspacesCommand = async ( input: StartWorkspacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.StartWorkspaces", - }; + const headers: __HeaderBag = sharedHeaders("StartWorkspaces"); let body: any; body = JSON.stringify(serializeAws_json1_1StartWorkspacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1174,10 +1000,7 @@ export const serializeAws_json1_1StopWorkspacesCommand = async ( input: StopWorkspacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.StopWorkspaces", - }; + const headers: __HeaderBag = sharedHeaders("StopWorkspaces"); let body: any; body = JSON.stringify(serializeAws_json1_1StopWorkspacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1187,10 +1010,7 @@ export const serializeAws_json1_1TerminateWorkspacesCommand = async ( input: TerminateWorkspacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.TerminateWorkspaces", - }; + const headers: __HeaderBag = sharedHeaders("TerminateWorkspaces"); let body: any; body = JSON.stringify(serializeAws_json1_1TerminateWorkspacesRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1200,10 +1020,7 @@ export const serializeAws_json1_1UpdateConnectClientAddInCommand = async ( input: UpdateConnectClientAddInCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.UpdateConnectClientAddIn", - }; + const headers: __HeaderBag = sharedHeaders("UpdateConnectClientAddIn"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateConnectClientAddInRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1213,10 +1030,7 @@ export const serializeAws_json1_1UpdateConnectionAliasPermissionCommand = async input: UpdateConnectionAliasPermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.UpdateConnectionAliasPermission", - }; + const headers: __HeaderBag = sharedHeaders("UpdateConnectionAliasPermission"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateConnectionAliasPermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1226,10 +1040,7 @@ export const serializeAws_json1_1UpdateRulesOfIpGroupCommand = async ( input: UpdateRulesOfIpGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.UpdateRulesOfIpGroup", - }; + const headers: __HeaderBag = sharedHeaders("UpdateRulesOfIpGroup"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateRulesOfIpGroupRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1239,10 +1050,7 @@ export const serializeAws_json1_1UpdateWorkspaceBundleCommand = async ( input: UpdateWorkspaceBundleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.UpdateWorkspaceBundle", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWorkspaceBundle"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWorkspaceBundleRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1252,10 +1060,7 @@ export const serializeAws_json1_1UpdateWorkspaceImagePermissionCommand = async ( input: UpdateWorkspaceImagePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "WorkspacesService.UpdateWorkspaceImagePermission", - }; + const headers: __HeaderBag = sharedHeaders("UpdateWorkspaceImagePermission"); let body: any; body = JSON.stringify(serializeAws_json1_1UpdateWorkspaceImagePermissionRequest(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -7409,6 +7214,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `WorkspacesService.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts b/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts index 7062d89e43a18..dbd3108484141 100644 --- a/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts +++ b/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts @@ -115,9 +115,7 @@ export const serializeAws_ec2DatetimeOffsetsCommand = async ( input: DatetimeOffsetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DatetimeOffsets", Version: "2020-01-08", @@ -129,9 +127,7 @@ export const serializeAws_ec2EmptyInputAndEmptyOutputCommand = async ( input: EmptyInputAndEmptyOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2EmptyInputAndEmptyOutputInput(input, context), @@ -145,9 +141,7 @@ export const serializeAws_ec2EndpointOperationCommand = async ( input: EndpointOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "EndpointOperation", Version: "2020-01-08", @@ -166,9 +160,7 @@ export const serializeAws_ec2EndpointWithHostLabelOperationCommand = async ( input: EndpointWithHostLabelOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2HostLabelInput(input, context), @@ -193,9 +185,7 @@ export const serializeAws_ec2FractionalSecondsCommand = async ( input: FractionalSecondsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "FractionalSeconds", Version: "2020-01-08", @@ -207,9 +197,7 @@ export const serializeAws_ec2GreetingWithErrorsCommand = async ( input: GreetingWithErrorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "GreetingWithErrors", Version: "2020-01-08", @@ -221,9 +209,7 @@ export const serializeAws_ec2HostWithPathOperationCommand = async ( input: HostWithPathOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "HostWithPathOperation", Version: "2020-01-08", @@ -235,9 +221,7 @@ export const serializeAws_ec2IgnoresWrappingXmlNameCommand = async ( input: IgnoresWrappingXmlNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "IgnoresWrappingXmlName", Version: "2020-01-08", @@ -249,9 +233,7 @@ export const serializeAws_ec2NestedStructuresCommand = async ( input: NestedStructuresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2NestedStructuresInput(input, context), @@ -265,9 +247,7 @@ export const serializeAws_ec2NoInputAndOutputCommand = async ( input: NoInputAndOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "NoInputAndOutput", Version: "2020-01-08", @@ -279,9 +259,7 @@ export const serializeAws_ec2QueryIdempotencyTokenAutoFillCommand = async ( input: QueryIdempotencyTokenAutoFillCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2QueryIdempotencyTokenAutoFillInput(input, context), @@ -295,9 +273,7 @@ export const serializeAws_ec2QueryListsCommand = async ( input: QueryListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2QueryListsInput(input, context), @@ -311,9 +287,7 @@ export const serializeAws_ec2QueryTimestampsCommand = async ( input: QueryTimestampsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2QueryTimestampsInput(input, context), @@ -327,9 +301,7 @@ export const serializeAws_ec2RecursiveXmlShapesCommand = async ( input: RecursiveXmlShapesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "RecursiveXmlShapes", Version: "2020-01-08", @@ -341,9 +313,7 @@ export const serializeAws_ec2SimpleInputParamsCommand = async ( input: SimpleInputParamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_ec2SimpleInputParamsInput(input, context), @@ -357,9 +327,7 @@ export const serializeAws_ec2SimpleScalarXmlPropertiesCommand = async ( input: SimpleScalarXmlPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "SimpleScalarXmlProperties", Version: "2020-01-08", @@ -371,9 +339,7 @@ export const serializeAws_ec2XmlBlobsCommand = async ( input: XmlBlobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlBlobs", Version: "2020-01-08", @@ -385,9 +351,7 @@ export const serializeAws_ec2XmlEmptyBlobsCommand = async ( input: XmlEmptyBlobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlEmptyBlobs", Version: "2020-01-08", @@ -399,9 +363,7 @@ export const serializeAws_ec2XmlEmptyListsCommand = async ( input: XmlEmptyListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlEmptyLists", Version: "2020-01-08", @@ -413,9 +375,7 @@ export const serializeAws_ec2XmlEnumsCommand = async ( input: XmlEnumsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlEnums", Version: "2020-01-08", @@ -427,9 +387,7 @@ export const serializeAws_ec2XmlIntEnumsCommand = async ( input: XmlIntEnumsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlIntEnums", Version: "2020-01-08", @@ -441,9 +399,7 @@ export const serializeAws_ec2XmlListsCommand = async ( input: XmlListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlLists", Version: "2020-01-08", @@ -455,9 +411,7 @@ export const serializeAws_ec2XmlNamespacesCommand = async ( input: XmlNamespacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlNamespaces", Version: "2020-01-08", @@ -469,9 +423,7 @@ export const serializeAws_ec2XmlTimestampsCommand = async ( input: XmlTimestampsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlTimestamps", Version: "2020-01-08", @@ -2142,6 +2094,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts b/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts index b236f7d680578..4cacc9110a29b 100644 --- a/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts +++ b/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts @@ -71,10 +71,7 @@ export const serializeAws_json1_0EmptyInputAndEmptyOutputCommand = async ( input: EmptyInputAndEmptyOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "JsonRpc10.EmptyInputAndEmptyOutput", - }; + const headers: __HeaderBag = sharedHeaders("EmptyInputAndEmptyOutput"); let body: any; body = JSON.stringify(serializeAws_json1_0EmptyInputAndEmptyOutputInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -84,10 +81,7 @@ export const serializeAws_json1_0EndpointOperationCommand = async ( input: EndpointOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "JsonRpc10.EndpointOperation", - }; + const headers: __HeaderBag = sharedHeaders("EndpointOperation"); const body = "{}"; let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -103,10 +97,7 @@ export const serializeAws_json1_0EndpointWithHostLabelOperationCommand = async ( input: EndpointWithHostLabelOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "JsonRpc10.EndpointWithHostLabelOperation", - }; + const headers: __HeaderBag = sharedHeaders("EndpointWithHostLabelOperation"); let body: any; body = JSON.stringify(serializeAws_json1_0EndpointWithHostLabelOperationInput(input, context)); let { hostname: resolvedHostname } = await context.endpoint(); @@ -127,10 +118,7 @@ export const serializeAws_json1_0GreetingWithErrorsCommand = async ( input: GreetingWithErrorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "JsonRpc10.GreetingWithErrors", - }; + const headers: __HeaderBag = sharedHeaders("GreetingWithErrors"); let body: any; body = JSON.stringify(serializeAws_json1_0GreetingWithErrorsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -140,10 +128,7 @@ export const serializeAws_json1_0HostWithPathOperationCommand = async ( input: HostWithPathOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "JsonRpc10.HostWithPathOperation", - }; + const headers: __HeaderBag = sharedHeaders("HostWithPathOperation"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -152,10 +137,7 @@ export const serializeAws_json1_0JsonUnionsCommand = async ( input: JsonUnionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "JsonRpc10.JsonUnions", - }; + const headers: __HeaderBag = sharedHeaders("JsonUnions"); let body: any; body = JSON.stringify(serializeAws_json1_0JsonUnionsInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -165,10 +147,7 @@ export const serializeAws_json1_0NoInputAndNoOutputCommand = async ( input: NoInputAndNoOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "JsonRpc10.NoInputAndNoOutput", - }; + const headers: __HeaderBag = sharedHeaders("NoInputAndNoOutput"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -177,10 +156,7 @@ export const serializeAws_json1_0NoInputAndOutputCommand = async ( input: NoInputAndOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "JsonRpc10.NoInputAndOutput", - }; + const headers: __HeaderBag = sharedHeaders("NoInputAndOutput"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -189,10 +165,7 @@ export const serializeAws_json1_0SimpleScalarPropertiesCommand = async ( input: SimpleScalarPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.0", - "x-amz-target": "JsonRpc10.SimpleScalarProperties", - }; + const headers: __HeaderBag = sharedHeaders("SimpleScalarProperties"); let body: any; body = JSON.stringify(serializeAws_json1_0SimpleScalarPropertiesInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -806,6 +779,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `JsonRpc10.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts b/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts index e2981088e8653..18269b6234b10 100644 --- a/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts +++ b/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts @@ -96,10 +96,7 @@ export const serializeAws_json1_1DatetimeOffsetsCommand = async ( input: DatetimeOffsetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.DatetimeOffsets", - }; + const headers: __HeaderBag = sharedHeaders("DatetimeOffsets"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -108,10 +105,7 @@ export const serializeAws_json1_1EmptyOperationCommand = async ( input: EmptyOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.EmptyOperation", - }; + const headers: __HeaderBag = sharedHeaders("EmptyOperation"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -120,10 +114,7 @@ export const serializeAws_json1_1EndpointOperationCommand = async ( input: EndpointOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.EndpointOperation", - }; + const headers: __HeaderBag = sharedHeaders("EndpointOperation"); const body = "{}"; let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -139,10 +130,7 @@ export const serializeAws_json1_1EndpointWithHostLabelOperationCommand = async ( input: EndpointWithHostLabelOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.EndpointWithHostLabelOperation", - }; + const headers: __HeaderBag = sharedHeaders("EndpointWithHostLabelOperation"); let body: any; body = JSON.stringify(serializeAws_json1_1HostLabelInput(input, context)); let { hostname: resolvedHostname } = await context.endpoint(); @@ -163,10 +151,7 @@ export const serializeAws_json1_1FractionalSecondsCommand = async ( input: FractionalSecondsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.FractionalSeconds", - }; + const headers: __HeaderBag = sharedHeaders("FractionalSeconds"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -175,10 +160,7 @@ export const serializeAws_json1_1GreetingWithErrorsCommand = async ( input: GreetingWithErrorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.GreetingWithErrors", - }; + const headers: __HeaderBag = sharedHeaders("GreetingWithErrors"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -187,10 +169,7 @@ export const serializeAws_json1_1HostWithPathOperationCommand = async ( input: HostWithPathOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.HostWithPathOperation", - }; + const headers: __HeaderBag = sharedHeaders("HostWithPathOperation"); const body = "{}"; return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -199,10 +178,7 @@ export const serializeAws_json1_1JsonEnumsCommand = async ( input: JsonEnumsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.JsonEnums", - }; + const headers: __HeaderBag = sharedHeaders("JsonEnums"); let body: any; body = JSON.stringify(serializeAws_json1_1JsonEnumsInputOutput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -212,10 +188,7 @@ export const serializeAws_json1_1JsonUnionsCommand = async ( input: JsonUnionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.JsonUnions", - }; + const headers: __HeaderBag = sharedHeaders("JsonUnions"); let body: any; body = JSON.stringify(serializeAws_json1_1UnionInputOutput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -225,10 +198,7 @@ export const serializeAws_json1_1KitchenSinkOperationCommand = async ( input: KitchenSinkOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.KitchenSinkOperation", - }; + const headers: __HeaderBag = sharedHeaders("KitchenSinkOperation"); let body: any; body = JSON.stringify(serializeAws_json1_1KitchenSink(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -238,10 +208,7 @@ export const serializeAws_json1_1NullOperationCommand = async ( input: NullOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.NullOperation", - }; + const headers: __HeaderBag = sharedHeaders("NullOperation"); let body: any; body = JSON.stringify(serializeAws_json1_1NullOperationInputOutput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -251,10 +218,7 @@ export const serializeAws_json1_1OperationWithOptionalInputOutputCommand = async input: OperationWithOptionalInputOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.OperationWithOptionalInputOutput", - }; + const headers: __HeaderBag = sharedHeaders("OperationWithOptionalInputOutput"); let body: any; body = JSON.stringify(serializeAws_json1_1OperationWithOptionalInputOutputInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -264,10 +228,7 @@ export const serializeAws_json1_1PutAndGetInlineDocumentsCommand = async ( input: PutAndGetInlineDocumentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.PutAndGetInlineDocuments", - }; + const headers: __HeaderBag = sharedHeaders("PutAndGetInlineDocuments"); let body: any; body = JSON.stringify(serializeAws_json1_1PutAndGetInlineDocumentsInputOutput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -277,10 +238,7 @@ export const serializeAws_json1_1SimpleScalarPropertiesCommand = async ( input: SimpleScalarPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-amz-json-1.1", - "x-amz-target": "JsonProtocol.SimpleScalarProperties", - }; + const headers: __HeaderBag = sharedHeaders("SimpleScalarProperties"); let body: any; body = JSON.stringify(serializeAws_json1_1SimpleScalarPropertiesInputOutput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); @@ -1659,6 +1617,12 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `JsonProtocol.${operation}`, + }; +} const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => { diff --git a/private/aws-protocoltests-query/src/protocols/Aws_query.ts b/private/aws-protocoltests-query/src/protocols/Aws_query.ts index d8bbab8a2ed17..8bd3f0c16edae 100644 --- a/private/aws-protocoltests-query/src/protocols/Aws_query.ts +++ b/private/aws-protocoltests-query/src/protocols/Aws_query.ts @@ -138,9 +138,7 @@ export const serializeAws_queryDatetimeOffsetsCommand = async ( input: DatetimeOffsetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "DatetimeOffsets", Version: "2020-01-08", @@ -152,9 +150,7 @@ export const serializeAws_queryEmptyInputAndEmptyOutputCommand = async ( input: EmptyInputAndEmptyOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryEmptyInputAndEmptyOutputInput(input, context), @@ -168,9 +164,7 @@ export const serializeAws_queryEndpointOperationCommand = async ( input: EndpointOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "EndpointOperation", Version: "2020-01-08", @@ -189,9 +183,7 @@ export const serializeAws_queryEndpointWithHostLabelOperationCommand = async ( input: EndpointWithHostLabelOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryHostLabelInput(input, context), @@ -216,9 +208,7 @@ export const serializeAws_queryFlattenedXmlMapCommand = async ( input: FlattenedXmlMapCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "FlattenedXmlMap", Version: "2020-01-08", @@ -230,9 +220,7 @@ export const serializeAws_queryFlattenedXmlMapWithXmlNameCommand = async ( input: FlattenedXmlMapWithXmlNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "FlattenedXmlMapWithXmlName", Version: "2020-01-08", @@ -244,9 +232,7 @@ export const serializeAws_queryFlattenedXmlMapWithXmlNamespaceCommand = async ( input: FlattenedXmlMapWithXmlNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "FlattenedXmlMapWithXmlNamespace", Version: "2020-01-08", @@ -258,9 +244,7 @@ export const serializeAws_queryFractionalSecondsCommand = async ( input: FractionalSecondsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "FractionalSeconds", Version: "2020-01-08", @@ -272,9 +256,7 @@ export const serializeAws_queryGreetingWithErrorsCommand = async ( input: GreetingWithErrorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "GreetingWithErrors", Version: "2020-01-08", @@ -286,9 +268,7 @@ export const serializeAws_queryHostWithPathOperationCommand = async ( input: HostWithPathOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "HostWithPathOperation", Version: "2020-01-08", @@ -300,9 +280,7 @@ export const serializeAws_queryIgnoresWrappingXmlNameCommand = async ( input: IgnoresWrappingXmlNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "IgnoresWrappingXmlName", Version: "2020-01-08", @@ -314,9 +292,7 @@ export const serializeAws_queryNestedStructuresCommand = async ( input: NestedStructuresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryNestedStructuresInput(input, context), @@ -330,9 +306,7 @@ export const serializeAws_queryNoInputAndNoOutputCommand = async ( input: NoInputAndNoOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "NoInputAndNoOutput", Version: "2020-01-08", @@ -344,9 +318,7 @@ export const serializeAws_queryNoInputAndOutputCommand = async ( input: NoInputAndOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryNoInputAndOutputInput(input, context), @@ -360,9 +332,7 @@ export const serializeAws_queryQueryIdempotencyTokenAutoFillCommand = async ( input: QueryIdempotencyTokenAutoFillCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryQueryIdempotencyTokenAutoFillInput(input, context), @@ -376,9 +346,7 @@ export const serializeAws_queryQueryListsCommand = async ( input: QueryListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryQueryListsInput(input, context), @@ -392,9 +360,7 @@ export const serializeAws_queryQueryMapsCommand = async ( input: QueryMapsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryQueryMapsInput(input, context), @@ -408,9 +374,7 @@ export const serializeAws_queryQueryTimestampsCommand = async ( input: QueryTimestampsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_queryQueryTimestampsInput(input, context), @@ -424,9 +388,7 @@ export const serializeAws_queryRecursiveXmlShapesCommand = async ( input: RecursiveXmlShapesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "RecursiveXmlShapes", Version: "2020-01-08", @@ -438,9 +400,7 @@ export const serializeAws_querySimpleInputParamsCommand = async ( input: SimpleInputParamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; let body: any; body = buildFormUrlencodedString({ ...serializeAws_querySimpleInputParamsInput(input, context), @@ -454,9 +414,7 @@ export const serializeAws_querySimpleScalarXmlPropertiesCommand = async ( input: SimpleScalarXmlPropertiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "SimpleScalarXmlProperties", Version: "2020-01-08", @@ -468,9 +426,7 @@ export const serializeAws_queryXmlBlobsCommand = async ( input: XmlBlobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlBlobs", Version: "2020-01-08", @@ -482,9 +438,7 @@ export const serializeAws_queryXmlEmptyBlobsCommand = async ( input: XmlEmptyBlobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlEmptyBlobs", Version: "2020-01-08", @@ -496,9 +450,7 @@ export const serializeAws_queryXmlEmptyListsCommand = async ( input: XmlEmptyListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlEmptyLists", Version: "2020-01-08", @@ -510,9 +462,7 @@ export const serializeAws_queryXmlEmptyMapsCommand = async ( input: XmlEmptyMapsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlEmptyMaps", Version: "2020-01-08", @@ -524,9 +474,7 @@ export const serializeAws_queryXmlEnumsCommand = async ( input: XmlEnumsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlEnums", Version: "2020-01-08", @@ -538,9 +486,7 @@ export const serializeAws_queryXmlIntEnumsCommand = async ( input: XmlIntEnumsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlIntEnums", Version: "2020-01-08", @@ -552,9 +498,7 @@ export const serializeAws_queryXmlListsCommand = async ( input: XmlListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlLists", Version: "2020-01-08", @@ -566,9 +510,7 @@ export const serializeAws_queryXmlMapsCommand = async ( input: XmlMapsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlMaps", Version: "2020-01-08", @@ -580,9 +522,7 @@ export const serializeAws_queryXmlMapsXmlNameCommand = async ( input: XmlMapsXmlNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlMapsXmlName", Version: "2020-01-08", @@ -594,9 +534,7 @@ export const serializeAws_queryXmlNamespacesCommand = async ( input: XmlNamespacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlNamespaces", Version: "2020-01-08", @@ -608,9 +546,7 @@ export const serializeAws_queryXmlTimestampsCommand = async ( input: XmlTimestampsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: __HeaderBag = { - "content-type": "application/x-www-form-urlencoded", - }; + const headers: __HeaderBag = SHARED_HEADERS; const body = buildFormUrlencodedString({ Action: "XmlTimestamps", Version: "2020-01-08", @@ -2862,6 +2798,9 @@ const buildHttpRpcRequest = async ( } return new __HttpRequest(contents); }; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; const parseBody = (streamBody: any, context: __SerdeContext): any => collectBodyString(streamBody, context).then((encoded) => {