Prepared data classes for user's profile.

This commit is contained in:
Filip Strajnar 2024-06-16 18:51:35 +02:00
parent f3e5e14af3
commit 6e7ee1c73d
5 changed files with 122 additions and 0 deletions

View file

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace DiscordClient.Data
{
public class Badge
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("description")]
public string Description { get; set; }
[JsonPropertyName("icon")]
public string Icon { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("link")]
public Uri Link { get; set; }
}
}

View file

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace DiscordClient.Data
{
public class FullProfile
{
[JsonPropertyName("user")]
public User User { get; set; }
[JsonPropertyName("profile_themes_experiment_bucket")]
public long ProfileThemesExperimentBucket { get; set; }
[JsonPropertyName("user_profile")]
public UserProfile UserProfile { get; set; }
[JsonPropertyName("badges")]
public Badge[] Badges { get; set; }
[JsonPropertyName("mutual_guilds")]
public MutualGuild[] MutualGuilds { get; set; }
[JsonPropertyName("legacy_username")]
public string LegacyUsername { get; set; }
}
}

View file

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace DiscordClient.Data
{
public class MutualGuild
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("nick")]
public string Nick { get; set; }
}
}

View file

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace DiscordClient.Data
{
public class User
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("username")]
public string? Username { get; set; }
[JsonPropertyName("global_name")]
public string? GlobalName { get; set; }
[JsonPropertyName("avatar")]
public string Avatar { get; set; }
[JsonPropertyName("discriminator")]
public string? Discriminator { get; set; }
[JsonPropertyName("public_flags")]
public long PublicFlags { get; set; }
[JsonPropertyName("flags")]
public long Flags { get; set; }
[JsonPropertyName("bio")]
public string Bio { get; set; }
}
}

View file

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace DiscordClient.Data
{
public class UserProfile
{
[JsonPropertyName("bio")]
public string Bio { get; set; }
[JsonPropertyName("pronouns")]
public string Pronouns { get; set; }
}
}