Skip to content

Commit

Permalink
feat: stringStore codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Dec 15, 2023
1 parent a7c7213 commit 73cc560
Show file tree
Hide file tree
Showing 486 changed files with 110,099 additions and 180,893 deletions.
693 changes: 192 additions & 501 deletions clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts

Large diffs are not rendered by default.

141 changes: 41 additions & 100 deletions clients/client-account/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
import { requestBuilder as rb } from "@smithy/core";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import {
_json,
Expand Down Expand Up @@ -60,28 +61,20 @@ export const se_DeleteAlternateContactCommand = async (
input: DeleteAlternateContactCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const b = rb(input, context);
const headers: any = {
"content-type": "application/json",
};
const resolvedPath =
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/deleteAlternateContact";
b.bp("/deleteAlternateContact");
let body: any;
body = JSON.stringify(
take(input, {
AccountId: [],
AlternateContactType: [],
})
);
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
b.m("POST").h(headers).b(body);
return b.build();
};

/**
Expand All @@ -91,27 +84,20 @@ export const se_DisableRegionCommand = async (
input: DisableRegionCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const b = rb(input, context);
const headers: any = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/disableRegion";
b.bp("/disableRegion");
let body: any;
body = JSON.stringify(
take(input, {
AccountId: [],
RegionName: [],
})
);
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
b.m("POST").h(headers).b(body);
return b.build();
};

/**
Expand All @@ -121,27 +107,20 @@ export const se_EnableRegionCommand = async (
input: EnableRegionCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const b = rb(input, context);
const headers: any = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/enableRegion";
b.bp("/enableRegion");
let body: any;
body = JSON.stringify(
take(input, {
AccountId: [],
RegionName: [],
})
);
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
b.m("POST").h(headers).b(body);
return b.build();
};

/**
Expand All @@ -151,27 +130,20 @@ export const se_GetAlternateContactCommand = async (
input: GetAlternateContactCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const b = rb(input, context);
const headers: any = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getAlternateContact";
b.bp("/getAlternateContact");
let body: any;
body = JSON.stringify(
take(input, {
AccountId: [],
AlternateContactType: [],
})
);
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
b.m("POST").h(headers).b(body);
return b.build();
};

/**
Expand All @@ -181,26 +153,19 @@ export const se_GetContactInformationCommand = async (
input: GetContactInformationCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const b = rb(input, context);
const headers: any = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getContactInformation";
b.bp("/getContactInformation");
let body: any;
body = JSON.stringify(
take(input, {
AccountId: [],
})
);
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
b.m("POST").h(headers).b(body);
return b.build();
};

/**
Expand All @@ -210,27 +175,20 @@ export const se_GetRegionOptStatusCommand = async (
input: GetRegionOptStatusCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const b = rb(input, context);
const headers: any = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getRegionOptStatus";
b.bp("/getRegionOptStatus");
let body: any;
body = JSON.stringify(
take(input, {
AccountId: [],
RegionName: [],
})
);
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
b.m("POST").h(headers).b(body);
return b.build();
};

/**
Expand All @@ -240,11 +198,11 @@ export const se_ListRegionsCommand = async (
input: ListRegionsCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const b = rb(input, context);
const headers: any = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listRegions";
b.bp("/listRegions");
let body: any;
body = JSON.stringify(
take(input, {
Expand All @@ -254,15 +212,8 @@ export const se_ListRegionsCommand = async (
RegionOptStatusContains: (_) => _json(_),
})
);
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
b.m("POST").h(headers).b(body);
return b.build();
};

/**
Expand All @@ -272,11 +223,11 @@ export const se_PutAlternateContactCommand = async (
input: PutAlternateContactCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const b = rb(input, context);
const headers: any = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/putAlternateContact";
b.bp("/putAlternateContact");
let body: any;
body = JSON.stringify(
take(input, {
Expand All @@ -288,15 +239,8 @@ export const se_PutAlternateContactCommand = async (
Title: [],
})
);
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
b.m("POST").h(headers).b(body);
return b.build();
};

/**
Expand All @@ -306,27 +250,20 @@ export const se_PutContactInformationCommand = async (
input: PutContactInformationCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const b = rb(input, context);
const headers: any = {
"content-type": "application/json",
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/putContactInformation";
b.bp("/putContactInformation");
let body: any;
body = JSON.stringify(
take(input, {
AccountId: [],
ContactInformation: (_) => _json(_),
})
);
return new __HttpRequest({
protocol,
hostname,
port,
method: "POST",
headers,
path: resolvedPath,
body,
});
b.m("POST").h(headers).b(body);
return b.build();
};

/**
Expand Down Expand Up @@ -982,6 +919,8 @@ const isSerializableHeaderValue = (value: any): boolean =>
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);

// HttpBindingProtocolGenerator

const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
Expand Down Expand Up @@ -1032,3 +971,5 @@ const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | unde
return sanitizeErrorCode(data["__type"]);
}
};

// RestJsonProtocolGenerator
4 changes: 4 additions & 0 deletions clients/client-acm-pca/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2417,6 +2417,8 @@ function sharedHeaders(operation: string): __HeaderBag {
};
}

// HttpRpcProtocolGenerator

const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
Expand Down Expand Up @@ -2467,3 +2469,5 @@ const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | unde
return sanitizeErrorCode(data["__type"]);
}
};

// JsonRpcProtocolGenerator
4 changes: 4 additions & 0 deletions clients/client-acm/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,8 @@ function sharedHeaders(operation: string): __HeaderBag {
};
}

// HttpRpcProtocolGenerator

const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
Expand Down Expand Up @@ -1689,3 +1691,5 @@ const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | unde
return sanitizeErrorCode(data["__type"]);
}
};

// JsonRpcProtocolGenerator
Original file line number Diff line number Diff line change
Expand Up @@ -7192,6 +7192,8 @@ function sharedHeaders(operation: string): __HeaderBag {
};
}

// HttpRpcProtocolGenerator

const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
Expand Down Expand Up @@ -7242,3 +7244,5 @@ const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | unde
return sanitizeErrorCode(data["__type"]);
}
};

// JsonRpcProtocolGenerator
Loading

0 comments on commit 73cc560

Please sign in to comment.