Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move endpoint resolution to the serializers #1106

Merged
merged 3 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 115 additions & 79 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 = "https", port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol,
hostname,
port,
method: "PUT",
headers: headers,
headers,
path: resolvedPath,
body: body,
...context.endpoint
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 = "https", port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol,
hostname,
port,
method: "PUT",
headers: headers,
headers,
path: resolvedPath,
body: body,
...context.endpoint
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 = "https", port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol,
hostname,
port,
method: "DELETE",
headers: headers,
headers,
path: resolvedPath,
query: query,
body: body,
...context.endpoint
query,
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 = "https", port } = await context.endpoint();
return new __HttpRequest({
protocol: "https",
protocol,
hostname,
port,
method: "DELETE",
headers: headers,
headers,
path: resolvedPath,
query: query,
body: body,
...context.endpoint
query,
body
});
}

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

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

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

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

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

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

Expand Down
Loading