from typing import Callable
from typing import get_type_hints


def get_method_classes(func: Callable, body_name: str):
    """
    gets result class and body class from method typehints
    :param func: function to decorate
    :param body_name: name of body parameter
    :return: Result class, body class
    """
    hints = get_type_hints(func)
    result_class = hints.get("return")
    body_class = hints.get(body_name)
    return result_class, body_class