using Microsoft.Extensions.Configuration;
using RestSharp;

namespace LazyBear.MCP.Services.Jira;

public sealed class JiraClientProvider
{
    public RestClient? Client { get; }

    public string? InitializationError { get; }

    public JiraClientProvider(IConfiguration configuration)
    {
        try
        {
            Client = JiraClientFactory.CreateClient(configuration);
        }
        catch (Exception ex)
        {
            InitializationError = $"{ex.GetType().Name}: {ex.Message}";
        }
    }
}
