| | 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 | | /// A map of Element identifiers that are used within an SpdxDocument but defined external to that SpdxDocument. |
| | 10 | | /// See https://spdx.github.io/spdx-spec/v3.0.1/model/Core/Classes/ExternalMap/ |
| | 11 | | /// </summary> |
| | 12 | | public class ExternalMap : BaseModelClass |
| | 13 | | { |
| | 14 | | [JsonPropertyName("definingArtifact")] |
| | 15 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 4 | 16 | | public Artifact? DefiningArtifact { get; set; } |
| | 17 | |
|
| | 18 | | [JsonPropertyName("externalSpdxId")] |
| | 19 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 11 | 20 | | public required string ExternalSpdxId { get; set; } |
| | 21 | |
|
| | 22 | | [JsonPropertyName("locationHint")] |
| | 23 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 4 | 24 | | public Uri? LocationHint { get; set; } |
| | 25 | |
|
| | 26 | | [JsonPropertyName("verifiedUsing")] |
| | 27 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 10 | 28 | | public IList<IntegrityMethod> VerifiedUsing { get; } = new List<IntegrityMethod>(); |
| | 29 | |
|
| | 30 | | // protected internal no-parm constructor required for deserialization |
| | 31 | | // ReSharper disable once UnusedMember.Global |
| 1 | 32 | | protected internal ExternalMap() |
| | 33 | | { |
| 1 | 34 | | } |
| | 35 | |
|
| | 36 | | [SetsRequiredMembers] |
| 4 | 37 | | public ExternalMap(Catalog catalog, string externalSpdxId) : base(catalog) |
| | 38 | | { |
| 4 | 39 | | ExternalSpdxId = externalSpdxId; |
| 4 | 40 | | } |
| | 41 | |
|
| | 42 | | public override void Validate() |
| | 43 | | { |
| 3 | 44 | | base.Validate(); |
| 2 | 45 | | ValidateRequiredProperty(nameof(ExternalSpdxId)); |
| 2 | 46 | | } |
| | 47 | | } |