18 lines
777 B
C#
18 lines
777 B
C#
using System.Net;
|
|
using YandexMusic.API.Models.Library;
|
|
|
|
namespace YandexMusic.API.Requests.Library;
|
|
|
|
public class YGetLibrarySectionBuilder<T> : YMusicRequestBuilder<T?, (YLibrarySection section, YLibrarySectionType type)>
|
|
{
|
|
public YGetLibrarySectionBuilder(YandexMusicApi api) : base(api) { }
|
|
protected override string Method => WebRequestMethods.Http.Get;
|
|
protected override string PathTemplate => "users/{uid}/{type}/{section}";
|
|
protected override Dictionary<string, string> GetSubstitutions((YLibrarySection section, YLibrarySectionType type) tuple)
|
|
=> new()
|
|
{
|
|
{ "uid", Api.Storage.User.Uid },
|
|
{ "type", tuple.type.ToString().ToLower() },
|
|
{ "section", tuple.section.ToString().ToLower() }
|
|
};
|
|
} |