From aee42562698ad3e84f781d51e8aa5017a1a589bc Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 6 Jun 2018 00:02:30 -0400 Subject: remove obsolete Nexus API client --- .../Framework/Clients/Nexus/NexusClient.cs | 48 ---------------------- 1 file changed, 48 deletions(-) delete mode 100644 src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs (limited to 'src/SMAPI.Web/Framework/Clients/Nexus') diff --git a/src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs b/src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs deleted file mode 100644 index adec41be..00000000 --- a/src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Threading.Tasks; -using Pathoschild.Http.Client; - -namespace StardewModdingAPI.Web.Framework.Clients.Nexus -{ - /// An HTTP client for fetching mod metadata from the Nexus Mods API. - internal class NexusClient : INexusClient - { - /********* - ** Properties - *********/ - /// The URL for a Nexus Mods API query excluding the base URL, where {0} is the mod ID. - private readonly string ModUrlFormat; - - /// The underlying HTTP client. - private readonly IClient Client; - - - /********* - ** Public methods - *********/ - /// Construct an instance. - /// The user agent for the Nexus Mods API client. - /// The base URL for the Nexus Mods API. - /// The URL for a Nexus Mods API query excluding the , where {0} is the mod ID. - public NexusClient(string userAgent, string baseUrl, string modUrlFormat) - { - this.ModUrlFormat = modUrlFormat; - this.Client = new FluentClient(baseUrl).SetUserAgent(userAgent); - } - - /// Get metadata about a mod. - /// The Nexus mod ID. - /// Returns the mod info if found, else null. - public async Task GetModAsync(uint id) - { - return await this.Client - .GetAsync(string.Format(this.ModUrlFormat, id)) - .As(); - } - - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - public void Dispose() - { - this.Client?.Dispose(); - } - } -} -- cgit