|
@@ -9,7 +9,11 @@ import "net/http"
|
|
|
// It won't send any version information if the version number is empty. It is
|
|
|
// highly recommended that you set a version or your client may break if the
|
|
|
// server is upgraded.
|
|
|
-// Deprecated: use NewClientWithOpts
|
|
|
+//
|
|
|
+// Deprecated: use [NewClientWithOpts] passing the [WithHost], [WithVersion],
|
|
|
+// [WithHTTPClient] and [WithHTTPHeaders] options. We recommend enabling API
|
|
|
+// version negotiation by passing the [WithAPIVersionNegotiation] option instead
|
|
|
+// of WithVersion.
|
|
|
func NewClient(host string, version string, client *http.Client, httpHeaders map[string]string) (*Client, error) {
|
|
|
return NewClientWithOpts(WithHost(host), WithVersion(version), WithHTTPClient(client), WithHTTPHeaders(httpHeaders))
|
|
|
}
|
|
@@ -17,7 +21,7 @@ func NewClient(host string, version string, client *http.Client, httpHeaders map
|
|
|
// NewEnvClient initializes a new API client based on environment variables.
|
|
|
// See FromEnv for a list of support environment variables.
|
|
|
//
|
|
|
-// Deprecated: use NewClientWithOpts(FromEnv)
|
|
|
+// Deprecated: use [NewClientWithOpts] passing the [FromEnv] option.
|
|
|
func NewEnvClient() (*Client, error) {
|
|
|
return NewClientWithOpts(FromEnv)
|
|
|
}
|