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

namespace StellaOps.Feedser.Source.Vndr.Adobe;

public sealed class VndrAdobeConnectorPlugin : IConnectorPlugin
{
    public const string SourceName = "vndr-adobe";

    public string Name => SourceName;

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

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