aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Models/Http/User.cs
blob: 98406fec320e3597bb5a5c90f865bce4504727d4 (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
using System.ComponentModel.DataAnnotations;
using Timeline.Models.Validation;

namespace Timeline.Models.Http
{
    public class UserPutRequest
    {
        [Required]
        public string Password { get; set; } = default!;
        [Required]
        public bool? Administrator { get; set; }
    }

    public class UserPatchRequest
    {
        public string? Password { get; set; }
        public bool? Administrator { get; set; }
    }

    public class ChangeUsernameRequest
    {
        [Required]
        public string OldUsername { get; set; } = default!;

        [Required, ValidateWith(typeof(UsernameValidator))]
        public string NewUsername { get; set; } = default!;
    }

    public class ChangePasswordRequest
    {
        [Required]
        public string OldPassword { get; set; } = default!;
        [Required]
        public string NewPassword { get; set; } = default!;
    }
}