// Code generated by 'make generate-dns'; DO NOT EDIT.

package dns

import (
	"fmt"

	"github.com/go-acme/lego/v4/challenge"
	"github.com/go-acme/lego/v4/challenge/dns01"
{{- range $provider := .Providers }}
     "github.com/go-acme/lego/v4/providers/dns/{{ cleanName $provider.Code }}"
{{- end}}
)

// NewDNSChallengeProviderByName Factory for DNS providers.
func NewDNSChallengeProviderByName(name string) (challenge.Provider, error) {
	switch name {
	case "manual":
		return dns01.NewDNSProviderManual()
{{- range $provider := .Providers }}
	case "{{ $provider.Code }}"{{range $alias := $provider.Aliases }},"{{ $alias }}"{{end}}:
		return {{ cleanName $provider.Code }}.NewDNSProvider()
{{- end}}
	default:
		return nil, fmt.Errorf("unrecognized DNS provider: %s", name)
	}
}
