Skip to content

Commit

Permalink
feat: codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP committed Apr 24, 2020
1 parent 62c9392 commit 3beee4a
Show file tree
Hide file tree
Showing 218 changed files with 13,070 additions and 7,942 deletions.
144 changes: 90 additions & 54 deletions clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ export async function serializeAws_restJson1_1CreateAnalyzerCommand(
bodyParams["type"] = input.type;
}
body = JSON.stringify(bodyParams);
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "PUT",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -185,13 +187,15 @@ export async function serializeAws_restJson1_1CreateArchiveRuleCommand(
bodyParams["ruleName"] = input.ruleName;
}
body = JSON.stringify(bodyParams);
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "PUT",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -221,14 +225,16 @@ export async function serializeAws_restJson1_1DeleteAnalyzerCommand(
query["clientToken"] = input.clientToken;
}
let body: any;
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "DELETE",
headers: headers,
path: resolvedPath,
query: query,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -270,14 +276,16 @@ export async function serializeAws_restJson1_1DeleteArchiveRuleCommand(
query["clientToken"] = input.clientToken;
}
let body: any;
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "DELETE",
headers: headers,
path: resolvedPath,
query: query,
body: body,
...context.endpoint
body: body
});
}

Expand All @@ -296,14 +304,16 @@ export async function serializeAws_restJson1_1GetAnalyzedResourceCommand(
query["resourceArn"] = input.resourceArn;
}
let body: any;
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "GET",
headers: headers,
path: resolvedPath,
query: query,
body: body,
...context.endpoint
body: body
});
}

Expand All @@ -329,13 +339,15 @@ export async function serializeAws_restJson1_1GetAnalyzerCommand(
throw new Error("No value provided for input HTTP label: analyzerName.");
}
let body: any;
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "GET",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -373,13 +385,15 @@ export async function serializeAws_restJson1_1GetArchiveRuleCommand(
throw new Error("No value provided for input HTTP label: ruleName.");
}
let body: any;
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "GET",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -407,14 +421,16 @@ export async function serializeAws_restJson1_1GetFindingCommand(
query["analyzerArn"] = input.analyzerArn;
}
let body: any;
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "GET",
headers: headers,
path: resolvedPath,
query: query,
body: body,
...context.endpoint
body: body
});
}

Expand All @@ -440,13 +456,15 @@ export async function serializeAws_restJson1_1ListAnalyzedResourcesCommand(
bodyParams["resourceType"] = input.resourceType;
}
body = JSON.stringify(bodyParams);
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "POST",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand All @@ -468,14 +486,16 @@ export async function serializeAws_restJson1_1ListAnalyzersCommand(
query["type"] = input.type;
}
let body: any;
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "GET",
headers: headers,
path: resolvedPath,
query: query,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -508,14 +528,16 @@ export async function serializeAws_restJson1_1ListArchiveRulesCommand(
query["nextToken"] = input.nextToken;
}
let body: any;
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "GET",
headers: headers,
path: resolvedPath,
query: query,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -550,13 +572,15 @@ export async function serializeAws_restJson1_1ListFindingsCommand(
);
}
body = JSON.stringify(bodyParams);
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "POST",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand All @@ -582,13 +606,15 @@ export async function serializeAws_restJson1_1ListTagsForResourceCommand(
throw new Error("No value provided for input HTTP label: resourceArn.");
}
let body: any;
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "GET",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand All @@ -608,13 +634,15 @@ export async function serializeAws_restJson1_1StartResourceScanCommand(
bodyParams["resourceArn"] = input.resourceArn;
}
body = JSON.stringify(bodyParams);
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "POST",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -645,13 +673,15 @@ export async function serializeAws_restJson1_1TagResourceCommand(
bodyParams["tags"] = serializeAws_restJson1_1TagsMap(input.tags, context);
}
body = JSON.stringify(bodyParams);
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "POST",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -681,14 +711,16 @@ export async function serializeAws_restJson1_1UntagResourceCommand(
query["tagKeys"] = (input.tagKeys || []).map(_entry => _entry);
}
let body: any;
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "DELETE",
headers: headers,
path: resolvedPath,
query: query,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -740,13 +772,15 @@ export async function serializeAws_restJson1_1UpdateArchiveRuleCommand(
);
}
body = JSON.stringify(bodyParams);
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "PUT",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand Down Expand Up @@ -781,13 +815,15 @@ export async function serializeAws_restJson1_1UpdateFindingsCommand(
bodyParams["status"] = input.status;
}
body = JSON.stringify(bodyParams);
const { hostname, protocol, port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "PUT",
headers: headers,
path: resolvedPath,
body: body,
...context.endpoint
body: body
});
}

Expand Down
12 changes: 7 additions & 5 deletions clients/client-acm-pca/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4105,19 +4105,21 @@ const collectBodyString = (
);
};

const buildHttpRpcRequest = (
const buildHttpRpcRequest = async (
context: __SerdeContext,
headers: __HeaderBag,
path: string,
resolvedHostname: string | undefined,
body: any
): __HttpRequest => {
): Promise<__HttpRequest> => {
const { hostname, protocol, port } = await context.endpoint();
const contents: any = {
protocol: "https",
protocol: "https" || protocol,
hostname,
port,
method: "POST",
path: path,
headers: headers,
...context.endpoint
headers: headers
};
if (resolvedHostname !== undefined) {
contents.hostname = resolvedHostname;
Expand Down
Loading

0 comments on commit 3beee4a

Please sign in to comment.