Skip to content

Commit

Permalink
refactor: migrate AWS protocol support to smithy-kotlin (#1254)
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd authored Mar 14, 2024
1 parent 0462019 commit 19f9ec6
Show file tree
Hide file tree
Showing 33 changed files with 8 additions and 2,821 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import aws.smithy.kotlin.runtime.collections.AttributeKey
public object AwsClientOption {
/**
* The AWS region the client should use. Note this is not always the same as [AwsSigningAttributes.SigningRegion] in
* the case of global services like IAM
* the case of global services like IAM.
*
* NOTE: Synonymous with [aws.smithy.kotlin.runtime.awsprotocol.AwsAttributes.Region]
*/
public val Region: AttributeKey<String> = AttributeKey("aws.sdk.kotlin#AwsRegion")
public val Region: AttributeKey<String> = AttributeKey("aws.smithy.kotlin#AwsRegion")

/**
* The ID of the AWS account requests are routed to.
Expand Down
3 changes: 1 addition & 2 deletions codegen/aws-sdk-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ group = "aws.sdk.kotlin"
version = sdkVersion

dependencies {

api(project(":codegen:smithy-aws-kotlin-codegen"))
implementation(libs.kotlin.stdlib.jdk8)
api(libs.smithy.kotlin.codegen)
api(libs.smithy.aws.kotlin.codegen)

api(libs.smithy.aws.traits)
api(libs.smithy.aws.iam.traits)
Expand Down
14 changes: 0 additions & 14 deletions codegen/protocol-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,15 @@ data class ProtocolTest(val projectionName: String, val serviceShapeId: String,
// The following section exposes Smithy protocol test suites as gradle test targets
// for the configured protocols in [enabledProtocols].
val enabledProtocols = listOf(
ProtocolTest("aws-ec2-query", "aws.protocoltests.ec2#AwsEc2"),
ProtocolTest("aws-json-10", "aws.protocoltests.json10#JsonRpc10"),
ProtocolTest("aws-json-11", "aws.protocoltests.json#JsonProtocol"),
ProtocolTest("aws-restjson", "aws.protocoltests.restjson#RestJson"),
ProtocolTest("aws-restxml", "aws.protocoltests.restxml#RestXml"),
ProtocolTest("aws-restxml-xmlns", "aws.protocoltests.restxml.xmlns#RestXmlWithNamespace"),
ProtocolTest("aws-query", "aws.protocoltests.query#AwsQuery"),

// service specific tests
ProtocolTest("apigateway", "com.amazonaws.apigateway#BackplaneControlService"),
ProtocolTest("glacier", "com.amazonaws.glacier#Glacier"),
ProtocolTest("machinelearning", "com.amazonaws.machinelearning#AmazonML_20141212", sdkId = "Machine Learning"),

// Custom hand written tests
ProtocolTest("error-correction-json", "aws.protocoltests.errorcorrection#RequiredValueJson"),
ProtocolTest("error-correction-xml", "aws.protocoltests.errorcorrection#RequiredValueXml"),
)

smithyBuild {
enabledProtocols.forEach { test ->
projections.register(test.projectionName) {
imports = listOf(file("model").absolutePath)

transforms = listOf(
"""
{
Expand Down
156 changes: 0 additions & 156 deletions codegen/protocol-tests/model/error-correction-tests.smithy

This file was deleted.

98 changes: 0 additions & 98 deletions codegen/smithy-aws-kotlin-codegen/build.gradle.kts

This file was deleted.

This file was deleted.

Loading

0 comments on commit 19f9ec6

Please sign in to comment.