Skip to content
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 @@ -47,7 +47,7 @@ private class GlacierAccountIdMiddleware : ProtocolMiddleware {
val accountId = ctx.model.expectShape<StructureShape>(op.input.get()).members().first { it.memberName.lowercase() == "accountid" }
writer.addImport(RuntimeTypes.Http.Operation.OperationRequest)

writer.withBlock("execution.initialize.intercept { req, next -> ", "}") {
writer.withBlock("op.execution.initialize.intercept { req, next -> ", "}") {
openBlock("if (req.subject.#L.isNullOrEmpty()) {", accountId.defaultName())
.write("val updated = req.subject.copy { #L = #S }", accountId.defaultName(), "-")
.write("next.call(#T(req.context, updated))", RuntimeTypes.Http.Operation.OperationRequest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ open class RestXml : AwsHttpBindingProtocolGenerator() {
// in two different contexts
val boundMemberName = boundMember.capitalizedDefaultName()
val deserializeLambdaIdent = "deserialize$boundMemberName"
writer.withBlock("val $deserializeLambdaIdent = suspend {", "}") {
writer.withBlock("val $deserializeLambdaIdent = {", "}") {
write("val builder = #T.builder()", memberSymbol)
renderDeserializerBody(ctx, copyWithMemberTraits, targetShape.members().toList(), writer)
write("builder.build()")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sdkVersion=0.9.3-SNAPSHOT
smithyVersion=1.13.1
smithyGradleVersion=0.5.3
# smithy-kotlin codegen and runtime are versioned together
smithyKotlinVersion=0.7.1-alpha
smithyKotlinVersion=0.7.2-SNAPSHOT

# kotlin
kotlinVersion=1.5.31
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal class GetBucketLocationOperationDeserializer : HttpDeserialize<GetBucke
}
}

private suspend fun deserializeGetBucketLocationOperationBody(builder: GetBucketLocationResponse.DslBuilder, payload: ByteArray) {
private fun deserializeGetBucketLocationOperationBody(builder: GetBucketLocationResponse.DslBuilder, payload: ByteArray) {
val dom = parseDom(xmlStreamReader(payload))
check(dom.name.local == "LocationConstraint") { "Expected top-level tag of 'LocationConstraint' but found ${dom.name}." }
val rawLocationConstraint = checkNotNull(dom.text) { "Did not receive a value for 'LocationConstraint' in response." }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal fun setS3ErrorMetadata(exception: Any, response: HttpResponse, errorDet
}
}

internal suspend fun parseS3ErrorResponse(payload: ByteArray): S3ErrorDetails {
internal fun parseS3ErrorResponse(payload: ByteArray): S3ErrorDetails {
val MESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("Message"))
val CODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("Code"))
val REQUESTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, XmlSerialName("RequestId"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
*/
package aws.sdk.kotlin.services.s3.internal

import aws.sdk.kotlin.runtime.testing.runSuspendTest
import kotlin.test.*

class S3ErrorDeserializerTest {

@Test
fun `it deserializes s3 errors`() = runSuspendTest {
fun `it deserializes s3 errors`() {
val payload = """
<Error>
<Type>Sender</Type>
Expand All @@ -31,7 +30,7 @@ class S3ErrorDeserializerTest {
}

@Test
fun `it partially deserializes s3 errors`() = runSuspendTest {
fun `it partially deserializes s3 errors`() {
val tests = listOf(
"""
<Error>
Expand Down