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

namespace StellaOps.Feedser.Source.Osv;

public sealed class OsvConnectorPlugin : IConnectorPlugin
{
    public string Name => SourceName;

    public static string SourceName => "osv";

    public bool IsAvailable(IServiceProvider services) => services is not null;

    public IFeedConnector Create(IServiceProvider services)
    {
        ArgumentNullException.ThrowIfNull(services);
        return ActivatorUtilities.CreateInstance<OsvConnector>(services);
    }
}
