using IWS5.Autotest.IWS5.Api.ApiEndpointFormats;
using IWS5.Autotest.IWS5.Api.Common;
using IWS5.Core.DTO;
using IWS5.Core.Models.Request;
using RestSharp;

namespace IWS5.Autotest.IWS5.Api.Api
{
    public class AuthenticationControllerApi : BaseAppApi
    {
        public AuthenticationControllerApi() : base(ApiEndpointFormat.Authentication.Base)
        {
        }

        public async Task<RestResponse<LogInResponseDto>> LoginUser(LogInCredentials loginRequest)
        {
            var request = CreatePostRequest(ApiEndpointFormat.Authentication.Login, loginRequest);
            return await ExecuteRequest<LogInResponseDto>(request);
        }

        //TODO
        //public async Task<RestResponse<CodeResponse<LogInResponseDto>>> RefreshToken(RefreshTokenRequest refreshTokenRequest)
        //{
        //    var request = CreatePostRequest("refresh", refreshTokenRequest);
        //    return await ExecuteRequest<CodeResponse<LogInResponseDto>>(request);
        //}

        //public async Task<RestResponse<CodeResponse<LogOutResponseDto>>> LogoutUser(LogOutRequest logOutRequest)
        //{
        //    var request = CreatePostRequest("logout", logOutRequest);
        //    return await ExecuteRequest<CodeResponse<LogOutResponseDto>>(request);
        //}
    }
}
