diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/ProcessAwsQueryWaiters.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/ProcessAwsQueryWaiters.java index b9f88a82f72b3..ea4b6507eb5af 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/ProcessAwsQueryWaiters.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/ProcessAwsQueryWaiters.java @@ -3,7 +3,10 @@ import software.amazon.smithy.aws.traits.protocols.AwsQueryErrorTrait; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.node.ObjectNode; -import software.amazon.smithy.model.shapes.*; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.traits.ErrorTrait; import software.amazon.smithy.model.transform.ModelTransformer; import software.amazon.smithy.typescript.codegen.TypeScriptSettings; @@ -48,19 +51,19 @@ public Model preprocessModel(Model model, TypeScriptSettings settings) { operationBuilder.removeTrait(WaitableTrait.ID); WaitableTrait waiterTrait = operationShape.expectTrait(WaitableTrait.class); WaitableTrait.Builder waitableTraitBuilder = (WaitableTrait.Builder) waiterTrait.toBuilder(); - for (Map.Entry entry : waiterTrait.getWaiters().entrySet()){ + for (Map.Entry entry : waiterTrait.getWaiters().entrySet()) { String name = entry.getKey(); Waiter waiter = entry.getValue(); Waiter.Builder waiterBuilder = (Waiter.Builder) waiter.toBuilder(); waiterBuilder.clearAcceptors(); - for (Acceptor acceptor : waiter.getAcceptors()){ + for (Acceptor acceptor : waiter.getAcceptors()) { ObjectNode acceptorNode = acceptor.toNode().expectObjectNode(); Matcher matcher = acceptor.getMatcher(); - if (matcher instanceof Matcher.ErrorTypeMember){ + if (matcher instanceof Matcher.ErrorTypeMember) { ObjectNode matcherNode = matcher.toNode().expectObjectNode(); String errorCode = matcherNode.expectStringMember("errorType").getValue(); - if (errorCodeToShapeId.containsKey(errorCode)){ + if (errorCodeToShapeId.containsKey(errorCode)) { matcherNode = matcherNode.toBuilder() .withMember("errorType", errorCodeToShapeId.get(errorCode)) .build(); @@ -72,7 +75,7 @@ public Model preprocessModel(Model model, TypeScriptSettings settings) { } waiterBuilder.addAcceptor(Acceptor.fromNode(acceptorNode)); } - waitableTraitBuilder.put(name,waiterBuilder.build()); + waitableTraitBuilder.put(name, waiterBuilder.build()); } operationBuilder.addTrait(waitableTraitBuilder.build()); } @@ -86,4 +89,4 @@ public Model preprocessModel(Model model, TypeScriptSettings settings) { return model; } -} \ No newline at end of file +}