From 07d5029a985125b678cb213fc410568fd60e4731 Mon Sep 17 00:00:00 2001 From: Michael Dowling Date: Mon, 23 Mar 2020 15:05:53 -0700 Subject: [PATCH 1/2] Move IAM traits to its own package This change allows us to evolve the IAM traits independent of the rest of the AWS traits. We shouldn't put *all* AWS traits into a single package because it requires that the traits are all changed in unison. --- settings.gradle.kts | 1 + smithy-aws-iam-traits/README.md | 4 ++++ .../build.gradle.kts | 12 ++++++------ .../traits}/ActionPermissionDescriptionTrait.java | 4 ++-- .../aws/iam/traits}/ConditionKeyDefinition.java | 4 ++-- .../smithy/aws/iam/traits}/ConditionKeysIndex.java | 4 ++-- .../smithy/aws/iam/traits}/ConditionKeysTrait.java | 4 ++-- .../aws/iam/traits}/ConditionKeysValidator.java | 4 ++-- .../aws/iam/traits}/DefineConditionKeysTrait.java | 4 ++-- .../traits}/DisableConditionKeyInferenceTrait.java | 4 ++-- .../smithy/aws/iam/traits}/RequiredActionsTrait.java | 4 ++-- .../software.amazon.smithy.model.traits.TraitService | 5 +++++ ...software.amazon.smithy.model.validation.Validator | 1 + .../src/main/resources/META-INF/smithy/aws.iam.json | 0 .../src/main/resources/META-INF/smithy/manifest | 1 + .../ActionPermissionDescriptionTraitTest.java | 4 ++-- .../aws/iam/traits}/ConditionKeysIndexTest.java | 4 ++-- .../aws/iam/traits}/RequiredActionsTraitTest.java | 8 ++++---- .../aws/iam/traits}/invalid-condition-keys.smithy | 0 .../smithy/aws/iam/traits}/required-actions.smithy | 0 .../aws/iam/traits}/successful-condition-keys.smithy | 0 .../software.amazon.smithy.model.traits.TraitService | 5 ----- ...software.amazon.smithy.model.validation.Validator | 1 - .../src/main/resources/META-INF/smithy/manifest | 1 - 24 files changed, 42 insertions(+), 37 deletions(-) create mode 100644 smithy-aws-iam-traits/README.md rename smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/package-info.java => smithy-aws-iam-traits/build.gradle.kts (70%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits}/ActionPermissionDescriptionTrait.java (92%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits}/ConditionKeyDefinition.java (97%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits}/ConditionKeysIndex.java (99%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits}/ConditionKeysTrait.java (94%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits}/ConditionKeysValidator.java (96%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits}/DefineConditionKeysTrait.java (97%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits}/DisableConditionKeyInferenceTrait.java (92%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits}/RequiredActionsTrait.java (94%) create mode 100644 smithy-aws-iam-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService create mode 100644 smithy-aws-iam-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator rename {smithy-aws-traits => smithy-aws-iam-traits}/src/main/resources/META-INF/smithy/aws.iam.json (100%) create mode 100644 smithy-aws-iam-traits/src/main/resources/META-INF/smithy/manifest rename {smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits}/ActionPermissionDescriptionTraitTest.java (93%) rename {smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits}/ConditionKeysIndexTest.java (97%) rename {smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits}/RequiredActionsTraitTest.java (80%) rename {smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/test/resources/software/amazon/smithy/aws/iam/traits}/invalid-condition-keys.smithy (100%) rename {smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/test/resources/software/amazon/smithy/aws/iam/traits}/required-actions.smithy (100%) rename {smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/iam => smithy-aws-iam-traits/src/test/resources/software/amazon/smithy/aws/iam/traits}/successful-condition-keys.smithy (100%) diff --git a/settings.gradle.kts b/settings.gradle.kts index be6f919cad3..f58fea0517c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,5 @@ rootProject.name = "smithy" +include(":smithy-aws-iam-traits") include(":smithy-aws-traits") include(":smithy-aws-apigateway-openapi") include(":smithy-aws-protocol-tests") diff --git a/smithy-aws-iam-traits/README.md b/smithy-aws-iam-traits/README.md new file mode 100644 index 00000000000..3531d508b31 --- /dev/null +++ b/smithy-aws-iam-traits/README.md @@ -0,0 +1,4 @@ +# Smithy AWS IAM traits + +See the [Smithy specification](https://awslabs.github.io/smithy/spec/) +for details on how these traits are used. diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/package-info.java b/smithy-aws-iam-traits/build.gradle.kts similarity index 70% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/package-info.java rename to smithy-aws-iam-traits/build.gradle.kts index 6701b2bbc96..a829bbc1eb6 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/package-info.java +++ b/smithy-aws-iam-traits/build.gradle.kts @@ -13,10 +13,10 @@ * permissions and limitations under the License. */ -/** - * Defines AWS specific traits for Smithy. - */ -@SmithyUnstableApi -package software.amazon.smithy.aws.traits.iam; +description = "This module provides Smithy traits and validators for IAM." +extra["displayName"] = "Smithy :: AWS :: IAM Traits" +extra["moduleName"] = "software.amazon.smithy.aws.iam.traits" -import software.amazon.smithy.utils.SmithyUnstableApi; +dependencies { + api(project(":smithy-aws-traits")) +} diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ActionPermissionDescriptionTrait.java b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ActionPermissionDescriptionTrait.java similarity index 92% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ActionPermissionDescriptionTrait.java rename to smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ActionPermissionDescriptionTrait.java index e93e85c55e2..154b3fac3c1 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ActionPermissionDescriptionTrait.java +++ b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ActionPermissionDescriptionTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import software.amazon.smithy.model.SourceLocation; import software.amazon.smithy.model.shapes.ShapeId; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeyDefinition.java b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeyDefinition.java similarity index 97% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeyDefinition.java rename to smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeyDefinition.java index 500a593881e..8571ed2cee3 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeyDefinition.java +++ b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeyDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import java.util.List; import java.util.Objects; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeysIndex.java b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysIndex.java similarity index 99% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeysIndex.java rename to smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysIndex.java index be6a41c1356..f500ae426dd 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeysIndex.java +++ b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import java.util.Collections; import java.util.HashMap; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeysTrait.java b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysTrait.java similarity index 94% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeysTrait.java rename to smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysTrait.java index 6ddd0db1897..24dd3631434 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeysTrait.java +++ b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import java.util.List; import software.amazon.smithy.model.FromSourceLocation; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeysValidator.java b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysValidator.java similarity index 96% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeysValidator.java rename to smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysValidator.java index be272171b11..5eb0cd3ace3 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/ConditionKeysValidator.java +++ b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import java.util.ArrayList; import java.util.List; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/DefineConditionKeysTrait.java b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/DefineConditionKeysTrait.java similarity index 97% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/DefineConditionKeysTrait.java rename to smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/DefineConditionKeysTrait.java index 5f4139c5540..11c65a6a1e6 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/DefineConditionKeysTrait.java +++ b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/DefineConditionKeysTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import java.util.AbstractMap; import java.util.HashMap; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/DisableConditionKeyInferenceTrait.java b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/DisableConditionKeyInferenceTrait.java similarity index 92% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/DisableConditionKeyInferenceTrait.java rename to smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/DisableConditionKeyInferenceTrait.java index ed0744588a5..e2d1049f1d8 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/DisableConditionKeyInferenceTrait.java +++ b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/DisableConditionKeyInferenceTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import software.amazon.smithy.model.SourceLocation; import software.amazon.smithy.model.shapes.ShapeId; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/RequiredActionsTrait.java b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/RequiredActionsTrait.java similarity index 94% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/RequiredActionsTrait.java rename to smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/RequiredActionsTrait.java index b3fce9b179d..7800636240e 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/iam/RequiredActionsTrait.java +++ b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/RequiredActionsTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import java.util.List; import software.amazon.smithy.model.FromSourceLocation; diff --git a/smithy-aws-iam-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService b/smithy-aws-iam-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService new file mode 100644 index 00000000000..c587c255221 --- /dev/null +++ b/smithy-aws-iam-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService @@ -0,0 +1,5 @@ +software.amazon.smithy.aws.iam.traits.ActionPermissionDescriptionTrait$Provider +software.amazon.smithy.aws.iam.traits.ConditionKeysTrait$Provider +software.amazon.smithy.aws.iam.traits.DefineConditionKeysTrait$Provider +software.amazon.smithy.aws.iam.traits.DisableConditionKeyInferenceTrait$Provider +software.amazon.smithy.aws.iam.traits.RequiredActionsTrait$Provider diff --git a/smithy-aws-iam-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator b/smithy-aws-iam-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator new file mode 100644 index 00000000000..c77a40ad52b --- /dev/null +++ b/smithy-aws-iam-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator @@ -0,0 +1 @@ +software.amazon.smithy.aws.iam.traits.ConditionKeysValidator diff --git a/smithy-aws-traits/src/main/resources/META-INF/smithy/aws.iam.json b/smithy-aws-iam-traits/src/main/resources/META-INF/smithy/aws.iam.json similarity index 100% rename from smithy-aws-traits/src/main/resources/META-INF/smithy/aws.iam.json rename to smithy-aws-iam-traits/src/main/resources/META-INF/smithy/aws.iam.json diff --git a/smithy-aws-iam-traits/src/main/resources/META-INF/smithy/manifest b/smithy-aws-iam-traits/src/main/resources/META-INF/smithy/manifest new file mode 100644 index 00000000000..dac078e3eda --- /dev/null +++ b/smithy-aws-iam-traits/src/main/resources/META-INF/smithy/manifest @@ -0,0 +1 @@ +aws.iam.json diff --git a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam/ActionPermissionDescriptionTraitTest.java b/smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits/ActionPermissionDescriptionTraitTest.java similarity index 93% rename from smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam/ActionPermissionDescriptionTraitTest.java rename to smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits/ActionPermissionDescriptionTraitTest.java index 682bb5cbb66..426e9cada76 100644 --- a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam/ActionPermissionDescriptionTraitTest.java +++ b/smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits/ActionPermissionDescriptionTraitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; diff --git a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam/ConditionKeysIndexTest.java b/smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits/ConditionKeysIndexTest.java similarity index 97% rename from smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam/ConditionKeysIndexTest.java rename to smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits/ConditionKeysIndexTest.java index e72932c6e16..48d2a862014 100644 --- a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam/ConditionKeysIndexTest.java +++ b/smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits/ConditionKeysIndexTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; diff --git a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam/RequiredActionsTraitTest.java b/smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits/RequiredActionsTraitTest.java similarity index 80% rename from smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam/RequiredActionsTraitTest.java rename to smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits/RequiredActionsTraitTest.java index cf4949f3725..aba961b71d3 100644 --- a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/iam/RequiredActionsTraitTest.java +++ b/smithy-aws-iam-traits/src/test/java/software/amazon/smithy/aws/iam/traits/RequiredActionsTraitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.iam; +package software.amazon.smithy.aws.iam.traits; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; @@ -33,10 +33,10 @@ public void loadsFromModel() { .assemble() .unwrap(); - Shape myOperation = result.getShape(ShapeId.from("smithy.example#MyOperation")).get(); + Shape myOperation = result.expectShape(ShapeId.from("smithy.example#MyOperation")); assertTrue(myOperation.hasTrait(RequiredActionsTrait.class)); - assertThat(myOperation.getTrait(RequiredActionsTrait.class).get().getValues(), containsInAnyOrder( + assertThat(myOperation.expectTrait(RequiredActionsTrait.class).getValues(), containsInAnyOrder( "iam:PassRole", "ec2:RunInstances")); } } diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/iam/invalid-condition-keys.smithy b/smithy-aws-iam-traits/src/test/resources/software/amazon/smithy/aws/iam/traits/invalid-condition-keys.smithy similarity index 100% rename from smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/iam/invalid-condition-keys.smithy rename to smithy-aws-iam-traits/src/test/resources/software/amazon/smithy/aws/iam/traits/invalid-condition-keys.smithy diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/iam/required-actions.smithy b/smithy-aws-iam-traits/src/test/resources/software/amazon/smithy/aws/iam/traits/required-actions.smithy similarity index 100% rename from smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/iam/required-actions.smithy rename to smithy-aws-iam-traits/src/test/resources/software/amazon/smithy/aws/iam/traits/required-actions.smithy diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/iam/successful-condition-keys.smithy b/smithy-aws-iam-traits/src/test/resources/software/amazon/smithy/aws/iam/traits/successful-condition-keys.smithy similarity index 100% rename from smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/iam/successful-condition-keys.smithy rename to smithy-aws-iam-traits/src/test/resources/software/amazon/smithy/aws/iam/traits/successful-condition-keys.smithy diff --git a/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService b/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService index 00555335967..69f5e9b8894 100644 --- a/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService +++ b/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService @@ -6,11 +6,6 @@ software.amazon.smithy.aws.traits.DataPlaneTrait$Provider software.amazon.smithy.aws.traits.DataTrait$Provider software.amazon.smithy.aws.traits.ServiceTrait$Provider software.amazon.smithy.aws.traits.auth.UnsignedPayloadTrait$Provider -software.amazon.smithy.aws.traits.iam.ActionPermissionDescriptionTrait$Provider -software.amazon.smithy.aws.traits.iam.ConditionKeysTrait$Provider -software.amazon.smithy.aws.traits.iam.DefineConditionKeysTrait$Provider -software.amazon.smithy.aws.traits.iam.DisableConditionKeyInferenceTrait$Provider -software.amazon.smithy.aws.traits.iam.RequiredActionsTrait$Provider software.amazon.smithy.aws.traits.apigateway.AuthorizerTrait$Provider software.amazon.smithy.aws.traits.apigateway.AuthorizersTrait$Provider software.amazon.smithy.aws.traits.apigateway.RequestValidatorTrait$Provider diff --git a/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator b/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator index 1283308cd1c..863a4491aa8 100644 --- a/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator +++ b/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator @@ -1,5 +1,4 @@ software.amazon.smithy.aws.traits.ArnTemplateValidator software.amazon.smithy.aws.traits.SdkServiceIdValidator -software.amazon.smithy.aws.traits.iam.ConditionKeysValidator software.amazon.smithy.aws.traits.apigateway.AuthorizersTraitValidator software.amazon.smithy.aws.traits.clientendpointdiscovery.ClientEndpointDiscoveryValidator diff --git a/smithy-aws-traits/src/main/resources/META-INF/smithy/manifest b/smithy-aws-traits/src/main/resources/META-INF/smithy/manifest index a16fe6388ae..e44913f7667 100644 --- a/smithy-aws-traits/src/main/resources/META-INF/smithy/manifest +++ b/smithy-aws-traits/src/main/resources/META-INF/smithy/manifest @@ -1,5 +1,4 @@ aws.api.json aws.apigateway.json aws.auth.json -aws.iam.json aws.protocols.json From 3df17710680b8509f6c7cd20abb678d9de77b403 Mon Sep 17 00:00:00 2001 From: Michael Dowling Date: Mon, 23 Mar 2020 17:46:07 -0700 Subject: [PATCH 2/2] Move API Gateway traits to their own package --- settings.gradle.kts | 1 + .../build.gradle.kts | 4 +--- .../apigateway/openapi/AddApiKeySource.java | 2 +- .../apigateway/openapi/AddAuthorizers.java | 8 +++---- .../openapi/AddCorsPreflightIntegration.java | 4 ++-- .../apigateway/openapi/AddIntegrations.java | 6 ++--- .../openapi/AddRequestValidators.java | 2 +- smithy-aws-apigateway-traits/README.md | 4 ++++ smithy-aws-apigateway-traits/build.gradle.kts | 22 +++++++++++++++++++ .../apigateway/traits}/ApiKeySourceTrait.java | 4 ++-- .../traits}/AuthorizerDefinition.java | 4 ++-- .../apigateway/traits}/AuthorizerIndex.java | 4 ++-- .../apigateway/traits}/AuthorizerTrait.java | 4 ++-- .../apigateway/traits}/AuthorizersTrait.java | 4 ++-- .../traits}/AuthorizersTraitValidator.java | 4 ++-- .../traits}/IntegrationResponse.java | 4 ++-- .../apigateway/traits}/IntegrationTrait.java | 4 ++-- .../traits}/IntegrationTraitIndex.java | 4 ++-- .../traits}/MockIntegrationTrait.java | 4 ++-- .../traits}/RequestValidatorTrait.java | 4 ++-- ...re.amazon.smithy.model.traits.TraitService | 6 +++++ ...e.amazon.smithy.model.validation.Validator | 1 + .../META-INF/smithy/aws.apigateway.json | 0 .../main/resources/META-INF/smithy/manifest | 1 + .../traits}/ApiKeySourceTraitTest.java | 2 +- .../traits}/AuthorizerIndexTest.java | 2 +- .../traits}/AuthorizersTraitTest.java | 2 +- .../traits}/IntegrationTraitIndexTest.java | 4 ++-- .../traits}/IntegrationTraitTest.java | 7 +++--- .../traits}/MockIntegrationTraitTest.java | 4 ++-- .../traits}/RequestValidatorTraitTest.java | 2 +- .../aws/apigateway/traits/TestRunnerTest.java | 20 +++++++++++++++++ .../traits}/effective-authorizers.smithy | 0 .../errorfiles}/invalid-authorizers.errors | 0 .../errorfiles}/invalid-authorizers.json | 0 .../errorfiles}/valid-integration.errors | 0 .../traits/errorfiles}/valid-integration.json | 0 .../apigateway/traits}/integration-index.json | 0 smithy-aws-traits/build.gradle.kts | 1 - ...re.amazon.smithy.model.traits.TraitService | 6 ----- ...e.amazon.smithy.model.validation.Validator | 1 - .../main/resources/META-INF/smithy/manifest | 1 - 42 files changed, 100 insertions(+), 57 deletions(-) create mode 100644 smithy-aws-apigateway-traits/README.md create mode 100644 smithy-aws-apigateway-traits/build.gradle.kts rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/ApiKeySourceTrait.java (91%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/AuthorizerDefinition.java (99%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/AuthorizerIndex.java (97%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/AuthorizerTrait.java (91%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/AuthorizersTrait.java (97%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/AuthorizersTraitValidator.java (96%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/IntegrationResponse.java (98%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/IntegrationTrait.java (99%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/IntegrationTraitIndex.java (97%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/MockIntegrationTrait.java (99%) rename {smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits}/RequestValidatorTrait.java (91%) create mode 100644 smithy-aws-apigateway-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService create mode 100644 smithy-aws-apigateway-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator rename {smithy-aws-traits => smithy-aws-apigateway-traits}/src/main/resources/META-INF/smithy/aws.apigateway.json (100%) create mode 100644 smithy-aws-apigateway-traits/src/main/resources/META-INF/smithy/manifest rename {smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits}/ApiKeySourceTraitTest.java (94%) rename {smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits}/AuthorizerIndexTest.java (98%) rename {smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits}/AuthorizersTraitTest.java (96%) rename {smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits}/IntegrationTraitIndexTest.java (95%) rename {smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits}/IntegrationTraitTest.java (89%) rename {smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits}/MockIntegrationTraitTest.java (89%) rename {smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits}/RequestValidatorTraitTest.java (94%) create mode 100644 smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/TestRunnerTest.java rename {smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits}/effective-authorizers.smithy (100%) rename {smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway => smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles}/invalid-authorizers.errors (100%) rename {smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway => smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles}/invalid-authorizers.json (100%) rename {smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway => smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles}/valid-integration.errors (100%) rename {smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway => smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles}/valid-integration.json (100%) rename {smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/apigateway => smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits}/integration-index.json (100%) diff --git a/settings.gradle.kts b/settings.gradle.kts index f58fea0517c..2cf69e61ab4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,6 +1,7 @@ rootProject.name = "smithy" include(":smithy-aws-iam-traits") include(":smithy-aws-traits") +include(":smithy-aws-apigateway-traits") include(":smithy-aws-apigateway-openapi") include(":smithy-aws-protocol-tests") include(":smithy-cli") diff --git a/smithy-aws-apigateway-openapi/build.gradle.kts b/smithy-aws-apigateway-openapi/build.gradle.kts index 6f213d1f589..817a4f03832 100644 --- a/smithy-aws-apigateway-openapi/build.gradle.kts +++ b/smithy-aws-apigateway-openapi/build.gradle.kts @@ -19,8 +19,6 @@ extra["displayName"] = "Smithy :: Amazon API Gateway OpenAPI Support" extra["moduleName"] = "software.amazon.smithy.aws.apigateway.openapi" dependencies { - api(project(":smithy-model")) - api(project(":smithy-utils")) api(project(":smithy-openapi")) - api(project(":smithy-aws-traits")) + api(project(":smithy-aws-apigateway-traits")) } diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddApiKeySource.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddApiKeySource.java index 120ada05994..d2e84ccfcbc 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddApiKeySource.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddApiKeySource.java @@ -16,7 +16,7 @@ package software.amazon.smithy.aws.apigateway.openapi; import java.util.logging.Logger; -import software.amazon.smithy.aws.traits.apigateway.ApiKeySourceTrait; +import software.amazon.smithy.aws.apigateway.traits.ApiKeySourceTrait; import software.amazon.smithy.model.traits.Trait; import software.amazon.smithy.openapi.fromsmithy.Context; import software.amazon.smithy.openapi.fromsmithy.OpenApiMapper; diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddAuthorizers.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddAuthorizers.java index 036fef7fc8e..d4c43687af9 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddAuthorizers.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddAuthorizers.java @@ -18,10 +18,10 @@ import java.util.List; import java.util.Map; import java.util.logging.Logger; -import software.amazon.smithy.aws.traits.apigateway.AuthorizerDefinition; -import software.amazon.smithy.aws.traits.apigateway.AuthorizerIndex; -import software.amazon.smithy.aws.traits.apigateway.AuthorizerTrait; -import software.amazon.smithy.aws.traits.apigateway.AuthorizersTrait; +import software.amazon.smithy.aws.apigateway.traits.AuthorizerDefinition; +import software.amazon.smithy.aws.apigateway.traits.AuthorizerIndex; +import software.amazon.smithy.aws.apigateway.traits.AuthorizerTrait; +import software.amazon.smithy.aws.apigateway.traits.AuthorizersTrait; import software.amazon.smithy.model.node.Node; import software.amazon.smithy.model.node.ObjectNode; import software.amazon.smithy.model.shapes.ServiceShape; diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsPreflightIntegration.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsPreflightIntegration.java index aaf4e69a6c1..b9e587c0202 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsPreflightIntegration.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsPreflightIntegration.java @@ -26,8 +26,8 @@ import java.util.TreeSet; import java.util.logging.Logger; import java.util.stream.Collectors; -import software.amazon.smithy.aws.traits.apigateway.IntegrationResponse; -import software.amazon.smithy.aws.traits.apigateway.MockIntegrationTrait; +import software.amazon.smithy.aws.apigateway.traits.IntegrationResponse; +import software.amazon.smithy.aws.apigateway.traits.MockIntegrationTrait; import software.amazon.smithy.jsonschema.Schema; import software.amazon.smithy.model.node.ObjectNode; import software.amazon.smithy.model.traits.CorsTrait; diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddIntegrations.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddIntegrations.java index ab5f60f8ff6..174c85899d4 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddIntegrations.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddIntegrations.java @@ -20,9 +20,9 @@ import java.util.Set; import java.util.TreeSet; import java.util.logging.Logger; -import software.amazon.smithy.aws.traits.apigateway.IntegrationTrait; -import software.amazon.smithy.aws.traits.apigateway.IntegrationTraitIndex; -import software.amazon.smithy.aws.traits.apigateway.MockIntegrationTrait; +import software.amazon.smithy.aws.apigateway.traits.IntegrationTrait; +import software.amazon.smithy.aws.apigateway.traits.IntegrationTraitIndex; +import software.amazon.smithy.aws.apigateway.traits.MockIntegrationTrait; import software.amazon.smithy.model.node.Node; import software.amazon.smithy.model.node.ObjectNode; import software.amazon.smithy.model.shapes.OperationShape; diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddRequestValidators.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddRequestValidators.java index 89d8beca629..9ab63195ed6 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddRequestValidators.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddRequestValidators.java @@ -18,7 +18,7 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import software.amazon.smithy.aws.traits.apigateway.RequestValidatorTrait; +import software.amazon.smithy.aws.apigateway.traits.RequestValidatorTrait; import software.amazon.smithy.model.node.Node; import software.amazon.smithy.model.node.ObjectNode; import software.amazon.smithy.model.shapes.OperationShape; diff --git a/smithy-aws-apigateway-traits/README.md b/smithy-aws-apigateway-traits/README.md new file mode 100644 index 00000000000..880de72919a --- /dev/null +++ b/smithy-aws-apigateway-traits/README.md @@ -0,0 +1,4 @@ +# Smithy AWS API Gateway traits + +See the [Smithy specification](https://awslabs.github.io/smithy/spec/) +for details on how these traits are used. diff --git a/smithy-aws-apigateway-traits/build.gradle.kts b/smithy-aws-apigateway-traits/build.gradle.kts new file mode 100644 index 00000000000..ec0e4b78a4b --- /dev/null +++ b/smithy-aws-apigateway-traits/build.gradle.kts @@ -0,0 +1,22 @@ +/* + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +description = "This module provides Smithy traits and validators for API Gateway." +extra["displayName"] = "Smithy :: AWS :: API Gateway Traits" +extra["moduleName"] = "software.amazon.smithy.aws.apigateway.traits" + +dependencies { + api(project(":smithy-aws-traits")) +} diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/ApiKeySourceTrait.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/ApiKeySourceTrait.java similarity index 91% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/ApiKeySourceTrait.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/ApiKeySourceTrait.java index e5add4c0820..e1819de7a80 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/ApiKeySourceTrait.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/ApiKeySourceTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import software.amazon.smithy.model.FromSourceLocation; import software.amazon.smithy.model.SourceLocation; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerDefinition.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerDefinition.java similarity index 99% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerDefinition.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerDefinition.java index 65522ebb47a..f3fbe415332 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerDefinition.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import java.util.List; import java.util.Objects; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerIndex.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerIndex.java similarity index 97% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerIndex.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerIndex.java index 9da50f91d4a..870cf9d9c1b 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerIndex.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import java.util.HashMap; import java.util.Map; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerTrait.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerTrait.java similarity index 91% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerTrait.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerTrait.java index 13ecfc6eb2b..5166355b25c 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerTrait.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import software.amazon.smithy.model.SourceLocation; import software.amazon.smithy.model.shapes.ShapeId; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizersTrait.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTrait.java similarity index 97% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizersTrait.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTrait.java index 9ddc4b21b13..dde5ba21330 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizersTrait.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import java.util.Comparator; import java.util.HashMap; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizersTraitValidator.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTraitValidator.java similarity index 96% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizersTraitValidator.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTraitValidator.java index 49651318176..ae062b70d89 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/AuthorizersTraitValidator.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTraitValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import java.util.HashMap; import java.util.List; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/IntegrationResponse.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/IntegrationResponse.java similarity index 98% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/IntegrationResponse.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/IntegrationResponse.java index edf453717b7..94b9ee46f89 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/IntegrationResponse.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/IntegrationResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import java.util.HashMap; import java.util.Map; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTrait.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTrait.java similarity index 99% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTrait.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTrait.java index c1e04a54c2a..7a824bec933 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTrait.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import java.util.ArrayList; import java.util.HashMap; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTraitIndex.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTraitIndex.java similarity index 97% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTraitIndex.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTraitIndex.java index d8cb867fd5a..3ecdd7fae6c 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTraitIndex.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTraitIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import java.util.HashMap; import java.util.Map; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/MockIntegrationTrait.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/MockIntegrationTrait.java similarity index 99% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/MockIntegrationTrait.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/MockIntegrationTrait.java index 6026ac5866a..2efbc4f79cd 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/MockIntegrationTrait.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/MockIntegrationTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import java.util.HashMap; import java.util.Map; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/RequestValidatorTrait.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/RequestValidatorTrait.java similarity index 91% rename from smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/RequestValidatorTrait.java rename to smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/RequestValidatorTrait.java index bdd3da41192..a623a499a94 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/apigateway/RequestValidatorTrait.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/RequestValidatorTrait.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import software.amazon.smithy.model.FromSourceLocation; import software.amazon.smithy.model.SourceLocation; diff --git a/smithy-aws-apigateway-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService b/smithy-aws-apigateway-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService new file mode 100644 index 00000000000..8a81fa7539e --- /dev/null +++ b/smithy-aws-apigateway-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService @@ -0,0 +1,6 @@ +software.amazon.smithy.aws.apigateway.traits.AuthorizerTrait$Provider +software.amazon.smithy.aws.apigateway.traits.AuthorizersTrait$Provider +software.amazon.smithy.aws.apigateway.traits.RequestValidatorTrait$Provider +software.amazon.smithy.aws.apigateway.traits.ApiKeySourceTrait$Provider +software.amazon.smithy.aws.apigateway.traits.IntegrationTrait$Provider +software.amazon.smithy.aws.apigateway.traits.MockIntegrationTrait$Provider diff --git a/smithy-aws-apigateway-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator b/smithy-aws-apigateway-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator new file mode 100644 index 00000000000..6a00d6d73ac --- /dev/null +++ b/smithy-aws-apigateway-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator @@ -0,0 +1 @@ +software.amazon.smithy.aws.apigateway.traits.AuthorizersTraitValidator diff --git a/smithy-aws-traits/src/main/resources/META-INF/smithy/aws.apigateway.json b/smithy-aws-apigateway-traits/src/main/resources/META-INF/smithy/aws.apigateway.json similarity index 100% rename from smithy-aws-traits/src/main/resources/META-INF/smithy/aws.apigateway.json rename to smithy-aws-apigateway-traits/src/main/resources/META-INF/smithy/aws.apigateway.json diff --git a/smithy-aws-apigateway-traits/src/main/resources/META-INF/smithy/manifest b/smithy-aws-apigateway-traits/src/main/resources/META-INF/smithy/manifest new file mode 100644 index 00000000000..e1e1cbe5eab --- /dev/null +++ b/smithy-aws-apigateway-traits/src/main/resources/META-INF/smithy/manifest @@ -0,0 +1 @@ +aws.apigateway.json diff --git a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/ApiKeySourceTraitTest.java b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/ApiKeySourceTraitTest.java similarity index 94% rename from smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/ApiKeySourceTraitTest.java rename to smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/ApiKeySourceTraitTest.java index 3ba7be59099..1bbd566c6b7 100644 --- a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/ApiKeySourceTraitTest.java +++ b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/ApiKeySourceTraitTest.java @@ -1,4 +1,4 @@ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; diff --git a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerIndexTest.java b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerIndexTest.java similarity index 98% rename from smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerIndexTest.java rename to smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerIndexTest.java index 421600719b3..4ad833ecb85 100644 --- a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/AuthorizerIndexTest.java +++ b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/AuthorizerIndexTest.java @@ -1,4 +1,4 @@ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; diff --git a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/AuthorizersTraitTest.java b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTraitTest.java similarity index 96% rename from smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/AuthorizersTraitTest.java rename to smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTraitTest.java index aeb066a290c..e56be02df8d 100644 --- a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/AuthorizersTraitTest.java +++ b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTraitTest.java @@ -1,4 +1,4 @@ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; diff --git a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTraitIndexTest.java b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTraitIndexTest.java similarity index 95% rename from smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTraitIndexTest.java rename to smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTraitIndexTest.java index 4fbf4aaff3e..47c43262c44 100644 --- a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTraitIndexTest.java +++ b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTraitIndexTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; diff --git a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTraitTest.java b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTraitTest.java similarity index 89% rename from smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTraitTest.java rename to smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTraitTest.java index f20b1c6ef7e..a387494ca60 100644 --- a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/IntegrationTraitTest.java +++ b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTraitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,13 +13,12 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import org.junit.jupiter.api.Test; -import software.amazon.smithy.aws.traits.TestRunnerTest; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.ShapeId; @@ -47,7 +46,7 @@ public void loadsValidTrait() { public void loadsTraitFromModel() { Model model = Model.assembler() .discoverModels(getClass().getClassLoader()) - .addImport(TestRunnerTest.class.getResource("errorfiles/apigateway/valid-integration.json")) + .addImport(TestRunnerTest.class.getResource("errorfiles/valid-integration.json")) .assemble() .unwrap(); diff --git a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/MockIntegrationTraitTest.java b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/MockIntegrationTraitTest.java similarity index 89% rename from smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/MockIntegrationTraitTest.java rename to smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/MockIntegrationTraitTest.java index 317c4da5316..c878b448c5b 100644 --- a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/MockIntegrationTraitTest.java +++ b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/MockIntegrationTraitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; diff --git a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/RequestValidatorTraitTest.java b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/RequestValidatorTraitTest.java similarity index 94% rename from smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/RequestValidatorTraitTest.java rename to smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/RequestValidatorTraitTest.java index bbc1e94dfc2..5fd221589a9 100644 --- a/smithy-aws-traits/src/test/java/software/amazon/smithy/aws/traits/apigateway/RequestValidatorTraitTest.java +++ b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/RequestValidatorTraitTest.java @@ -1,4 +1,4 @@ -package software.amazon.smithy.aws.traits.apigateway; +package software.amazon.smithy.aws.apigateway.traits; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; diff --git a/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/TestRunnerTest.java b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/TestRunnerTest.java new file mode 100644 index 00000000000..2e6268ee15a --- /dev/null +++ b/smithy-aws-apigateway-traits/src/test/java/software/amazon/smithy/aws/apigateway/traits/TestRunnerTest.java @@ -0,0 +1,20 @@ +package software.amazon.smithy.aws.apigateway.traits; + +import java.util.concurrent.Callable; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import software.amazon.smithy.model.validation.testrunner.SmithyTestCase; +import software.amazon.smithy.model.validation.testrunner.SmithyTestSuite; + +public class TestRunnerTest { + @ParameterizedTest(name = "{0}") + @MethodSource("source") + public void testRunner(String filename, Callable callable) throws Exception { + callable.call(); + } + + public static Stream source() { + return SmithyTestSuite.defaultParameterizedTestSource(TestRunnerTest.class); + } +} diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/apigateway/effective-authorizers.smithy b/smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/effective-authorizers.smithy similarity index 100% rename from smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/apigateway/effective-authorizers.smithy rename to smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/effective-authorizers.smithy diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/invalid-authorizers.errors b/smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles/invalid-authorizers.errors similarity index 100% rename from smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/invalid-authorizers.errors rename to smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles/invalid-authorizers.errors diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/invalid-authorizers.json b/smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles/invalid-authorizers.json similarity index 100% rename from smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/invalid-authorizers.json rename to smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles/invalid-authorizers.json diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/valid-integration.errors b/smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles/valid-integration.errors similarity index 100% rename from smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/valid-integration.errors rename to smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles/valid-integration.errors diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/valid-integration.json b/smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles/valid-integration.json similarity index 100% rename from smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/apigateway/valid-integration.json rename to smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/errorfiles/valid-integration.json diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/apigateway/integration-index.json b/smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/integration-index.json similarity index 100% rename from smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/apigateway/integration-index.json rename to smithy-aws-apigateway-traits/src/test/resources/software/amazon/smithy/aws/apigateway/traits/integration-index.json diff --git a/smithy-aws-traits/build.gradle.kts b/smithy-aws-traits/build.gradle.kts index 7efa27aa429..8e5a5304bfe 100644 --- a/smithy-aws-traits/build.gradle.kts +++ b/smithy-aws-traits/build.gradle.kts @@ -19,5 +19,4 @@ extra["moduleName"] = "software.amazon.smithy.aws.traits" dependencies { api(project(":smithy-model")) - api(project(":smithy-utils")) } diff --git a/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService b/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService index 69f5e9b8894..b171bdcd0fb 100644 --- a/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService +++ b/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.traits.TraitService @@ -6,12 +6,6 @@ software.amazon.smithy.aws.traits.DataPlaneTrait$Provider software.amazon.smithy.aws.traits.DataTrait$Provider software.amazon.smithy.aws.traits.ServiceTrait$Provider software.amazon.smithy.aws.traits.auth.UnsignedPayloadTrait$Provider -software.amazon.smithy.aws.traits.apigateway.AuthorizerTrait$Provider -software.amazon.smithy.aws.traits.apigateway.AuthorizersTrait$Provider -software.amazon.smithy.aws.traits.apigateway.RequestValidatorTrait$Provider -software.amazon.smithy.aws.traits.apigateway.ApiKeySourceTrait$Provider -software.amazon.smithy.aws.traits.apigateway.IntegrationTrait$Provider -software.amazon.smithy.aws.traits.apigateway.MockIntegrationTrait$Provider software.amazon.smithy.aws.traits.clientendpointdiscovery.ClientEndpointDiscoveryTrait$Provider software.amazon.smithy.aws.traits.clientendpointdiscovery.ClientEndpointDiscoveryIdTrait$Provider software.amazon.smithy.aws.traits.clientendpointdiscovery.ClientDiscoveredEndpointTrait$Provider diff --git a/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator b/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator index 863a4491aa8..296564295f9 100644 --- a/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator +++ b/smithy-aws-traits/src/main/resources/META-INF/services/software.amazon.smithy.model.validation.Validator @@ -1,4 +1,3 @@ software.amazon.smithy.aws.traits.ArnTemplateValidator software.amazon.smithy.aws.traits.SdkServiceIdValidator -software.amazon.smithy.aws.traits.apigateway.AuthorizersTraitValidator software.amazon.smithy.aws.traits.clientendpointdiscovery.ClientEndpointDiscoveryValidator diff --git a/smithy-aws-traits/src/main/resources/META-INF/smithy/manifest b/smithy-aws-traits/src/main/resources/META-INF/smithy/manifest index e44913f7667..0c76136e520 100644 --- a/smithy-aws-traits/src/main/resources/META-INF/smithy/manifest +++ b/smithy-aws-traits/src/main/resources/META-INF/smithy/manifest @@ -1,4 +1,3 @@ aws.api.json -aws.apigateway.json aws.auth.json aws.protocols.json