Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove client properties feature #1501

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ abstract class AWSHTTPProtocolCustomizations : DefaultHTTPProtocolCustomizations
serviceConfig: ServiceConfig
): HttpProtocolServiceClient {
writer.addImport(AWSSwiftDependency.AWS_CLIENT_RUNTIME.target, false, "FileBasedConfig")
val clientProperties = getClientProperties()
return AWSHttpProtocolServiceClient(ctx, writer, clientProperties, serviceConfig)
return AWSHttpProtocolServiceClient(ctx, writer, serviceConfig)
}

override val messageDecoderSymbol: Symbol = AWSClientRuntimeTypes.AWSEventStream.AWSMessageDecoder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import software.amazon.smithy.swift.codegen.ClientRuntimeTypes
import software.amazon.smithy.swift.codegen.SwiftWriter
import software.amazon.smithy.swift.codegen.config.ConfigProperty
import software.amazon.smithy.swift.codegen.config.DefaultProvider
import software.amazon.smithy.swift.codegen.integration.ClientProperty
import software.amazon.smithy.swift.codegen.integration.HttpProtocolServiceClient
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
import software.amazon.smithy.swift.codegen.integration.ServiceConfig
Expand All @@ -22,9 +21,8 @@ import software.amazon.smithy.swift.codegen.utils.toUpperCamelCase
class AWSHttpProtocolServiceClient(
private val ctx: ProtocolGenerator.GenerationContext,
private val writer: SwiftWriter,
properties: List<ClientProperty>,
private val serviceConfig: ServiceConfig
) : HttpProtocolServiceClient(ctx, writer, properties, serviceConfig) {
) : HttpProtocolServiceClient(ctx, writer, serviceConfig) {
override fun renderConvenienceInitFunctions(serviceSymbol: Symbol) {
writer.openBlock("public convenience init(region: Swift.String) throws {", "}") {
writer.write("let config = try ${serviceConfig.typeName}(region: region)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@ class PresignerGenerator : SwiftIntegration {
)
}
val operationStackName = "operation"
for (prop in protocolGenerator.customizations.getClientProperties()) {
prop.addImportsAndDependencies(writer)
prop.renderInstantiation(writer)
prop.renderConfiguration(writer)
}

val generator = MiddlewareExecutionGenerator(
protocolGeneratorContext,
writer,
Expand All @@ -117,11 +111,7 @@ class PresignerGenerator : SwiftIntegration {
}

if (protocolGeneratorContext.settings.useInterceptors) {
writer.write(
"""
return try await op.presignRequest(input: input)
""".trimIndent()
)
writer.write("return try await op.presignRequest(input: input)")
} else {
val requestBuilderName = "presignedRequestBuilder"
val builtRequestName = "builtRequest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ class PresignableUrlIntegration(private val presignedOperations: Map<String, Set
)
}
val operationStackName = "operation"
for (prop in protocolGenerator.customizations.getClientProperties()) {
prop.addImportsAndDependencies(writer)
prop.renderInstantiation(writer)
prop.renderConfiguration(writer)
}

val generator = MiddlewareExecutionGenerator(
protocolGeneratorContext,
writer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ import software.amazon.smithy.model.shapes.Shape
import software.amazon.smithy.model.traits.TimestampFormatTrait
import software.amazon.smithy.protocoltests.traits.HttpRequestTestCase
import software.amazon.smithy.swift.codegen.SwiftWriter
import software.amazon.smithy.swift.codegen.integration.ClientProperty

class EC2QueryCustomizations : AWSHTTPProtocolCustomizations() {

override fun getClientProperties(): List<ClientProperty> {
return listOf()
}

override fun customRenderBodyComparison(test: HttpRequestTestCase): ((SwiftWriter, HttpRequestTestCase, Symbol, Shape, String, String) -> Unit)? {
return this::renderFormURLBodyComparison
}
Expand Down
Loading