-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLink.cs
More file actions
43 lines (34 loc) · 1.41 KB
/
Copy pathLink.cs
File metadata and controls
43 lines (34 loc) · 1.41 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
using System.Text.Json.Serialization;
namespace JSONstat.Models;
/// <summary>
/// A single item inside a <c>link</c> array (e.g. an entry of a collection's
/// <c>link.item</c>). Items can be references (by <see cref="Href"/>) or embed
/// a full response.
/// Source: <c>../wiki/links.md</c>.
/// </summary>
public sealed class LinkItem
{
/// <summary>URL of the related resource.</summary>
public string? Href { get; set; }
/// <summary>IANA link relation (e.g. "item", "self").</summary>
public string? Rel { get; set; }
/// <summary>Media type of the related resource.</summary>
public string? Type { get; set; }
/// <summary>Short descriptive text.</summary>
public string? Label { get; set; }
/// <summary>JSON-stat version, when embedded.</summary>
public string? Version { get; set; }
/// <summary>Class of the linked/embedded resource, when known.</summary>
public ResponseClass? Class { get; set; }
/// <summary>Embedded content of the linked resource, if present.</summary>
public System.Text.Json.JsonElement? Extension { get; set; }
}
/// <summary>
/// The <c>link</c> object, which maps relation names to arrays of
/// <see cref="LinkItem"/>. The <c>item</c> relation is used by collections.
/// </summary>
public sealed class Link
{
/// <summary>Items referenced by the "item" relation (collections).</summary>
public LinkItem[]? Item { get; set; }
}