ImageRequest.cs 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using MediaBrowser.Model.Entities;
  2. using ServiceStack.ServiceHost;
  3. namespace MediaBrowser.Api.Images
  4. {
  5. /// <summary>
  6. /// Class ImageRequest
  7. /// </summary>
  8. public class ImageRequest : DeleteImageRequest
  9. {
  10. /// <summary>
  11. /// The max width
  12. /// </summary>
  13. [ApiMember(Name = "MaxWidth", Description = "The maximum image width to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  14. public int? MaxWidth { get; set; }
  15. /// <summary>
  16. /// The max height
  17. /// </summary>
  18. [ApiMember(Name = "MaxHeight", Description = "The maximum image height to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  19. public int? MaxHeight { get; set; }
  20. /// <summary>
  21. /// The width
  22. /// </summary>
  23. [ApiMember(Name = "Width", Description = "The fixed image width to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  24. public int? Width { get; set; }
  25. /// <summary>
  26. /// The height
  27. /// </summary>
  28. [ApiMember(Name = "Height", Description = "The fixed image height to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  29. public int? Height { get; set; }
  30. /// <summary>
  31. /// Gets or sets the quality.
  32. /// </summary>
  33. /// <value>The quality.</value>
  34. [ApiMember(Name = "Quality", Description = "Optional quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  35. public int? Quality { get; set; }
  36. /// <summary>
  37. /// Gets or sets the tag.
  38. /// </summary>
  39. /// <value>The tag.</value>
  40. [ApiMember(Name = "Tag", Description = "Optional. Supply the cache tag from the item object to receive strong caching headers.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
  41. public string Tag { get; set; }
  42. [ApiMember(Name = "CropWhitespace", Description = "Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
  43. public bool? CropWhitespace { get; set; }
  44. }
  45. /// <summary>
  46. /// Class DeleteImageRequest
  47. /// </summary>
  48. public class DeleteImageRequest
  49. {
  50. /// <summary>
  51. /// Gets or sets the type of the image.
  52. /// </summary>
  53. /// <value>The type of the image.</value>
  54. [ApiMember(Name = "Type", Description = "Image Type", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
  55. [ApiMember(Name = "Type", Description = "Image Type", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
  56. [ApiMember(Name = "Type", Description = "Image Type", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
  57. public ImageType Type { get; set; }
  58. /// <summary>
  59. /// Gets or sets the index.
  60. /// </summary>
  61. /// <value>The index.</value>
  62. [ApiMember(Name = "Index", Description = "Image Index", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
  63. [ApiMember(Name = "Index", Description = "Image Index", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "POST")]
  64. [ApiMember(Name = "Index", Description = "Image Index", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "DELETE")]
  65. public int? Index { get; set; }
  66. }
  67. }