// New creates a new MessageBird client object.
333929
func New(accessKey string) *Client {
	return &Client{
		AccessKey: accessKey,
		HTTPClient: &http.Client{
			Timeout: httpClientTimeout,
		},
	}
}
1274394
func New(channelSecret, channelToken string, options ...ClientOption) (*Client, error) {
	if channelSecret == "" {
		return nil, errors.New("missing channel secret")
	}
	if channelToken == "" {
		return nil, errors.New("missing channel access token")
	}
	c := &Client{
		channelSecret: channelSecret,
		channelToken:  channelToken,
		httpClient:    http.DefaultClient,
	}
	for _, option := range options {
		err := option(c)
		if err != nil {
			return nil, err
		}
	}
	if c.endpointBase == nil {
		u, err := url.ParseRequestURI(APIEndpointBase)
		if err != nil {
			return nil, err
		}
		c.endpointBase = u
	}
	return c, nil
}
459983
func New() *Client {
	return &Client{
		Concurrency:    DefaultClient.Concurrency,
		MaxRetries:     DefaultClient.MaxRetries,
		Backoff:        DefaultClient.Backoff,
		ErrLog:         DefaultClient.ErrLog,
		wg:             &sync.WaitGroup{},
		RetryOnHTTP429: false,
	}
}
946022
func New(url, ver string, insecure bool, opts ...metaOp) (*Client, error) {
	if err := parseURL(url); err != nil {
		return nil, err
	}
	if ver == "" {
		ver = "v1"
	}
	var t *http.Transport
	if insecure {
		t = insecureTransport
	} else {
		t = secureTransport
	}
	c := &Client{
		URL:     url,
		Version: ver,

		http: &http.Client{
			Transport: t,
		},
	}
	for _, opt := range opts {
		opt(c)
	}
	c.prefix = url + "/" + ver
	return c, nil
}
1204331
func New(logger hclog.Logger, shutdownCh chan struct{}, connPoolPinger Pinger) (m *Manager) {
	logger = logger.Named("server_mgr")
	return &Manager{
		logger:         logger,
		connPoolPinger: connPoolPinger,
		rebalanceTimer: time.NewTimer(clientRPCMinReuseDuration),
		shutdownCh:     shutdownCh,
	}
}
709524
func New(ctx context.Context, config shim.Config, opt Opt) (*Client, error) {
	s, c, err := opt(ctx, config)
	if err != nil {
		return nil, err
	}
	return &Client{
		ShimService: s,
		c:           c,
		exitCh:      make(chan struct{}),
	}, nil
}
1002482
func New(mo Options) *Messenger {
	if mo.Mux == nil {
		mo.Mux = http.NewServeMux()
	}

	m := &Messenger{
		mux:       mo.Mux,
		token:     mo.Token,
		verify:    mo.Verify,
		appSecret: mo.AppSecret,
	}

	if mo.WebhookURL == "" {
		mo.WebhookURL = "/"
	}

	m.verifyHandler = newVerifyHandler(mo.VerifyToken)
	m.mux.HandleFunc(mo.WebhookURL, m.handle)

	return m
}
1164967
func New(transport runtime.ClientTransport, formats strfmt.Registry) *TodoList {
	// ensure nullable parameters have default
	if formats == nil {
		formats = strfmt.Default
	}

	cli := new(TodoList)
	cli.Transport = transport

	cli.Todos = todos.New(transport, formats)

	return cli
}
242946
func New(code string, message string) error {
	err := errors.New(message)
	return argoerr{code, message, err.(stackTracer)}
}
271028
func New(token, environment, codeVersion, serverHost, serverRoot string) *Client {
	return NewAsync(token, environment, codeVersion, serverHost, serverRoot)
}
1104928
func New(consumerKey, consumerSecret, accessToken, tokenSecret string) *Client {
	c := &Client{}
	c.ConsumerKey = consumerKey
	c.ConsumerSecret = consumerSecret
	c.AccessToken = accessToken
	c.TokenSecret = tokenSecret

	c.Keys = &KeyResource{c}
	c.Repos = &RepoResource{c}
	c.Users = &UserResource{c}
	c.Emails = &EmailResource{c}
	c.Brokers = &BrokerResource{c}
	c.Teams = &TeamResource{c}
	c.RepoKeys = &RepoKeyResource{c}
	c.Sources = &SourceResource{c}
	return c
}
455627
func New() (*Client, error) {
	cmd := exec.Command(GetBinary())
	stdin, err := cmd.StdinPipe()
	if err != nil {
		return nil, err
	}

	stdout, err := cmd.StdoutPipe()
	if err != nil {
		return nil, err
	}

	br := bufio.NewReader(stdout)
	if err := cmd.Start(); err != nil {
		return nil, err
	}

	// check welcome message
	banner, _, err := br.ReadLine()
	if err != nil {
		return nil, err
	}
	if !bytes.HasPrefix(banner, []byte("OK")) {
		return nil, fmt.Errorf("wrong banner: %s", banner)
	}

	cl := &Client{
		cmd: cmd,
		in:  stdin,
		out: br,
	}

	return cl, nil
}
417885
func New(apiKey string, system SystemType) *Client {
	return &Client{
		Key: apiKey,
		Url: system.Url(),
	}
}
793060
func New(c dropbox.Config) Client {
	ctx := apiImpl(dropbox.NewContext(c))
	return &ctx
}
658753
func New(conn net.Conn) *Client {
	return &Client{
		Client: jsonrpc.NewClient(conn),
		conn:   conn,
	}
}
997715
func New(credentials *auth.Credentials, apiVersion string, logger *log.Logger) *Client {
	return &Client{*http.DefaultClient, MaxSendAttempts, credentials, apiVersion, logger, false}
}
49870
func New(ctx fabcontext.Client) (*Client, error) {
	authInfo, err := newAuthInfo(ctx)
	if err != nil {
		return nil, err
	}

	return &Client{
		ctx:      ctx,
		authInfo: authInfo,
	}, nil
}