diff options
| author | crobibero <cody@robibe.ro> | 2020-04-21 19:15:27 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-04-21 19:15:27 -0600 |
| commit | 461b298be7247afd7f7962604efab3b58b9dae4b (patch) | |
| tree | 5d8255b2d64441eb715669fc60a59687836ec53e /Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs | |
| parent | a2f19eadf739297cbbc99c9082b0175e8b881054 (diff) | |
Migrate DlnaServerController to Jellyfin.Api
Diffstat (limited to 'Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs')
| -rw-r--r-- | Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs b/Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs new file mode 100644 index 000000000..d6d7e4563 --- /dev/null +++ b/Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc.Routing; + +namespace Jellyfin.Api.Attributes +{ + /// <summary> + /// Identifies an action that supports the HTTP GET method. + /// </summary> + public class HttpUnsubscribeAttribute : HttpMethodAttribute + { + private static readonly IEnumerable<string> _supportedMethods = new[] { "UNSUBSCRIBE" }; + + /// <summary> + /// Initializes a new instance of the <see cref="HttpUnsubscribeAttribute"/> class. + /// </summary> + public HttpUnsubscribeAttribute() + : base(_supportedMethods) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="HttpUnsubscribeAttribute"/> class. + /// </summary> + /// <param name="template">The route template. May not be null.</param> + public HttpUnsubscribeAttribute(string template) + : base(_supportedMethods, template) + { + if (template == null) + { + throw new ArgumentNullException(nameof(template)); + } + } + } +} |
