|
| 1 | +using System.Text.Json.Serialization; |
| 2 | +using JetBrains.Annotations; |
| 3 | +using NexusMods.Abstractions.GOG.JsonConverters; |
| 4 | +using NexusMods.Abstractions.GOG.Values; |
| 5 | + |
| 6 | +namespace NexusMods.Abstractions.GOG.DTOs; |
| 7 | + |
| 8 | +/// <summary> |
| 9 | +/// Information about a build, which is a collection of files and the chunks that make up those files. This may sound confusing, but the idea |
| 10 | +/// is that "build" and to some extent "depot" are both metadata concepts. The Build is the information about what a collection of files are tagged |
| 11 | +/// as (like Cyberpunk 1.5) and the depot is metadata about the actual files that are stored on the CDN. There is a 1:1 relationship between depots and |
| 12 | +/// builds. The files in the depot are then stored in one of many CDNs, these CDN links are known as "SecureLinks". There may be many secure links (mirrors) |
| 13 | +/// for a given depot and build. |
| 14 | +/// </summary> |
| 15 | +[UsedImplicitly] |
| 16 | +public class Build |
| 17 | +{ |
| 18 | + /// <summary> |
| 19 | + /// The unique ID of the build. |
| 20 | + /// </summary> |
| 21 | + [JsonPropertyName("build_id")] |
| 22 | + public required BuildId BuildId { get; init; } |
| 23 | + |
| 24 | + /// <summary> |
| 25 | + /// The product ID of the build. |
| 26 | + /// </summary> |
| 27 | + [JsonPropertyName("product_id")] |
| 28 | + public required ProductId ProductId { get; init; } |
| 29 | + |
| 30 | + /// <summary> |
| 31 | + /// The OS of the build. |
| 32 | + /// </summary> |
| 33 | + [JsonPropertyName("os")] |
| 34 | + public required string OS { get; init; } |
| 35 | + |
| 36 | + /// <summary> |
| 37 | + /// The version of the build. |
| 38 | + /// </summary> |
| 39 | + [JsonPropertyName("version_name")] |
| 40 | + public required string VersionName { get; init; } |
| 41 | + |
| 42 | + /// <summary> |
| 43 | + /// Various tags for the build (not sure what these may contain). |
| 44 | + /// </summary> |
| 45 | + [JsonPropertyName("tags")] |
| 46 | + public required string[] Tags { get; init; } |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// True if the build is public, false if it is private. |
| 50 | + /// </summary> |
| 51 | + [JsonPropertyName("public")] |
| 52 | + public bool Public { get; init; } |
| 53 | + |
| 54 | + /// <summary> |
| 55 | + /// The date the build was published. |
| 56 | + /// </summary> |
| 57 | + [JsonConverter(typeof(GOGDateTimeOffsetConverter))] |
| 58 | + [JsonPropertyName("date_published")] |
| 59 | + public DateTimeOffset DatePublished { get; init; } |
| 60 | + |
| 61 | + /// <summary> |
| 62 | + /// The generation of the build data (should be 2). |
| 63 | + /// </summary> |
| 64 | + [JsonPropertyName("generation")] |
| 65 | + public int Generation { get; init; } |
| 66 | + |
| 67 | + /// <summary> |
| 68 | + /// A link to the build's details |
| 69 | + /// </summary> |
| 70 | + [JsonPropertyName("link")] |
| 71 | + public required Uri? Link { get; init; } |
| 72 | +} |
0 commit comments