|
16 | 16 | package software.amazon.smithy.aws.typescript.codegen; |
17 | 17 |
|
18 | 18 | import java.util.Collections; |
| 19 | +import java.util.HashMap; |
19 | 20 | import java.util.List; |
20 | 21 | import java.util.Map; |
21 | 22 | import java.util.function.Consumer; |
22 | 23 | import software.amazon.smithy.aws.traits.clientendpointdiscovery.ClientDiscoveredEndpointTrait; |
23 | 24 | import software.amazon.smithy.aws.traits.clientendpointdiscovery.ClientEndpointDiscoveryTrait; |
24 | 25 | import software.amazon.smithy.codegen.core.CodegenException; |
| 26 | +import software.amazon.smithy.codegen.core.Symbol; |
25 | 27 | import software.amazon.smithy.codegen.core.SymbolProvider; |
26 | 28 | import software.amazon.smithy.model.Model; |
27 | 29 | import software.amazon.smithy.model.shapes.OperationShape; |
@@ -68,21 +70,29 @@ public List<RuntimeClientPlugin> getClientPlugins() { |
68 | 70 | .withConventions(AwsDependency.MIDDLEWARE_ENDPOINT_DISCOVERY.dependency, |
69 | 71 | "EndpointDiscovery", RuntimeClientPlugin.Convention.HAS_CONFIG) |
70 | 72 | // ToDo: The Endpoint Discovery Command Name needs to be read from ClientEndpointDiscoveryTrait. |
71 | | - .additionalResolveFunctionParameters("DescribeEndpointsCommand") |
| 73 | + .additionalResolveFunctionParamsSupplier((m, s, o) -> new HashMap<String, Object>() {{ |
| 74 | + put("DescribeEndpointsCommand", Symbol.builder().name("DescribeEndpointsCommand").build()); |
| 75 | + }}) |
72 | 76 | .servicePredicate((m, s) -> hasClientEndpointDiscovery(s)) |
73 | 77 | .build(), |
74 | 78 | // ToDo: The value ClientDiscoveredEndpointTrait.isRequired() needs to be passed to Plugin instead |
75 | 79 | // of creating two functions Required and Optional. The map of identifiers also needs to be passed. |
76 | 80 | RuntimeClientPlugin.builder() |
77 | 81 | .withConventions(AwsDependency.MIDDLEWARE_ENDPOINT_DISCOVERY.dependency, |
78 | 82 | "EndpointDiscoveryRequired", RuntimeClientPlugin.Convention.HAS_MIDDLEWARE) |
79 | | - .additionalPluginFunctionParameters(new String[]{"clientStack", "options"}) |
| 83 | + .additionalPluginFunctionParamsSupplier((m, s, o) -> new HashMap<String, Object>() {{ |
| 84 | + put("clientStack", Symbol.builder().name("clientStack").build()); |
| 85 | + put("options", Symbol.builder().name("options").build()); |
| 86 | + }}) |
80 | 87 | .operationPredicate((m, s, o) -> isClientDiscoveredEndpointRequired(s, o)) |
81 | 88 | .build(), |
82 | 89 | RuntimeClientPlugin.builder() |
83 | 90 | .withConventions(AwsDependency.MIDDLEWARE_ENDPOINT_DISCOVERY.dependency, |
84 | 91 | "EndpointDiscoveryOptional", RuntimeClientPlugin.Convention.HAS_MIDDLEWARE) |
85 | | - .additionalPluginFunctionParameters(new String[]{"clientStack", "options"}) |
| 92 | + .additionalPluginFunctionParamsSupplier((m, s, o) -> new HashMap<String, Object>() {{ |
| 93 | + put("clientStack", Symbol.builder().name("clientStack").build()); |
| 94 | + put("options", Symbol.builder().name("options").build()); |
| 95 | + }}) |
86 | 96 | .operationPredicate((m, s, o) -> isClientDiscoveredEndpointOptional(s, o)) |
87 | 97 | .build() |
88 | 98 | ); |
|
0 commit comments