Skip to content

Commit c4d8204

Browse files
committed
wip
1 parent 8fc2114 commit c4d8204

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

packages/smithy-client/src/command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ export abstract class Command<
5353
return this;
5454
},
5555
/**
56-
* Set the Smithy context record.
56+
* Set the context record.
5757
*/
58-
sc(smithyContext: Record<string, unknown>) {
58+
c(smithyContext: Record<string, unknown>) {
5959
args.smithyContext = smithyContext;
6060
return this;
6161
},

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CommandGenerator.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import software.amazon.smithy.typescript.codegen.sections.CommandBodyExtraCodeSection;
5757
import software.amazon.smithy.typescript.codegen.sections.CommandConstructorCodeSection;
5858
import software.amazon.smithy.typescript.codegen.sections.CommandPropertiesCodeSection;
59+
import software.amazon.smithy.typescript.codegen.sections.SmithyContextCodeSection;
5960
import software.amazon.smithy.typescript.codegen.validation.SensitiveDataFinder;
6061
import software.amazon.smithy.utils.MapUtils;
6162
import software.amazon.smithy.utils.SmithyInternalApi;
@@ -382,6 +383,25 @@ private void generateCommandMiddlewareResolver(String configType) {
382383
)
383384
.n($client:S, $command:S, $service:S, $operation:S)
384385
.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+
"""
385405
.build()(clientStack, config, options);
386406
}
387407
"""

0 commit comments

Comments
 (0)