@Override
    public List<ValidationEvent> validate(Model model) {
        List<ValidationEvent> events = new ArrayList<>();
        if (!model.getAppliedTraits().contains(ConditionKeyValueTrait.ID)) {
            return events;
        }

        TopDownIndex topDownIndex = TopDownIndex.of(model);
        OperationIndex operationIndex = OperationIndex.of(model);
        for (ServiceShape service : model.getServiceShapesWithTrait(ServiceTrait.class)) {
            for (OperationShape operation : topDownIndex.getContainedOperations(service)) {
                Map<String, List<String>> conditionKeyMembers = new HashMap<>();

                // Store each member name where the same condition key value is derived.
                for (MemberShape memberShape : operationIndex.getInputMembers(operation)
                        .values()) {
                    if (memberShape.hasTrait(ConditionKeyValueTrait.ID)) {
                        ConditionKeyValueTrait trait = memberShape.expectTrait(ConditionKeyValueTrait.class);
                        String conditionKey = trait.resolveConditionKey(service);
                        conditionKeyMembers.computeIfAbsent(conditionKey, k -> new ArrayList<>())
                                .add(memberShape.getMemberName());
                    }
                }

                // Emit events if more than one value source member is found for the same key.
                for (Map.Entry<String, List<String>> entry : conditionKeyMembers.entrySet()) {
                    if (entry.getValue().size() > 1) {
                        events.add(error(operationIndex.expectInputShape(operation),
                                format("The `%s` condition key has its value supplied in the `%s` operation's input "
                                        + "shape by multiple members [%s]. This value must only be supplied by one "
                                        + "member.",
                                        entry.getKey(),
                                        operation.getId(),
                                        ValidationUtils.tickedList(entry.getValue()))));
                    }
                }
            }
        }
        return events;
    }
Validates that members match 1:1 with supplying a value for a specific condition key.
smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeyValueTraitValidator.java