File tree Expand file tree Collapse file tree 4 files changed +61
-0
lines changed
codegen/smithy-kotlin-codegen/src/main
kotlin/software/amazon/smithy/kotlin/codegen
resources/META-INF/services
runtime/smithy-client/common/src/aws/smithy/kotlin/runtime/client/config Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,8 @@ object RuntimeTypes {
231231 object Config : RuntimeTypePackage(KotlinDependency .SMITHY_CLIENT , " config" ) {
232232 val RequestCompressionConfig = symbol(" RequestCompressionConfig" )
233233 val CompressionClientConfig = symbol(" CompressionClientConfig" )
234+ val HttpChecksumClientConfig = symbol(" HttpChecksumClientConfig" )
235+ val RequestChecksumCalculation = symbol(" RequestChecksumCalculation" )
234236 }
235237
236238 object Endpoints : RuntimeTypePackage(KotlinDependency .SMITHY_CLIENT , " endpoints" ) {
Original file line number Diff line number Diff line change 1+ package software.amazon.smithy.kotlin.codegen.rendering.checksums
2+
3+ import software.amazon.smithy.aws.traits.HttpChecksumTrait
4+ import software.amazon.smithy.kotlin.codegen.KotlinSettings
5+ import software.amazon.smithy.kotlin.codegen.core.CodegenContext
6+ import software.amazon.smithy.kotlin.codegen.core.RuntimeTypes
7+ import software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration
8+ import software.amazon.smithy.kotlin.codegen.lang.KotlinTypes
9+ import software.amazon.smithy.kotlin.codegen.model.asNullable
10+ import software.amazon.smithy.kotlin.codegen.rendering.util.ConfigProperty
11+ import software.amazon.smithy.kotlin.codegen.rendering.util.nestedBuilder
12+ import software.amazon.smithy.kotlin.codegen.utils.topDownOperations
13+ import software.amazon.smithy.model.Model
14+
15+ /* *
16+ * todo
17+ */
18+ class HttpChecksumIntegration : KotlinIntegration {
19+ override fun enabledForService (model : Model , settings : KotlinSettings ): Boolean =
20+ model.topDownOperations(settings.service).any { it.hasTrait(HttpChecksumTrait ::class .java) }
21+
22+ override fun additionalServiceConfigProps (ctx : CodegenContext ): List <ConfigProperty > =
23+ listOf (
24+ ConfigProperty {
25+ name = " requestChecksumCalculation"
26+ symbol = RuntimeTypes .SmithyClient .Config .RequestChecksumCalculation
27+ baseClass = RuntimeTypes .SmithyClient .Config .HttpChecksumClientConfig
28+ useNestedBuilderBaseClass()
29+ documentation = " " // todo
30+ }
31+ )
32+ }
Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ software.amazon.smithy.kotlin.codegen.rendering.endpoints.SdkEndpointBuiltinInte
1313software.amazon.smithy.kotlin.codegen.rendering.compression.RequestCompressionIntegration
1414software.amazon.smithy.kotlin.codegen.rendering.auth.SigV4AsymmetricAuthSchemeIntegration
1515software.amazon.smithy.kotlin.codegen.rendering.smoketests.SmokeTestsIntegration
16+ software.amazon.smithy.kotlin.codegen.rendering.checksums.HttpChecksumIntegration
Original file line number Diff line number Diff line change 1+ package aws.smithy.kotlin.runtime.client.config
2+
3+ public interface HttpChecksumClientConfig {
4+ /* *
5+ * todo
6+ */
7+ public val requestChecksumCalculation: RequestChecksumCalculation ?
8+
9+ public interface Builder {
10+ /* *
11+ * todo
12+ */
13+ public var requestChecksumCalculation: RequestChecksumCalculation ?
14+ }
15+ }
16+
17+ public enum class RequestChecksumCalculation {
18+ /* *
19+ * todo
20+ */
21+ WHEN_SUPPORTED ,
22+ /* *
23+ * todo
24+ */
25+ WHEN_REQUIRED ,
26+ }
You can’t perform that action at this time.
0 commit comments