public ReadOnlyCollection <Record> GetPersonalBests( string userId, int?top = null, string seriesId = null, string gameId = null, RunEmbeds embeds = default(RunEmbeds)) { var parameters = new List <string>() { embeds.ToString() }; if (top.HasValue) { parameters.Add(string.Format("top={0}", top.Value)); } if (!string.IsNullOrEmpty(seriesId)) { parameters.Add(string.Format("series={0}", Uri.EscapeDataString(seriesId))); } if (!string.IsNullOrEmpty(gameId)) { parameters.Add(string.Format("game={0}", Uri.EscapeDataString(gameId))); } var uri = GetUsersUri(string.Format("/{0}/personal-bests{1}", Uri.EscapeDataString(userId), parameters.ToParameters())); return(baseClient.DoDataCollectionRequest(uri, x => Record.Parse(baseClient, x) as Record)); }
public ReadOnlyCollection <Category> GetCategories( string gameId, bool miscellaneous = true, CategoryEmbeds embeds = default, CategoriesOrdering orderBy = default) { var parameters = new List <string>() { embeds.ToString() }; parameters.AddRange(orderBy.ToParameters()); if (!miscellaneous) { parameters.Add("miscellaneous=no"); } var uri = GetGamesUri(string.Format("/{0}/categories{1}", Uri.EscapeDataString(gameId), parameters.ToParameters())); return(baseClient.DoDataCollectionRequest(uri, x => Category.Parse(baseClient, x) as Category)); }
public ReadOnlyCollection <Variable> GetVariables(string categoryId, VariablesOrdering orderBy = default(VariablesOrdering)) { var parameters = new List <string>(orderBy.ToParameters()); var uri = GetCategoriesUri(string.Format("/{0}/variables{1}", Uri.EscapeDataString(categoryId), parameters.ToParameters())); return(baseClient.DoDataCollectionRequest <Variable>(uri, x => Variable.Parse(baseClient, x))); }