Unverified Commit cf2034f9 authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

Smithy Client cannot be an optional dependency (#979)

* Smithy Client cannot be an optional dependency

* Update changelogs
parent ca977587
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -22,3 +22,15 @@ message = "Include non-service-specific examples in the generated root Cargo wor
references = ["smithy-rs#957"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "jdisanti"

[[smithy-rs]]
message = "Make `aws-smithy-client` a required dependency in generated services."
references = ["smithy-rs#979"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "rcoh"

[[aws-sdk-rust]]
message = "Make `aws-smithy-client` a required dependency in generated services."
references = ["smithy-rs#979"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "rcoh"
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import software.amazon.smithy.rust.codegen.util.expectTrait
import software.amazon.smithy.rustsdk.AwsRuntimeType.defaultMiddleware

private class Types(runtimeConfig: RuntimeConfig) {
    private val smithyClientDep = CargoDependency.SmithyClient(runtimeConfig).copy(optional = true)
    private val smithyClientDep = CargoDependency.SmithyClient(runtimeConfig)

    val awsTypes = awsTypes(runtimeConfig).asType()
    val smithyClientRetry = RuntimeType("retry", smithyClientDep, "aws_smithy_client")
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ object AwsRuntimeType {
            "middleware", public = true,
            CargoDependency.SmithyHttp(this),
            CargoDependency.SmithyHttpTower(this),
            CargoDependency.SmithyClient(this),
            CargoDependency.Tower,
            awsHttp(),
            awsEndpoint(),
+2 −2
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ data class ClientGenerics(

class GenericFluentClient(codegenContext: CodegenContext) : FluentClientCustomization() {
    private val moduleUseName = codegenContext.moduleUseName()
    private val clientDep = CargoDependency.SmithyClient(codegenContext.runtimeConfig).copy(optional = true)
    private val clientDep = CargoDependency.SmithyClient(codegenContext.runtimeConfig)
    private val codegenScope = arrayOf("client" to clientDep.asType())
    override fun section(section: FluentClientSection): Writable {
        return when (section) {
@@ -290,7 +290,7 @@ class FluentClientGenerator(
        TopDownIndex.of(codegenContext.model).getContainedOperations(serviceShape).sortedBy { it.id }
    private val symbolProvider = codegenContext.symbolProvider
    private val model = codegenContext.model
    private val clientDep = CargoDependency.SmithyClient(codegenContext.runtimeConfig).copy(optional = true)
    private val clientDep = CargoDependency.SmithyClient(codegenContext.runtimeConfig)
    private val runtimeConfig = codegenContext.runtimeConfig
    private val core = FluentClientCore(model)