| | 1 | | using System.Diagnostics.CodeAnalysis; |
| | 2 | | using System.Text.Json.Serialization; |
| | 3 | | using Spdx3.Serialization; |
| | 4 | | using Spdx3.Utility; |
| | 5 | |
|
| | 6 | | namespace Spdx3.Model.Core.Classes; |
| | 7 | |
|
| | 8 | | /// <summary> |
| | 9 | | /// Base domain class from which all other SPDX-3.0 domain classes derive |
| | 10 | | /// See https://spdx.github.io/spdx-spec/v3.0.1/model/Core/Classes/Element/ |
| | 11 | | /// </summary> |
| | 12 | | public abstract class Element : BaseModelClass |
| | 13 | | { |
| | 14 | | [JsonPropertyName("comment")] |
| | 15 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 569 | 16 | | public string? Comment { get; set; } |
| | 17 | |
|
| | 18 | | [JsonPropertyName("creationInfo")] |
| | 19 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 1852 | 20 | | public required CreationInfo CreationInfo { get; set; } |
| | 21 | |
|
| | 22 | | [JsonPropertyName("description")] |
| | 23 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 257 | 24 | | public string? Description { get; set; } |
| | 25 | |
|
| | 26 | | [JsonPropertyName("extension")] |
| | 27 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 1756 | 28 | | public IList<Extension.Classes.Extension> Extension { get; } = new List<Extension.Classes.Extension>(); |
| | 29 | |
|
| | 30 | | [JsonPropertyName("externalIdentifier")] |
| | 31 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 1766 | 32 | | public IList<ExternalIdentifier> ExternalIdentifier { get; } = new List<ExternalIdentifier>(); |
| | 33 | |
|
| | 34 | | [JsonPropertyName("externalRef")] |
| | 35 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 1755 | 36 | | public IList<ExternalRef> ExternalRef { get; } = new List<ExternalRef>(); |
| | 37 | |
|
| | 38 | | [JsonPropertyName("name")] |
| | 39 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 590 | 40 | | public string? Name { get; set; } |
| | 41 | |
|
| | 42 | | [JsonPropertyName("summary")] |
| | 43 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 227 | 44 | | public string? Summary { get; set; } |
| | 45 | |
|
| | 46 | | [JsonPropertyName("verifiedUsing")] |
| | 47 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 1768 | 48 | | public IList<IntegrityMethod> VerifiedUsing { get; } = new List<IntegrityMethod>(); |
| | 49 | |
|
| | 50 | | // protected internal no-parm constructor required for deserialization |
| 815 | 51 | | protected internal Element() |
| | 52 | | { |
| 815 | 53 | | } |
| | 54 | |
|
| | 55 | |
|
| | 56 | | [SetsRequiredMembers] |
| 594 | 57 | | protected Element(Catalog catalog, CreationInfo creationInfo) : base(catalog) |
| | 58 | | { |
| 594 | 59 | | CreationInfo = creationInfo; |
| 594 | 60 | | } |
| | 61 | |
|
| | 62 | | public override void Validate() |
| | 63 | | { |
| 136 | 64 | | base.Validate(); |
| 113 | 65 | | ValidateRequiredProperty(nameof(CreationInfo)); |
| 113 | 66 | | ValidateRequiredProperty(nameof(Type)); |
| 113 | 67 | | } |
| | 68 | | } |