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

25 lines
1.1 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.
namespace YandexMusic.API.Common.Providers
{
/// <summary>
/// Интерфейс для провайдеров обработки запросов
/// </summary>
public interface IRequestProvider
{
/// <summary>
/// Функция получения ответа
/// </summary>
/// <param name="message">Запрос</param>
/// <param name="completionOption">Опция завершения запроса</param>
/// <returns></returns>
Task<HttpResponseMessage> GetWebResponseAsync(HttpRequestMessage message, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead);
/// <summary>
/// Функция формирования ответа
/// </summary>
/// <typeparam name="T">Тип объекта с ответом</typeparam>
/// <param name="api">API</param>
/// <param name="response">Ответ</param>
/// <returns></returns>
Task<T> GetDataFromResponseAsync<T>(YandexMusicApi api, HttpResponseMessage response);
}
}