// NewClient returns an *http.Client which sets a GCE VM metadata token in the
// Header of an *http.Request during Do. The audience for the token is the
// *http.Request.URL.Host.
355110
func NewClient(meta *metadata.Client, acc string) *http.Client {
	return &http.Client{
		Transport: newRoundTripper(meta, acc),
	}
}
349099
func NewClient(apiKey string) *Client {
	c := &Client{}

	c.domain = DomainURL
	c.apiKey = apiKey
	c.context = ""

	ctx := context.Background()
	c.Trend = &TrendService{client: c, ctx: ctx}
	c.KnowledgeQA = &KnowledgeQAService{client: c, ctx: ctx}
	c.Dialogue = &DialogueService{client: c, ctx: ctx}

	return c
}
1209203
func NewClient(apiKey, apiSecret string) (c *client) {
	return &client{apiKey, apiSecret, &http.Client{}, time.Tick(reqInterval), 30 * time.Second, false}
}
1238457
func NewClient(config *Config) (*Client, error) {
	client := &Client{
		config: *config,
	}
	return client, nil
}
776807
func NewClient(auth Auth) (*Client, error) {
	c := &Client{
		auth: auth,
	}
	return c, nil
}
1158135
func NewClient(apiKey string, apiSecret string) (*Client, error) {
	if apiKey == "" {
		return nil, fmt.Errorf("credentials missing: API key")
	}

	if apiSecret == "" {
		return nil, fmt.Errorf("credentials missing: API secret")
	}

	return &Client{
		apiKey:     apiKey,
		apiSecret:  apiSecret,
		HTTPClient: &http.Client{},
	}, nil
}
171965
func NewClient() *Client {
	return &Client{
		Logger:         zap.NewNop(),
		IDGenerator:    snowflake.NewIDGenerator(),
		TokenGenerator: rand.NewTokenGenerator(64),
		time:           time.Now,
	}
}
785138
func NewClient(prefix string, apiVersion string, version string,
	token TokenHolder, t http.RoundTripper) *Client {

	rt := &registryRoundTripper{
		DefaultRequestDoer: DefaultRequestDoer{
			Client: &http.Client{
				Transport: t,
				Timeout:   time.Minute,
			},
			Host: prefix,
		},

		apiVersion: apiVersion,
		version:    version,
		holder:     token,
	}

	return NewClientWithRoundTripper(rt)
}
878669
func NewClient(cert tls.Certificate) (*http.Client, error) {
	config := &tls.Config{
		Certificates: []tls.Certificate{cert},
	}
	config.BuildNameToCertificate()
	transport := &http.Transport{TLSClientConfig: config}

	if err := http2.ConfigureTransport(transport); err != nil {
		return nil, err
	}

	return &http.Client{Transport: transport}, nil
}
389347
func NewClient(parentCtx context.Context, region, host string) (*Client, error) {
	if host == "" {
		return nil, fmt.Errorf("Invalid host")
	}
	if region == "" || region == "[" {
		return nil, fmt.Errorf("Invalid region")
	}

	ctx, cancel := context.WithCancel(parentCtx)
	return &Client{
		push:        make(chan string, 100), // FIXME verify if buffered make sense here
		sub:         make(chan string, 100), // FIXME verify if buffered make sense here
		host:        host,
		region:      region,
		ctx:         ctx,
		cancel:      cancel,
		exitSignal:  make(chan struct{}),
		readySignal: make(chan interface{}),
	}, nil
}
821148
func newClient(url string, http *http.Client) *Client {
	return &Client{
		Client: &httpclient.Client{
			ErrNotFound: ErrNotFound,
			URL:         url,
			HTTP:        http,
		},
	}
}
987719
func NewClient(url string, httpClient *http.Client) *Client {
	if httpClient == nil {
		httpClient = http.DefaultClient
	}
	return &Client{
		url:        url,
		httpClient: httpClient,
	}
}
234583
func NewClient(httpClient *http.Client) *Client {
	if httpClient == nil {
		httpClient = http.DefaultClient
	}

	client := &Client{
		Client: *httpClient,
		UserAgent: "Akamai-Open-Edgegrid-golang/" + libraryVersion +
			" golang/" + strings.TrimPrefix(runtime.Version(), "go"),
	}

	return client
}
647725
func NewClient(region string, auth Auth, httpClient *http.Client) (*Client, error) {
	if httpClient == nil {
		httpClient = &http.Client{}
	}

	c := &Client{httpClient: httpClient}

	c.endpoint = fmt.Sprintf(identityBaseURL, region)

	identity, err := c.getIdentity(auth)
	if err != nil {
		return nil, fmt.Errorf("failed to login: %v", err)
	}

	c.token = identity.Access.Token.ID
	c.endpoint = fmt.Sprintf(dnsServiceBaseURL, region)

	return c, nil
}
1082592
func NewClient(config *oauth2.Config) *Client {
	return &Client{
		Config:  config,
		backoff: backoff,
	}
}
857345
func NewClient(token string, httpClient *http.Client, baseURL string) *Client {
	return &Client{
		token:      token,
		httpClient: httpClient,
		url:        fmt.Sprintf("%s/bot%s/", baseURL, token) + "%s",
	}
}
1199460
func NewClient(
	accessToken string,
	clientID string,
	apiURL string,
	logger logger.Logger,
) wl.Client {
	return &oauthClient{
		apiURL:      apiURL,
		accessToken: accessToken,
		clientID:    clientID,
		logger:      logger,
	}
}