private List<ValidationEvent> validateBindings(
            OperationShape operation,
            EndpointTrait endpoint,
            StructureShape input
    ) {
        List<ValidationEvent> events = new ArrayList<>();
        SmithyPattern hostPrefix = endpoint.getHostPrefix();

        // Create a set of labels and remove from the set when a match is
        // found. If any labels remain after looking at all members, then
        // there are unmatched labels.
        Set<String> labels = hostPrefix.getLabels()
                .stream()
                .map(SmithyPattern.Segment::getContent)
                .collect(Collectors.toSet());

        for (MemberShape member : input.getAllMembers().values()) {
            if (member.hasTrait(HostLabelTrait.ID)) {
                HostLabelTrait trait = member.expectTrait(HostLabelTrait.class);
                labels.remove(member.getMemberName());
                if (!hostPrefix.getLabel(member.getMemberName()).isPresent()) {
                    events.add(error(member,
                            trait,
                            format(
                                    "This `%s` structure member is marked with the `hostLabel` trait, but no "
                                            + "corresponding `endpoint` label could be found when used as the input of "
                                            + "the `%s` operation.",
                                    member.getMemberName(),
                                    operation.getId())));
                }
            }
        }

        if (!labels.isEmpty()) {
            events.add(error(operation,
                    format(
                            "This operation uses %s as input, but the following host labels found in the operation's "
                                    + "`endpoint` trait do not have a corresponding member marked with the `hostLabel` trait: %s",
                            input.getId(),
                            ValidationUtils.tickedList(labels))));
        }

        return events;
    }
Match the expanded template to be a valid RFC 3896 host.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HostLabelTraitValidator.java