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

package dns

import (
	"fmt"

	"github.com/go-acme/lego/v4/challenge"
{{- 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 {
{{- 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)
	}
}
