using Microsoft.Extensions.Configuration;
using RestSharp;

namespace LazyBear.MCP.Services.Confluence;

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

    public string? InitializationError { get; }

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