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

route53: codegen fix to correctly look for operations that need sanitize url #851

Merged
merged 2 commits into from
Oct 23, 2020
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 @@ -3,7 +3,9 @@
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.smithy.aws.traits.ServiceTrait;
import software.amazon.smithy.codegen.core.CodegenException;
import software.amazon.smithy.codegen.core.SymbolProvider;
import software.amazon.smithy.go.codegen.GoDelegator;
import software.amazon.smithy.go.codegen.GoSettings;
Expand Down Expand Up @@ -143,12 +145,17 @@ private static boolean supportsHostedZoneIDValue(Model model, ServiceShape servi
}

StructureShape input = model.expectShape(operation.getInput().get(), StructureShape.class);
Optional<MemberShape> targetMember = input.getAllMembers().values().stream().findFirst().filter(
List<MemberShape> targetMembers = input.getAllMembers().values().stream().filter(
memberShape -> memberShape.getTarget().getName().equalsIgnoreCase("ResourceId") ||
memberShape.getTarget().getName().equalsIgnoreCase("DelegationSetId")
);
).collect(Collectors.toList());

if (targetMembers.size() >1 ){
throw new CodegenException(String.format("Route53 service has ResourceId, DelegationSetId members " +
"modeled on %s shape", input.getId().getName()));
}

return targetMember.isPresent();
return targetMembers.size() != 0;
}

// returns true if service is route53
Expand Down
1 change: 1 addition & 0 deletions service/route53/api_op_ChangeResourceRecordSets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions service/route53/api_op_CreateHostedZone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions service/route53/api_op_CreateQueryLoggingConfig.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions service/route53/api_op_CreateTrafficPolicyInstance.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions service/route53/api_op_DisassociateVPCFromHostedZone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions service/route53/api_op_ListHostedZonesByName.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions service/route53/api_op_ListTrafficPolicyInstances.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions service/route53/api_op_ListVPCAssociationAuthorizations.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions service/route53/api_op_TestDNSAnswer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service/route53/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/route53
go 1.15

require (
github.com/aws/aws-sdk-go-v2 v0.27.1-0.20201021211102-ffda7ace423e
github.com/aws/aws-sdk-go-v2 v0.27.1-0.20201022222834-4451b4af620e
github.com/awslabs/smithy-go v0.2.0
)

Expand Down