public Guild GetGuildProfile(string realm, string guild, GuildFields field) { string fieldInput = field.ToString(); Request request = new Request(User_Agent); request.Get($"{Api_Url}wow/guild/{realm}/{guild}?fields={fieldInput}&locale={Locale}&apikey={Api_Key}"); return(new Guild(JObject.Parse(request.Response))); }
public static string BuildQueryString(this GuildFields fields) { switch (fields) { case GuildFields.All: return("&fields=members,achievements,news,challenge"); case GuildFields.None: return(string.Empty); default: var flags = fields.ToString().ToLower(); return($"&fields={flags}"); } }
public static string BuildQueryString(this GuildFields fields) { // The Blizzard API only accepts lowercase fields. string flags = fields.ToString().ToLower(); if (flags == "all") { return("&fields=members,achievements,news,challenge"); } if (flags == "none") { return(string.Empty); } return($"&fields={flags}"); }