-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathOLAuthor.cs
More file actions
38 lines (36 loc) · 1.1 KB
/
OLAuthor.cs
File metadata and controls
38 lines (36 loc) · 1.1 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
using Newtonsoft.Json;
using System.Collections.ObjectModel;
using OpenLibraryNET.Data;
using OpenLibraryNET.Utility;
using CodeGeneration_Attributes;
namespace OpenLibraryNET
{
/// <summary>
/// Composite storage of various data related to an author.
/// </summary>
[CollectionValueEquality]
public partial record OLAuthor
{
/// <summary>
/// The ID of the author.
/// </summary>
[JsonProperty("id")]
public string ID { get; init; } = "";
/// <summary>
/// Data about the author itself.
/// </summary>
[JsonProperty("data")]
public OLAuthorData? Data { get; init; } = null;
/// <summary>
/// Works by the author.
/// </summary>
[JsonIgnore]
public IReadOnlyList<OLWorkData>? Works
{
get => _works == null ? null : new ReadOnlyCollection<OLWorkData>(_works);
init { if (value == null) _works = null; else _works = value.ToArray(); }
}
[JsonProperty("works")]
private OLWorkData[]? _works { get; init; } = null;
}
}