Полный рефакторинг api. Вынесено отдельно api passport
This commit is contained in:
26
YandexMusic.API/Requests/Passport/YSendPushBuilder.cs
Normal file
26
YandexMusic.API/Requests/Passport/YSendPushBuilder.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using YandexMusic.API.Models.Passport;
|
||||
|
||||
namespace YandexMusic.API.Requests.Passport;
|
||||
|
||||
internal class YSendPushBuilder : YPassportRequestBuilder<YSendPushResult?, string>
|
||||
{
|
||||
public YSendPushBuilder(YandexMusicApi api) : base(api) { }
|
||||
|
||||
protected override string Method => WebRequestMethods.Http.Post;
|
||||
protected override string PathTemplate => "pwl-yandex/api/passport/auth/suggest-send-push";
|
||||
|
||||
protected override HttpContent? GetContent(string phone)
|
||||
{
|
||||
var data = new
|
||||
{
|
||||
track_id = Api.Storage.AuthToken.TrackId,
|
||||
phone_number = phone,
|
||||
can_use_anmon = true,
|
||||
force_show_code_in_notification = "1",
|
||||
country = Api.Storage.Country
|
||||
};
|
||||
return JsonContent.Create(data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user