diff options
| author | Patrick Barron <18354464+barronpm@users.noreply.github.com> | 2020-08-03 17:00:46 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-03 17:00:46 +0000 |
| commit | 3a0bccb9418facb589e248d78de25b4e88d5de7d (patch) | |
| tree | 65de943282c3929832961490a544a97649c845b6 /Jellyfin.Api/Attributes/HttpUnsubscribeAttribute.cs | |
| parent | 97c95d3a6b8af0f2fceec7fd45d6cef60d2d4ba7 (diff) | |
| parent | 4bb1e1c29246e9293ee119e85c41edef51c39972 (diff) | |
Merge pull request #2957 from crobibero/api-dlna-server
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)); + } + } + } +} |
