private List<ValidationEvent> validateResource(
            Model model,
            ResourceShape resource,
            ServiceShape service,
            AwsTagIndex awsTagIndex
    ) {
        List<ValidationEvent> events = new ArrayList<>();
        // Generate danger if resource has tag property in update API.
        if (awsTagIndex.isResourceTagOnUpdate(resource.getId())) {
            Shape operation = resource.getUpdate().isPresent()
                    ? model.expectShape(resource.getUpdate().get())
                    : model.expectShape(resource.getPut().get());
            events.add(danger(operation,
                    "Update and put resource lifecycle operations should not support updating tags"
                            + " because it is a privileged operation that modifies access."));
        }
        // A valid taggable resource must support one of the following:
        // 1. Tagging via service-wide TagResource/UntagResource/ListTagsForResource
        //    APIs that have input which targets a resource ARN and have expected tag
        //    list or tag keys input or output member
        // 2. Tagging via APIs specified in the @taggable trait which are validated
        //    through the tag property, and must be resource instance operations
        boolean isServiceWideTaggable = awsTagIndex.serviceHasTagApis(service.getId());
        boolean isInstanceOpTaggable = isTaggableViaInstanceOperations(model, resource);

        if (isServiceWideTaggable && !isInstanceOpTaggable && !resource.hasTrait(ArnTrait.ID)) {
            events.add(error(resource,
                    "Resource is taggable only via service-wide tag operations."
                            + " It must use the `aws.api@arn` trait."));
        }

        if (!isServiceWideTaggable && !isInstanceOpTaggable) {
            events.add(danger(resource,
                    String.format("Resource does not have tagging CRUD operations and is not"
                            + " compatible with service-wide tagging operations"
                            + " for service `%s`.",
                            service.getId())));
        }

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