| | 1 | | using System.Diagnostics.CodeAnalysis; |
| | 2 | | using System.Text.Json.Serialization; |
| | 3 | | using Spdx3.Model.Core.Classes; |
| | 4 | | using Spdx3.Model.Core.Enums; |
| | 5 | | using Spdx3.Model.Security.Enums; |
| | 6 | | using Spdx3.Serialization; |
| | 7 | | using Spdx3.Utility; |
| | 8 | |
|
| | 9 | | namespace Spdx3.Model.Security.Classes; |
| | 10 | |
|
| | 11 | | /// <summary> |
| | 12 | | /// Provides an exploit assessment of a vulnerability. |
| | 13 | | /// See https://spdx.github.io/spdx-spec/v3.0.1/model/Security/Classes/ExploitCatalogVulnAssessmentRelationship/ |
| | 14 | | /// </summary> |
| | 15 | | public class ExploitCatalogVulnAssessmentRelationship : VulnAssessmentRelationship |
| | 16 | | { |
| | 17 | | [JsonPropertyName("security_catalogType")] |
| | 18 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 8 | 19 | | public required ExploitCatalogType? CatalogType { get; set; } |
| | 20 | |
|
| | 21 | | [JsonPropertyName("security_exploited")] |
| | 22 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 7 | 23 | | public required bool? Exploited { get; set; } |
| | 24 | |
|
| | 25 | | [JsonPropertyName("security_locator")] |
| | 26 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 7 | 27 | | public required Uri? Locator { get; set; } |
| | 28 | |
|
| | 29 | | // protected internal no-parm constructor required for deserialization |
| | 30 | | #pragma warning disable CS8618, CS9264 |
| 1 | 31 | | internal ExploitCatalogVulnAssessmentRelationship() |
| | 32 | | { |
| 1 | 33 | | } |
| | 34 | | #pragma warning restore CS8618, CS9264 |
| | 35 | |
|
| | 36 | | [SetsRequiredMembers] |
| | 37 | | public ExploitCatalogVulnAssessmentRelationship(Catalog catalog, CreationInfo creationInfo, Element from, |
| 2 | 38 | | List<Element> to, ExploitCatalogType catalogType, bool exploited, Uri locator) : base(catalog, creationInfo, |
| 2 | 39 | | RelationshipType.hasAssessmentFor, from, to) |
| | 40 | | { |
| 2 | 41 | | CatalogType = catalogType; |
| 2 | 42 | | Exploited = exploited; |
| 2 | 43 | | Locator = locator; |
| 2 | 44 | | } |
| | 45 | | } |