// NewClient returns a client instance.
779954
func NewClient(opts ClientOpts) *Client {
	if opts.HTTPClient == nil {
		opts.HTTPClient = &http.Client{}
	}

	return &Client{
		token:      opts.Token,
		baseURL:    opts.BaseURL,
		httpClient: opts.HTTPClient,
		userAgent:  opts.UserAgent,
	}
}
86752
func NewClient(accessKeyId, accessKeySecret string) *Client {
	return &Client{
		AccessKeyId:     accessKeyId,
		AccessKeySecret: accessKeySecret,
		endpoint:        CSDefaultEndpoint,
		Version:         CSAPIVersion,
		httpClient:      &http.Client{},
	}
}
118491
func NewClient(c HTTPClient) *Client {
	return &Client{
		Provider: &xmlContentProvider{
			client: &countingHTTPApiClient{
				client:       c,
				requestCount: 0,
			},
		},
	}
}
254097
func NewClient(opts ...Option) *Client {
	var c Client
	// set some sane defaults
	c.Option(ConnectTimeout(5))
	return c.Option(opts...)
}
410358
func NewClient() *Client {
	c := new(Client)
	c.SetSoftwareName(DefaultSoftwareName)
	c.logger = NewLogger()
	return c
}
737937
func newClient(ifi *net.Interface, p net.PacketConn, addrs []net.Addr) (*Client, error) {
	ip, err := firstIPv4Addr(addrs)
	if err != nil {
		return nil, err
	}

	return &Client{
		ifi: ifi,
		ip:  ip,
		p:   p,
	}, nil
}
589372
func NewClient(conn io.ReadWriteCloser) *rpc.Client {
	return rpc.NewClientWithCodec(NewClientCodec(conn))
}
821148
func newClient(url string, http *http.Client) *Client {
	return &Client{
		Client: &httpclient.Client{
			ErrNotFound: ErrNotFound,
			URL:         url,
			HTTP:        http,
		},
	}
}
515987
func NewClient(st base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(st, "FirewallRules")
	return &Client{ClientFacade: frontend, st: st, facade: backend}
}
73824
func NewClient(config ClientConfig) (Client, error) {
	if config.Connection == nil {
		return nil, WithStack(InvalidArgumentError{Message: "Connection is not set"})
	}
	conn := config.Connection
	if config.Authentication != nil {
		var err error
		conn, err = conn.SetAuthentication(config.Authentication)
		if err != nil {
			return nil, WithStack(err)
		}
	}
	c := &client{
		conn: conn,
	}
	if config.SynchronizeEndpointsInterval > 0 {
		go c.autoSynchronizeEndpoints(config.SynchronizeEndpointsInterval)
	}
	return c, nil
}
1321697
func NewClient(c *http.Client) *Client {
	return &Client{Transport: &Transport{Client: c}}
}
398998
func NewClient(doer Doer) *Client {
	if doer == nil {
		doer = http.DefaultClient
	}
	baseURL, _ := url.Parse(defaultBaseURL)
	client := &Client{doer: doer, BaseURL: baseURL, UserAgent: userAgent}
	return client
}
1126099
func NewClient() (*Client, error) {
	cc := ClientConfig{
		ChunkSize:   1420,
		Compression: COMP_GZIP,
	}
	return NewClientWithConfig(cc)
}
856307
func newClient(c clientConfig) (client, error) {
	if c.app.tokenURL == "" {
		c.app.tokenURL = tokenURL
	}

	if c.app.unauthenticated() {
		return &baseClient{clientWithAgent(c.agent)}, nil
	}

	if err := c.app.validateAuth(); err != nil {
		return nil, err
	}

	return newAppClient(c)
}
1316026
func NewClient(httpClient *http.Client) *Client {
	if httpClient == nil {
		httpClient = http.DefaultClient
	}

	return &Client{
		httpClient: httpClient,
	}
}
1041127
func NewClient(consumerKey string, consumerSecret string) *Client {
	c := Client{}
	c.SetConsumer(consumerKey, consumerSecret)
	return &c
}
380199
func NewClient(user string, password string, key string) *Client {
	config := ClientConfig{
		User:     user,
		Password: password,
		APIKey:   key,
	}
	c, _ := NewClientWithConfig(config)
	return c
}