summaryrefslogtreecommitdiff
path: root/ApiModels.cs
blob: 6ac744e29c14e66ad77314ecc09522aa33a7c6c8 (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
using System.Text.Json.Serialization;

namespace HyperBooru.ApiModels;

public enum PathType {
    Windows,
    Unix
}

public enum TagSource {
    Internal = 0,
    UserTag  = 1
}

public record Media {
    public Guid    MediaId          { get; init; }
    public string? ShortDescription { get; init; }
    public string? LongDescription  { get; init; }
}

public record UploadedFile {
    public Guid      UploadedFileId   { get; init; }
    public Guid      MediaId          { get; init; }
    public string    Checksum         { get; init; }
    public bool      ChecksumVerified { get; init; }
    public string?   Filename         { get; init; }
    public long      Length           { get; init; }
    public string    MimeType         { get; init; }
    public int?      Width            { get; init; }
    public int?      Height           { get; init; }
    public DateTime  UploadTime       { get; init; }
    public DateTime? LastAccessTime   { get; init; }
    public DateTime? LastWriteTime    { get; init; }
    public DateTime? CreateTime       { get; init; }
    public string?   Path             { get; init; }
    [JsonConverter(typeof(JsonStringEnumConverter))]
    public PathType? PathType         { get; init; }
}

public record TagDefinition {
    public Guid      TagDefinitionId { get; init; }
    [JsonConverter(typeof(JsonStringEnumConverter))]
    public TagSource Source          { get; init; }
    public string?   Namespace       { get; init; }
    public string    Name            { get; init; }
    public string?   Alias           { get; init; }
    public Guid[]    ImplicitTags    { get; init; }
}

public record User {
    public Guid   UserId   { get; init; }
    public string Username { get; init; }
}

public record OcrData {
    public Guid     MediaId        { get; init; }
    public string   Text           { get; init; }
    public string   SearchableText { get; init; }
    public DateTime Timestamp      { get; init; }
}