ProducesFileAttribute.cs 824 B

1234567891011121314151617181920212223242526272829
  1. #pragma warning disable CA1813 // Avoid unsealed attributes
  2. using System;
  3. namespace Jellyfin.Api.Attributes;
  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[] ContentTypes => _contentTypes;
  24. }