| | 1 | | using System.Diagnostics.CodeAnalysis; |
| | 2 | | using System.Text.Json.Serialization; |
| | 3 | | using Spdx3.Model.Core.Classes; |
| | 4 | | using Spdx3.Model.SimpleLicensing.Classes; |
| | 5 | | using Spdx3.Serialization; |
| | 6 | | using Spdx3.Utility; |
| | 7 | |
|
| | 8 | | namespace Spdx3.Model.ExpandedLicensing.Classes; |
| | 9 | |
|
| | 10 | | /// <summary> |
| | 11 | | /// Portion of an AnyLicenseInfo representing a License which has additional text applied to it. |
| | 12 | | /// See https://spdx.github.io/spdx-spec/v3.0.1/model/ExpandedLicensing/Classes/WithAdditionOperator/ |
| | 13 | | /// </summary> |
| | 14 | | public class WithAdditionOperator : AnyLicenseInfo |
| | 15 | | { |
| | 16 | | [JsonPropertyName("expandedlicensing_subjectAddition")] |
| | 17 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 8 | 18 | | public required LicenseAddition SubjectAddition { get; set; } |
| | 19 | |
|
| | 20 | | [JsonPropertyName("expandedlicensing_subjectExtendableLicense")] |
| | 21 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 8 | 22 | | public required ExtendableLicense SubjectExtendableLicense { get; set; } |
| | 23 | |
|
| 0 | 24 | | protected internal WithAdditionOperator() |
| | 25 | | { |
| 0 | 26 | | } |
| | 27 | |
|
| | 28 | | [SetsRequiredMembers] |
| | 29 | | public WithAdditionOperator(Catalog catalog, CreationInfo creationInfo, ExtendableLicense subjectExtendableLicense, |
| 2 | 30 | | LicenseAddition subjectAddition) : base(catalog, creationInfo) |
| | 31 | | { |
| 2 | 32 | | SubjectAddition = subjectAddition; |
| 2 | 33 | | SubjectExtendableLicense = subjectExtendableLicense; |
| 2 | 34 | | } |
| | 35 | |
|
| | 36 | | public override void Validate() |
| | 37 | | { |
| 2 | 38 | | base.Validate(); |
| 2 | 39 | | ValidateRequiredProperty(nameof(SubjectAddition)); |
| 2 | 40 | | ValidateRequiredProperty(nameof(SubjectExtendableLicense)); |
| 2 | 41 | | } |
| | 42 | | } |