// NewSenderWithHTTPClient instantiates a Sender given the API key and an http.Client.
341676
func NewSenderWithHTTPClient(apiKey string, client *http.Client) *Sender {
	return &Sender{apiKey, client}
}
763381
func (c *Config) WithHTTPClient(client *http.Client) *Config {
	c.HTTPClient = client
	return c
}
1223248
func (o *UpdateJSONWebKeySetParams) WithHTTPClient(client *http.Client) *UpdateJSONWebKeySetParams {
	o.SetHTTPClient(client)
	return o
}
157889
func NewClientWithHTTPClient(key string, secret string, region *Region, client *http.Client) *Client {
	return &Client{
		keys:          &aws4.Keys{AccessKey: key, SecretKey: secret},
		httpClient:    client,
		pollingClient: client,
		Region:        region,
	}
}
797699
func NewServer(t testing.TB, h http.Handler, client *http.Client) *Server {
	return newServer(t, httptest.NewServer(h), client)
}
1284077
func (o *GetFqdnCacheIDParams) WithHTTPClient(client *http.Client) *GetFqdnCacheIDParams {
	o.SetHTTPClient(client)
	return o
}
1231117
func NewSendResponse(apiResponse *api.Response, responseBody []byte) (*SendResponse, error) {
	resp := &SendResponse{
		Response:  apiResponse,
		CacheMeta: &CacheMeta{},
	}

	// If a response body is separately provided we set that as the SendResponse.ResponseBody,
	// otherwise we will do an ioutil.ReadAll to extract the response body from apiResponse.
	switch {
	case len(responseBody) > 0:
		resp.ResponseBody = responseBody
	case apiResponse.Body != nil:
		respBody, err := ioutil.ReadAll(apiResponse.Body)
		if err != nil {
			return nil, err
		}
		// Close the old body
		apiResponse.Body.Close()

		// Re-set the response body after reading from the Reader
		apiResponse.Body = ioutil.NopCloser(bytes.NewReader(respBody))

		resp.ResponseBody = respBody
	}

	return resp, nil
}
162393
func NewWithCustomHttpClient(apiKey, apiSecret string, httpClient *http.Client) *Bittrex {
	client := NewClientWithCustomHttpConfig(apiKey, apiSecret, httpClient)
	return &Bittrex{client}
}
809300
func NewSender(o SenderOptions) (s *Sender) {
	s = &Sender{
		client:     o.Client,
		retryFunc:  o.RetryFunc,
		retryMax:   o.RetryMax,
		retrySleep: o.RetrySleep,
	}
	if s.client == nil {
		s.client = &http.Client{}
	}
	if s.retryFunc == nil {
		s.retryFunc = defaultRetryFunc
	}
	return
}
298629
func (o *GetEndpointIDLogParams) WithHTTPClient(client *http.Client) *GetEndpointIDLogParams {
	o.SetHTTPClient(client)
	return o
}
590488
func NewClientWithSender(sender Sender, prefix string) (Statter, error) {
	if sender == nil {
		return nil, fmt.Errorf("Client sender may not be nil")
	}

	return &Client{prefix: prefix, sender: sender}, nil
}
919568
func (c *Client) NewServiceClient(path string, namespace string) *Client {
	vc := c.URL()
	u, err := url.Parse(path)
	if err != nil {
		log.Panicf("url.Parse(%q): %s", path, err)
	}
	if u.Host == "" {
		u.Scheme = vc.Scheme
		u.Host = vc.Host
	}

	client := NewClient(u, c.k)
	client.Namespace = "urn:" + namespace
	if cert := c.Certificate(); cert != nil {
		client.SetCertificate(*cert)
	}

	// Copy the trusted thumbprints
	c.hostsMu.Lock()
	for k, v := range c.hosts {
		client.hosts[k] = v
	}
	c.hostsMu.Unlock()

	// Copy the cookies
	client.Client.Jar.SetCookies(u, c.Client.Jar.Cookies(u))

	// Set SOAP Header cookie
	for _, cookie := range client.Jar.Cookies(u) {
		if cookie.Name == SessionCookieName {
			client.cookie = cookie.Value
			break
		}
	}

	// Copy any query params (e.g. GOVMOMI_TUNNEL_PROXY_PORT used in testing)
	client.u.RawQuery = vc.RawQuery

	client.UserAgent = c.UserAgent

	return client
}
827022
func (o *UpdateJSONWebKeyParams) WithHTTPClient(client *http.Client) *UpdateJSONWebKeyParams {
	o.SetHTTPClient(client)
	return o
}
615098
func (o *IsInstanceReadyParams) WithHTTPClient(client *http.Client) *IsInstanceReadyParams {
	o.SetHTTPClient(client)
	return o
}
1119409
func WithHTTPClient(client *http.Client) Opt {
	return func(c *Client) {
		c.httpClient = client
	}
}
858253
func (o *AddCommentToTaskParams) WithHTTPClient(client *http.Client) *AddCommentToTaskParams {
	o.SetHTTPClient(client)
	return o
}
731580
func (o *GetJSONWebKeyParams) WithHTTPClient(client *http.Client) *GetJSONWebKeyParams {
	o.SetHTTPClient(client)
	return o
}