func (c *Config) WithLogger(logger log.Logger) *Config {
	c.Logger = logger
	return c
}
WithLogger defines the logger for informational messages, e.g. requests
and their response times. It is nil by default.
package spotinst
import (
	"net"
	"net/http"
	"net/url"
	"runtime"
	"strings"
	"time"
	"github.com/spotinst/spotinst-sdk-go/spotinst/credentials"
	"github.com/spotinst/spotinst-sdk-go/spotinst/log"
	"github.com/spotinst/spotinst-sdk-go/spotinst/util/useragent"
)
const (
	defaultBaseURL = "https://api.spotinst.io"
	defaultContentType = "application/json"
)
type Config struct {
	BaseURL *url.URL
	HTTPClient *http.Client
	Credentials *credentials.Credentials
	Logger log.Logger
	UserAgent, ContentType string
}
func DefaultBaseURL() *url.URL {
	baseURL, _ := url.Parse(defaultBaseURL)
	return baseURL
}
func DefaultUserAgent() string {
	return useragent.New(
		SDKName,
		SDKVersion,
		runtime.Version(),
		runtime.GOOS,
		runtime.GOARCH).String()
}
func DefaultContentType() string {
	return defaultContentType
}
func DefaultTransport() *http.Transport {
	return &http.Transport{
		Proxy: http.ProxyFromEnvironment,
		DialContext: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 30 * time.Second,
		}).DialContext,
		TLSHandshakeTimeout: 10 * time.Second,
		DisableKeepAlives:   false,
		MaxIdleConnsPerHost: 1,
	}
}
func DefaultHTTPClient() *http.Client {
	return &http.Client{
		Transport: DefaultTransport(),
	}
}
func DefaultConfig() *Config {
	return &Config{
		BaseURL:     DefaultBaseURL(),
		HTTPClient:  DefaultHTTPClient(),
		UserAgent:   DefaultUserAgent(),
		ContentType: DefaultContentType(),
		Credentials: credentials.NewChainCredentials(
			new(credentials.EnvProvider),
			new(credentials.FileProvider),
		),
	}
}
func (c *Config) WithBaseURL(rawurl string) *Config {
	baseURL, _ := url.Parse(rawurl)
	c.BaseURL = baseURL
	return c
}
func (c *Config) WithHTTPClient(client *http.Client) *Config {
	c.HTTPClient = client
	return c
}
func (c *Config) WithCredentials(creds *credentials.Credentials) *Config {
	c.Credentials = creds
	return c
}
func (c *Config) WithUserAgent(ua string) *Config {
	c.UserAgent = strings.TrimSpace(strings.Join([]string{ua, c.UserAgent}, " "))
	return c
}
func (c *Config) WithContentType(ct string) *Config {
	c.ContentType = ct
	return c
}