summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/Clients/GitHub/GitLicense.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-12 19:15:39 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-12 19:15:39 -0400
commit0b48c1748b354458059c7607415288de072b01e9 (patch)
treef63fd950f565d363414eb692be9024895cdea174 /src/SMAPI.Web/Framework/Clients/GitHub/GitLicense.cs
parent9fbed0fa1f28a9b0fe0b952a78b10e2d475adb03 (diff)
downloadSMAPI-0b48c1748b354458059c7607415288de072b01e9.tar.gz
SMAPI-0b48c1748b354458059c7607415288de072b01e9.tar.bz2
SMAPI-0b48c1748b354458059c7607415288de072b01e9.zip
enable nullable annotations in the web project & related code (#837)
Diffstat (limited to 'src/SMAPI.Web/Framework/Clients/GitHub/GitLicense.cs')
-rw-r--r--src/SMAPI.Web/Framework/Clients/GitHub/GitLicense.cs26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/SMAPI.Web/Framework/Clients/GitHub/GitLicense.cs b/src/SMAPI.Web/Framework/Clients/GitHub/GitLicense.cs
index 275c775a..24d6c3c5 100644
--- a/src/SMAPI.Web/Framework/Clients/GitHub/GitLicense.cs
+++ b/src/SMAPI.Web/Framework/Clients/GitHub/GitLicense.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using Newtonsoft.Json;
namespace StardewModdingAPI.Web.Framework.Clients.GitHub
@@ -7,16 +5,34 @@ namespace StardewModdingAPI.Web.Framework.Clients.GitHub
/// <summary>The license info for a GitHub project.</summary>
internal class GitLicense
{
+ /*********
+ ** Accessors
+ *********/
/// <summary>The license display name.</summary>
[JsonProperty("name")]
- public string Name { get; set; }
+ public string Name { get; }
/// <summary>The SPDX ID for the license.</summary>
[JsonProperty("spdx_id")]
- public string SpdxId { get; set; }
+ public string SpdxId { get; }
/// <summary>The URL for the license info.</summary>
[JsonProperty("url")]
- public string Url { get; set; }
+ public string Url { get; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ /// <param name="name">The license display name.</param>
+ /// <param name="spdxId">The SPDX ID for the license.</param>
+ /// <param name="url">The URL for the license info.</param>
+ public GitLicense(string name, string spdxId, string url)
+ {
+ this.Name = name;
+ this.SpdxId = spdxId;
+ this.Url = url;
+ }
}
}