2020-05-03 21:34:03 +01:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace SpotifyAPI.Web
|
|
|
|
{
|
|
|
|
public class SearchRequest : RequestParams
|
|
|
|
{
|
2020-05-05 14:30:00 +01:00
|
|
|
public SearchRequest(Types type, string query)
|
|
|
|
{
|
|
|
|
Ensure.ArgumentNotNull(type, nameof(type));
|
|
|
|
Ensure.ArgumentNotNullOrEmptyString(query, nameof(query));
|
|
|
|
|
|
|
|
Type = type;
|
|
|
|
Query = query;
|
|
|
|
}
|
|
|
|
|
2020-05-03 21:34:03 +01:00
|
|
|
[QueryParam("type")]
|
2020-05-05 14:30:00 +01:00
|
|
|
public Types Type { get; set; }
|
2020-05-03 21:34:03 +01:00
|
|
|
|
|
|
|
[QueryParam("q")]
|
|
|
|
public string Query { get; set; }
|
|
|
|
|
|
|
|
[QueryParam("market")]
|
|
|
|
public string Market { get; set; }
|
|
|
|
|
|
|
|
[QueryParam("limit")]
|
|
|
|
public int? Limit { get; set; }
|
|
|
|
|
|
|
|
[QueryParam("offset")]
|
|
|
|
public int? Offset { get; set; }
|
|
|
|
|
|
|
|
[QueryParam("include_external")]
|
2020-05-05 14:30:00 +01:00
|
|
|
public IncludeExternals? IncludeExternal { get; set; }
|
2020-05-03 21:34:03 +01:00
|
|
|
|
|
|
|
[Flags]
|
2020-05-05 14:30:00 +01:00
|
|
|
public enum IncludeExternals
|
2020-05-03 21:34:03 +01:00
|
|
|
{
|
|
|
|
[String("audio")]
|
2020-05-05 14:30:00 +01:00
|
|
|
Audio = 1,
|
2020-05-03 21:34:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
[Flags]
|
2020-05-05 14:30:00 +01:00
|
|
|
public enum Types
|
2020-05-03 21:34:03 +01:00
|
|
|
{
|
|
|
|
[String("album")]
|
2020-05-05 14:30:00 +01:00
|
|
|
Album = 1,
|
2020-05-03 21:34:03 +01:00
|
|
|
[String("artist")]
|
2020-05-05 14:30:00 +01:00
|
|
|
Artist = 2,
|
2020-05-03 21:34:03 +01:00
|
|
|
[String("playlist")]
|
2020-05-05 14:30:00 +01:00
|
|
|
Playlist = 4,
|
2020-05-03 21:34:03 +01:00
|
|
|
[String("track")]
|
2020-05-05 14:30:00 +01:00
|
|
|
Track = 8,
|
2020-05-03 21:34:03 +01:00
|
|
|
[String("show")]
|
2020-05-05 14:30:00 +01:00
|
|
|
Show = 16,
|
2020-05-03 21:34:03 +01:00
|
|
|
[String("episode")]
|
2020-05-05 14:30:00 +01:00
|
|
|
Episode = 32,
|
2020-05-03 21:34:03 +01:00
|
|
|
All = Album | Artist | Playlist | Track | Show | Episode
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|