// NewClient is a constructor for the Client. It takes the key and token credentials
// of a Trello member to authenticate and authorise requests with.
500533
func NewClient(key, token string) *Client {
	return &Client{
		Client:   http.DefaultClient,
		BaseURL:  DefaultBaseURL,
		Key:      key,
		Token:    token,
		throttle: time.Tick(time.Second / 8), // Actually 10/second, but we're extra cautious
		testMode: false,
		ctx:      context.Background(),
	}
}
835790
func NewClient(url string) *Client {
	return &Client{
		URL:    url,
		client: http.DefaultClient,
	}
}
682381
func NewClient(user, pass, base string) *Client {
	return &Client{
		ID:          user,
		Token:       pass,
		Client:      defaultHttpClient,
		Base:        base,
		UploadType:  JSON,
		ErrorParser: DefaultErrorParser,
	}
}
410358
func NewClient() *Client {
	c := new(Client)
	c.SetSoftwareName(DefaultSoftwareName)
	c.logger = NewLogger()
	return c
}
754748
func NewClient(config Config) Client {
	if config.AuthKey == "" {
		panic("failed to create Transloadit client: missing AuthKey")
	}

	if config.AuthSecret == "" {
		panic("failed to create Transloadit client: missing AuthSecret")
	}

	client := Client{
		config:     config,
		httpClient: &http.Client{},
	}

	return client
}
6023
func NewClient(name string, b func(...client.Option) client.Client) Option {
	return func(o *Options) {
		o.Clients[name] = b
	}
}
1179008
func NewClient(appID, apiKey string) *Client {
	return NewClientWithConfig(
		Configuration{
			AppID:  appID,
			APIKey: apiKey,
		},
	)
}
731198
func NewKeyClient(addr, port string, creds *Credentials, key *Key) *Client {
	return &Client{
		addr:        addr,
		port:        port,
		useAgent:    false,
		credentials: creds,
		key:         key,
	}
}
1302322
func NewClient(addr string) (*Client, error) {
	connection, err := net.Dial("tcp", addr)
	if err != nil {
		return nil, err
	}

	return &Client{
		address:        addr,
		connection:     connection,
		responseReader: bufio.NewReader(connection),
	}, nil
}
284496
func NewClient(opt *Options) *Client {
	opt.init()

	c := Client{
		baseClient: baseClient{
			opt:      opt,
			connPool: newConnPool(opt),
		},
	}
	c.baseClient.init()
	c.init()

	return &c
}
1209203
func NewClient(apiKey, apiSecret string) (c *client) {
	return &client{apiKey, apiSecret, &http.Client{}, time.Tick(reqInterval), 30 * time.Second, false}
}
512977
func NewClient(apiKey string, secretKey string) (*Client, error) {
	if apiKey == "" {
		return nil, fmt.Errorf("CloudXNS: credentials missing: apiKey")
	}

	if secretKey == "" {
		return nil, fmt.Errorf("CloudXNS: credentials missing: secretKey")
	}

	return &Client{
		apiKey:     apiKey,
		secretKey:  secretKey,
		HTTPClient: &http.Client{},
		BaseURL:    defaultBaseURL,
	}, nil
}
1222276
func (t *TestTLSServer) NewClient(identity TestIdentity) (*Client, error) {
	tlsConfig, err := t.ClientTLSConfig(identity)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	addrs := []utils.NetAddr{utils.FromAddr(t.Listener.Addr())}
	return NewTLSClient(ClientConfig{Addrs: addrs, TLS: tlsConfig})
}
1242094
func NewClient(key string, secret string, region *Region) *Client {
	return &Client{
		keys:          &aws4.Keys{AccessKey: key, SecretKey: secret},
		httpClient:    http.DefaultClient,
		pollingClient: http.DefaultClient,
		Region:        region,
	}
}
803422
func NewClient(uri, key string) (Client, error) {
	return NewClientWithHTTP(uri, key, httphelper.RetryClient)
}
512902
func NewClient(authToken string) Client {
	return Client{
		AuthToken: authToken,
		BaseURL:   defaultBaseURL,
		Transport: http.DefaultTransport,
	}
}
1238457
func NewClient(config *Config) (*Client, error) {
	client := &Client{
		config: *config,
	}
	return client, nil
}