using System;
using Microsoft.Extensions.DependencyInjection;
using StellaOps.Plugin;

namespace StellaOps.Feedser.Source.Kisa;

public sealed class KisaConnectorPlugin : IConnectorPlugin
{
    public const string SourceName = "kisa";

    public string Name => SourceName;

    public bool IsAvailable(IServiceProvider services)
        => services.GetService<KisaConnector>() is not null;

    public IFeedConnector Create(IServiceProvider services)
    {
        ArgumentNullException.ThrowIfNull(services);
        return services.GetRequiredService<KisaConnector>();
    }
}
