ProducesFileAttribute.cs 857 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. namespace Jellyfin.Api.Attributes
  3. {
  4. /// <summary>
  5. /// Internal produces image attribute.
  6. /// </summary>
  7. [AttributeUsage(AttributeTargets.Method)]
  8. public class ProducesFileAttribute : Attribute
  9. {
  10. private readonly string[] _contentTypes;
  11. /// <summary>
  12. /// Initializes a new instance of the <see cref="ProducesFileAttribute"/> class.
  13. /// </summary>
  14. /// <param name="contentTypes">Content types this endpoint produces.</param>
  15. public ProducesFileAttribute(params string[] contentTypes)
  16. {
  17. _contentTypes = contentTypes;
  18. }
  19. /// <summary>
  20. /// Gets the configured content types.
  21. /// </summary>
  22. /// <returns>the configured content types.</returns>
  23. public string[] GetContentTypes() => _contentTypes;
  24. }
  25. }