| | | 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 the portion of an AnyLicenseInfo representing a license. |
| | | 11 | | /// </summary> |
| | | 12 | | public abstract class License : ExtendableLicense |
| | | 13 | | { |
| | | 14 | | [JsonPropertyName("simplelicensing_licenseText")] |
| | | 15 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 742 | 16 | | public required string LicenseText { get; set; } |
| | | 17 | | |
| | | 18 | | [JsonPropertyName("expandedlicensing_isDeprecatedLicenseId")] |
| | | 19 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 46 | 20 | | public bool? IsDeprecatedLicenseId { get; set; } |
| | | 21 | | |
| | | 22 | | [JsonPropertyName("expandedlicensing_isFsfLibre")] |
| | | 23 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 141 | 24 | | public bool? IsFsfLibre { get; set; } |
| | | 25 | | |
| | | 26 | | [JsonPropertyName("expandedlicensing_isOsiApproved")] |
| | | 27 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 141 | 28 | | public bool? IsOsiApproved { get; set; } |
| | | 29 | | |
| | | 30 | | [JsonPropertyName("expandedlicensing_licenseXml")] |
| | | 31 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 14 | 32 | | public string? LicenseXml { get; set; } |
| | | 33 | | |
| | | 34 | | [JsonPropertyName("expandedlicensing_obsoletedBy")] |
| | | 35 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 14 | 36 | | public string? ObsoletedBy { get; set; } |
| | | 37 | | |
| | | 38 | | [JsonPropertyName("expandedlicensing_seeAlso")] |
| | | 39 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 1438 | 40 | | public List<Uri> SeeAlso { get; set; } = []; |
| | | 41 | | |
| | | 42 | | [JsonPropertyName("expandedlicensing_standardLicenseHeader")] |
| | | 43 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 106 | 44 | | public string? StandardLicenseHeader { get; set; } |
| | | 45 | | |
| | | 46 | | [JsonPropertyName("expandedlicensing_standardLicenseTemplate")] |
| | | 47 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 707 | 48 | | public string? StandardLicenseTemplate { get; set; } |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// No-arg constructor required for serialization/deserialization |
| | | 52 | | /// </summary> |
| | 695 | 53 | | protected internal License() |
| | | 54 | | { |
| | 695 | 55 | | } |
| | | 56 | | |
| | | 57 | | [SetsRequiredMembers] |
| | 28 | 58 | | protected License(Catalog catalog, CreationInfo creationInfo, string licenseText) : base(catalog, creationInfo) |
| | | 59 | | { |
| | 28 | 60 | | LicenseText = licenseText; |
| | 28 | 61 | | } |
| | | 62 | | |
| | | 63 | | public override void Validate() |
| | | 64 | | { |
| | 6 | 65 | | base.Validate(); |
| | 6 | 66 | | ValidateRequiredProperty(nameof(LicenseText)); |
| | 6 | 67 | | } |
| | | 68 | | } |