// NewClient Creates a new client of NIFCLOUD DNS
354122
func NewClient(accessKey string, secretKey string) (*Client, error) {
	if len(accessKey) == 0 || len(secretKey) == 0 {
		return nil, errors.New("credentials missing")
	}

	return &Client{
		accessKey:  accessKey,
		secretKey:  secretKey,
		BaseURL:    defaultBaseURL,
		HTTPClient: &http.Client{},
	}, nil
}
94919
func NewClient(context *cli.Context, opts ...containerd.ClientOpt) (*containerd.Client, gocontext.Context, gocontext.CancelFunc, error) {
	client, err := containerd.New(context.GlobalString("address"), opts...)
	if err != nil {
		return nil, nil, nil, err
	}
	ctx, cancel := AppContext(context)
	return client, ctx, cancel, nil
}
1263404
func NewClient(url, token string) *Client {
	return &Client{
		url:         strings.TrimSuffix(url, "/"),
		accessToken: token,
		client:      &http.Client{},
	}
}
589372
func NewClient(conn io.ReadWriteCloser) *rpc.Client {
	return rpc.NewClientWithCodec(NewClientCodec(conn))
}
438332
func NewClient(host string) (*Client, error) {
	if host == "" {
		host = DefaultSockPath()
	}
	tmp := strings.SplitN(host, "://", 2)
	if len(tmp) != 2 {
		return nil, fmt.Errorf("invalid host format '%s'", host)
	}

	switch tmp[0] {
	case "tcp":
		if _, err := url.Parse("tcp://" + tmp[1]); err != nil {
			return nil, err
		}
		host = "http://" + tmp[1]
	case "unix":
		host = tmp[1]
	}

	transport := configureTransport(nil, tmp[0], host)
	httpClient := &http.Client{Transport: transport}
	clientTrans := runtime_client.NewWithClient(tmp[1], clientapi.DefaultBasePath,
		clientapi.DefaultSchemes, httpClient)
	return &Client{*clientapi.New(clientTrans, strfmt.Default)}, nil
}
1118909
func NewClient(host string, user string, pass string, httpClient *http.Client) Client {
	return &RealClient{host, user, pass, httpClient}
}
410358
func NewClient() *Client {
	c := new(Client)
	c.SetSoftwareName(DefaultSoftwareName)
	c.logger = NewLogger()
	return c
}
1082592
func NewClient(config *oauth2.Config) *Client {
	return &Client{
		Config:  config,
		backoff: backoff,
	}
}
1141643
func NewClient(apiKey string) *Client {
	c := &Client{
		URL:        BaseURL,
		key:        apiKey,
		post:       http.PostForm,
		argMarshal: marshallArgs,
	}
	c.apiCall = c.liveAPICaller
	return c
}
155969
func NewClient(hostname string, port int) (*Client, error) {
	return NewClientWithPolicyAndHost(NewClientPolicy(), NewHost(hostname, port))
}
86752
func NewClient(accessKeyId, accessKeySecret string) *Client {
	return &Client{
		AccessKeyId:     accessKeyId,
		AccessKeySecret: accessKeySecret,
		endpoint:        CSDefaultEndpoint,
		Version:         CSAPIVersion,
		httpClient:      &http.Client{},
	}
}
1318009
func NewClient(conn net.Conn, host string) (*smtp.Client, error) {
  return smtp.NewClient(conn, host)
}
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,
	}
}
835790
func NewClient(url string) *Client {
	return &Client{
		URL:    url,
		client: http.DefaultClient,
	}
}
1345598
func NewClient(clientID string, secret string, APIBase string) (*Client, error) {
	if clientID == "" || secret == "" || APIBase == "" {
		return nil, errors.New("ClientID, Secret and APIBase are required to create a Client")
	}

	return &Client{
		Client:   &http.Client{},
		ClientID: clientID,
		Secret:   secret,
		APIBase:  APIBase,
	}, nil
}
776807
func NewClient(auth Auth) (*Client, error) {
	c := &Client{
		auth: auth,
	}
	return c, nil
}
259002
func NewClient(c *vim25.Client) *Client {
	sc := c.Client.NewServiceClient(internal.Path, "")

	return &Client{sc}
}