| | 1 | | using System.Diagnostics.CodeAnalysis; |
| | 2 | | using System.Text.Json.Serialization; |
| | 3 | | using Spdx3.Model.Core.Classes; |
| | 4 | | using Spdx3.Serialization; |
| | 5 | | using Spdx3.Utility; |
| | 6 | |
|
| | 7 | | namespace Spdx3.Model.ExpandedLicensing.Classes; |
| | 8 | |
|
| | 9 | | /// <summary> |
| | 10 | | /// Abstract class for additional text intended to be added to a License, but which is not itself a standalone License. |
| | 11 | | /// See https://spdx.github.io/spdx-spec/v3.0.1/model/ExpandedLicensing/Classes/LicenseAddition/ |
| | 12 | | /// </summary> |
| | 13 | | public abstract class LicenseAddition : Element |
| | 14 | | { |
| | 15 | | [JsonPropertyName("expandedlicensing_additionText")] |
| | 16 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 27 | 17 | | public required string AdditionText { get; set; } |
| | 18 | |
|
| | 19 | | [JsonPropertyName("expandedlicensing_isDeprecatedAdditionId")] |
| | 20 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 7 | 21 | | public bool? IsDeprecatedAdditionId { get; set; } |
| | 22 | |
|
| | 23 | | [JsonPropertyName("expandedlicensing_licenseXml")] |
| | 24 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 7 | 25 | | public string? LicenseXml { get; set; } |
| | 26 | |
|
| | 27 | | [JsonPropertyName("expandedlicensing_obsoletedBy")] |
| | 28 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 7 | 29 | | public string? ObsoletedBy { get; set; } |
| | 30 | |
|
| | 31 | | [JsonPropertyName("expandedlicensing_seeAlso")] |
| | 32 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 23 | 33 | | public IList<Uri> SeeAlso { get; set; } = new List<Uri>(); |
| | 34 | |
|
| | 35 | | [JsonPropertyName("expandedlicensing_standardAdditionTemplate")] |
| | 36 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 7 | 37 | | public string? StandardAdditionTemplate { get; set; } |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// No-arg constructor required for serialization/deserialization |
| | 41 | | /// </summary> |
| 1 | 42 | | protected internal LicenseAddition() |
| | 43 | | { |
| 1 | 44 | | } |
| | 45 | |
|
| | 46 | | [SetsRequiredMembers] |
| 8 | 47 | | protected LicenseAddition(Catalog catalog, CreationInfo creationInfo, string additionText) : base(catalog, |
| 8 | 48 | | creationInfo) |
| | 49 | | { |
| 8 | 50 | | AdditionText = additionText; |
| 8 | 51 | | } |
| | 52 | |
|
| | 53 | | public override void Validate() |
| | 54 | | { |
| 6 | 55 | | base.Validate(); |
| 6 | 56 | | ValidateRequiredProperty(nameof(AdditionText)); |
| 6 | 57 | | } |
| | 58 | | } |