using System.Net;

using YandexMusic.API.Common;
using YandexMusic.API.Models.Common;
using YandexMusic.API.Models.Track;
using YandexMusic.API.Requests.Common;
using YandexMusic.API.Requests.Common.Attributes;

namespace YandexMusic.API.Requests.Track;

[YApiRequest(WebRequestMethods.Http.Post, "tracks")]
public class YGetTracksBuilder : YRequestBuilder<YResponse<List<YTrack>>, IEnumerable<string>>
{
    public YGetTracksBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
    {
    }

    protected override HttpContent GetContent(IEnumerable<string> trackIds)
    {
        return new FormUrlEncodedContent(new Dictionary<string, string> {
            { "track-ids", string.Join(",", trackIds) },
            { "with-positions", "true" }
        });
    }
}