fromType<T extends ApiResult> static method

ResultType fromType<T extends ApiResult>()

Implementation

static ResultType fromType<T extends ApiResult>() => switch (T) {
      YoutubeVideo => video,
      YoutubeChannel => channel,
      YoutubePlaylist => playlist,
      _ => throw Exception('Invalid type.'),
    };