From d76964c5f381a5b8faba123646d851e7ae2c06f0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 29 Jan 2023 16:37:23 -0500 Subject: group response models --- .../ResponseModels/UpdateManifestModModel.cs | 34 ++++++++++++++++++++++ .../ResponseModels/UpdateManifestModel.cs | 31 ++++++++++++++++++++ .../ResponseModels/UpdateManifestVersionModel.cs | 34 ++++++++++++++++++++++ .../Clients/UpdateManifest/UpdateManifestClient.cs | 1 + .../UpdateManifest/UpdateManifestModModel.cs | 34 ---------------------- .../UpdateManifest/UpdateManifestModPage.cs | 1 + .../Clients/UpdateManifest/UpdateManifestModel.cs | 31 -------------------- .../UpdateManifest/UpdateManifestVersionModel.cs | 34 ---------------------- 8 files changed, 101 insertions(+), 99 deletions(-) create mode 100644 src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs create mode 100644 src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModel.cs create mode 100644 src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestVersionModel.cs delete mode 100644 src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModModel.cs delete mode 100644 src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModel.cs delete mode 100644 src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs new file mode 100644 index 00000000..ee1fbeb6 --- /dev/null +++ b/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModModel.cs @@ -0,0 +1,34 @@ +// Copyright 2022 Jamie Taylor +namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest.ResponseModels +{ + /// The data model for a mod in an update manifest file. + internal class UpdateManifestModModel + { + /********* + ** Accessors + *********/ + /// The mod's name. + public string? Name { get; } + + /// The mod page URL from which to download updates. + public string? Url { get; } + + /// The available versions for this mod. + public UpdateManifestVersionModel[]? Versions { get; } + + + /********* + ** Public methods + *********/ + /// Construct an instance. + /// The mod's name. + /// The mod page URL from which to download updates. + /// The available versions for this mod. + public UpdateManifestModModel(string? name, string? url, UpdateManifestVersionModel[]? versions) + { + this.Name = name; + this.Url = url; + this.Versions = versions; + } + } +} diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModel.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModel.cs new file mode 100644 index 00000000..e213fbab --- /dev/null +++ b/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestModel.cs @@ -0,0 +1,31 @@ +// Copyright 2022 Jamie Taylor +using System.Collections.Generic; + +namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest.ResponseModels +{ + /// The data model for an update manifest file. + internal class UpdateManifestModel + { + /********* + ** Accessors + *********/ + /// The manifest format version. + public string? ManifestVersion { get; } + + /// The mod info in this update manifest. + public IDictionary? Mods { get; } + + + /********* + ** Public methods + *********/ + /// Construct an instance. + /// The manifest format version. + /// The mod info in this update manifest. + public UpdateManifestModel(string manifestVersion, IDictionary mods) + { + this.ManifestVersion = manifestVersion; + this.Mods = mods; + } + } +} diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestVersionModel.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestVersionModel.cs new file mode 100644 index 00000000..1e84501f --- /dev/null +++ b/src/SMAPI.Web/Framework/Clients/UpdateManifest/ResponseModels/UpdateManifestVersionModel.cs @@ -0,0 +1,34 @@ +// Copyright 2022 Jamie Taylor +namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest.ResponseModels +{ + /// Data model for a Version in an update manifest. + internal class UpdateManifestVersionModel + { + /********* + ** Accessors + *********/ + /// The mod's semantic version. + public string? Version { get; } + + /// The URL for this version's download page (if any). + public string? DownloadPageUrl { get; } + + /// The URL for this version's direct file download (if any). + public string? DownloadFileUrl { get; } + + + /********* + ** Public methods + *********/ + /// Construct an instance. + /// The mod's semantic version. + /// This version's download page URL, if any. + /// This version's direct file download URL, if any. + public UpdateManifestVersionModel(string version, string? downloadPageUrl, string? downloadFileUrl) + { + this.Version = version; + this.DownloadPageUrl = downloadPageUrl; + this.DownloadFileUrl = downloadFileUrl; + } + } +} diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestClient.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestClient.cs index 0199027f..0d19900e 100644 --- a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestClient.cs +++ b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestClient.cs @@ -4,6 +4,7 @@ using System.Net.Http.Headers; using System.Threading.Tasks; using Pathoschild.Http.Client; using StardewModdingAPI.Toolkit.Framework.UpdateData; +using StardewModdingAPI.Web.Framework.Clients.UpdateManifest.ResponseModels; namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest { diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModModel.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModModel.cs deleted file mode 100644 index 92642321..00000000 --- a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModModel.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2022 Jamie Taylor -namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest -{ - /// The data model for a mod in an update manifest file. - internal class UpdateManifestModModel - { - /********* - ** Accessors - *********/ - /// The mod's name. - public string? Name { get; } - - /// The mod page URL from which to download updates. - public string? Url { get; } - - /// The available versions for this mod. - public UpdateManifestVersionModel[]? Versions { get; } - - - /********* - ** Public methods - *********/ - /// Construct an instance. - /// The mod's name. - /// The mod page URL from which to download updates. - /// The available versions for this mod. - public UpdateManifestModModel(string? name, string? url, UpdateManifestVersionModel[]? versions) - { - this.Name = name; - this.Url = url; - this.Versions = versions; - } - } -} diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModPage.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModPage.cs index 7537eb24..251ed9ec 100644 --- a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModPage.cs +++ b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModPage.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using StardewModdingAPI.Toolkit.Framework.UpdateData; +using StardewModdingAPI.Web.Framework.Clients.UpdateManifest.ResponseModels; namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest { diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModel.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModel.cs deleted file mode 100644 index ad618022..00000000 --- a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestModel.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2022 Jamie Taylor -using System.Collections.Generic; - -namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest -{ - /// The data model for an update manifest file. - internal class UpdateManifestModel - { - /********* - ** Accessors - *********/ - /// The manifest format version. - public string? ManifestVersion { get; } - - /// The mod info in this update manifest. - public IDictionary? Mods { get; } - - - /********* - ** Public methods - *********/ - /// Construct an instance. - /// The manifest format version. - /// The mod info in this update manifest. - public UpdateManifestModel(string manifestVersion, IDictionary mods) - { - this.ManifestVersion = manifestVersion; - this.Mods = mods; - } - } -} diff --git a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs b/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs deleted file mode 100644 index 90e054d8..00000000 --- a/src/SMAPI.Web/Framework/Clients/UpdateManifest/UpdateManifestVersionModel.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2022 Jamie Taylor -namespace StardewModdingAPI.Web.Framework.Clients.UpdateManifest -{ - /// Data model for a Version in an update manifest. - internal class UpdateManifestVersionModel - { - /********* - ** Accessors - *********/ - /// The mod's semantic version. - public string? Version { get; } - - /// The URL for this version's download page (if any). - public string? DownloadPageUrl { get; } - - /// The URL for this version's direct file download (if any). - public string? DownloadFileUrl { get; } - - - /********* - ** Public methods - *********/ - /// Construct an instance. - /// The mod's semantic version. - /// This version's download page URL, if any. - /// This version's direct file download URL, if any. - public UpdateManifestVersionModel(string version, string? downloadPageUrl, string? downloadFileUrl) - { - this.Version = version; - this.DownloadPageUrl = downloadPageUrl; - this.DownloadFileUrl = downloadFileUrl; - } - } -} -- cgit