Rearranged models

This commit is contained in:
Johnny Dellinger @PC 2015-07-26 14:02:22 +02:00
parent d36a3f3fd9
commit b0f687c994
16 changed files with 128 additions and 31 deletions

View File

@ -8,11 +8,14 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("href")]
public String Href { get; set; }
[JsonProperty("icons")]
public List<Image> Icons { get; set; }
[JsonProperty("id")]
public String Id { get; set; }
[JsonProperty("name")]
public String Name { get; set; }
}
}
}

View File

@ -7,4 +7,4 @@ namespace SpotifyAPI.Web.Models
[JsonProperty("categories")]
public Paging<Category> Categories { get; set; }
}
}
}

View File

@ -7,4 +7,4 @@ namespace SpotifyAPI.Web.Models
[JsonProperty("playlists")]
public Paging<SimplePlaylist> Playlists { get; set; }
}
}
}

View File

@ -7,7 +7,8 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("message")]
public String Message { get; set; }
[JsonProperty("playlists")]
public Paging<SimplePlaylist> Playlists { get; set; }
}
}
}

View File

@ -8,37 +8,53 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("album_type")]
public String AlbumType { get; set; }
[JsonProperty("artists")]
public List<SimpleArtist> Artists { get; set; }
[JsonProperty("available_markets")]
public List<String> AvailableMarkets { get; set; }
[JsonProperty("copyrights")]
public List<Copyright> Copyrights { get; set; }
[JsonProperty("external_ids")]
public Dictionary<String, String> ExternalIds { get; set; }
[JsonProperty("external_urls")]
public Dictionary<String, String> ExternalUrls { get; set; }
[JsonProperty("genres")]
public List<String> Genres { get; set; }
[JsonProperty("href")]
public String Href { get; set; }
[JsonProperty("id")]
public String Id { get; set; }
[JsonProperty("images")]
public List<Image> 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<SimpleTrack> Tracks { get; set; }
[JsonProperty("type")]
public String Type { get; set; }
[JsonProperty("uri")]
public String Uri { get; set; }
}
}
}

View File

@ -8,23 +8,32 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("external_urls")]
public Dictionary<String, String> ExternalUrls { get; set; }
[JsonProperty("followers")]
public Followers Followers { get; set; }
[JsonProperty("genres")]
public List<String> Genres { get; set; }
[JsonProperty("href")]
public String Href { get; set; }
[JsonProperty("id")]
public String Id { get; set; }
[JsonProperty("images")]
public List<Image> 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; }
}
}
}

View File

@ -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<string, string> 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<Image> 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<PlaylistTrack> Tracks { get; set; }
[JsonProperty("type")]
public String Type { get; set; }
[JsonProperty("uri")]
public String Uri { get; set; }
}
}
}

View File

@ -7,4 +7,4 @@ namespace SpotifyAPI.Web.Models
[JsonProperty("albums")]
public Paging<SimpleAlbum> Albums { get; set; }
}
}
}

View File

@ -8,17 +8,23 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("href")]
public String Href { get; set; }
[JsonProperty("items")]
public List<T> 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; }
}
}
}

View File

@ -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<string, string> 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<Image> Images { get; set; }
[JsonProperty("product")]
public String Product { get; set; }
[JsonProperty("type")]
public String Type { get; set; }
[JsonProperty("uri")]
public String Uri { get; set; }
}
}
}

View File

@ -8,19 +8,26 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("display_name")]
public String DisplayName { get; set; }
[JsonProperty("external_urls")]
public Dictionary<string, string> 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<Image> Images { get; set; }
[JsonProperty("type")]
public String Type { get; set; }
[JsonProperty("uri")]
public String Uri { get; set; }
}
}
}

View File

@ -6,9 +6,11 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("artists")]
public Paging<SimpleArtist> Artists { get; set; }
[JsonProperty("albums")]
public Paging<SimpleAlbum> Albums { get; set; }
[JsonProperty("tracks")]
public Paging<FullTrack> Tracks { get; set; }
}
}
}

View File

@ -8,21 +8,29 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("album_type")]
public String AlbumType { get; set; }
[JsonProperty("available_markets")]
public List<String> AvailableMarkets { get; set; }
[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("images")]
public List<Image> Images { get; set; }
[JsonProperty("name")]
public String Name { get; set; }
[JsonProperty("type")]
public String Type { get; set; }
[JsonProperty("uri")]
public String Uri { get; set; }
}
}
}

View File

@ -8,15 +8,20 @@ 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("name")]
public String Name { get; set; }
[JsonProperty("type")]
public String Type { get; set; }
[JsonProperty("uri")]
public String Uri { get; set; }
}
}
}

View File

@ -8,29 +8,41 @@ namespace SpotifyAPI.Web.Models
{
[JsonProperty("artist")]
public SimpleArtist Artist { 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_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("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; }
}
}
}

View File

@ -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; }
/// <summary>
/// Checks if the token has expired
/// </summary>
@ -34,4 +39,4 @@ namespace SpotifyAPI.Web.Models
return CreateDate.Add(TimeSpan.FromSeconds(ExpiresIn)) <= DateTime.Now;
}
}
}
}