Skip to content

Commit 52576ef

Browse files
committed
chore: use Symbol for variables in function parameters
1 parent 99d461b commit 52576ef

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAwsAuthPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.util.function.Consumer;
3030
import software.amazon.smithy.aws.traits.ServiceTrait;
3131
import software.amazon.smithy.aws.traits.auth.SigV4Trait;
32+
import software.amazon.smithy.codegen.core.Symbol;
3233
import software.amazon.smithy.codegen.core.SymbolProvider;
3334
import software.amazon.smithy.model.Model;
3435
import software.amazon.smithy.model.knowledge.TopDownIndex;
@@ -106,7 +107,7 @@ && isAwsService(s)
106107
.withConventions(AwsDependency.STS_MIDDLEWARE.dependency,
107108
"StsAuth", HAS_CONFIG)
108109
.resolveFunctionParamsSupplier((m, s, o) -> new HashMap<String, Object>() {{
109-
put("STSClient", "STSClient");
110+
put("STSClient", Symbol.builder().name("STSClient").build());
110111
}})
111112
.servicePredicate((m, s) -> testServiceId(s, "STS"))
112113
.build(),

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddEndpointDiscoveryPlugin.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import software.amazon.smithy.aws.traits.clientendpointdiscovery.ClientDiscoveredEndpointTrait;
2424
import software.amazon.smithy.aws.traits.clientendpointdiscovery.ClientEndpointDiscoveryTrait;
2525
import software.amazon.smithy.codegen.core.CodegenException;
26+
import software.amazon.smithy.codegen.core.Symbol;
2627
import software.amazon.smithy.codegen.core.SymbolProvider;
2728
import software.amazon.smithy.model.Model;
2829
import software.amazon.smithy.model.shapes.OperationShape;
@@ -70,7 +71,7 @@ public List<RuntimeClientPlugin> getClientPlugins() {
7071
"EndpointDiscovery", RuntimeClientPlugin.Convention.HAS_CONFIG)
7172
// ToDo: The Endpoint Discovery Command Name needs to be read from ClientEndpointDiscoveryTrait.
7273
.resolveFunctionParamsSupplier((m, s, o) -> new HashMap<String, Object>() {{
73-
put("DescribeEndpointsCommand", "DescribeEndpointsCommand");
74+
put("DescribeEndpointsCommand", Symbol.builder().name("DescribeEndpointsCommand").build());
7475
}})
7576
.servicePredicate((m, s) -> hasClientEndpointDiscovery(s))
7677
.build(),
@@ -80,17 +81,17 @@ public List<RuntimeClientPlugin> getClientPlugins() {
8081
.withConventions(AwsDependency.MIDDLEWARE_ENDPOINT_DISCOVERY.dependency,
8182
"EndpointDiscoveryRequired", RuntimeClientPlugin.Convention.HAS_MIDDLEWARE)
8283
.pluginFunctionParamsSupplier((m, s, o) -> new HashMap<String, Object>() {{
83-
put("clientStack", "clientStack");
84-
put("options", "options");
84+
put("clientStack", Symbol.builder().name("clientStack").build());
85+
put("options", Symbol.builder().name("options").build());
8586
}})
8687
.operationPredicate((m, s, o) -> isClientDiscoveredEndpointRequired(s, o))
8788
.build(),
8889
RuntimeClientPlugin.builder()
8990
.withConventions(AwsDependency.MIDDLEWARE_ENDPOINT_DISCOVERY.dependency,
9091
"EndpointDiscoveryOptional", RuntimeClientPlugin.Convention.HAS_MIDDLEWARE)
9192
.pluginFunctionParamsSupplier((m, s, o) -> new HashMap<String, Object>() {{
92-
put("clientStack", "clientStack");
93-
put("options", "options");
93+
put("clientStack", Symbol.builder().name("clientStack").build());
94+
put("options", Symbol.builder().name("options").build());
9495
}})
9596
.operationPredicate((m, s, o) -> isClientDiscoveredEndpointOptional(s, o))
9697
.build()

0 commit comments

Comments
 (0)