mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-08 15:13:56 -06:00
61499cfcf0
* Terraform Provider 1&1 * Addressing pull request remarks * Fixed imports * Fixing remarks * Test optimiziation
25 lines
411 B
Go
25 lines
411 B
Go
package oneandone
|
|
|
|
import (
|
|
"github.com/1and1/oneandone-cloudserver-sdk-go"
|
|
)
|
|
|
|
type Config struct {
|
|
Token string
|
|
Retries int
|
|
Endpoint string
|
|
API *oneandone.API
|
|
}
|
|
|
|
func (c *Config) Client() (*Config, error) {
|
|
token := oneandone.SetToken(c.Token)
|
|
|
|
if len(c.Endpoint) > 0 {
|
|
c.API = oneandone.New(token, c.Endpoint)
|
|
} else {
|
|
c.API = oneandone.New(token, oneandone.BaseUrl)
|
|
}
|
|
|
|
return c, nil
|
|
}
|