2021-11-16 15:31:57 +00:00
|
|
|
|
#pragma warning disable CA1813 // Avoid unsealed attributes
|
|
|
|
|
|
|
|
|
|
using System;
|
2020-09-01 23:26:49 +00:00
|
|
|
|
|
2023-01-31 11:18:10 +00:00
|
|
|
|
namespace Jellyfin.Api.Attributes;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Internal produces image attribute.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[AttributeUsage(AttributeTargets.Method)]
|
|
|
|
|
public class ProducesFileAttribute : Attribute
|
2020-09-01 23:26:49 +00:00
|
|
|
|
{
|
2023-01-31 11:18:10 +00:00
|
|
|
|
private readonly string[] _contentTypes;
|
|
|
|
|
|
2020-09-01 23:26:49 +00:00
|
|
|
|
/// <summary>
|
2023-01-31 11:18:10 +00:00
|
|
|
|
/// Initializes a new instance of the <see cref="ProducesFileAttribute"/> class.
|
2020-09-01 23:26:49 +00:00
|
|
|
|
/// </summary>
|
2023-01-31 11:18:10 +00:00
|
|
|
|
/// <param name="contentTypes">Content types this endpoint produces.</param>
|
|
|
|
|
public ProducesFileAttribute(params string[] contentTypes)
|
2020-09-01 23:26:49 +00:00
|
|
|
|
{
|
2023-01-31 11:18:10 +00:00
|
|
|
|
_contentTypes = contentTypes;
|
2020-09-01 23:26:49 +00:00
|
|
|
|
}
|
2023-01-31 11:18:10 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the configured content types.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>the configured content types.</returns>
|
|
|
|
|
public string[] ContentTypes => _contentTypes;
|
2020-09-01 23:26:49 +00:00
|
|
|
|
}
|