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.
Prowlarr/src/Prowlarr.Http/ResourceChangeMessage.cs

30 lines
824 B

11 years ago
using System;
using NzbDrone.Core.Datastore.Events;
4 years ago
using Prowlarr.Http.REST;
11 years ago
4 years ago
namespace Prowlarr.Http
11 years ago
{
public class ResourceChangeMessage<TResource>
where TResource : RestResource
11 years ago
{
public TResource Resource { get; private set; }
public ModelAction Action { get; private set; }
public ResourceChangeMessage(ModelAction action)
{
if (action != ModelAction.Deleted && action != ModelAction.Sync)
11 years ago
{
throw new InvalidOperationException("Resource message without a resource needs to have Delete or Sync as action");
}
Action = action;
}
public ResourceChangeMessage(TResource resource, ModelAction action)
{
Resource = resource;
Action = action;
}
}
}