63 lines
1.9 KiB
C#
63 lines
1.9 KiB
C#
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();
|
||
}
|
||
|
||
|
||
}
|
||
} |