-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathOLEdition.cs
More file actions
60 lines (57 loc) · 1.98 KB
/
OLEdition.cs
File metadata and controls
60 lines (57 loc) · 1.98 KB
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 Newtonsoft.Json;
using System.Collections.ObjectModel;
using OpenLibraryNET.Data;
using CodeGeneration_Attributes;
namespace OpenLibraryNET
{
/// <summary>
/// Composite storage of various data related to an edition.
/// </summary>
[CollectionValueEquality]
public partial record OLEdition
{
/// <summary>
/// The ID of the edition.
/// </summary>
[JsonProperty("id")]
public string ID { get; init; } = "";
/// <summary>
/// Data about the edition itself.
/// </summary>
[JsonProperty("data")]
public OLEditionData? Data { get; init; } = null;
/// <summary>
/// The cover of the edition, in small resolution.
/// </summary>
[JsonIgnore]
public IReadOnlyList<byte>? CoverS
{
get => _cover_S == null ? null : new ReadOnlyCollection<byte>(_cover_S);
init { if (value == null) _cover_S = null; else _cover_S = value.ToArray(); }
}
/// <summary>
/// The cover of the edition, in medium resolution.
/// </summary>
[JsonIgnore]
public IReadOnlyList<byte>? CoverM
{
get => _cover_M == null ? null : new ReadOnlyCollection<byte>(_cover_M);
init { if (value == null) _cover_M = null; else _cover_M = value.ToArray(); }
}
/// <summary>
/// The cover of the edition, in large resolution.
/// </summary>
[JsonIgnore]
public IReadOnlyList<byte>? CoverL
{
get => _cover_L == null ? null : new ReadOnlyCollection<byte>(_cover_L);
init { if (value == null) _cover_L = null; else _cover_L = value.ToArray(); }
}
[JsonProperty("cover_s")]
private byte[]? _cover_S { get; init; } = null;
[JsonProperty("cover_m")]
private byte[]? _cover_M { get; init; } = null;
[JsonProperty("cover_l")]
private byte[]? _cover_L { get; init; } = null;
}
}