Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #241 from aspriddell/update-roles
Browse files Browse the repository at this point in the history
update api returned role response
  • Loading branch information
aspriddell authored Jun 15, 2021
2 parents 72c0967 + b80494e commit f3be539
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace DragonFruit.Six.Api.Services.Verification
{
public static class AccountExtensions
{
public static string GetName(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.CustomTitle) ? GetName(dragon6User.AccountRole) : dragon6User.CustomTitle;
public static string GetIcon(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.CustomIcon) ? GetIcon(dragon6User.AccountRole) : dragon6User.CustomIcon;
public static string GetColor(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.CustomColour) ? GetColor(dragon6User.AccountRole) : dragon6User.CustomColour;
public static string GetName(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.Title) ? GetName(dragon6User.AccountRole) : dragon6User.Title;
public static string GetIcon(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.TitleIcon) ? GetIcon(dragon6User.AccountRole) : dragon6User.TitleIcon;
public static string GetColor(this Dragon6AccountInfo dragon6User) => string.IsNullOrEmpty(dragon6User.TitleColour) ? GetColor(dragon6User.AccountRole) : dragon6User.TitleColour;

/// <summary>
/// Retrieves the default title for the <see cref="AccountRole"/> provided
Expand Down
26 changes: 10 additions & 16 deletions DragonFruit.Six.Api/Services/Verification/Dragon6AccountInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,22 @@ namespace DragonFruit.Six.Api.Services.Verification
/// </summary>
public class Dragon6AccountInfo
{
[JsonProperty("Level")]
public AccountRole AccountRole { get; set; }

[JsonProperty("Guid")]
[JsonProperty("profile_id")]
public string ProfileId { get; set; }

[JsonProperty("youtube")]
public string YouTube { get; set; }

[JsonProperty("twitch")]
public string Twitch { get; set; }
[JsonProperty("role")]
public AccountRole AccountRole { get; set; }

[JsonProperty("ImageHeaderLink")]
[JsonProperty("cover_img")]
public string Image { get; set; }

[JsonProperty("CustomText")]
public string CustomTitle { get; set; }
[JsonProperty("title")]
public string Title { get; set; }

[JsonProperty("CustomIcon")]
public string CustomIcon { get; set; }
[JsonProperty("title_icon")]
public string TitleIcon { get; set; }

[JsonProperty("CustomColour")]
public string CustomColour { get; set; }
[JsonProperty("title_colour")]
public string TitleColour { get; set; }
}
}

0 comments on commit f3be539

Please sign in to comment.