ArchiSteamFarm.CustomPlugins.ExamplePlugin/CatController.cs
/// <summary>
///     Fetches URL of a random cat picture.
/// </summary>
Fetches URL of a random cat picture.
Fetches URL of a random cat picture .
[HttpGet]
	[ProducesResponseType(typeof(GenericResponse<string>), (int) HttpStatusCode.OK)]
	[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.ServiceUnavailable)]
	public async Task<ActionResult<GenericResponse>> CatGet() {
		if (ASF.WebBrowser == null) {
			throw new InvalidOperationException(nameof(ASF.WebBrowser));
		}
		string? link = await CatAPI.GetRandomCatURL(ASF.WebBrowser).ConfigureAwait(false);
		return !string.IsNullOrEmpty(link) ? Ok(new GenericResponse<string>(link)) : StatusCode((int) HttpStatusCode.ServiceUnavailable, new GenericResponse(false));
	}
[ HttpGet ] [ ProducesResponseType ( typeof ( GenericResponse < string > ) , ( int ) HttpStatusCode . OK ) ] [ ProducesResponseType ( typeof ( GenericResponse ) , ( int ) HttpStatusCode . ServiceUnavailable ) ] public async Task < ActionResult < GenericResponse > > CatGet ( ) { if ( ASF . WebBrowser == null ) { throw new InvalidOperationException ( nameof ( ASF . WebBrowser ) ) ; } string ? link = await CatAPI . GetRandomCatURL ( ASF . WebBrowser ) . ConfigureAwait ( false ) ; return ! string . IsNullOrEmpty ( link ) ? Ok ( new GenericResponse < string > ( link ) ) : StatusCode ( ( int ) HttpStatusCode . ServiceUnavailable , new GenericResponse ( false ) ) ; }
Fetches URL of a random cat picture.
Fetches URL of a random cat picture .