aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Attributes/ProducesFileAttribute.cs
blob: d8e4141acbca93cdf1109a0ae3e702330c3a9d43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma warning disable CA1813 // Avoid unsealed attributes

using System;

namespace Jellyfin.Api.Attributes
{
    /// <summary>
    /// Internal produces image attribute.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method)]
    public class ProducesFileAttribute : Attribute
    {
        private readonly string[] _contentTypes;

        /// <summary>
        /// Initializes a new instance of the <see cref="ProducesFileAttribute"/> class.
        /// </summary>
        /// <param name="contentTypes">Content types this endpoint produces.</param>
        public ProducesFileAttribute(params string[] contentTypes)
        {
            _contentTypes = contentTypes;
        }

        /// <summary>
        /// Gets the configured content types.
        /// </summary>
        /// <returns>the configured content types.</returns>
        public string[] ContentTypes => _contentTypes;
    }
}