55
55
import software .amazon .smithy .waiters .Waiter ;
56
56
57
57
@ SmithyUnstableApi
58
- final class DirectedTypeScriptCodegen implements DirectedCodegen <TypeScriptCodegenContext , TypeScriptSettings , TypeScriptIntegration > {
58
+ final class DirectedTypeScriptCodegen
59
+ implements DirectedCodegen <TypeScriptCodegenContext , TypeScriptSettings , TypeScriptIntegration > {
59
60
60
61
private static final Logger LOGGER = Logger .getLogger (DirectedTypeScriptCodegen .class .getName ());
61
62
@@ -78,7 +79,8 @@ public SymbolProvider createSymbolProvider(CreateSymbolProviderDirective<TypeScr
78
79
}
79
80
80
81
@ Override
81
- public TypeScriptCodegenContext createContext (CreateContextDirective <TypeScriptSettings , TypeScriptIntegration > directive ) {
82
+ public TypeScriptCodegenContext createContext (CreateContextDirective <TypeScriptSettings ,
83
+ TypeScriptIntegration > directive ) {
82
84
83
85
List <RuntimeClientPlugin > runtimePlugins = new ArrayList <>();
84
86
directive .integrations ().forEach (integration -> {
@@ -205,7 +207,7 @@ public void generateService(GenerateServiceDirective<TypeScriptCodegenContext, T
205
207
}
206
208
207
209
if (settings .generateServerSdk ()) {
208
- for (OperationShape operation : directive .operations ()) {
210
+ for (OperationShape operation : directive .operations ()) {
209
211
delegator .useShapeWriter (operation , w -> {
210
212
ServerGenerator .generateOperationHandler (symbolProvider , service , operation , w );
211
213
});
@@ -281,7 +283,7 @@ private void generateCommands(GenerateServiceDirective<TypeScriptCodegenContext,
281
283
ApplicationProtocol applicationProtocol = directive .context ().applicationProtocol ();
282
284
283
285
// Generate each operation for the service.
284
- for (OperationShape operation : directive .operations ()) {
286
+ for (OperationShape operation : directive .operations ()) {
285
287
// Right now this only generates stubs
286
288
if (settings .generateClient ()) {
287
289
CommandGenerator .writeIndex (model , service , symbolProvider , fileManifest );
@@ -299,7 +301,8 @@ private void generateCommands(GenerateServiceDirective<TypeScriptCodegenContext,
299
301
}
300
302
}
301
303
302
- private void generateServiceInterface (GenerateServiceDirective <TypeScriptCodegenContext , TypeScriptSettings > directive ) {
304
+ private void generateServiceInterface (GenerateServiceDirective <TypeScriptCodegenContext ,
305
+ TypeScriptSettings > directive ) {
303
306
ServiceShape service = directive .shape ();
304
307
SymbolProvider symbolProvider = directive .symbolProvider ();
305
308
Set <OperationShape > operations = directive .operations ();
@@ -366,15 +369,17 @@ public void generateEnumShape(GenerateEnumDirective<TypeScriptCodegenContext, Ty
366
369
}
367
370
368
371
@ Override
369
- public void customizeBeforeIntegrations (CustomizeDirective <TypeScriptCodegenContext , TypeScriptSettings > directive ) {
372
+ public void customizeBeforeIntegrations (
373
+ CustomizeDirective <TypeScriptCodegenContext , TypeScriptSettings > directive ) {
370
374
// Write shared / static content.
371
375
STATIC_FILE_COPIES .forEach ((from , to ) -> {
372
376
LOGGER .fine (() -> "Writing contents of `" + from + "` to `" + to + "`" );
373
377
directive .fileManifest ().writeFile (from , getClass (), to );
374
378
});
375
379
376
380
// TODO: do all of these parts below are before/after?
377
- SymbolVisitor .writeModelIndex (directive .connectedShapes ().values (), directive .symbolProvider (), directive .fileManifest ());
381
+ SymbolVisitor .writeModelIndex (directive .connectedShapes ().values (), directive .symbolProvider (),
382
+ directive .fileManifest ());
378
383
379
384
// Generate the client Node and Browser configuration files. These
380
385
// files are switched between in package.json based on the targeted
@@ -440,7 +445,8 @@ public void customizeBeforeIntegrations(CustomizeDirective<TypeScriptCodegenCont
440
445
String protocolTestFileName = String .format ("test/functional/%s.spec.ts" , baseName );
441
446
442
447
// TODO: what to do here?
443
- // context.setDeferredWriter(() -> directive.context().writerDelegator().checkoutFileWriter(protocolTestFileName));
448
+ // context.setDeferredWriter(() -> directive.context().writerDelegator().checkoutFileWriter
449
+ // (protocolTestFileName));
444
450
445
451
// protocolGenerator.generateProtocolTests(context);
446
452
}
@@ -465,7 +471,8 @@ private void checkValidationSettings(TypeScriptSettings settings, Model model, S
465
471
466
472
if (!unvalidatedOperations .isEmpty ()) {
467
473
throw new CodegenException (String .format ("Every operation must have the %s error attached unless %s is set "
468
- + "to 'true' in the plugin settings. Operations without %s errors attached: %s" ,
474
+ + "to 'true' in the plugin settings. Operations without %s "
475
+ + "errors attached: %s" ,
469
476
VALIDATION_EXCEPTION_SHAPE ,
470
477
TypeScriptSettings .DISABLE_DEFAULT_VALIDATION ,
471
478
VALIDATION_EXCEPTION_SHAPE ,
0 commit comments