Files
YandexMusic/YandexMusic.API/API/YLandingAPIAsync.cs
2026-04-10 12:12:33 +03:00

63 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using YandexMusic.API.Common;
using YandexMusic.API.Models.Common;
using YandexMusic.API.Models.Feed;
using YandexMusic.API.Models.Landing;
using YandexMusic.API.Requests.Feed;
using YandexMusic.API.Requests.Landing;
namespace YandexMusic.API
{
/// <summary>
/// API для взаимодействия с главной страницей
/// </summary>
public partial class YLandingAPI : YCommonAPI
{
public YLandingAPI(YandexMusicApi yandex) : base(yandex)
{
}
/// <summary>
/// Получение персональных списков
/// </summary>
/// <param name="storage">Хранилище</param>
/// <param name="blocks">Типы запрашиваемых блоков</param>
/// <returns></returns>
public Task<YResponse<YLanding>> GetAsync(AuthStorage storage, params YLandingBlockType[] blocks)
{
if (blocks == null)
return null;
return new YGetLandingBuilder(api, storage)
.Build(blocks)
.GetResponseAsync();
}
/// <summary>
/// Получение ленты
/// </summary>
/// <param name="storage">Хранилище</param>
/// <returns></returns>
public Task<YResponse<YFeed>> GetFeedAsync(AuthStorage storage)
{
return new YGetFeedBuilder(api, storage)
.Build(null)
.GetResponseAsync();
}
/// <summary>
/// Получение лендинга детского раздела
/// </summary>
/// <param name="storage">Хранилище</param>
/// <returns></returns>
public Task<YResponse<YChildrenLanding>> GetChildrenLandingAsync(AuthStorage storage)
{
return new YGetChildrenLandingBuilder(api, storage)
.Build(null)
.GetResponseAsync();
}
}
}