Skip to content

Commit

Permalink
feat(client): update HTTP request header code
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFossAWS committed Mar 30, 2023
1 parent 5a70042 commit 2d615b3
Show file tree
Hide file tree
Showing 154 changed files with 7,979 additions and 26,616 deletions.
121 changes: 29 additions & 92 deletions clients/client-acm-pca/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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) => {
Expand Down
Loading

0 comments on commit 2d615b3

Please sign in to comment.