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

Generate presigner into nested package for consistency #502

Merged
merged 3 commits into from
Jan 20, 2022
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 @@ -104,7 +104,7 @@ class PresignerGenerator : KotlinIntegration {

// If presignable operations found for this service, generate a Presigner file
if (presignOperations.isNotEmpty()) {
delegator.useFileWriter("Presigner.kt", ctx.settings.pkg.name) { writer ->
delegator.useFileWriter("Presigners.kt", "${ctx.settings.pkg.name}.presigners") { writer ->
renderPresigner(writer, ctx, httpBindingResolver, service.expectTrait<SigV4Trait>().name, presignOperations, defaultTimestampFormat)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ class PresignerGeneratorTest {

testContext.generationCtx.delegator.flushWriters()
val testManifest = testContext.generationCtx.delegator.fileManifest as MockManifest
val actual = testManifest.expectFileString("src/main/kotlin/smithy/kotlin/traits/Presigner.kt")
val actual = testManifest.expectFileString("src/main/kotlin/smithy/kotlin/traits/presigners/Presigners.kt")

val expected = """
package smithy.kotlin.traits
package smithy.kotlin.traits.presigners

import aws.sdk.kotlin.runtime.ClientException
import aws.sdk.kotlin.runtime.auth.credentials.CredentialsProvider
import aws.sdk.kotlin.runtime.auth.credentials.DefaultChainCredentialsProvider
Expand All @@ -97,6 +97,7 @@ class PresignerGeneratorTest {
import aws.smithy.kotlin.runtime.client.ExecutionContext
import aws.smithy.kotlin.runtime.http.QueryParameters
import aws.smithy.kotlin.runtime.http.request.HttpRequest
import smithy.kotlin.traits.TestClient
import smithy.kotlin.traits.internal.DefaultEndpointResolver
import smithy.kotlin.traits.model.GetFooRequest
import smithy.kotlin.traits.model.PostFooRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import aws.sdk.kotlin.runtime.testing.runSuspendTest
import aws.sdk.kotlin.services.polly.model.OutputFormat
import aws.sdk.kotlin.services.polly.model.SynthesizeSpeechRequest
import aws.sdk.kotlin.services.polly.model.VoiceId
import aws.sdk.kotlin.services.polly.presigners.PollyPresignConfig
import aws.sdk.kotlin.services.polly.presigners.presign
import aws.smithy.kotlin.runtime.http.HttpMethod
import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down
1 change: 1 addition & 0 deletions services/polly/e2eTest/PollyPresignerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import aws.sdk.kotlin.runtime.http.engine.crt.CrtHttpEngine
import aws.sdk.kotlin.services.polly.model.OutputFormat
import aws.sdk.kotlin.services.polly.model.SynthesizeSpeechRequest
import aws.sdk.kotlin.services.polly.model.VoiceId
import aws.sdk.kotlin.services.polly.presigners.presign
import aws.smithy.kotlin.runtime.http.response.complete
import aws.smithy.kotlin.runtime.http.sdkHttpClient
import aws.smithy.kotlin.runtime.testing.runSuspendTest
Expand Down
2 changes: 1 addition & 1 deletion services/s3/e2eTest/S3PresignerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import aws.sdk.kotlin.runtime.testing.runSuspendTest
import aws.sdk.kotlin.services.s3.S3Client
import aws.sdk.kotlin.services.s3.model.GetObjectRequest
import aws.sdk.kotlin.services.s3.model.PutObjectRequest
import aws.sdk.kotlin.services.s3.presign
import aws.sdk.kotlin.services.s3.presigners.presign
import aws.smithy.kotlin.runtime.content.ByteStream
import aws.smithy.kotlin.runtime.content.decodeToString
import aws.smithy.kotlin.runtime.http.response.complete
Expand Down
1 change: 1 addition & 0 deletions services/sts/e2eTest/STSPresignerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package aws.sdk.kotlin.services.sts
import aws.sdk.kotlin.runtime.http.engine.crt.CrtHttpEngine
import aws.sdk.kotlin.runtime.testing.runSuspendTest
import aws.sdk.kotlin.services.sts.model.GetCallerIdentityRequest
import aws.sdk.kotlin.services.sts.presigners.presign
import aws.smithy.kotlin.runtime.http.response.complete
import aws.smithy.kotlin.runtime.http.sdkHttpClient
import org.junit.jupiter.api.TestInstance
Expand Down