From b0f687c994560b7fc0677958068cc84075ce07cb Mon Sep 17 00:00:00 2001 From: "Johnny Dellinger @PC" Date: Sun, 26 Jul 2015 14:02:22 +0200 Subject: [PATCH] Rearranged models --- SpotifyAPI/Web/Models/Category.cs | 5 ++- SpotifyAPI/Web/Models/CategoryList.cs | 2 +- SpotifyAPI/Web/Models/CategoryPlaylist.cs | 2 +- SpotifyAPI/Web/Models/FeaturedPlaylists.cs | 3 +- SpotifyAPI/Web/Models/FullAlbum.cs | 18 ++++++++++- SpotifyAPI/Web/Models/FullArtist.cs | 11 ++++++- SpotifyAPI/Web/Models/FullPlaylist.cs | 14 +++++++- SpotifyAPI/Web/Models/NewAlbumReleases.cs | 2 +- SpotifyAPI/Web/Models/Paging.cs | 8 ++++- SpotifyAPI/Web/Models/PrivateProfile.cs | 13 +++++++- SpotifyAPI/Web/Models/PublicProfile.cs | 9 +++++- SpotifyAPI/Web/Models/SearchItem.cs | 4 ++- SpotifyAPI/Web/Models/SimpleAlbum.cs | 10 +++++- SpotifyAPI/Web/Models/SimpleArtist.cs | 7 +++- SpotifyAPI/Web/Models/SimpleTrack.cs | 14 +++++++- SpotifyAPI/Web/Models/Token.cs | 37 ++++++++++++---------- 16 files changed, 128 insertions(+), 31 deletions(-) diff --git a/SpotifyAPI/Web/Models/Category.cs b/SpotifyAPI/Web/Models/Category.cs index cd612ea2..0c94efc2 100644 --- a/SpotifyAPI/Web/Models/Category.cs +++ b/SpotifyAPI/Web/Models/Category.cs @@ -8,11 +8,14 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("href")] public String Href { get; set; } + [JsonProperty("icons")] public List Icons { get; set; } + [JsonProperty("id")] public String Id { get; set; } + [JsonProperty("name")] public String Name { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/CategoryList.cs b/SpotifyAPI/Web/Models/CategoryList.cs index 7938081d..c46d5cbe 100644 --- a/SpotifyAPI/Web/Models/CategoryList.cs +++ b/SpotifyAPI/Web/Models/CategoryList.cs @@ -7,4 +7,4 @@ namespace SpotifyAPI.Web.Models [JsonProperty("categories")] public Paging Categories { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/CategoryPlaylist.cs b/SpotifyAPI/Web/Models/CategoryPlaylist.cs index 5dbc41b0..02875d5a 100644 --- a/SpotifyAPI/Web/Models/CategoryPlaylist.cs +++ b/SpotifyAPI/Web/Models/CategoryPlaylist.cs @@ -7,4 +7,4 @@ namespace SpotifyAPI.Web.Models [JsonProperty("playlists")] public Paging Playlists { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/FeaturedPlaylists.cs b/SpotifyAPI/Web/Models/FeaturedPlaylists.cs index 886985e6..88b7939b 100644 --- a/SpotifyAPI/Web/Models/FeaturedPlaylists.cs +++ b/SpotifyAPI/Web/Models/FeaturedPlaylists.cs @@ -7,7 +7,8 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("message")] public String Message { get; set; } + [JsonProperty("playlists")] public Paging Playlists { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/FullAlbum.cs b/SpotifyAPI/Web/Models/FullAlbum.cs index 15f197b1..1df3e4a7 100644 --- a/SpotifyAPI/Web/Models/FullAlbum.cs +++ b/SpotifyAPI/Web/Models/FullAlbum.cs @@ -8,37 +8,53 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("album_type")] public String AlbumType { get; set; } + [JsonProperty("artists")] public List Artists { get; set; } + [JsonProperty("available_markets")] public List AvailableMarkets { get; set; } + [JsonProperty("copyrights")] public List Copyrights { get; set; } + [JsonProperty("external_ids")] public Dictionary ExternalIds { get; set; } + [JsonProperty("external_urls")] public Dictionary ExternalUrls { get; set; } + [JsonProperty("genres")] public List Genres { get; set; } + [JsonProperty("href")] public String Href { get; set; } + [JsonProperty("id")] public String Id { get; set; } + [JsonProperty("images")] public List Images { get; set; } + [JsonProperty("name")] public String Name { get; set; } + [JsonProperty("popularity")] public int Popularity { get; set; } + [JsonProperty("release_date")] public String ReleaseDate { get; set; } + [JsonProperty("release_date_precision")] public String ReleaseDatePrecision { get; set; } + [JsonProperty("tracks")] public Paging Tracks { get; set; } + [JsonProperty("type")] public String Type { get; set; } + [JsonProperty("uri")] public String Uri { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/FullArtist.cs b/SpotifyAPI/Web/Models/FullArtist.cs index c5fa9054..b1982cbf 100644 --- a/SpotifyAPI/Web/Models/FullArtist.cs +++ b/SpotifyAPI/Web/Models/FullArtist.cs @@ -8,23 +8,32 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("external_urls")] public Dictionary ExternalUrls { get; set; } + [JsonProperty("followers")] public Followers Followers { get; set; } + [JsonProperty("genres")] public List Genres { get; set; } + [JsonProperty("href")] public String Href { get; set; } + [JsonProperty("id")] public String Id { get; set; } + [JsonProperty("images")] public List Images { get; set; } + [JsonProperty("name")] public String Name { get; set; } + [JsonProperty("popularity")] public int Popularity { get; set; } + [JsonProperty("type")] public String Type { get; set; } + [JsonProperty("uri")] public String Uri { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/FullPlaylist.cs b/SpotifyAPI/Web/Models/FullPlaylist.cs index 1e041c0b..14e0ac95 100644 --- a/SpotifyAPI/Web/Models/FullPlaylist.cs +++ b/SpotifyAPI/Web/Models/FullPlaylist.cs @@ -8,29 +8,41 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("collaborative")] public Boolean Collaborative { get; set; } + [JsonProperty("description")] public String Description { get; set; } + [JsonProperty("external_urls")] public Dictionary ExternalUrls { get; set; } + [JsonProperty("followers")] public Followers Followers { get; set; } + [JsonProperty("href")] public String Href { get; set; } + [JsonProperty("id")] public String Id { get; set; } + [JsonProperty("images")] public List Images { get; set; } + [JsonProperty("name")] public String Name { get; set; } + [JsonProperty("owner")] public PublicProfile Owner { get; set; } + [JsonProperty("public")] public Boolean Public { get; set; } + [JsonProperty("tracks")] public Paging Tracks { get; set; } + [JsonProperty("type")] public String Type { get; set; } + [JsonProperty("uri")] public String Uri { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/NewAlbumReleases.cs b/SpotifyAPI/Web/Models/NewAlbumReleases.cs index c4bb2106..c85139ef 100644 --- a/SpotifyAPI/Web/Models/NewAlbumReleases.cs +++ b/SpotifyAPI/Web/Models/NewAlbumReleases.cs @@ -7,4 +7,4 @@ namespace SpotifyAPI.Web.Models [JsonProperty("albums")] public Paging Albums { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/Paging.cs b/SpotifyAPI/Web/Models/Paging.cs index c901d6a0..db25fb8d 100644 --- a/SpotifyAPI/Web/Models/Paging.cs +++ b/SpotifyAPI/Web/Models/Paging.cs @@ -8,17 +8,23 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("href")] public String Href { get; set; } + [JsonProperty("items")] public List Items { get; set; } + [JsonProperty("limit")] public int Limit { get; set; } + [JsonProperty("next")] public String Next { get; set; } + [JsonProperty("offset")] public int Offset { get; set; } + [JsonProperty("previous")] public String Previous { get; set; } + [JsonProperty("total")] public int Total { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/PrivateProfile.cs b/SpotifyAPI/Web/Models/PrivateProfile.cs index 8d6f619c..87349d60 100644 --- a/SpotifyAPI/Web/Models/PrivateProfile.cs +++ b/SpotifyAPI/Web/Models/PrivateProfile.cs @@ -8,27 +8,38 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("birthdate")] public String Birthdate { get; set; } + [JsonProperty("country")] public String Country { get; set; } + [JsonProperty("display_name")] public String DisplayName { get; set; } + [JsonProperty("email")] public String Email { get; set; } + [JsonProperty("external_urls")] public Dictionary ExternalUrls { get; set; } + [JsonProperty("followers")] public Followers Followers { get; set; } + [JsonProperty("href")] public String Href { get; set; } + [JsonProperty("id")] public String Id { get; set; } + [JsonProperty("images")] public List Images { get; set; } + [JsonProperty("product")] public String Product { get; set; } + [JsonProperty("type")] public String Type { get; set; } + [JsonProperty("uri")] public String Uri { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/PublicProfile.cs b/SpotifyAPI/Web/Models/PublicProfile.cs index dd33d370..098a99ef 100644 --- a/SpotifyAPI/Web/Models/PublicProfile.cs +++ b/SpotifyAPI/Web/Models/PublicProfile.cs @@ -8,19 +8,26 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("display_name")] public String DisplayName { get; set; } + [JsonProperty("external_urls")] public Dictionary ExternalUrls { get; set; } + [JsonProperty("followers")] public Followers Followers { get; set; } + [JsonProperty("href")] public String Href { get; set; } + [JsonProperty("id")] public String Id { get; set; } + [JsonProperty("images")] public List Images { get; set; } + [JsonProperty("type")] public String Type { get; set; } + [JsonProperty("uri")] public String Uri { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/SearchItem.cs b/SpotifyAPI/Web/Models/SearchItem.cs index 8b8ef686..3396118b 100644 --- a/SpotifyAPI/Web/Models/SearchItem.cs +++ b/SpotifyAPI/Web/Models/SearchItem.cs @@ -6,9 +6,11 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("artists")] public Paging Artists { get; set; } + [JsonProperty("albums")] public Paging Albums { get; set; } + [JsonProperty("tracks")] public Paging Tracks { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/SimpleAlbum.cs b/SpotifyAPI/Web/Models/SimpleAlbum.cs index 3ec1b816..8f0f292f 100644 --- a/SpotifyAPI/Web/Models/SimpleAlbum.cs +++ b/SpotifyAPI/Web/Models/SimpleAlbum.cs @@ -8,21 +8,29 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("album_type")] public String AlbumType { get; set; } + [JsonProperty("available_markets")] public List AvailableMarkets { get; set; } + [JsonProperty("external_urls")] public Dictionary ExternalUrls { get; set; } + [JsonProperty("href")] public String Href { get; set; } + [JsonProperty("id")] public String Id { get; set; } + [JsonProperty("images")] public List Images { get; set; } + [JsonProperty("name")] public String Name { get; set; } + [JsonProperty("type")] public String Type { get; set; } + [JsonProperty("uri")] public String Uri { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/SimpleArtist.cs b/SpotifyAPI/Web/Models/SimpleArtist.cs index 134e775f..f20a0e0c 100644 --- a/SpotifyAPI/Web/Models/SimpleArtist.cs +++ b/SpotifyAPI/Web/Models/SimpleArtist.cs @@ -8,15 +8,20 @@ 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("name")] public String Name { get; set; } + [JsonProperty("type")] public String Type { get; set; } + [JsonProperty("uri")] public String Uri { get; set; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/SimpleTrack.cs b/SpotifyAPI/Web/Models/SimpleTrack.cs index 4cccca48..2c78c6a0 100644 --- a/SpotifyAPI/Web/Models/SimpleTrack.cs +++ b/SpotifyAPI/Web/Models/SimpleTrack.cs @@ -8,29 +8,41 @@ namespace SpotifyAPI.Web.Models { [JsonProperty("artist")] public SimpleArtist Artist { 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_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("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; } } -} +} \ No newline at end of file diff --git a/SpotifyAPI/Web/Models/Token.cs b/SpotifyAPI/Web/Models/Token.cs index d75e7499..e6bf4ee1 100644 --- a/SpotifyAPI/Web/Models/Token.cs +++ b/SpotifyAPI/Web/Models/Token.cs @@ -5,26 +5,31 @@ namespace SpotifyAPI.Web.Models { public class Token { - [JsonProperty("access_token")] - public String AccessToken { get; set; } - [JsonProperty("token_type")] - public String TokenType { get; set; } - [JsonProperty("expires_in")] - public int ExpiresIn { get; set; } - [JsonProperty("refresh_token")] - public String RefreshToken { get; set; } - [JsonProperty("error")] - public String Error { get; set; } - [JsonProperty("error_description")] - public String ErrorDescription { get; set; } - - public DateTime CreateDate { get; set; } - public Token() { CreateDate = DateTime.Now; } + [JsonProperty("access_token")] + public String AccessToken { get; set; } + + [JsonProperty("token_type")] + public String TokenType { get; set; } + + [JsonProperty("expires_in")] + public int ExpiresIn { get; set; } + + [JsonProperty("refresh_token")] + public String RefreshToken { get; set; } + + [JsonProperty("error")] + public String Error { get; set; } + + [JsonProperty("error_description")] + public String ErrorDescription { get; set; } + + public DateTime CreateDate { get; set; } + /// /// Checks if the token has expired /// @@ -34,4 +39,4 @@ namespace SpotifyAPI.Web.Models return CreateDate.Add(TimeSpan.FromSeconds(ExpiresIn)) <= DateTime.Now; } } -} +} \ No newline at end of file