Добавьте файлы проекта.
This commit is contained in:
63
YandexMusic.API/API/YLandingAPIAsync.cs
Normal file
63
YandexMusic.API/API/YLandingAPIAsync.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user