File size: 5,101 Bytes
fab29d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System;
using System.Collections.Generic;

namespace VersOne.Epub.Schema
{
    /// <summary>
    /// <para>A metadata link. Links are used to associate resources with the EPUB book, such as metadata records.</para>
    /// <para>See <see href="https://www.w3.org/TR/epub-33/#sec-link-elem" /> for more information.</para>
    /// </summary>
    public class EpubMetadataLink
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EpubMetadataLink" /> class.
        /// </summary>
        /// <param name="href">The location of the linked resource.</param>
        /// <param name="id">The unique ID of this link or <c>null</c> if the link doesn't have an ID.</param>
        /// <param name="mediaType">The media type of the linked resource or <c>null</c> if the link doesn't specify the media type.</param>
        /// <param name="properties">
        /// A list of the link properties used to establish the type of record a referenced resource represents or <c>null</c> if the link doesn't specify properties.
        /// </param>
        /// <param name="refines">A relative IRI that identifies the resource augmented by the link or <c>null</c> if the link doesn't specify any augmentation.</param>
        /// <param name="relationships">A list of properties that establish the relationship the resource has with the EPUB book.</param>
        /// <param name="hrefLanguage">The language of the linked resource or <c>null</c> if the link doesn't specify the language of the linked resource.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="href" /> parameter is <c>null</c>.</exception>
        public EpubMetadataLink(string href, string? id = null, string? mediaType = null, List<EpubMetadataLinkProperty>? properties = null, string? refines = null,
            List<EpubMetadataLinkRelationship>? relationships = null, string? hrefLanguage = null)
        {
            Href = href ?? throw new ArgumentNullException(nameof(href));
            Id = id;
            MediaType = mediaType;
            Properties = properties;
            Refines = refines;
            Relationships = relationships ?? new List<EpubMetadataLinkRelationship>();
            HrefLanguage = hrefLanguage;
        }

        /// <summary>
        /// <para>Gets the location of the linked resource.</para>
        /// <para>
        /// See <see href="https://www.w3.org/TR/epub-33/#sec-link-elem" />
        /// and <see href="https://www.w3.org/TR/epub-33/#attrdef-href" /> for more information.
        /// </para>
        /// </summary>
        public string Href { get; }

        /// <summary>
        /// <para>Gets the unique ID of this link or <c>null</c> if the link doesn't have an ID.</para>
        /// <para>See <see href="https://www.w3.org/TR/epub-33/#attrdef-id" /> for more information.</para>
        /// </summary>
        public string? Id { get; }

        /// <summary>
        /// <para>Gets the media type of the linked resource or <c>null</c> if the link doesn't specify the media type.</para>
        /// <para>
        /// See <see href="https://www.w3.org/TR/epub-33/#attrdef-link-media-type" /> for more information.
        /// </para>
        /// </summary>
        public string? MediaType { get; }

        /// <summary>
        /// <para>Gets a list of the link properties used to establish the type of record a referenced resource represents or <c>null</c> if the link doesn't specify properties.</para>
        /// <para>
        /// See <see href="https://www.w3.org/TR/epub-33/#attrdef-properties" />
        /// and <see href="https://www.w3.org/TR/epub-33/#sec-link-properties" /> for more information.
        /// </para>
        /// </summary>
        public List<EpubMetadataLinkProperty>? Properties { get; }

        /// <summary>
        /// <para>Gets a relative IRI that identifies the resource augmented by the link or <c>null</c> if the link doesn't specify any augmentation.</para>
        /// <para>
        /// See <see href="https://www.w3.org/TR/epub-33/#attrdef-refines" /> for more information.
        /// </para>
        /// </summary>
        public string? Refines { get; }

        /// <summary>
        /// <para>Gets a list of properties that establish the relationship the resource has with the EPUB book.</para>
        /// <para>
        /// See <see href="https://www.w3.org/TR/epub-33/#attrdef-link-rel" />
        /// and <see href="https://www.w3.org/TR/epub-33/#sec-link-rel" /> for more information.
        /// </para>
        /// </summary>
        public List<EpubMetadataLinkRelationship> Relationships { get; }

        /// <summary>
        /// <para>Gets the language of the linked resource or <c>null</c> if the link doesn't specify the language of the linked resource.</para>
        /// <para>
        /// See <see href="https://www.w3.org/TR/epub-33/#attrdef-hreflang" />
        /// and <see href="https://www.rfc-editor.org/info/bcp47" /> for more information.
        /// </para>
        /// </summary>
        public string? HrefLanguage { get; }
    }
}