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 public class FollowedArtists : BasicModel
{ {
[JsonProperty("artists")] [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")] [JsonProperty("album")]
public SimpleAlbum Album { get; set; } public SimpleAlbum Album { get; set; }
[JsonProperty("artists")] [JsonProperty("artists")]
public List<SimpleArtist> Artists { get; set; } public List<SimpleArtist> Artists { get; set; }
[JsonProperty("available_markets")] [JsonProperty("available_markets")]
public List<String> AvailableMarkets { get; set; } public List<String> AvailableMarkets { get; set; }
[JsonProperty("disc_number")] [JsonProperty("disc_number")]
public int DiscNumber { get; set; } public int DiscNumber { get; set; }
[JsonProperty("duration_ms")] [JsonProperty("duration_ms")]
public int DurationMs { get; set; } public int DurationMs { get; set; }
[JsonProperty("explicit")] [JsonProperty("explicit")]
public Boolean Explicit { get; set; } public Boolean Explicit { get; set; }
[JsonProperty("external_ids")] [JsonProperty("external_ids")]
public Dictionary<String, String> ExternalIds { get; set; } public Dictionary<String, String> ExternalIds { get; set; }
[JsonProperty("external_urls")] [JsonProperty("external_urls")]
public Dictionary<String, String> ExternUrls { get; set; } public Dictionary<String, String> ExternUrls { get; set; }
[JsonProperty("href")] [JsonProperty("href")]
public String Href { get; set; } public String Href { get; set; }
[JsonProperty("id")] [JsonProperty("id")]
public String Id { get; set; } public String Id { get; set; }
[JsonProperty("name")] [JsonProperty("name")]
public String Name { get; set; } public String Name { get; set; }
[JsonProperty("popularity")] [JsonProperty("popularity")]
public int Popularity { get; set; } public int Popularity { get; set; }
[JsonProperty("preview_url")] [JsonProperty("preview_url")]
public String PreviewUrl { get; set; } public String PreviewUrl { get; set; }
[JsonProperty("track_number")] [JsonProperty("track_number")]
public int TrackNumber { get; set; } public int TrackNumber { get; set; }
[JsonProperty("type")] [JsonProperty("type")]
public String Type { get; set; } public String Type { get; set; }
[JsonProperty("uri")] [JsonProperty("uri")]
public String Uri { get; set; } public String Uri { get; set; }
/// <summary> /// <summary>
/// Only filled when the "market"-parameter was supplied! /// Only filled when the "market"-parameter was supplied!
/// </summary> /// </summary>
[JsonProperty("is_playable")] [JsonProperty("is_playable")]
public Boolean? IsPlayable { get; set; } public Boolean? IsPlayable { get; set; }
/// <summary> /// <summary>
/// Only filled when the "market"-parameter was supplied! /// Only filled when the "market"-parameter was supplied!
/// </summary> /// </summary>
[JsonProperty("linked_from")] [JsonProperty("linked_from")]
public LinkedFrom LinkedFrom { get; set; } public LinkedFrom LinkedFrom { get; set; }
} }
} }

View File

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