using DataSharing.Share.Dtos.Province;
using IdentityModel.Client;

namespace DataSharing
{
    public partial interface IHttpInvoker
    {
        Task<TokenResponse> GetTokenAsync(ClientCredentialsTokenRequest request, CancellationToken cancellationToken);

        Task<TResponse?> RequestAsync<TRequest, TResponse>(TRequest request, Action<HttpClient>? setHttpClient = null, CancellationToken cancellationToken = default)
            where TRequest : ISharingRequest, new();

        Task<TResponse?> RequestStringContentAsync<TResponse>(
            string url, string httpMethod, string? stringContent = null,
            Action<HttpClient>? setHttpClient = null, CancellationToken cancellationToken = default);
    }
}
