You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
recyclarr/src/Recyclarr.ServarrApi/ReleaseProfile/ReleaseProfileApiService.cs

36 lines
1.2 KiB

using Flurl.Http;
using Recyclarr.Config.Models;
using Recyclarr.ServarrApi.Http.Servarr;
namespace Recyclarr.ServarrApi.ReleaseProfile;
public class ReleaseProfileApiService(IServarrRequestBuilder service) : IReleaseProfileApiService
{
public async Task UpdateReleaseProfile(IServiceConfiguration config, SonarrReleaseProfile profile)
{
await service.Request(config, "releaseprofile", profile.Id)
.PutJsonAsync(profile);
}
public async Task<SonarrReleaseProfile> CreateReleaseProfile(
IServiceConfiguration config,
SonarrReleaseProfile profile)
{
return await service.Request(config, "releaseprofile")
.PostJsonAsync(profile)
.ReceiveJson<SonarrReleaseProfile>();
}
public async Task<IList<SonarrReleaseProfile>> GetReleaseProfiles(IServiceConfiguration config)
{
return await service.Request(config, "releaseprofile")
.GetJsonAsync<List<SonarrReleaseProfile>>();
}
public async Task DeleteReleaseProfile(IServiceConfiguration config, int releaseProfileId)
{
await service.Request(config, "releaseprofile", releaseProfileId)
.DeleteAsync();
}
}