From 68449470d60d6b5a81742988ceded89aa6c67196 Mon Sep 17 00:00:00 2001 From: sid <48153483+siddsriv@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:49:53 -0400 Subject: [PATCH] =?UTF-8?q?Revert=20"feat:=20omit=20endpoint=20params=20fr?= =?UTF-8?q?om=20generation=20in=20the=20client=20interface=20(#=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ab12d79b9d81c755ad0670ca8628495120731c8a. --- .../endpointsV2/EndpointsV2Generator.java | 5 +-- .../endpointsV2/OmitEndpointParams.java | 33 ------------------- 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/OmitEndpointParams.java diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/EndpointsV2Generator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/EndpointsV2Generator.java index 9db0a0529bc..f85201e1f50 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/EndpointsV2Generator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/EndpointsV2Generator.java @@ -117,10 +117,7 @@ private void generateEndpointParameters() { RuleSetParameterFinder ruleSetParameterFinder = new RuleSetParameterFinder(service); Map clientInputParams = ruleSetParameterFinder.getClientContextParams(); - //Omit Endpoint params that should not be a part of the ClientInputEndpointParameters interface - Map builtInParams = ruleSetParameterFinder.getBuiltInParams(); - builtInParams.keySet().removeIf(OmitEndpointParams::isOmitted); - clientInputParams.putAll(builtInParams); + clientInputParams.putAll(ruleSetParameterFinder.getBuiltInParams()); ObjectNode ruleSet = endpointRuleSetTrait.getRuleSet().expectObjectNode(); ruleSet.getObjectMember("parameters").ifPresent(parameters -> { diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/OmitEndpointParams.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/OmitEndpointParams.java deleted file mode 100644 index 7c94fe61f38..00000000000 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/OmitEndpointParams.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - - package software.amazon.smithy.typescript.codegen.endpointsV2; - - import java.util.Collections; - import java.util.HashSet; - import java.util.Set; - - /** - * Manages a collection of endpoint parameter names to be omitted from a specific interface. - * While this could be extensible in the future, as of right now, - * this collection is maintaining endpoint params to be omitted from the `ClientInputEndpointParameters` interface. - */ - public final class OmitEndpointParams { - private static final Set OMITTED_PARAMS = new HashSet<>(); - - private OmitEndpointParams() {} - - public static void addOmittedParams(Set paramNames) { - OMITTED_PARAMS.addAll(paramNames); - } - - public static boolean isOmitted(String paramName) { - return OMITTED_PARAMS.contains(paramName); - } - - public static Set getOmittedParams() { - return Collections.unmodifiableSet(OMITTED_PARAMS); - } -}