summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/ConfigModels
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web/Framework/ConfigModels')
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs36
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/ModOverrideConfig.cs6
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs10
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs6
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/SmapiInfoConfig.cs8
5 files changed, 30 insertions, 36 deletions
diff --git a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs
index 3730a9db..b582b2b0 100644
--- a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs
+++ b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
namespace StardewModdingAPI.Web.Framework.ConfigModels
{
/// <summary>The config settings for the API clients.</summary>
@@ -12,17 +10,17 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels
** Generic
****/
/// <summary>The user agent for API clients, where {0} is the SMAPI version.</summary>
- public string UserAgent { get; set; }
+ public string UserAgent { get; set; } = null!;
/****
** Azure
****/
/// <summary>The connection string for the Azure Blob storage account.</summary>
- public string AzureBlobConnectionString { get; set; }
+ public string? AzureBlobConnectionString { get; set; }
/// <summary>The Azure Blob container in which to store temporary uploaded logs.</summary>
- public string AzureBlobTempContainer { get; set; }
+ public string AzureBlobTempContainer { get; set; } = null!;
/// <summary>The number of days since the blob's last-modified date when it will be deleted.</summary>
public int AzureBlobTempExpiryDays { get; set; }
@@ -32,65 +30,65 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels
** Chucklefish
****/
/// <summary>The base URL for the Chucklefish mod site.</summary>
- public string ChucklefishBaseUrl { get; set; }
+ public string ChucklefishBaseUrl { get; set; } = null!;
/// <summary>The URL for a mod page on the Chucklefish mod site excluding the <see cref="GitHubBaseUrl"/>, where {0} is the mod ID.</summary>
- public string ChucklefishModPageUrlFormat { get; set; }
+ public string ChucklefishModPageUrlFormat { get; set; } = null!;
/****
** CurseForge
****/
/// <summary>The base URL for the CurseForge API.</summary>
- public string CurseForgeBaseUrl { get; set; }
+ public string CurseForgeBaseUrl { get; set; } = null!;
/****
** GitHub
****/
/// <summary>The base URL for the GitHub API.</summary>
- public string GitHubBaseUrl { get; set; }
+ public string GitHubBaseUrl { get; set; } = null!;
/// <summary>The Accept header value expected by the GitHub API.</summary>
- public string GitHubAcceptHeader { get; set; }
+ public string GitHubAcceptHeader { get; set; } = null!;
/// <summary>The username with which to authenticate to the GitHub API (if any).</summary>
- public string GitHubUsername { get; set; }
+ public string? GitHubUsername { get; set; }
/// <summary>The password with which to authenticate to the GitHub API (if any).</summary>
- public string GitHubPassword { get; set; }
+ public string? GitHubPassword { get; set; }
/****
** ModDrop
****/
/// <summary>The base URL for the ModDrop API.</summary>
- public string ModDropApiUrl { get; set; }
+ public string ModDropApiUrl { get; set; } = null!;
/// <summary>The URL for a ModDrop mod page for the user, where {0} is the mod ID.</summary>
- public string ModDropModPageUrl { get; set; }
+ public string ModDropModPageUrl { get; set; } = null!;
/****
** Nexus Mods
****/
/// <summary>The base URL for the Nexus Mods API.</summary>
- public string NexusBaseUrl { get; set; }
+ public string NexusBaseUrl { get; set; } = null!;
/// <summary>The URL for a Nexus mod page for the user, excluding the <see cref="NexusBaseUrl"/>, where {0} is the mod ID.</summary>
- public string NexusModUrlFormat { get; set; }
+ public string NexusModUrlFormat { get; set; } = null!;
/// <summary>The URL for a Nexus mod page to scrape for versions, excluding the <see cref="NexusBaseUrl"/>, where {0} is the mod ID.</summary>
- public string NexusModScrapeUrlFormat { get; set; }
+ public string NexusModScrapeUrlFormat { get; set; } = null!;
/// <summary>The Nexus API authentication key.</summary>
- public string NexusApiKey { get; set; }
+ public string? NexusApiKey { get; set; }
/****
** Pastebin
****/
/// <summary>The base URL for the Pastebin API.</summary>
- public string PastebinBaseUrl { get; set; }
+ public string PastebinBaseUrl { get; set; } = null!;
}
}
diff --git a/src/SMAPI.Web/Framework/ConfigModels/ModOverrideConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ModOverrideConfig.cs
index 682c97e6..e46ecf2b 100644
--- a/src/SMAPI.Web/Framework/ConfigModels/ModOverrideConfig.cs
+++ b/src/SMAPI.Web/Framework/ConfigModels/ModOverrideConfig.cs
@@ -1,17 +1,15 @@
-#nullable disable
-
namespace StardewModdingAPI.Web.Framework.ConfigModels
{
/// <summary>Override update-check metadata for a mod.</summary>
internal class ModOverrideConfig
{
/// <summary>The unique ID from the mod's manifest.</summary>
- public string ID { get; set; }
+ public string ID { get; set; } = null!;
/// <summary>Whether to allow non-standard versions.</summary>
public bool AllowNonStandardVersions { get; set; }
/// <summary>The mod page URL to use regardless of which site has the update, or <c>null</c> to use the site URL.</summary>
- public string SetUrl { get; set; }
+ public string? SetUrl { get; set; }
}
}
diff --git a/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs
index e525e09a..c3b136e8 100644
--- a/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs
+++ b/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs
@@ -1,4 +1,4 @@
-#nullable disable
+using System;
namespace StardewModdingAPI.Web.Framework.ConfigModels
{
@@ -8,16 +8,16 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels
/*********
** Accessors
*********/
- /// <summary>The number of minutes successful update checks should be cached before refetching them.</summary>
+ /// <summary>The number of minutes successful update checks should be cached before re-fetching them.</summary>
public int SuccessCacheMinutes { get; set; }
- /// <summary>The number of minutes failed update checks should be cached before refetching them.</summary>
+ /// <summary>The number of minutes failed update checks should be cached before re-fetching them.</summary>
public int ErrorCacheMinutes { get; set; }
/// <summary>Update-check metadata to override.</summary>
- public ModOverrideConfig[] ModOverrides { get; set; }
+ public ModOverrideConfig[] ModOverrides { get; set; } = Array.Empty<ModOverrideConfig>();
/// <summary>The update-check config for SMAPI's own update checks.</summary>
- public SmapiInfoConfig SmapiInfo { get; set; }
+ public SmapiInfoConfig SmapiInfo { get; set; } = null!;
}
}
diff --git a/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs
index ef6c2659..62685e47 100644
--- a/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs
+++ b/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
namespace StardewModdingAPI.Web.Framework.ConfigModels
{
/// <summary>The site config settings.</summary>
@@ -9,9 +7,9 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels
** Accessors
*********/
/// <summary>A message to show below the download button (e.g. for details on downloading a beta version), in Markdown format.</summary>
- public string OtherBlurb { get; set; }
+ public string? OtherBlurb { get; set; }
/// <summary>A list of supports to credit on the main page, in Markdown format.</summary>
- public string SupporterList { get; set; }
+ public string? SupporterList { get; set; }
}
}
diff --git a/src/SMAPI.Web/Framework/ConfigModels/SmapiInfoConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/SmapiInfoConfig.cs
index dbf58817..a95e0048 100644
--- a/src/SMAPI.Web/Framework/ConfigModels/SmapiInfoConfig.cs
+++ b/src/SMAPI.Web/Framework/ConfigModels/SmapiInfoConfig.cs
@@ -1,4 +1,4 @@
-#nullable disable
+using System;
namespace StardewModdingAPI.Web.Framework.ConfigModels
{
@@ -6,12 +6,12 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels
internal class SmapiInfoConfig
{
/// <summary>The mod ID used for SMAPI update checks.</summary>
- public string ID { get; set; }
+ public string ID { get; set; } = null!;
/// <summary>The default update key used for SMAPI update checks.</summary>
- public string DefaultUpdateKey { get; set; }
+ public string DefaultUpdateKey { get; set; } = null!;
/// <summary>The update keys to add for SMAPI update checks when the player has a beta version installed.</summary>
- public string[] AddBetaUpdateKeys { get; set; }
+ public string[] AddBetaUpdateKeys { get; set; } = Array.Empty<string>();
}
}