summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/Clients/GitHub/IGitHubClient.cs
blob: a34f03bdffca62cc49c3d87d8a754a97a34dc875 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using System.Threading.Tasks;

namespace StardewModdingAPI.Web.Framework.Clients.GitHub
{
    /// <summary>An HTTP client for fetching metadata from GitHub.</summary>
    internal interface IGitHubClient : IDisposable
    {
        /*********
        ** Methods
        *********/
        /// <summary>Get basic metadata for a GitHub repository, if available.</summary>
        /// <param name="repo">The repository key (like <c>Pathoschild/SMAPI</c>).</param>
        /// <returns>Returns the repository info if it exists, else <c>null</c>.</returns>
        Task<GitRepo> GetRepositoryAsync(string repo);

        /// <summary>Get the latest release for a GitHub repository.</summary>
        /// <param name="repo">The repository key (like <c>Pathoschild/SMAPI</c>).</param>
        /// <param name="includePrerelease">Whether to return a prerelease version if it's latest.</param>
        /// <returns>Returns the release if found, else <c>null</c>.</returns>
        Task<GitRelease> GetLatestReleaseAsync(string repo, bool includePrerelease = false);
    }
}