summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/Clients/GitHub/IGitHubClient.cs
blob: e1961416b42c42fd5d19bd707f893fc33f7ace7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#nullable disable

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 : IModSiteClient, 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);
    }
}