| | 1 | | using System.Diagnostics.CodeAnalysis; |
| | 2 | | using System.Text.Json.Serialization; |
| | 3 | | using Spdx3.Model.Core.Classes; |
| | 4 | | using Spdx3.Model.Software.Enums; |
| | 5 | | using Spdx3.Serialization; |
| | 6 | | using Spdx3.Utility; |
| | 7 | |
|
| | 8 | | namespace Spdx3.Model.Software.Classes; |
| | 9 | |
|
| | 10 | | public class ContentIdentifier : IntegrityMethod |
| | 11 | | { |
| | 12 | | [JsonPropertyName("software_contentIdentifierType")] |
| | 13 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 11 | 14 | | public ContentIdentifierType ContentIdentifierType { get; set; } |
| | 15 | |
|
| | 16 | | [JsonPropertyName("software_contentIdentifierValue")] |
| | 17 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 11 | 18 | | public Uri? ContentIdentifierValue { get; set; } |
| | 19 | |
|
| | 20 | | // protected internal no-parm constructor required for deserialization |
| | 21 | | // ReSharper disable once UnusedMember.Global |
| 1 | 22 | | protected internal ContentIdentifier() |
| | 23 | | { |
| 1 | 24 | | } |
| | 25 | |
|
| | 26 | | [SetsRequiredMembers] |
| | 27 | | public ContentIdentifier(Catalog catalog, ContentIdentifierType contentIdentifierType, Uri contentIdentifierValue) : |
| 5 | 28 | | base(catalog) |
| | 29 | | { |
| 5 | 30 | | ContentIdentifierType = contentIdentifierType; |
| 5 | 31 | | ContentIdentifierValue = contentIdentifierValue; |
| 5 | 32 | | } |
| | 33 | |
|
| | 34 | | public override void Validate() |
| | 35 | | { |
| 3 | 36 | | base.Validate(); |
| 2 | 37 | | ValidateRequiredProperty(nameof(ContentIdentifierType)); |
| 2 | 38 | | ValidateRequiredProperty(nameof(ContentIdentifierValue)); |
| 2 | 39 | | } |
| | 40 | | } |