using System;
using Sepehr.ApiGateway.Partners.Contracts.Flight.Refund.V3.DoRefund.RequestModel;
using Sepehr.ApiGateway.Partners.Contracts.Flight.Refund.V3.DoRefund.ResponseModel;
using SepehrFlightApiSampleClient.BuiltinTypeExtensions;

namespace SepehrFlightApiSampleClient.Refund.WebApi
{
    public class DoRefundApi
    {
        public static Guid? Post(string url, Request request)
        {
            var response = HttpClientHelper.Post(
                $"{url}/api/Partners/Flight/Refund/V3/DoRefund",
                request.SerializeToJson());

            return response.DeserializeFromJson<Response>().TrackingCode;
        }
    }
}
