diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java index b443c581a665..72fc7a5996cb 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java @@ -138,7 +138,7 @@ private static boolean testInputContainsMember( OperationShape operationShape, Set expectedMemberNames ) { - OperationIndex operationIndex = model.getKnowledge(OperationIndex.class); + OperationIndex operationIndex = OperationIndex.of(model); return operationIndex.getInput(operationShape) .filter(input -> input.getMemberNames().stream().anyMatch(expectedMemberNames::contains)) .isPresent(); diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddEventStreamHandlingDependency.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddEventStreamHandlingDependency.java index a6f48892036d..95b93cc78593 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddEventStreamHandlingDependency.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddEventStreamHandlingDependency.java @@ -129,9 +129,9 @@ public Map> getRuntimeConfigWriters( } private static boolean hasEventStreamInput(Model model, ServiceShape service) { - TopDownIndex topDownIndex = model.getKnowledge(TopDownIndex.class); + TopDownIndex topDownIndex = TopDownIndex.of(model); Set operations = topDownIndex.getContainedOperations(service); - EventStreamIndex eventStreamIndex = model.getKnowledge(EventStreamIndex.class); + EventStreamIndex eventStreamIndex = EventStreamIndex.of(model); for (OperationShape operation : operations) { if (eventStreamIndex.getInputInfo(operation).isPresent()) { return true; @@ -141,7 +141,7 @@ private static boolean hasEventStreamInput(Model model, ServiceShape service) { } private static boolean hasEventStreamInput(Model model, ServiceShape service, OperationShape operation) { - EventStreamIndex eventStreamIndex = model.getKnowledge(EventStreamIndex.class); + EventStreamIndex eventStreamIndex = EventStreamIndex.of(model); return eventStreamIndex.getInputInfo(operation).isPresent(); } } diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegration.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegration.java index 0332d9acf527..c9a707f2bf01 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegration.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegration.java @@ -74,7 +74,7 @@ public void writeAdditionalFiles( .collect(Collectors.joining("\n")); resource = resource.replaceAll(Pattern.quote("${documentation}"), documentation); - TopDownIndex topDownIndex = model.getKnowledge(TopDownIndex.class); + TopDownIndex topDownIndex = TopDownIndex.of(model); OperationShape firstOperation = topDownIndex.getContainedOperations(service).iterator().next(); String operationName = firstOperation.getId().getName(); resource = resource.replaceAll(Pattern.quote("${commandName}"), operationName); diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java index 0cd517fa1a6c..9e9a36fca5c1 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java @@ -80,7 +80,7 @@ static void generateDocumentBodyShapeSerde( ShapeVisitor visitor ) { // Walk all the shapes within those in the document and generate for them as well. - Walker shapeWalker = new Walker(context.getModel().getKnowledge(NeighborProviderIndex.class).getProvider()); + Walker shapeWalker = new Walker(NeighborProviderIndex.of(context.getModel()).getProvider()); Set shapesToGenerate = new TreeSet<>(shapes); shapes.forEach(shape -> shapesToGenerate.addAll(shapeWalker.walkShapes(shape))); shapesToGenerate.forEach(shape -> shape.accept(visitor)); @@ -264,7 +264,7 @@ static String getInputTimestampValueProvider( Format defaultFormat, String inputLocation ) { - HttpBindingIndex httpIndex = context.getModel().getKnowledge(HttpBindingIndex.class); + HttpBindingIndex httpIndex = HttpBindingIndex.of(context.getModel()); TimestampFormatTrait.Format format = httpIndex.determineTimestampFormat(memberShape, DOCUMENT, defaultFormat); return HttpProtocolGeneratorUtils.getTimestampInputParam(context, inputLocation, memberShape, format); }