From 0d6c80477750852d606d283c564f269c11e41806 Mon Sep 17 00:00:00 2001 From: Luc Talatinian <102624213+lucix-aws@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:15:34 -0400 Subject: [PATCH] add rollout switches for waiters (#527) --- .../amazon/smithy/go/codegen/integration/Waiters.java | 8 ++++++++ .../amazon/smithy/go/codegen/integration/Waiters2.java | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/Waiters.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/Waiters.java index c55139d1..8ab90de6 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/Waiters.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/Waiters.java @@ -58,8 +58,16 @@ public Set getAdditionalClientOptions() { return emptySet(); } + public boolean enabledForService(Model model, ShapeId service) { + return true; + } + @Override public void writeAdditionalFiles(GoCodegenContext ctx) { + if (!enabledForService(ctx.model(), ctx.settings().getService())) { + return; + } + var service = ctx.settings().getService(ctx.model()); TopDownIndex.of(ctx.model()).getContainedOperations(service).stream() diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/Waiters2.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/Waiters2.java index 999350ad..eb6dc673 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/Waiters2.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/Waiters2.java @@ -57,8 +57,16 @@ public Set getAdditionalClientOptions() { return emptySet(); } + public boolean enabledForService(Model model, ShapeId service) { + return true; + } + @Override public void writeAdditionalFiles(GoCodegenContext ctx) { + if (!enabledForService(ctx.model(), ctx.settings().getService())) { + return; + } + var service = ctx.settings().getService(ctx.model()); TopDownIndex.of(ctx.model()).getContainedOperations(service).stream()