From 214484a7c044771d6a9baacab6d5d31bf27273b3 Mon Sep 17 00:00:00 2001 From: "Johnny Dellinger @PC" Date: Sun, 26 Jul 2015 14:03:53 +0200 Subject: [PATCH] More models rearranged --- SpotifyAPI/Web/Models/FollowedArtists.cs | 2 +- SpotifyAPI/Web/Models/FullTrack.cs | 21 +++++++++++-- SpotifyAPI/Web/Models/GeneralModels.cs | 39 +++++++++++++++++++----- 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/SpotifyAPI/Web/Models/FollowedArtists.cs b/SpotifyAPI/Web/Models/FollowedArtists.cs index 2fc4f3b1..163ce877 100644 --- a/SpotifyAPI/Web/Models/FollowedArtists.cs +++ b/SpotifyAPI/Web/Models/FollowedArtists.cs @@ -5,6 +5,6 @@ namespace SpotifyAPI.Web.Models public class FollowedArtists : BasicModel { [JsonProperty("artists")] - CursorPaging Artists { get; set; } + public CursorPaging Artists { get; set; } } } \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/FullTrack.cs b/SpotifyAPI/Web/Models/FullTrack.cs index 3c0265d8..be76d17b 100644 --- a/SpotifyAPI/Web/Models/FullTrack.cs +++ b/SpotifyAPI/Web/Models/FullTrack.cs @@ -8,47 +8,62 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("album")] public SimpleAlbum Album { get; set; } + [JsonProperty("artists")] public List Artists { get; set; } + [JsonProperty("available_markets")] public List 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 ExternalIds { get; set; } + [JsonProperty("external_urls")] public Dictionary 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; } /// - /// Only filled when the "market"-parameter was supplied! + /// Only filled when the "market"-parameter was supplied! /// [JsonProperty("is_playable")] public Boolean? IsPlayable { get; set; } /// - /// Only filled when the "market"-parameter was supplied! + /// Only filled when the "market"-parameter was supplied! /// [JsonProperty("linked_from")] public LinkedFrom LinkedFrom { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/GeneralModels.cs b/SpotifyAPI/Web/Models/GeneralModels.cs index e0469781..89dbe60d 100644 --- a/SpotifyAPI/Web/Models/GeneralModels.cs +++ b/SpotifyAPI/Web/Models/GeneralModels.cs @@ -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 Positions { get; set; } - /// /// Delete-Track Wrapper /// @@ -67,30 +76,41 @@ namespace SpotifyAPI.Web.Models Uri = uri; } + [JsonProperty("uri")] + public String Uri { get; set; } + + [JsonProperty("positions")] + public List Positions { get; set; } + public bool ShouldSerializePositions() { return (Positions.Count > 0); } } + public class SeveralTracks : BasicModel { [JsonProperty("tracks")] public List Tracks { get; set; } } + public class SeveralArtists : BasicModel { [JsonProperty("artists")] public List Artists { get; set; } } + public class SeveralAlbums : BasicModel { [JsonProperty("albums")] public List 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 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; } } -} +} \ No newline at end of file