| | | 1 | | using System.Diagnostics.CodeAnalysis; |
| | | 2 | | using System.Text.Json.Serialization; |
| | | 3 | | using Spdx3.Model.Core.Classes; |
| | | 4 | | using Spdx3.Serialization; |
| | | 5 | | using Spdx3.Utility; |
| | | 6 | | |
| | | 7 | | namespace Spdx3.Model.Build.Classes; |
| | | 8 | | |
| | | 9 | | public class Build : Element |
| | | 10 | | { |
| | | 11 | | [JsonPropertyName("build_buildEndTime")] |
| | | 12 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 5 | 13 | | public DateTimeOffset? BuildEndTime { get; set; } |
| | | 14 | | |
| | | 15 | | [JsonPropertyName("build_buildId")] |
| | | 16 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 7 | 17 | | public string? BuildId { get; set; } |
| | | 18 | | |
| | | 19 | | [JsonPropertyName("build_buildStartTime")] |
| | | 20 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 5 | 21 | | public DateTimeOffset? BuildStartTime { get; set; } |
| | | 22 | | |
| | | 23 | | [JsonPropertyName("build_buildType")] |
| | | 24 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 11 | 25 | | public required Uri BuildType { get; set; } |
| | | 26 | | |
| | | 27 | | [JsonPropertyName("build_configSourceDigest")] |
| | | 28 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 11 | 29 | | public IList<Hash> ConfigSourceDigest { get; set; } = new List<Hash>(); |
| | | 30 | | |
| | | 31 | | [JsonPropertyName("build_configSourceEntrypoint")] |
| | | 32 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 11 | 33 | | public IList<string> ConfigSourceEntrypoint { get; set; } = new List<string>(); |
| | | 34 | | |
| | | 35 | | [JsonPropertyName("build_configSourceUri")] |
| | | 36 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 11 | 37 | | public IList<Uri> ConfigSourceUri { get; set; } = new List<Uri>(); |
| | | 38 | | |
| | | 39 | | [JsonPropertyName("build_environment")] |
| | | 40 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 11 | 41 | | public IList<DictionaryEntry> Environment { get; } = new List<DictionaryEntry>(); |
| | | 42 | | |
| | | 43 | | [JsonPropertyName("build_parameter")] |
| | | 44 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| | 11 | 45 | | public IList<DictionaryEntry> Parameter { get; } = new List<DictionaryEntry>(); |
| | | 46 | | |
| | | 47 | | // protected internal no-parm constructor required for deserialization |
| | | 48 | | // ReSharper disable once UnusedMember.Global |
| | 2 | 49 | | protected internal Build() |
| | | 50 | | { |
| | 2 | 51 | | } |
| | | 52 | | |
| | | 53 | | [SetsRequiredMembers] |
| | 2 | 54 | | public Build(Catalog catalog, CreationInfo creationInfo, Uri buildType) : base(catalog, creationInfo) |
| | | 55 | | { |
| | 2 | 56 | | BuildType = buildType; |
| | 2 | 57 | | } |
| | | 58 | | |
| | | 59 | | public override void Validate() |
| | | 60 | | { |
| | 3 | 61 | | base.Validate(); |
| | 2 | 62 | | ValidateRequiredProperty(nameof(BuildType)); |
| | 2 | 63 | | } |
| | | 64 | | } |