func (r *Request) Name(resourceName string) *Request {
	if r.err != nil {
		return r
	}
	if len(r.resourceName) != 0 {
		r.err = fmt.Errorf("resource name already set to %q, cannot change to %q", r.resourceName, resourceName)
		return r
	}
	r.resourceName = resourceName
	return r
}
Name sets the name of a resource to access (<resource>/[ns/<namespace>/]<name>)
package client
import (
	"bytes"
	"crypto/tls"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"path"
	"strconv"
	"strings"
	"time"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/util/httpstream"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
	watchjson "github.com/GoogleCloudPlatform/kubernetes/pkg/watch/json"
	"github.com/golang/glog"
)
var specialParams = util.NewStringSet("timeout")
type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}
type UnexpectedStatusError struct {
	Request  *http.Request
	Response *http.Response
	Body     string
}
func (u *UnexpectedStatusError) Error() string {
	return fmt.Sprintf("request [%+v] failed (%d) %s: %s", u.Request, u.Response.StatusCode, u.Response.Status, u.Body)
}
type RequestConstructionError struct {
	Err error
}
func (r *RequestConstructionError) Error() string {
	return fmt.Sprintf("request construction error: '%v'", r.Err)
}
type Request struct {
	client  HTTPClient
	verb    string
	baseURL *url.URL
	codec   runtime.Codec
	namespaceInQuery bool
	preserveResourceCase bool
	path    string
	subpath string
	params  url.Values
	namespace    string
	namespaceSet bool
	resource     string
	resourceName string
	selector     labels.Selector
	timeout      time.Duration
	err  error
	body io.Reader
}
func NewRequest(client HTTPClient, verb string, baseURL *url.URL,
	codec runtime.Codec, namespaceInQuery bool, preserveResourceCase bool) *Request {
	return &Request{
		client:  client,
		verb:    verb,
		baseURL: baseURL,
		path:    baseURL.Path,
		codec:                codec,
		namespaceInQuery:     namespaceInQuery,
		preserveResourceCase: preserveResourceCase,
	}
}
func (r *Request) Prefix(segments ...string) *Request {
	if r.err != nil {
		return r
	}
	r.path = path.Join(r.path, path.Join(segments...))
	return r
}
func (r *Request) Suffix(segments ...string) *Request {
	if r.err != nil {
		return r
	}
	r.subpath = path.Join(r.subpath, path.Join(segments...))
	return r
}
func (r *Request) Resource(resource string) *Request {
	if r.err != nil {
		return r
	}
	if len(r.resource) != 0 {
		r.err = fmt.Errorf("resource already set to %q, cannot change to %q", r.resource, resource)
		return r
	}
	r.resource = resource
	return r
}