using System;
using Newtonsoft.Json;
namespace StardewModdingAPI.Web.Framework.Clients.GitHub
{
/// A GitHub project release.
internal class GitRelease
{
/*********
** Accessors
*********/
/// The display name.
[JsonProperty("name")]
public string Name { get; }
/// The semantic version string.
[JsonProperty("tag_name")]
public string Tag { get; }
/// The Markdown description for the release.
public string Body { get; internal set; }
/// Whether this is a draft version.
[JsonProperty("draft")]
public bool IsDraft { get; }
/// Whether this is a prerelease version.
[JsonProperty("prerelease")]
public bool IsPrerelease { get; }
/// The attached files.
public GitAsset[] Assets { get; }
/*********
** Public methods
*********/
/// Construct an instance.
/// The display name.
/// The semantic version string.
/// The Markdown description for the release.
/// Whether this is a draft version.
/// Whether this is a prerelease version.
/// The attached files.
public GitRelease(string name, string tag, string? body, bool isDraft, bool isPrerelease, GitAsset[]? assets)
{
this.Name = name;
this.Tag = tag;
this.Body = body ?? string.Empty;
this.IsDraft = isDraft;
this.IsPrerelease = isPrerelease;
this.Assets = assets ?? Array.Empty();
}
}
}