@classmethod
def _map_disk_type(cls, str_, bytes_):
    """
        Returns str_ if DiskType is str and bytes_ if DiskType is bytes.
        Raises an error if it's neither.

        :param str_:    The return value when DiskType is str.
        :param bytes_:  The return type when DiskType is bytes.
        :return:        Either str_ or bytes_.
        """
    if cls._disk_type is str:
        return str_
    elif cls._disk_type is bytes:
        return bytes_
    else:
        raise TypeError(f'DiskType must be str or bytes, not {cls._disk_type}')
