@@ -18,7 +18,6 @@ import software.amazon.smithy.swift.codegen.swiftmodules.ClientRuntimeTypes
18
18
import software.amazon.smithy.swift.codegen.swiftmodules.SwiftTypes
19
19
20
20
class S3ExpressIntegration : SwiftIntegration {
21
-
22
21
override fun enabledForService (
23
22
model : Model ,
24
23
settings : SwiftSettings ,
@@ -27,7 +26,7 @@ class S3ExpressIntegration : SwiftIntegration {
27
26
override fun writeAdditionalFiles (
28
27
ctx : SwiftCodegenContext ,
29
28
protocolGenerationContext : ProtocolGenerator .GenerationContext ,
30
- delegator : SwiftDelegator
29
+ delegator : SwiftDelegator ,
31
30
) {
32
31
delegator.useFileWriter(" Sources/AWSS3/S3Client+S3Express.swift" ) { writer ->
33
32
writer.write(" " )
@@ -44,7 +43,9 @@ class S3ExpressIntegration : SwiftIntegration {
44
43
writer.write(" let client = S3Client(config: config)" )
45
44
writer.write(" let input = CreateSessionInput(bucket: bucket)" )
46
45
writer.write(" let output = try await client.createSession(input: input)" )
47
- writer.write(" guard let creds = output.credentials, let accessKeyID = creds.accessKeyId, let secretAccessKey = creds.secretAccessKey, let sessionToken = creds.sessionToken else { fatalError() }" )
46
+ writer.write(
47
+ " guard let creds = output.credentials, let accessKeyID = creds.accessKeyId, let secretAccessKey = creds.secretAccessKey, let sessionToken = creds.sessionToken else { fatalError() }" ,
48
+ )
48
49
writer.openBlock(" return \$ N(" , " )" , AWSSDKIdentityTypes .S3ExpressIdentity ) {
49
50
writer.write(" accessKeyID: accessKeyID," )
50
51
writer.write(" secretAccessKey: secretAccessKey," )
@@ -56,20 +57,20 @@ class S3ExpressIntegration : SwiftIntegration {
56
57
}
57
58
}
58
59
59
- override fun clientConfigurations (ctx : ProtocolGenerator .GenerationContext ): List <ClientConfiguration > {
60
- return super .clientConfigurations(ctx) + listOf (S3ExpressClientConfiguration ())
61
- }
60
+ override fun clientConfigurations (ctx : ProtocolGenerator .GenerationContext ): List <ClientConfiguration > =
61
+ super .clientConfigurations(ctx) + listOf (S3ExpressClientConfiguration ())
62
62
}
63
63
64
- class S3ExpressClientConfiguration : ClientConfiguration {
65
-
64
+ class S3ExpressClientConfiguration : ClientConfiguration {
66
65
override val swiftProtocolName: Symbol ?
67
66
get() = null
68
67
69
- override fun getProperties (ctx : ProtocolGenerator .GenerationContext ): Set <ConfigProperty > {
70
- return setOf (ConfigProperty (
71
- " s3ExpressIdentityResolver" ,
72
- AWSSDKIdentityTypes .S3ExpressIdentityResolver .toGeneric(),
73
- DefaultProvider ({ it.format(" \$ N()" , AWSSDKIdentityTypes .DefaultS3ExpressIdentityResolver ) }, false , false )))
74
- }
75
- }
68
+ override fun getProperties (ctx : ProtocolGenerator .GenerationContext ): Set <ConfigProperty > =
69
+ setOf (
70
+ ConfigProperty (
71
+ " s3ExpressIdentityResolver" ,
72
+ AWSSDKIdentityTypes .S3ExpressIdentityResolver .toGeneric(),
73
+ DefaultProvider ({ it.format(" \$ N()" , AWSSDKIdentityTypes .DefaultS3ExpressIdentityResolver ) }, false , false ),
74
+ ),
75
+ )
76
+ }
0 commit comments