public static Task <ModernModeStatsContainer <IEnumerable <ModernStatsTrend> > > GetModernStatsTrendAsync(this Dragon6Client client, UbisoftAccount account, PlaylistType playlistType = PlaylistType.All, OperatorType operatorType = OperatorType.Independent, DateTimeOffset?startDate = null, DateTimeOffset?endDate = null) { var request = new ModernStatsTrendRequest(account) { Playlist = playlistType, OperatorType = operatorType, TrendSpan = TrendSpan.Weekly }; ValueUtils.ApplyValue(startDate, s => request.StartDate = s); ValueUtils.ApplyValue(endDate, e => request.EndDate = e); return(client.PerformAsync <JObject>(request) .ContinueWith(t => t.Result.ProcessData <IEnumerable <ModernStatsTrend> >(request), TaskContinuationOptions.OnlyOnRanToCompletion)); }
public static ModernModeStatsContainer <IEnumerable <ModernStatsTrend> > GetModernStatsTrendFor <T>(this T client, AccountInfo account, PlaylistType playlistType = PlaylistType.All, OperatorType operatorType = OperatorType.Independent, TrendSpan trendSpan = TrendSpan.Weekly, DateTimeOffset?startDate = null, DateTimeOffset?endDate = null) where T : ModernDragon6Client { var request = new ModernStatsTrendRequest(account) { Playlist = playlistType, OperatorType = operatorType, TrendSpan = trendSpan }; ValueUtils.ApplyValue(startDate, s => request.StartDate = s); ValueUtils.ApplyValue(endDate, e => request.EndDate = e); return(client.Perform <JObject>(request) .ProcessData <IEnumerable <ModernStatsTrend> >(request, client)); }