More models rearranged

This commit is contained in:
Johnny Dellinger @PC 2015-07-26 14:03:53 +02:00
parent b0f687c994
commit 214484a7c0
3 changed files with 51 additions and 11 deletions

View File

@ -5,6 +5,6 @@ namespace SpotifyAPI.Web.Models
public class FollowedArtists : BasicModel
{
[JsonProperty("artists")]
CursorPaging<FullArtist> Artists { get; set; }
public CursorPaging<FullArtist> Artists { get; set; }
}
}

View File

@ -8,47 +8,62 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("album")]
public SimpleAlbum Album { get; set; }
[JsonProperty("artists")]
public List<SimpleArtist> Artists { get; set; }
[JsonProperty("available_markets")]
public List<String> AvailableMarkets { get; set; }
[JsonProperty("disc_number")]
public int DiscNumber { get; set; }
[JsonProperty("duration_ms")]
public int DurationMs { get; set; }
[JsonProperty("explicit")]
public Boolean Explicit { get; set; }
[JsonProperty("external_ids")]
public Dictionary<String, String> ExternalIds { get; set; }
[JsonProperty("external_urls")]
public Dictionary<String, String> ExternUrls { get; set; }
[JsonProperty("href")]
public String Href { get; set; }
[JsonProperty("id")]
public String Id { get; set; }
[JsonProperty("name")]
public String Name { get; set; }
[JsonProperty("popularity")]
public int Popularity { get; set; }
[JsonProperty("preview_url")]
public String PreviewUrl { get; set; }
[JsonProperty("track_number")]
public int TrackNumber { get; set; }
[JsonProperty("type")]
public String Type { get; set; }
[JsonProperty("uri")]
public String Uri { get; set; }
/// <summary>
/// Only filled when the "market"-parameter was supplied!
/// Only filled when the "market"-parameter was supplied!
/// </summary>
[JsonProperty("is_playable")]
public Boolean? IsPlayable { get; set; }
/// <summary>
/// Only filled when the "market"-parameter was supplied!
/// Only filled when the "market"-parameter was supplied!
/// </summary>
[JsonProperty("linked_from")]
public LinkedFrom LinkedFrom { get; set; }
}
}
}

View File

@ -9,53 +9,62 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("url")]
public String Url { get; set; }
[JsonProperty("width")]
public int Width { get; set; }
[JsonProperty("height")]
public int Height { get; set; }
}
public class ErrorResponse : BasicModel { }
public class ErrorResponse : BasicModel
{
}
public class Error
{
[JsonProperty("status")]
public int Status { get; set; }
[JsonProperty("message")]
public String Message { get; set; }
}
public class PlaylistTrackCollection
{
[JsonProperty("href")]
public String Href { get; set; }
[JsonProperty("total")]
public int Total { get; set; }
}
public class Followers
{
[JsonProperty("href")]
public String Href { get; set; }
[JsonProperty("total")]
public int Total { get; set; }
}
public class PlaylistTrack
{
[JsonProperty("added_at")]
public DateTime AddedAt { get; set; }
[JsonProperty("added_by")]
public PublicProfile AddedBy { get; set; }
[JsonProperty("track")]
public FullTrack Track { get; set; }
[JsonProperty("is_local")]
public Boolean IsLocal { get; set; }
}
public class DeleteTrackUri
{
[JsonProperty("uri")]
public String Uri { get; set; }
[JsonProperty("positions")]
public List<int> Positions { get; set; }
/// <summary>
/// Delete-Track Wrapper
/// </summary>
@ -67,30 +76,41 @@ namespace SpotifyAPI.Web.Models
Uri = uri;
}
[JsonProperty("uri")]
public String Uri { get; set; }
[JsonProperty("positions")]
public List<int> Positions { get; set; }
public bool ShouldSerializePositions()
{
return (Positions.Count > 0);
}
}
public class SeveralTracks : BasicModel
{
[JsonProperty("tracks")]
public List<FullTrack> Tracks { get; set; }
}
public class SeveralArtists : BasicModel
{
[JsonProperty("artists")]
public List<FullArtist> Artists { get; set; }
}
public class SeveralAlbums : BasicModel
{
[JsonProperty("albums")]
public List<FullAlbum> Albums { get; set; }
}
public class Copyright
{
[JsonProperty("text")]
public String Text { get; set; }
[JsonProperty("type")]
public String Type { get; set; }
}
@ -99,12 +119,16 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("external_urls")]
public Dictionary<String, String> ExternalUrls { get; set; }
[JsonProperty("href")]
public String Href { get; set; }
[JsonProperty("id")]
public String Id { get; set; }
[JsonProperty("type")]
public String Type { get; set; }
[JsonProperty("uri")]
public String Uri { get; set; }
}
@ -113,6 +137,7 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("added_at")]
public DateTime AddedAt { get; set; }
[JsonProperty("track")]
public FullTrack Track { get; set; }
}
@ -122,4 +147,4 @@ namespace SpotifyAPI.Web.Models
[JsonProperty("after")]
public String After { get; set; }
}
}
}