Spotify.NET/SpotifyAPI/Web/Models/GeneralModels.cs

141 lines
3.1 KiB
C#
Raw Normal View History

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
namespace SpotifyAPI.Web.Models
{
public class Image
{
[JsonProperty("url")]
2016-03-31 11:08:23 +01:00
public string Url { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("width")]
public int Width { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("height")]
public int Height { get; set; }
}
2015-07-26 13:03:53 +01:00
public class ErrorResponse : BasicModel
{
}
public class Error
{
[JsonProperty("status")]
public int Status { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("message")]
2016-03-31 11:08:23 +01:00
public string Message { get; set; }
}
2015-07-26 13:03:53 +01:00
public class PlaylistTrackCollection
{
[JsonProperty("href")]
2016-03-31 11:08:23 +01:00
public string Href { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("total")]
public int Total { get; set; }
}
2015-07-26 13:03:53 +01:00
public class Followers
{
[JsonProperty("href")]
2016-03-31 11:08:23 +01:00
public string Href { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("total")]
public int Total { get; set; }
}
2015-07-26 13:03:53 +01:00
public class PlaylistTrack
{
[JsonProperty("added_at")]
public DateTime AddedAt { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("added_by")]
public PublicProfile AddedBy { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("track")]
public FullTrack Track { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("is_local")]
public Boolean IsLocal { get; set; }
}
2015-07-26 13:03:53 +01:00
public class DeleteTrackUri
{
/// <summary>
/// Delete-Track Wrapper
/// </summary>
/// <param name="uri">An Spotify-URI</param>
/// <param name="positions">Optional positions</param>
2016-03-31 11:08:23 +01:00
public DeleteTrackUri(string uri, params int[] positions)
{
Positions = positions.ToList();
Uri = uri;
}
2015-07-26 13:03:53 +01:00
[JsonProperty("uri")]
2016-03-31 11:08:23 +01:00
public string Uri { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("positions")]
public List<int> Positions { get; set; }
public bool ShouldSerializePositions()
{
return (Positions.Count > 0);
}
}
2015-07-26 13:03:53 +01:00
public class Copyright
{
[JsonProperty("text")]
2016-03-31 11:08:23 +01:00
public string Text { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("type")]
2016-03-31 11:08:23 +01:00
public string Type { get; set; }
}
public class LinkedFrom
{
[JsonProperty("external_urls")]
2016-03-31 11:08:23 +01:00
public Dictionary<string, string> ExternalUrls { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("href")]
2016-03-31 11:08:23 +01:00
public string Href { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("id")]
2016-03-31 11:08:23 +01:00
public string Id { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("type")]
2016-03-31 11:08:23 +01:00
public string Type { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("uri")]
2016-03-31 11:08:23 +01:00
public string Uri { get; set; }
}
public class SavedTrack
{
[JsonProperty("added_at")]
public DateTime AddedAt { get; set; }
2015-07-26 13:03:53 +01:00
[JsonProperty("track")]
public FullTrack Track { get; set; }
}
2015-12-07 13:13:24 +00:00
public class SavedAlbum
{
[JsonProperty("added_at")]
public DateTime AddedAt { get; set; }
[JsonProperty("album")]
public FullAlbum Album { get; set; }
2015-12-07 13:13:24 +00:00
}
public class Cursor
{
[JsonProperty("after")]
2016-03-31 11:08:23 +01:00
public string After { get; set; }
}
2015-07-26 13:03:53 +01:00
}