ArchiSteamFarm/IPC/Controllers/Api/GitHubController.cs
/// <summary>
///     Fetches specific GitHub release of ASF project. Use "latest" for latest stable release.
/// </summary>
/// <remarks>
///     This is internal API being utilizied by our ASF-ui IPC frontend. You should not depend on existence of any /Api/WWW endpoints as they can disappear and change anytime.
/// </remarks>
Fetches specific GitHub release of ASF project. Use "latest" for latest stable release.
Fetches specific GitHub release of ASF project . Use " latest " for latest stable release .
[HttpGet("Release/{version:required}")]
	[ProducesResponseType(typeof(GenericResponse<GitHubReleaseResponse>), (int) HttpStatusCode.OK)]
	[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
	[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.ServiceUnavailable)]
	public async Task<ActionResult<GenericResponse>> GitHubReleaseGet(string version) {
		if (string.IsNullOrEmpty(version)) {
			throw new ArgumentNullException(nameof(version));
		}
		GitHub.ReleaseResponse? releaseResponse;
		switch (version.ToUpperInvariant()) {
			case "LATEST":
				releaseResponse = await GitHub.GetLatestRelease().ConfigureAwait(false);
				break;
			default:
				if (!Version.TryParse(version, out Version? parsedVersion)) {
					return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(version))));
				}
				releaseResponse = await GitHub.GetRelease(parsedVersion.ToString(4)).ConfigureAwait(false);
				break;
		}
		return releaseResponse != null ? Ok(new GenericResponse<GitHubReleaseResponse>(new GitHubReleaseResponse(releaseResponse))) : StatusCode((int) HttpStatusCode.ServiceUnavailable, new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorRequestFailedTooManyTimes, WebBrowser.MaxTries)));
	}
[ HttpGet ( " " ) ] [ ProducesResponseType ( typeof ( GenericResponse < GitHubReleaseResponse > ) , ( int ) HttpStatusCode . OK ) ] [ ProducesResponseType ( typeof ( GenericResponse ) , ( int ) HttpStatusCode . BadRequest ) ] [ ProducesResponseType ( typeof ( GenericResponse ) , ( int ) HttpStatusCode . ServiceUnavailable ) ] public async Task < ActionResult < GenericResponse > > GitHubReleaseGet ( string version ) { if ( string . IsNullOrEmpty ( version ) ) { throw new ArgumentNullException ( nameof ( version ) ) ; } GitHub . ReleaseResponse ? releaseResponse ; switch ( version . ToUpperInvariant ( ) ) { case " " : releaseResponse = await GitHub . GetLatestRelease ( ) . ConfigureAwait ( false ) ; break ; default : if ( ! Version . TryParse ( version , out Version ? parsedVersion ) ) { return BadRequest ( new GenericResponse ( false , string . Format ( CultureInfo . CurrentCulture , Strings . ErrorIsInvalid , nameof ( version ) ) ) ) ; } releaseResponse = await GitHub . GetRelease ( parsedVersion . ToString ( 4 ) ) . ConfigureAwait ( false ) ; break ; } return releaseResponse != null ? Ok ( new GenericResponse < GitHubReleaseResponse > ( new GitHubReleaseResponse ( releaseResponse ) ) ) : StatusCode ( ( int ) HttpStatusCode . ServiceUnavailable , new GenericResponse ( false , string . Format ( CultureInfo . CurrentCulture , Strings . ErrorRequestFailedTooManyTimes , WebBrowser . MaxTries ) ) ) ; }
Fetches specific GitHub release of ASF project.
Fetches specific GitHub release of ASF project .
version
string
remarks
This is internal API being utilizied by our ASF-ui IPC frontend. You should not depend on existence of any /Api/WWW endpoints as they can disappear and change anytime.
This is internal API being utilizied by our ASF - ui IPC frontend . You should not depend on existence of any / Api / WWW endpoints as they can disappear and change anytime .