Полностью переписанное api
All checks were successful
Release / pack-and-publish (release) Successful in 36s
All checks were successful
Release / pack-and-publish (release) Successful in 36s
This commit is contained in:
@@ -1,25 +1,13 @@
|
||||
using System.Net;
|
||||
|
||||
using YandexMusic.API.Common;
|
||||
using YandexMusic.API.Models.Common;
|
||||
using YandexMusic.API.Models.Playlist;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Playlist;
|
||||
|
||||
[YApiRequest(WebRequestMethods.Http.Get, "users/{user}/playlists/{kind}")]
|
||||
public class YGetPlaylistBuilder : YRequestBuilder<YResponse<YPlaylist>, (string user, string kind)>
|
||||
public class YGetPlaylistBuilder : YMusicRequestBuilder<YPlaylist?, (string user, string kind)>
|
||||
{
|
||||
public YGetPlaylistBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
|
||||
public YGetPlaylistBuilder(YandexMusicApi api) : base(api) { }
|
||||
protected override string Method => WebRequestMethods.Http.Get;
|
||||
protected override string PathTemplate => "users/{user}/playlists/{kind}";
|
||||
protected override Dictionary<string, string> GetSubstitutions((string user, string kind) tuple)
|
||||
{
|
||||
return new Dictionary<string, string> {
|
||||
{ "user", tuple.user },
|
||||
{ "kind", tuple.kind },
|
||||
};
|
||||
}
|
||||
=> new() { { "user", tuple.user }, { "kind", tuple.kind } };
|
||||
}
|
||||
Reference in New Issue
Block a user