def METHOD_NAME(
    payload_type: Type[BinaryMessageDefinition], get_user_input: GetInputFunc
) -> BinaryMessageDefinition:
    """Prompt to get payload.
    Args:
        get_user_input: Function to get user input.
        payload_type: Serializable payload type.
    Returns:
        Serializable payload.
    """
    payload_fields = dataclasses.fields(payload_type)
    i = {}
    for f in payload_fields:
        try:
            if not f.name == "message_id":
                i[f.name] = f.type.from_string(
                    get_user_input(f"enter {f.name}: ").strip()
                )
            else:
                i[f.name] = payload_type.message_id
        except ValueError as e:
            raise InvalidInput(str(e))
    # Mypy is not liking constructing the derived types.
    ret_instance = payload_type(**i)
    return ret_instance