| | 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.Serialization; |
| | 6 | | using Spdx3.Utility; |
| | 7 | |
|
| | 8 | | namespace Spdx3.Model.Security.Classes; |
| | 9 | |
|
| | 10 | | /// <summary> |
| | 11 | | /// Connects a vulnerability and an element designating the element as a product affected by the vulnerability. |
| | 12 | | /// See https://spdx.github.io/spdx-spec/v3.0.1/model/Security/Classes/VexAffectedVulnAssessmentRelationship/ |
| | 13 | | /// </summary> |
| | 14 | | public class VexAffectedVulnAssessmentRelationship : VexVulnAssessmentRelationship |
| | 15 | | { |
| | 16 | | [JsonPropertyName("security_actionStatement")] |
| | 17 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 8 | 18 | | public required string ActionStatement { get; set; } |
| | 19 | |
|
| | 20 | | [JsonPropertyName("security_actionStatementTime")] |
| | 21 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 2 | 22 | | public DateTimeOffset? ActionStatementTime { get; set; } |
| | 23 | |
|
| | 24 | | // protected internal no-parm constructor required for deserialization |
| | 25 | | #pragma warning disable CS8618, CS9264 |
| 1 | 26 | | protected internal VexAffectedVulnAssessmentRelationship() |
| | 27 | | { |
| 1 | 28 | | } |
| | 29 | | #pragma warning restore CS8618, CS9264 |
| | 30 | |
|
| | 31 | | [SetsRequiredMembers] |
| | 32 | | public VexAffectedVulnAssessmentRelationship(Catalog catalog, CreationInfo creationInfo, Vulnerability from, |
| 2 | 33 | | List<Element> to, string actionStatement) : base(catalog, creationInfo, RelationshipType.affects, from, to) |
| | 34 | | { |
| 2 | 35 | | ActionStatement = actionStatement; |
| 2 | 36 | | } |
| | 37 | |
|
| | 38 | | public override void Validate() |
| | 39 | | { |
| 2 | 40 | | base.Validate(); |
| 2 | 41 | | ValidateRequiredProperty(nameof(ActionStatement)); |
| 2 | 42 | | } |
| | 43 | | } |