Spotify.NET/SpotifyAPI.Web/SpotifyUrls.cs

135 lines
4.9 KiB
C#
Raw Permalink Normal View History

2020-05-01 19:05:28 +01:00
using System;
namespace SpotifyAPI.Web
{
public static class SpotifyUrls
{
static private readonly URIParameterFormatProvider _provider = new();
2020-05-01 19:05:28 +01:00
public static readonly Uri APIV1 = new("https://api.spotify.com/v1/");
2020-05-01 19:05:28 +01:00
public static readonly Uri Authorize = new("https://accounts.spotify.com/authorize");
2020-05-15 19:06:24 +01:00
public static readonly Uri OAuthToken = new("https://accounts.spotify.com/api/token");
public static Uri Me() => EUri($"me");
2020-05-01 19:05:28 +01:00
public static Uri User(string userId) => EUri($"users/{userId}");
2020-05-01 19:05:28 +01:00
public static Uri Categories() => EUri($"browse/categories");
2020-05-01 19:05:28 +01:00
public static Uri Category(string categoryId) => EUri($"browse/categories/{categoryId}");
2020-05-01 19:05:28 +01:00
public static Uri CategoryPlaylists(string categoryId) => EUri($"browse/categories/{categoryId}/playlists");
2020-05-01 19:05:28 +01:00
public static Uri Recommendations() => EUri($"recommendations");
public static Uri RecommendationGenres() => EUri($"recommendations/available-genre-seeds");
public static Uri NewReleases() => EUri($"browse/new-releases");
2020-05-02 13:58:11 +01:00
public static Uri FeaturedPlaylists() => EUri($"browse/featured-playlists");
2020-05-02 21:48:21 +01:00
public static Uri Show(string showId) => EUri($"shows/{showId}");
public static Uri Shows() => EUri($"shows");
public static Uri ShowEpisodes(string showId) => EUri($"shows/{showId}/episodes");
public static Uri PlaylistTracks(string playlistId) => EUri($"playlists/{playlistId}/tracks");
2020-05-03 00:00:35 +01:00
public static Uri UserPlaylists(string userId) => EUri($"users/{userId}/playlists");
2020-05-03 07:10:41 +01:00
public static Uri PlaylistImages(string playlistId) => EUri($"playlists/{playlistId}/images");
2020-05-03 08:06:28 +01:00
public static Uri Playlist(string playlistId) => EUri($"playlists/{playlistId}");
public static Uri CurrentUserPlaylists() => EUri($"me/playlists");
public static Uri Search() => EUri($"search");
2020-05-04 22:02:53 +01:00
public static Uri CurrentUserFollowerContains() => EUri($"me/following/contains");
public static Uri PlaylistFollowersContains(string playlistId) => EUri($"playlists/{playlistId}/followers/contains");
public static Uri CurrentUserFollower() => EUri($"me/following");
public static Uri PlaylistFollowers(string playlistId) => EUri($"playlists/{playlistId}/followers");
2020-05-07 12:48:31 +01:00
public static Uri Tracks() => EUri($"tracks");
public static Uri Track(string trackId) => EUri($"tracks/{trackId}");
public static Uri AudioAnalysis(string trackId) => EUri($"audio-analysis/{trackId}");
public static Uri AudioFeatures(string trackId) => EUri($"audio-features/{trackId}");
public static Uri AudioFeatures() => EUri($"audio-features");
2020-05-07 17:03:20 +01:00
public static Uri Player() => EUri($"me/player");
public static Uri PlayerQueue() => EUri($"me/player/queue");
public static Uri PlayerDevices() => EUri($"me/player/devices");
public static Uri PlayerCurrentlyPlaying() => EUri($"me/player/currently-playing");
public static Uri PlayerRecentlyPlayed() => EUri($"me/player/recently-played");
public static Uri PlayerPause() => EUri($"me/player/pause");
public static Uri PlayerResume() => EUri($"me/player/play");
public static Uri PlayerSeek() => EUri($"me/player/seek");
public static Uri PlayerRepeat() => EUri($"me/player/repeat");
public static Uri PlayerShuffle() => EUri($"me/player/shuffle");
public static Uri PlayerVolume() => EUri($"me/player/volume");
public static Uri PlayerNext() => EUri($"me/player/next");
public static Uri PlayerPrevious() => EUri($"me/player/previous");
2020-05-07 21:33:29 +01:00
public static Uri Albums() => EUri($"albums");
public static Uri Album(string albumId) => EUri($"albums/{albumId}");
public static Uri AlbumTracks(string albumId) => EUri($"albums/{albumId}/tracks");
2020-05-08 10:10:53 +01:00
public static Uri Artists() => EUri($"artists");
public static Uri Artist(string artistId) => EUri($"artists/{artistId}");
public static Uri ArtistAlbums(string artistId) => EUri($"artists/{artistId}/albums");
public static Uri ArtistTopTracks(string artistId) => EUri($"artists/{artistId}/top-tracks");
public static Uri ArtistRelatedArtists(string artistId) => EUri($"artists/{artistId}/related-artists");
2020-05-08 11:09:59 +01:00
public static Uri PersonalizationTop(string type) => EUri($"me/top/{type}");
public static Uri Episode(string episodeId) => EUri($"episodes/{episodeId}");
public static Uri Episodes() => EUri($"episodes");
2020-05-20 07:48:08 +01:00
public static Uri LibraryAlbumsContains() => EUri($"me/albums/contains");
public static Uri LibraryAlbums() => EUri($"me/albums");
public static Uri LibraryTracksContains() => EUri($"me/tracks/contains");
public static Uri LibraryTracks() => EUri($"me/tracks");
public static Uri LibraryShowsContains() => EUri($"me/shows/contains");
public static Uri LibraryShows() => EUri($"me/shows");
public static Uri LibraryEpisodes() => EUri($"me/episodes");
public static Uri LibraryEpisodesContains() => EUri($"me/episodes/contains");
private static Uri EUri(FormattableString path) => new(path.ToString(_provider), UriKind.Relative);
2020-05-01 19:05:28 +01:00
}
}