AcceptsFileAttribute.cs 915 B

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