|
56 | 56 | import software.amazon.smithy.typescript.codegen.sections.CommandBodyExtraCodeSection;
|
57 | 57 | import software.amazon.smithy.typescript.codegen.sections.CommandConstructorCodeSection;
|
58 | 58 | import software.amazon.smithy.typescript.codegen.sections.CommandPropertiesCodeSection;
|
| 59 | +import software.amazon.smithy.typescript.codegen.sections.SmithyContextCodeSection; |
59 | 60 | import software.amazon.smithy.typescript.codegen.validation.SensitiveDataFinder;
|
60 | 61 | import software.amazon.smithy.utils.MapUtils;
|
61 | 62 | import software.amazon.smithy.utils.SmithyInternalApi;
|
@@ -382,6 +383,25 @@ private void generateCommandMiddlewareResolver(String configType) {
|
382 | 383 | )
|
383 | 384 | .n($client:S, $command:S, $service:S, $operation:S)
|
384 | 385 | .f($inputFilter:L, $outputFilter:L)
|
| 386 | + """ |
| 387 | + ); |
| 388 | + writer.openBlock(".sc({", "})", () -> { |
| 389 | + writer.pushState(SmithyContextCodeSection.builder() |
| 390 | + .settings(settings) |
| 391 | + .model(model) |
| 392 | + .service(service) |
| 393 | + .operation(operation) |
| 394 | + .symbolProvider(symbolProvider) |
| 395 | + .runtimeClientPlugins(runtimePlugins) |
| 396 | + .protocolGenerator(protocolGenerator) |
| 397 | + .applicationProtocol(applicationProtocol) |
| 398 | + .build()); |
| 399 | + writer.write("service: $S,", service.toShapeId().getName()); |
| 400 | + writer.write("operation: $S,", operation.toShapeId().getName()); |
| 401 | + writer.popState(); |
| 402 | + }); |
| 403 | + writer.write( |
| 404 | + """ |
385 | 405 | .build()(clientStack, config, options);
|
386 | 406 | }
|
387 | 407 | """
|
|
0 commit comments