diff --git a/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/AwsSmokeTestsRunnerGeneratorIntegration.kt b/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/AwsSmokeTestsRunnerGeneratorIntegration.kt index 8e6ec43708a..1e694ae4bbc 100644 --- a/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/AwsSmokeTestsRunnerGeneratorIntegration.kt +++ b/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/AwsSmokeTestsRunnerGeneratorIntegration.kt @@ -39,7 +39,7 @@ private object AwsSmokeTestsRunnerGenerator { * Preserves other environment variables added via section writer binding, if any. */ val regionEnvironmentVariable = - SectionWriterBinding(AdditionalEnvironmentVariables) { writer, previous -> + SectionWriterBinding(SmokeTestSectionIds.AdditionalEnvironmentVariables) { writer, previous -> writer.write("#L", previous) writer.write( "private val regionOverride = #T.System.getenv(#S)", @@ -52,9 +52,9 @@ private object AwsSmokeTestsRunnerGenerator { * Add AWS specific client config support to AWS smoke test runners */ val clientConfig = - SectionWriterBinding(ClientConfig) { writer, _ -> - val name = writer.getContextValue(ClientConfig.Name) - val value = writer.getContextValue(ClientConfig.Value) + SectionWriterBinding(SmokeTestSectionIds.ClientConfig) { writer, _ -> + val name = writer.getContextValue(SmokeTestSectionIds.ClientConfig.Name) + val value = writer.getContextValue(SmokeTestSectionIds.ClientConfig.Value) // Normalize client config names val newName = when (name) { @@ -65,7 +65,7 @@ private object AwsSmokeTestsRunnerGenerator { "useAccelerate" -> "enableAccelerate" "useMultiRegionAccessPoints" -> "disableMrap" "useGlobalEndpoint" -> { - writer.write("throw Exception(#S)", "'useGlobalEndpoint' is not supported by the SDK") + writer.write("throw #T(#S)", RuntimeTypes.Core.SmokeTests.SmokeTestsException, "'useGlobalEndpoint' is not supported by the SDK") return@SectionWriterBinding } else -> name @@ -75,8 +75,8 @@ private object AwsSmokeTestsRunnerGenerator { // Normalize client values when (newName) { "endpointProvider" -> { - val endpointProvider = writer.getContextValue(ClientConfig.EndpointProvider) - val endpointParameters = writer.getContextValue(ClientConfig.EndpointParams) + val endpointProvider = writer.getContextValue(SmokeTestSectionIds.ClientConfig.EndpointProvider) + val endpointParameters = writer.getContextValue(SmokeTestSectionIds.ClientConfig.EndpointParams) writer.withBlock("object : #T {", "}", endpointProvider) { write( @@ -121,7 +121,7 @@ private object AwsSmokeTestsRunnerGenerator { * Preserves previous default config if any. */ val defaultClientConfig = - SectionWriterBinding(DefaultClientConfig) { writer, previous -> + SectionWriterBinding(SmokeTestSectionIds.DefaultClientConfig) { writer, previous -> writer.write("#L", previous) writer.write("region = regionOverride") } @@ -130,13 +130,13 @@ private object AwsSmokeTestsRunnerGenerator { * Replaces environment variable with one specific to AWS smoke test runners */ val skipTagsEnvironmentVariable = - SectionWriterBinding(SkipTags) { writer, _ -> writer.writeInline("#S", AWS_SKIP_TAGS) } + SectionWriterBinding(SmokeTestSectionIds.SkipTags) { writer, _ -> writer.writeInline("#S", AWS_SKIP_TAGS) } /** * Replaces environment variable with one specific to AWS smoke test runners */ val serviceFilterEnvironmentVariable = - SectionWriterBinding(ServiceFilter) { writer, _ -> writer.writeInline("#S", AWS_SERVICE_FILTER) } + SectionWriterBinding(SmokeTestSectionIds.ServiceFilter) { writer, _ -> writer.writeInline("#S", AWS_SERVICE_FILTER) } } /** diff --git a/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/testing/SmokeTestFailHttpEngineIntegration.kt b/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/testing/SmokeTestFailHttpEngineIntegration.kt index ee25447aa84..ad6bd0ee95e 100644 --- a/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/testing/SmokeTestFailHttpEngineIntegration.kt +++ b/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/testing/SmokeTestFailHttpEngineIntegration.kt @@ -10,7 +10,7 @@ import software.amazon.smithy.kotlin.codegen.integration.SectionWriter import software.amazon.smithy.kotlin.codegen.integration.SectionWriterBinding import software.amazon.smithy.kotlin.codegen.model.expectShape import software.amazon.smithy.kotlin.codegen.model.hasTrait -import software.amazon.smithy.kotlin.codegen.rendering.smoketests.HttpEngineOverride +import software.amazon.smithy.kotlin.codegen.rendering.smoketests.SmokeTestSectionIds import software.amazon.smithy.kotlin.codegen.utils.topDownOperations import software.amazon.smithy.model.Model import software.amazon.smithy.model.shapes.ServiceShape @@ -29,7 +29,7 @@ class SmokeTestFailHttpEngineIntegration : KotlinIntegration { override val sectionWriters: List get() = listOf( - SectionWriterBinding(HttpEngineOverride, httpClientOverride), + SectionWriterBinding(SmokeTestSectionIds.HttpEngineOverride, httpClientOverride), ) private val httpClientOverride = SectionWriter { writer, _ -> diff --git a/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/testing/SmokeTestSuccessHttpEngineIntegration.kt b/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/testing/SmokeTestSuccessHttpEngineIntegration.kt index e1b12dcf60b..03077a4cd5a 100644 --- a/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/testing/SmokeTestSuccessHttpEngineIntegration.kt +++ b/codegen/aws-sdk-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/smoketests/testing/SmokeTestSuccessHttpEngineIntegration.kt @@ -9,7 +9,7 @@ import software.amazon.smithy.kotlin.codegen.integration.SectionWriter import software.amazon.smithy.kotlin.codegen.integration.SectionWriterBinding import software.amazon.smithy.kotlin.codegen.model.expectShape import software.amazon.smithy.kotlin.codegen.model.hasTrait -import software.amazon.smithy.kotlin.codegen.rendering.smoketests.HttpEngineOverride +import software.amazon.smithy.kotlin.codegen.rendering.smoketests.SmokeTestSectionIds import software.amazon.smithy.kotlin.codegen.utils.topDownOperations import software.amazon.smithy.model.Model import software.amazon.smithy.model.shapes.ServiceShape @@ -28,7 +28,7 @@ class SmokeTestSuccessHttpEngineIntegration : KotlinIntegration { override val sectionWriters: List get() = listOf( - SectionWriterBinding(HttpEngineOverride, httpClientOverride), + SectionWriterBinding(SmokeTestSectionIds.HttpEngineOverride, httpClientOverride), ) private val httpClientOverride = SectionWriter { writer, _ ->