Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
2ed6942
chore(deps): bump aws.sdk.kotlin.crt:aws-crt-kotlin from 0.12.3 to 0.…
dependabot[bot] Mar 27, 2026
0f983bb
chore(deps): bump ktor-version from 3.4.1 to 3.4.2 (#1543)
dependabot[bot] Mar 27, 2026
6447ac7
chore(deps): bump com.gradle.plugin-publish from 2.0.0 to 2.1.1 (#1540)
dependabot[bot] Mar 27, 2026
44bd2e8
chore(deps): bump org.jetbrains.kotlinx:atomicfu-gradle-plugin from 0…
dependabot[bot] Mar 27, 2026
b604092
chore(deps): bump org.jsoup:jsoup from 1.21.2 to 1.22.1 (#1533)
dependabot[bot] Mar 27, 2026
6ce7946
chore(deps): bump org.jetbrains.kotlinx:kotlinx-serialization-json fr…
dependabot[bot] Mar 28, 2026
43ba826
chore: release 1.6.8
aws-sdk-kotlin-ci Mar 30, 2026
76bd93a
chore: bump snapshot version to 1.6.9-SNAPSHOT
aws-sdk-kotlin-ci Mar 30, 2026
d3e0b54
chore(deps): bump dokka-version from 2.1.0 to 2.2.0 (#1532)
dependabot[bot] Mar 30, 2026
9e25ad5
chore(deps): bump com.fasterxml.jackson:jackson-bom from 2.21.1 to 2.…
dependabot[bot] Mar 30, 2026
807b772
chore(deps): bump docker-java-version from 3.7.0 to 3.7.1 (#1530)
dependabot[bot] Mar 30, 2026
351a78e
chore(deps): bump okhttp-version from 5.0.0-alpha.14 to 5.3.2 (#1537)
dependabot[bot] Mar 30, 2026
8ecc960
chore(deps): bump dev.zacsweers.kctfork:core from 0.12.0 to 0.12.1 (#…
dependabot[bot] Mar 31, 2026
016a731
chore(deps): bump software.amazon.smithy.gradle:smithy-base from 1.3.…
dependabot[bot] Mar 31, 2026
a676f97
fix: handle negatives in default values for doubles (#1546)
lauzadis Mar 31, 2026
d76a1ff
fix: sleep outside of lock in adaptive rate limiter (#1547)
lauzadis Mar 31, 2026
e61b015
chore: release 1.6.9
aws-sdk-kotlin-ci Mar 31, 2026
660ff59
chore: bump snapshot version to 1.6.10-SNAPSHOT
aws-sdk-kotlin-ci Mar 31, 2026
d842681
chore(deps): bump com.squareup.okio:okio from 3.16.4 to 3.17.0 (#1529)
dependabot[bot] Mar 31, 2026
0ea5303
chore(deps): bump io.micrometer:micrometer-core from 1.16.1 to 1.16.4…
dependabot[bot] Mar 31, 2026
1503f4a
chore(deps): bump gradle-wrapper from 9.2.1 to 9.4.1 (#1534)
dependabot[bot] Apr 1, 2026
c61f53d
chore(deps): bump aws.sdk.kotlin.crt:aws-crt-kotlin from 0.12.6 to 0.…
dependabot[bot] Apr 1, 2026
601287c
chore(deps): bump junit-version from 5.14.1 to 5.14.3 (#1548)
dependabot[bot] Apr 2, 2026
6e72255
chore: add AI contribution policy to CONTRIBUTING.md (#1549)
ianbotsf Apr 2, 2026
d2fcd3d
chore: add clock skew integration tests (#1550)
ianbotsf Apr 6, 2026
6c5b60f
Replace junit with kotlin test (#1553)
luigi617 Apr 11, 2026
e5462cf
Replace junit with kotlin test (#1554)
luigi617 Apr 13, 2026
6fce603
chore: release 1.6.10
aws-sdk-kotlin-ci Apr 13, 2026
8549481
chore: bump snapshot version to 1.6.11-SNAPSHOT
aws-sdk-kotlin-ci Apr 13, 2026
00d88d1
chore(deps): bump org.jetbrains.kotlinx:kotlinx-serialization-json fr…
dependabot[bot] Apr 14, 2026
81a2cd0
chore(deps): bump otel-version from 1.60.1 to 1.61.0 (#1556)
dependabot[bot] Apr 14, 2026
48dc7d5
chore(deps): bump io.micrometer:micrometer-core from 1.16.4 to 1.16.5…
dependabot[bot] Apr 14, 2026
b0573c5
chore(deps): bump smithy-version from 1.68.0 to 1.69.0 (#1558)
dependabot[bot] Apr 14, 2026
da030dd
fix junit dependencies (#1560)
luigi617 Apr 16, 2026
0f9c429
Fix get attr in condition (#1559)
luigi617 Apr 16, 2026
ecd00fe
fix: enum values init deadlock (#1557)
0marperez Apr 16, 2026
b35c253
chore: release 1.6.11
aws-sdk-kotlin-ci Apr 17, 2026
a1b0a8d
chore: bump snapshot version to 1.6.12-SNAPSHOT
aws-sdk-kotlin-ci Apr 17, 2026
17ee211
feat: multiplatform file and dir apis (#1561)
0marperez Apr 19, 2026
0e89b9a
fix: use platform-safe conversion for fseek offset in native (#1562)
0marperez Apr 20, 2026
f3fae3e
chore: release 1.6.12
aws-sdk-kotlin-ci Apr 20, 2026
79ba7ac
chore: bump snapshot version to 1.6.13-SNAPSHOT
aws-sdk-kotlin-ci Apr 20, 2026
b1c9276
chore: bump Kotlin to 2.3.20 and add unit test to verify codegen vers…
ianbotsf Apr 23, 2026
a0201da
chore(deps): bump junit-version from 5.14.3 to 5.14.4 (#1579)
dependabot[bot] Apr 27, 2026
239187a
chore(deps): bump ktor-version from 3.4.2 to 3.4.3 (#1566)
dependabot[bot] Apr 27, 2026
20bb7f6
chore: add test filesystem capabilities (#1578)
ianbotsf Apr 27, 2026
a7e7e3e
chore: release 1.6.13
aws-sdk-kotlin-ci Apr 28, 2026
0e48daf
chore: bump snapshot version to 1.6.14-SNAPSHOT
aws-sdk-kotlin-ci Apr 28, 2026
6af7559
chore(deps): bump org.jsoup:jsoup from 1.22.1 to 1.22.2 (#1563)
dependabot[bot] Apr 28, 2026
9b66def
misc: repo tools v0.5.9 (#1581)
aws-sdk-kotlin-ci Apr 29, 2026
a734aea
fix: erase empty file if setting permissions fails (#1585)
ianbotsf Apr 30, 2026
c2bef0d
misc: repo tools v0.5.10 (#1586)
aws-sdk-kotlin-ci Apr 30, 2026
1586d34
misc: repo tools v0.5.12 (#1590)
aws-sdk-kotlin-ci May 1, 2026
a2753e0
Retry 2026 (#1596)
luigi617 May 8, 2026
fd9fb63
chore: release 1.6.14
aws-sdk-kotlin-ci May 8, 2026
ce7f1e4
chore: bump snapshot version to 1.6.15-SNAPSHOT
aws-sdk-kotlin-ci May 8, 2026
6bcbe58
chore(deps): bump slf4j-version from 2.0.17 to 2.0.18 (#1602)
dependabot[bot] May 14, 2026
372edb2
chore(deps): bump org.jetbrains.kotlinx:kotlinx-datetime from 0.7.1 t…
dependabot[bot] May 14, 2026
4ea359d
misc: repo tools v0.5.13 (#1605)
aws-sdk-kotlin-ci May 14, 2026
2c42e5d
chore(deps): bump kotlinx-benchmark-version from 0.4.16 to 0.4.17 (#1…
dependabot[bot] May 14, 2026
a030b6b
chore(deps): bump coroutines-version from 1.10.2 to 1.11.0 (#1594)
dependabot[bot] May 14, 2026
c1c7818
chore(deps): bump otel-version from 1.61.0 to 1.62.0 (#1601)
dependabot[bot] May 15, 2026
046335f
chore(deps): bump ktor-version from 3.4.3 to 3.5.0 (#1604)
dependabot[bot] May 15, 2026
e05816b
chore(deps): bump com.fasterxml.jackson:jackson-bom from 2.21.2 to 2.…
dependabot[bot] May 15, 2026
e704867
chore(deps): bump smithy-version from 1.69.0 to 1.70.0 (#1591)
dependabot[bot] May 18, 2026
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
1 change: 1 addition & 0 deletions .brazil.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"aws.sdk.kotlin.crt:aws-crt-kotlin:0.12.*": "AwsCrtKotlin-0.12.x",
"com.squareup.okhttp3:okhttp:4.*": "OkHttp3-4.x",
"org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.*": "KotlinxDatetimeJvm-0.x",
"org.jetbrains.kotlinx:kotlinx-io-core-jvm:0.*": "Maven-org-jetbrains-kotlinx_kotlinx-io-core-jvm-0.x",

"software.amazon.smithy:smithy-aws-traits:1.*": "Maven-software-amazon-smithy_smithy-aws-traits-1.x",
"software.amazon.smithy:smithy-aws-iam-traits:1.*": "Maven-software-amazon-smithy_smithy-aws-iam-traits-1.x",
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Changelog

## [1.6.14] - 05/08/2026

### Features
* Add standard retry strategy with updated exponential backoff, retry quotas, `x-amz-retry-after` header support, and service-specific behavior for DynamoDB. Gated behind the `SMITHY_NEW_RETRIES_2026` feature flag. See the [announcement](https://github.com/aws/aws-sdk-kotlin/discussions/1885) for more details.
* Add retry logic for long polling operations. See the [announcement](https://github.com/aws/aws-sdk-kotlin/discussions/1885) for more details.

### Fixes
* Erase empty file if setting permissions fails

## [1.6.13] - 04/28/2026

### Miscellaneous
* Bumping Kotlin version to 2.3.20

## [1.6.12] - 04/20/2026

## [1.6.11] - 04/17/2026

### Fixes
* Fix codegen for `getAttr` returning boolean in endpoint rule conditions

## [1.6.10] - 04/13/2026

## [1.6.9] - 03/31/2026

### Fixes
* Fix code generation of negative default values for doubles
* Sleep outside of lock in adaptive rate limiter

## [1.6.8] - 03/30/2026

## [1.6.7] - 03/24/2026

## [1.6.6] - 03/13/2026
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ To send us a pull request, please:
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).

### Automated Tools

The use of AI tooling for assisted development work is accepted and encouraged in this repository, but due to the volume
of submissions we ask that you observe the following rules:

- All issue and pull request submissions to this repository that are sourced by AI must first be reviewed by a human
before submitting to the repository. Items reviewed in this way must include a statement like "generated by AI tools,
and reviewed by <person>"
- Please ensure that your submissions are actually improvements. While we are grateful for any proposed fixes, even if
they are very small, behavior that looks like creating nuisance PRs or artificially inflating submission counts is not
acceptable.
- We may close issues or pull requests, or limit your ability to interact with this repository, for behavior that in our
estimation violates these rules or any of the other rules in the
[Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).

### API and style guidelines

Smithy Kotlin's generated code is multiplatform and intended to work for a wide variety of environments and use cases.
Expand Down
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
https://github.com/Kotlin/dokka/issues/3472#issuecomment-1929712374
https://github.com/Kotlin/dokka/issues/3194#issuecomment-1929382630
*/
classpath(enforcedPlatform("com.fasterxml.jackson:jackson-bom:2.21.1"))
classpath(enforcedPlatform("com.fasterxml.jackson:jackson-bom:2.21.3"))
}

configurations.classpath {
Expand All @@ -34,7 +34,7 @@ buildscript {

FIXME: Figure out what broke our buildscript classpath, this is a temporary fix
*/
force("com.squareup.okhttp3:okhttp-coroutines:5.0.0-alpha.14")
force("com.squareup.okhttp3:okhttp-coroutines:5.3.2")
}
}
}
Expand Down Expand Up @@ -139,6 +139,7 @@ apiValidation {
"compile",
"slf4j-1x-consumer",
"slf4j-2x-consumer",
"enum-tests",
),
)
}
Expand Down
4 changes: 1 addition & 3 deletions codegen/aws-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ dependencies {
api(libs.smithy.protocol.traits)
implementation(libs.smithy.aws.endpoints)

testImplementation(libs.junit.jupiter)
testImplementation(libs.junit.jupiter.params)
testImplementation(libs.kotest.assertions.core.jvm)
testImplementation(libs.kotlin.test.junit5)
testImplementation(libs.kotlin.test)
testImplementation(project(":codegen:codegen-testutils"))

testImplementation(libs.slf4j.api)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import aws.smithy.kotlin.codegen.test.newTestContext
import aws.smithy.kotlin.codegen.test.shouldContainOnlyOnceWithDiff
import aws.smithy.kotlin.codegen.test.toRenderingContext
import aws.smithy.kotlin.codegen.test.toSmithyModel
import org.junit.jupiter.api.Test
import software.amazon.smithy.model.shapes.ServiceShape
import kotlin.test.Test

class RegionSupportTest {
@Test
Expand Down
2 changes: 0 additions & 2 deletions codegen/codegen-testutils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ dependencies {
api(project(":codegen:codegen"))

// Test dependencies
implementation(libs.junit.jupiter)
implementation(libs.kotest.assertions.core.jvm)
implementation(libs.kotlin.test)
implementation(libs.kotlin.test.junit5)
}

tasks.withType<KotlinCompile> {
Expand Down
15 changes: 15 additions & 0 deletions codegen/codegen/api/codegen.api
Original file line number Diff line number Diff line change
Expand Up @@ -2152,6 +2152,21 @@ public final class aws/smithy/kotlin/codegen/rendering/endpoints/discovery/Endpo
public final fun isOptionalFor (Laws/smithy/kotlin/codegen/core/CodegenContext;)Z
}

public final class aws/smithy/kotlin/codegen/rendering/longpoll/LongPollingIntegration : aws/smithy/kotlin/codegen/integration/KotlinIntegration {
public fun <init> ()V
public fun additionalServiceConfigProps (Laws/smithy/kotlin/codegen/core/CodegenContext;)Ljava/util/List;
public fun authSchemes (Laws/smithy/kotlin/codegen/rendering/protocol/ProtocolGenerator$GenerationContext;)Ljava/util/List;
public fun customizeEndpointResolution (Laws/smithy/kotlin/codegen/rendering/protocol/ProtocolGenerator$GenerationContext;)Laws/smithy/kotlin/codegen/rendering/endpoints/EndpointCustomization;
public fun customizeMiddleware (Laws/smithy/kotlin/codegen/rendering/protocol/ProtocolGenerator$GenerationContext;Ljava/util/List;)Ljava/util/List;
public fun decorateSymbolProvider (Laws/smithy/kotlin/codegen/KotlinSettings;Lsoftware/amazon/smithy/model/Model;Lsoftware/amazon/smithy/codegen/core/SymbolProvider;)Lsoftware/amazon/smithy/codegen/core/SymbolProvider;
public fun enabledForService (Lsoftware/amazon/smithy/model/Model;Laws/smithy/kotlin/codegen/KotlinSettings;)Z
public fun getOrder ()B
public fun getProtocolGenerators ()Ljava/util/List;
public fun getSectionWriters ()Ljava/util/List;
public fun preprocessModel (Lsoftware/amazon/smithy/model/Model;Laws/smithy/kotlin/codegen/KotlinSettings;)Lsoftware/amazon/smithy/model/Model;
public fun writeAdditionalFiles (Laws/smithy/kotlin/codegen/core/CodegenContext;Laws/smithy/kotlin/codegen/core/KotlinDelegator;)V
}

public final class aws/smithy/kotlin/codegen/rendering/protocol/ApplicationProtocol {
public static final field Companion Laws/smithy/kotlin/codegen/rendering/protocol/ApplicationProtocol$Companion;
public fun <init> (Ljava/lang/String;Lsoftware/amazon/smithy/codegen/core/Symbol;Lsoftware/amazon/smithy/codegen/core/Symbol;)V
Expand Down
3 changes: 1 addition & 2 deletions codegen/codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ dependencies {
implementation(libs.jsoup)

// Test dependencies
testImplementation(libs.junit.jupiter)
testImplementation(libs.kotest.assertions.core.jvm)
testImplementation(libs.kotlin.test)
testImplementation(libs.kotlin.test.junit5)
testImplementation(project(":codegen:codegen-testutils"))
testImplementation(project(":runtime:testing"))
}

val generateSdkRuntimeVersion by tasks.registering {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private fun getDefaultRuntimeVersion(): String {
// publishing info
const val RUNTIME_GROUP: String = "aws.smithy.kotlin"
val RUNTIME_VERSION: String = System.getProperty("smithy.kotlin.codegen.clientRuntimeVersion", getDefaultRuntimeVersion())
val KOTLIN_COMPILER_VERSION: String = System.getProperty("smithy.kotlin.codegen.kotlinCompilerVersion", "2.3.0")
val KOTLIN_COMPILER_VERSION: String = System.getProperty("smithy.kotlin.codegen.kotlinCompilerVersion", "2.3.20")

enum class SourceSet {
CommonMain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class KotlinSymbolProvider(private val model: Model, private val settings: Kotli
private fun getDefaultValueForNumber(type: ShapeType, value: String) = when (type) {
ShapeType.LONG -> "${value}L"
ShapeType.FLOAT -> "${value}f"
ShapeType.DOUBLE -> if (value.matches("[0-9]*\\.[0-9]+".toRegex())) value else "$value.0"
ShapeType.DOUBLE -> if (value.matches("-?[0-9]*\\.[0-9]+".toRegex())) value else "$value.0"
ShapeType.SHORT -> "$value.toShort()"
ShapeType.BYTE -> "$value.toByte()"
else -> value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import java.util.logging.Logger
*
* fun values(): List<SimpleYesNo> = values
*
* private val values: List<SimpleYesNo> = listOf(Yes, No)
* private val values: List<SimpleYesNo> by lazy { listOf(Yes, No) }
* }
* }
*
Expand Down Expand Up @@ -93,7 +93,7 @@ import java.util.logging.Logger
*
* fun values(): List<SimpleYesNo> = values
*
* private val values: List<SimpleYesNo> = listOf(Yes, No)
* private val values: List<SimpleYesNo> by lazy { listOf(Yes, No) }
* }
* }
* ```
Expand Down Expand Up @@ -160,7 +160,7 @@ class EnumGenerator(val shape: Shape, val symbol: Symbol, val writer: KotlinWrit
write("public fun values(): #Q<#Q> = values", KotlinTypes.Collections.List, symbol)
write("")

withBlock("private val values: #Q<#Q> = listOf(", ")", KotlinTypes.Collections.List, symbol) {
withBlock("private val values: #Q<#Q> by lazy { listOf(", ") }", KotlinTypes.Collections.List, symbol) {
ktEnum.variants.forEach { write("#L,", it.name) }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import software.amazon.smithy.codegen.core.CodegenException
import software.amazon.smithy.codegen.core.Symbol
import software.amazon.smithy.model.SourceLocation
import software.amazon.smithy.rulesengine.language.EndpointRuleSet
import software.amazon.smithy.rulesengine.language.evaluation.type.BooleanType
import software.amazon.smithy.rulesengine.language.evaluation.type.OptionalType
import software.amazon.smithy.rulesengine.language.syntax.Identifier
import software.amazon.smithy.rulesengine.language.syntax.ToExpression
import software.amazon.smithy.rulesengine.language.syntax.expressions.*
Expand Down Expand Up @@ -156,9 +158,7 @@ class DefaultEndpointProviderGenerator(
writer.openBlock("if (")
expressions.forEachIndexed { index, it ->
renderExpression(it.function)
if (!it.function.isBooleanFunction()) { // these are meant to be evaluated on "truthiness" (i.e. is the result non-null)
writeInline(" != null")
}
it.function.renderTruthinessCheck(writer)
write(if (index == expressions.lastIndex) "" else " &&")
}
writer.closeAndOpenBlock(") {")
Expand Down Expand Up @@ -418,16 +418,23 @@ private fun isSet(expression: Expression) = IsSet
.getDefinition()
.createFunction(FunctionNode.ofExpressions(IsSet.ID, ToExpression { expression }))

private fun Expression.isBooleanFunction(): Boolean {
if (this !is LibraryFunction) {
return true
/**
* Returns true if this expression generates nullable Kotlin code regardless of Smithy type.
*/
private fun Expression.generatesNullableKotlin(): Boolean = this is GetAttr

private fun Expression.renderTruthinessCheck(writer: KotlinWriter) {
val exprType = runCatching { type() }.getOrNull()
val isNullable = exprType is OptionalType || generatesNullableKotlin()
val isBooleanInner = when {
exprType is OptionalType -> exprType.inner() is BooleanType
else -> exprType is BooleanType
}

return name !in setOf(
"parseUrl",
"substring",
"uriEncode",
"aws.parseArn",
"aws.partition",
)
when {
isNullable && isBooleanInner -> writer.writeInline(" == true")
isNullable -> writer.writeInline(" != null")
// Non-nullable boolean — use as-is
else -> Unit
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.smithy.kotlin.codegen.rendering.longpoll

import aws.smithy.kotlin.codegen.KotlinSettings
import aws.smithy.kotlin.codegen.core.KotlinWriter
import aws.smithy.kotlin.codegen.core.RuntimeTypes
import aws.smithy.kotlin.codegen.integration.KotlinIntegration
import aws.smithy.kotlin.codegen.lang.KotlinTypes
import aws.smithy.kotlin.codegen.model.expectTrait
import aws.smithy.kotlin.codegen.model.hasTrait
import aws.smithy.kotlin.codegen.rendering.protocol.ProtocolGenerator
import aws.smithy.kotlin.codegen.rendering.protocol.ProtocolMiddleware
import software.amazon.smithy.model.Model
import software.amazon.smithy.model.shapes.OperationShape
import software.amazon.smithy.model.traits.LongPollTrait

/**
* Sets long-polling context attributes for operations annotated with `smithy.api#longPoll`.
*/
class LongPollingIntegration : KotlinIntegration {
override fun enabledForService(model: Model, settings: KotlinSettings): Boolean = model.isTraitApplied(LongPollTrait::class.java)

override fun customizeMiddleware(
ctx: ProtocolGenerator.GenerationContext,
resolved: List<ProtocolMiddleware>,
): List<ProtocolMiddleware> = resolved + longPollingMiddleware
}

private val longPollingMiddleware = object : ProtocolMiddleware {
override val name: String = "LongPollingMiddleware"

override fun isEnabledFor(ctx: ProtocolGenerator.GenerationContext, op: OperationShape): Boolean = op.hasTrait<LongPollTrait>()

override fun render(ctx: ProtocolGenerator.GenerationContext, op: OperationShape, writer: KotlinWriter) {
val trait = op.expectTrait<LongPollTrait>()
writer.write(
"op.context[#T.LongPolling] = true",
RuntimeTypes.HttpClient.Operation.HttpOperationContext,
)
writer.write(
"op.context[#T.SocketReadTimeout] = #L.#T",
RuntimeTypes.HttpClient.Operation.HttpOperationContext,
trait.timeoutMillis,
KotlinTypes.Time.milliseconds,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ aws.smithy.kotlin.codegen.rendering.compression.RequestCompressionIntegration
aws.smithy.kotlin.codegen.rendering.auth.SigV4AsymmetricAuthSchemeIntegration
aws.smithy.kotlin.codegen.rendering.smoketests.SmokeTestsIntegration
aws.smithy.kotlin.codegen.rendering.checksums.HttpChecksumRequiredIntegration
aws.smithy.kotlin.codegen.ProtocolGeneratorSupplier
aws.smithy.kotlin.codegen.ProtocolGeneratorSupplier
aws.smithy.kotlin.codegen.rendering.longpoll.LongPollingIntegration
Loading
Loading