private List<ValidationEvent> validateService(ServiceShape service, AwsTagIndex awsTagIndex) {
        List<ValidationEvent> events = new ArrayList<>();
        TagEnabledTrait trait = service.expectTrait(TagEnabledTrait.class);

        Optional<ShapeId> tagResourceId = awsTagIndex.getTagResourceOperation(service.getId());
        if (tagResourceId.isPresent()) {
            if (!awsTagIndex.serviceHasValidTagResourceOperation(service.getId())) {
                events.add(getInvalidOperationEvent(service, trait, tagResourceId.get(), TAG_RESOURCE_OPNAME));
            }
        } else {
            events.add(getMissingOperationEvent(service, trait, TAG_RESOURCE_OPNAME));
        }

        Optional<ShapeId> untagResourceId = awsTagIndex.getUntagResourceOperation(service.getId());
        if (untagResourceId.isPresent()) {
            if (!awsTagIndex.serviceHasValidUntagResourceOperation(service.getId())) {
                events.add(getInvalidOperationEvent(service, trait, untagResourceId.get(), UNTAG_RESOURCE_OPNAME));
            }
        } else {
            events.add(getMissingOperationEvent(service, trait, UNTAG_RESOURCE_OPNAME));
        }

        Optional<ShapeId> listTagsId = awsTagIndex.getListTagsForResourceOperation(service.getId());
        if (listTagsId.isPresent()) {
            if (!awsTagIndex.serviceHasValidListTagsForResourceOperation(service.getId())) {
                events.add(getInvalidOperationEvent(service, trait, listTagsId.get(), LIST_TAGS_OPNAME));
            }
        } else {
            events.add(getMissingOperationEvent(service, trait, LIST_TAGS_OPNAME));
        }

        return events;
    }
Validates service satisfies AWS tagging requirements.
smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/ServiceTaggingValidator.java