def METHOD_NAME() -> None:
    """Ensure objects defined in gitlab.v4.objects have REST* as last item in
    class definition.
    We do this as we need to ensure the MRO (Method Resolution Order) is
    correct.
    """
    failed_messages = []
    for module_name, module_value in inspect.getmembers(gitlab.v4.objects):
        if not inspect.ismodule(module_value):
            # We only care about the modules
            continue
        # Iterate through all the classes in our module
        for class_name, class_value in inspect.getmembers(module_value):
            if not inspect.isclass(class_value):
                continue
            # Ignore imported classes from gitlab.base
            if class_value.__module__ == "gitlab.base":
                continue
            mro = class_value.mro()
            # We only check classes which have a 'gitlab.base' class in their MRO
            has_base = False
            for count, obj in enumerate(mro, start=1):
                if obj.__module__ == "gitlab.base":
                    has_base = True
                    base_classname = obj.__name__
            if has_base:
                filename = inspect.getfile(class_value)
                # NOTE(jlvillal): The very last item 'mro[-1]' is always going
                # to be 'object'. That is why we are checking 'mro[-2]'.
                if mro[-2].__module__ != "gitlab.base":
                    failed_messages.append(
                        (
                            f"class definition for {class_name!r} in file {filename!r} "
                            f"must have {base_classname!r} as the last class in the "
                            f"class definition"
                        )
                    )
    failed_msg = "\n".join(failed_messages)
    assert not failed_messages, failed_msg