private Optional<ValidationEvent> validateIdempotent(
            ResourceShape resource,
            OperationShape operation,
            String lifecycle,
            String additionalMessage
    ) {
        if (operation.hasTrait(IdempotentTrait.ID)) {
            return Optional.empty();
        }

        return Optional.of(error(resource,
                format(
                        "The `%s` lifecycle operation of this resource targets an invalid operation, `%s`. The targeted "
                                + "operation must be marked as idempotent.%s",
                        lifecycle,
                        operation.getId(),
                        additionalMessage)));
    }
Validates that resource are applied appropriately to resources.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceLifecycleValidator.java