From 06383bb79853a881a08ac68f1526dfa48ecc9ac1 Mon Sep 17 00:00:00 2001 From: Chase Coalwell Date: Fri, 20 Dec 2019 11:43:48 -0800 Subject: [PATCH] Fix plugin predicates (#569) --- .../typescript/codegen/AddBuiltinPlugins.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java index 3ee2577abcdb..af9eae5e2e77 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java @@ -103,44 +103,44 @@ public List getClientPlugins() { .build(), RuntimeClientPlugin.builder() .withConventions(AwsDependency.SSEC_MIDDLEWARE.dependency, "Ssec", HAS_MIDDLEWARE) - .servicePredicate((m, s) -> testServiceId(s, "S3")) - .operationPredicate((m, s, o) -> testInputContainsMember(m, o, SSEC_OPERATIONS)) + .operationPredicate((m, s, o) -> testInputContainsMember(m, o, SSEC_OPERATIONS) + && testServiceId(s, "S3")) .build(), RuntimeClientPlugin.builder() .withConventions(AwsDependency.LOCATION_CONSTRAINT.dependency, "LocationConstraint", HAS_MIDDLEWARE) - .servicePredicate((m, s) -> testServiceId(s, "S3")) - .operationPredicate((m, s, o) -> o.getId().getName().equals("CreateBucket")) + .operationPredicate((m, s, o) -> o.getId().getName().equals("CreateBucket") + && testServiceId(s, "S3")) .build(), RuntimeClientPlugin.builder() .withConventions(AwsDependency.MACHINELEARNING_MIDDLEWARE.dependency, "PredictEndpoint", HAS_MIDDLEWARE) - .servicePredicate((m, s) -> testServiceId(s, "Machine Learning")) - .operationPredicate((m, s, o) -> o.getId().getName().equals("Predict")) + .operationPredicate((m, s, o) -> o.getId().getName().equals("Predict") + && testServiceId(s, "Machine Learning")) .build(), RuntimeClientPlugin.builder() .withConventions(AwsDependency.BUCKET_ENDPOINT_MIDDLEWARE.dependency, "BucketEndpoint", HAS_MIDDLEWARE) - .servicePredicate((m, s) -> testServiceId(s, "S3")) - .operationPredicate((m, s, o) -> !NON_BUCKET_ENDPOINT_OPERATIONS.contains(o.getId().getName())) + .operationPredicate((m, s, o) -> !NON_BUCKET_ENDPOINT_OPERATIONS.contains(o.getId().getName()) + && testServiceId(s, "S3")) .build(), RuntimeClientPlugin.builder() .withConventions(AwsDependency.BODY_CHECKSUM.dependency, "ApplyMd5BodyChecksum", HAS_MIDDLEWARE) - .servicePredicate((m, s) -> testServiceId(s, "S3")) - .operationPredicate((m, s, o) -> S3_MD5_OPERATIONS.contains(o.getId().getName())) + .operationPredicate((m, s, o) -> S3_MD5_OPERATIONS.contains(o.getId().getName()) + && testServiceId(s, "S3")) .build(), RuntimeClientPlugin.builder() .withConventions(AwsDependency.ROUTE53_MIDDLEWARE.dependency, "ChangeResourceRecordSets", HAS_MIDDLEWARE) - .servicePredicate((m, s) -> testServiceId(s, "Route 53")) - .operationPredicate((m, s, o) -> o.getId().getName().equals("ChangeResourceRecordSets")) + .operationPredicate((m, s, o) -> o.getId().getName().equals("ChangeResourceRecordSets") + && testServiceId(s, "Route 53")) .build(), RuntimeClientPlugin.builder() .withConventions(AwsDependency.ROUTE53_MIDDLEWARE.dependency, "IdNormalizer", HAS_MIDDLEWARE) - .servicePredicate((m, s) -> testServiceId(s, "Route 53")) - .operationPredicate((m, s, o) -> testInputContainsMember(m, o, ROUTE_53_ID_MEMBERS)) + .operationPredicate((m, s, o) -> testInputContainsMember(m, o, ROUTE_53_ID_MEMBERS) + && testServiceId(s, "Route 53")) .build(), RuntimeClientPlugin.builder() .withConventions(AwsDependency.MIDDLEWARE_HOST_HEADER.dependency, "HostHeader")