provider/dnsimple.go
func NewDnsimpleProvider(domainFilter DomainFilter, zoneIDFilter ZoneIDFilter, dryRun bool) (Provider, error) {
	oauthToken := os.Getenv("DNSIMPLE_OAUTH")
	if len(oauthToken) == 0 {
		return nil, fmt.Errorf("No dnsimple oauth token provided")
	}
	client := dnsimple.NewClient(dnsimple.NewOauthTokenCredentials(oauthToken))
	provider := &dnsimpleProvider{
		client:       dnsimpleZoneService{service: client.Zones},
		identity:     identityService{service: client.Identity},
		domainFilter: domainFilter,
		zoneIDFilter: zoneIDFilter,
		dryRun:       dryRun,
	}
	whoamiResponse, err := provider.identity.service.Whoami()
	if err != nil {
		return nil, err
	}
	provider.accountID = strconv.Itoa(whoamiResponse.Data.Account.ID)
	return provider, nil
}
func NewDnsimpleProvider(domainFilter DomainFilter, zoneIDFilter ZoneIDFilter, dryRun bool) (Provider, error) {
	oauthToken := os.Getenv("DNSIMPLE_OAUTH")
	if len(oauthToken) == 0 {
		return nil, fmt.Errorf("No dnsimple oauth token provided")
	}
	client := dnsimple.NewClient(dnsimple.NewOauthTokenCredentials(oauthToken))
	provider := &dnsimpleProvider{
		client:       dnsimpleZoneService{service: client.Zones},
		identity:     identityService{service: client.Identity},
		domainFilter: domainFilter,
		zoneIDFilter: zoneIDFilter,
		dryRun:       dryRun,
	}
	whoamiResponse, err := provider.identity.service.Whoami()
	if err != nil {
		return nil, err
	}
	provider.accountID = strconv.Itoa(whoamiResponse.Data.Account.ID)
	return provider, nil
}
func NewDnsimpleProvider ( domainFilter DomainFilter , zoneIDFilter ZoneIDFilter , dryRun bool ) ( Provider , error ) { oauthToken := os . Getenv ( " " ) if len ( oauthToken ) == 0 { return nil , fmt . Errorf ( " " ) } client := dnsimple . NewClient ( dnsimple . NewOauthTokenCredentials ( oauthToken ) ) provider := & dnsimpleProvider { client : dnsimpleZoneService { service : client . Zones } , identity : identityService { service : client . Identity } , domainFilter : domainFilter , zoneIDFilter : zoneIDFilter , dryRun : dryRun , } whoamiResponse , err := provider . identity . service . Whoami ( ) if err != nil { return nil , err } provider . accountID = strconv . Itoa ( whoamiResponse . Data . Account . ID ) return provider , nil }
// NewDnsimpleProvider initializes a new Dnsimple based provider
NewDnsimpleProvider initializes a new Dnsimple based provider