// NewDNSProvider uses the supplied environment variables to return a DNSProvider instance:
// AKAMAI_HOST, AKAMAI_CLIENT_TOKEN, AKAMAI_CLIENT_SECRET, AKAMAI_ACCESS_TOKEN
551366
func NewDNSProvider() (*DNSProvider, error) {
	values, err := env.Get("AKAMAI_HOST", "AKAMAI_CLIENT_TOKEN", "AKAMAI_CLIENT_SECRET", "AKAMAI_ACCESS_TOKEN")
	if err != nil {
		return nil, fmt.Errorf("fastdns: %v", err)
	}

	config := NewDefaultConfig()
	config.Config = edgegrid.Config{
		Host:         values["AKAMAI_HOST"],
		ClientToken:  values["AKAMAI_CLIENT_TOKEN"],
		ClientSecret: values["AKAMAI_CLIENT_SECRET"],
		AccessToken:  values["AKAMAI_ACCESS_TOKEN"],
		MaxBody:      131072,
	}

	return NewDNSProviderConfig(config)
}
894025
func NewDNSProvider() (*DNSProvider, error) {
	values, err := env.Get("ZONEEE_API_USER", "ZONEEE_API_KEY")
	if err != nil {
		return nil, fmt.Errorf("zoneee: %v", err)
	}

	rawEndpoint := env.GetOrDefaultString("ZONEEE_ENDPOINT", defaultEndpoint)
	endpoint, err := url.Parse(rawEndpoint)
	if err != nil {
		return nil, fmt.Errorf("zoneee: %v", err)
	}

	config := NewDefaultConfig()
	config.Username = values["ZONEEE_API_USER"]
	config.APIKey = values["ZONEEE_API_KEY"]
	config.Endpoint = endpoint

	return NewDNSProviderConfig(config)
}
927692
func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
	if config == nil {
		return nil, errors.New("namecheap: the configuration of the DNS provider is nil")
	}

	if config.APIUser == "" || config.APIKey == "" {
		return nil, fmt.Errorf("namecheap: credentials missing")
	}

	if len(config.ClientIP) == 0 {
		clientIP, err := getClientIP(config.HTTPClient, config.Debug)
		if err != nil {
			return nil, fmt.Errorf("namecheap: %v", err)
		}
		config.ClientIP = clientIP
	}

	return &DNSProvider{config: config}, nil
}
346025
func NewProvider(datafile string) (isp.Provider, error) {
	prov := &provider{
		yfast.New(uint32(0)), // 32 bit universe size for 32 bit IPv4
	}
	return prov, prov.init(datafile)
}
838234
func NewDNSProviderCredentials(project string) (*DNSProvider, error) {
	if project == "" {
		return nil, fmt.Errorf("googlecloud: project name missing")
	}

	client, err := google.DefaultClient(context.Background(), dns.NdevClouddnsReadwriteScope)
	if err != nil {
		return nil, fmt.Errorf("googlecloud: unable to get Google Cloud client: %v", err)
	}

	config := NewDefaultConfig()
	config.Project = project
	config.HTTPClient = client

	return NewDNSProviderConfig(config)
}
653241
func NewDNSProvider() (*DNSProvider, error) {
	values, err := env.Get("STACKPATH_CLIENT_ID", "STACKPATH_CLIENT_SECRET", "STACKPATH_STACK_ID")
	if err != nil {
		return nil, fmt.Errorf("stackpath: %v", err)
	}

	config := NewDefaultConfig()
	config.ClientID = values["STACKPATH_CLIENT_ID"]
	config.ClientSecret = values["STACKPATH_CLIENT_SECRET"]
	config.StackID = values["STACKPATH_STACK_ID"]

	return NewDNSProviderConfig(config)
}
951434
func NewProvider(config ProviderConfig) (environs.CloudEnvironProvider, error) {
	environProvider, err := NewEnvironProvider(config)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return environProvider, nil
}
1309615
func NewDNSProvider() (*DNSProvider, error) {
	values, err := env.Get("PDNS_API_KEY", "PDNS_API_URL")
	if err != nil {
		return nil, fmt.Errorf("pdns: %v", err)
	}

	hostURL, err := url.Parse(values["PDNS_API_URL"])
	if err != nil {
		return nil, fmt.Errorf("pdns: %v", err)
	}

	config := NewDefaultConfig()
	config.Host = hostURL
	config.APIKey = values["PDNS_API_KEY"]

	return NewDNSProviderConfig(config)
}
1269841
func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
	if config == nil {
		return nil, errors.New("linodev4: the configuration of the DNS provider is nil")
	}

	if len(config.Token) == 0 {
		return nil, errors.New("linodev4: Linode Access Token missing")
	}

	if config.TTL < minTTL {
		return nil, fmt.Errorf("linodev4: invalid TTL, TTL (%d) must be greater than %d", config.TTL, minTTL)
	}

	tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: config.Token})
	oauth2Client := &http.Client{
		Timeout: config.HTTPTimeout,
		Transport: &oauth2.Transport{
			Source: tokenSource,
		},
	}

	client := linodego.NewClient(oauth2Client)
	client.SetUserAgent(fmt.Sprintf("lego-dns linodego/%s", linodego.Version))

	return &DNSProvider{
		config: config,
		client: &client,
	}, nil
}
509382
func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
	if config == nil {
		return nil, errors.New("ovh: the configuration of the DNS provider is nil")
	}

	if config.APIEndpoint == "" || config.ApplicationKey == "" || config.ApplicationSecret == "" || config.ConsumerKey == "" {
		return nil, fmt.Errorf("ovh: credentials missing")
	}

	client, err := ovh.NewClient(
		config.APIEndpoint,
		config.ApplicationKey,
		config.ApplicationSecret,
		config.ConsumerKey,
	)
	if err != nil {
		return nil, fmt.Errorf("ovh: %v", err)
	}

	client.Client = config.HTTPClient

	return &DNSProvider{
		config:    config,
		client:    client,
		recordIDs: make(map[string]int),
	}, nil
}
1204125
func NewDNSAPI(client *Client) *DNSAPI {
	return &DNSAPI{
		&baseAPI{
			client: client,
			FuncGetResourceURL: func() string {
				return "commonserviceitem"
			},
			FuncBaseSearchCondition: func() *sacloud.Request {
				res := &sacloud.Request{}
				res.AddFilter("Provider.Class", "dns")
				return res
			},
		},
	}
}
1358280
func NewDNSProvider() (*DNSProvider, error) {
	values, err := env.Get(ociPrivkey, ociTenancyOCID, ociUserOCID, ociPubkeyFingerprint, ociRegion, "OCI_COMPARTMENT_OCID")
	if err != nil {
		return nil, fmt.Errorf("oraclecloud: %v", err)
	}

	config := NewDefaultConfig()
	config.CompartmentID = values["OCI_COMPARTMENT_OCID"]
	config.OCIConfigProvider = newConfigProvider(values)

	return NewDNSProviderConfig(config)
}
26613
func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
	if config == nil {
		return nil, errors.New("bindman: the configuration of the DNS provider is nil")
	}

	if config.BaseURL == "" {
		return nil, fmt.Errorf("bindman: bindman manager address missing")
	}

	bClient, err := client.New(config.BaseURL, config.HTTPClient)
	if err != nil {
		return nil, fmt.Errorf("bindman: %v", err)
	}

	return &DNSProvider{config: config, client: bClient}, nil
}
622086
func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
	if config == nil {
		return nil, errors.New("linode: the configuration of the DNS provider is nil")
	}

	if len(config.APIKey) == 0 {
		return nil, errors.New("linode: credentials missing")
	}

	if config.TTL < minTTL {
		return nil, fmt.Errorf("linode: invalid TTL, TTL (%d) must be greater than %d", config.TTL, minTTL)
	}

	return &DNSProvider{
		config: config,
		client: dns.New(config.APIKey),
	}, nil
}
304804
func NewProvider(params ...SDKContextParams) *Provider {
	ctxProvider := Provider{}
	for _, param := range params {
		param(&ctxProvider)
	}
	return &ctxProvider
}
236125
func NewProvider(chainID string, client SignStatusClient) lite.Provider {
	return &provider{
		logger:  log.NewNopLogger(),
		chainID: chainID,
		client:  client,
	}
}
1213030
func NewDNSProvider() (*DNSProvider, error) {
	values, err := env.Get("EXEC_PATH")
	if err != nil {
		return nil, fmt.Errorf("exec: %v", err)
	}

	config := NewDefaultConfig()
	config.Program = values["EXEC_PATH"]
	config.Mode = os.Getenv("EXEC_MODE")

	return NewDNSProviderConfig(config)
}