aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Models/Http/User.cs
blob: 994c08bf0796330b0ec16ae2c49a78babffabdf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System.Collections.Generic;

namespace Timeline.Models.Http
{
    /// <summary>
    /// Info of a user.
    /// </summary>
    public class HttpUser
    {
        public HttpUser() { }

        public HttpUser(string uniqueId, string username, string nickname, List<string> permissions, HttpUserLinks links)
        {
            UniqueId = uniqueId;
            Username = username;
            Nickname = nickname;
            Permissions = permissions;
            _links = links;
        }

        /// <summary>
        /// Unique id.
        /// </summary>
        public string UniqueId { get; set; } = default!;
        /// <summary>
        /// Username.
        /// </summary>
        public string Username { get; set; } = default!;
        /// <summary>
        /// Nickname.
        /// </summary>
        public string Nickname { get; set; } = default!;
#pragma warning disable CA2227 // Collection properties should be read only
        /// <summary>
        /// The permissions of the user.
        /// </summary>
        public List<string> Permissions { get; set; } = default!;
#pragma warning restore CA2227 // Collection properties should be read only
#pragma warning disable CA1707 // Identifiers should not contain underscores
        /// <summary>
        /// Related links.
        /// </summary>
        public HttpUserLinks _links { get; set; } = default!;
#pragma warning restore CA1707 // Identifiers should not contain underscores
    }

    /// <summary>
    /// Related links for user.
    /// </summary>
    public class HttpUserLinks
    {
        public HttpUserLinks() { }

        public HttpUserLinks(string self, string avatar, string timeline)
        {
            Self = self;
            Avatar = avatar;
            Timeline = timeline;
        }

        /// <summary>
        /// Self.
        /// </summary>
        public string Self { get; set; } = default!;
        /// <summary>
        /// Avatar url.
        /// </summary>
        public string Avatar { get; set; } = default!;
        /// <summary>
        /// Personal timeline url.
        /// </summary>
        public string Timeline { get; set; } = default!;
    }
}