// NewForbidden 新建
342848
func NewForbidden(code int, msgs ...string) error {
	return Forbidden{codeError{code: code, msg: strings.Join(msgs, ",")}}
}
345974
func NewForConfig(cfg *restclient.Config, mapper PreferredResourceMapper, resolver dynamic.APIPathResolverFunc, scaleKindResolver ScaleKindResolver) (ScalesGetter, error) {
	// so that the RESTClientFor doesn't complain
	cfg.GroupVersion = &schema.GroupVersion{}

	cfg.NegotiatedSerializer = codecs.WithoutConversion()
	if len(cfg.UserAgent) == 0 {
		cfg.UserAgent = restclient.DefaultKubernetesUserAgent()
	}

	client, err := restclient.RESTClientFor(cfg)
	if err != nil {
		return nil, err
	}

	return New(client, mapper, resolver, scaleKindResolver), nil
}
1341382
func IsForbiddenError(err error) (bool, error) {
	e, ok := errs.Cause(err).(ForbiddenError)
	if !ok {
		return false, nil
	}
	return true, e
}
1327029
func NewForConfigOrDie(c *rest.Config) *Clientset {
	var cs Clientset
	cs.project = projectinternalversion.NewForConfigOrDie(c)

	cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
	return &cs
}
938481
func NewForConfigOrDie(c *rest.Config) *Clientset {
	var cs Clientset
	cs.apiextensionsV1beta1 = apiextensionsv1beta1.NewForConfigOrDie(c)

	cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
	return &cs
}
60068
func (factory *CleverbotBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := CleverbotBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
252951
func NewForbiddenError(field *FieldPath, value interface{}) *Error {
	return &Error{ErrorTypeForbidden, field.String(), value, ""}
}
826490
func NewForConfig(c *unversioned.Config) (*Clientset, error) {
	var clientset Clientset
	var err error
	clientset.CoreClient, err = unversionedcore.NewForConfig(c)
	if err != nil {
		return &clientset, err
	}
	clientset.ExtensionsClient, err = unversionedextensions.NewForConfig(c)
	if err != nil {
		return &clientset, err
	}

	clientset.DiscoveryClient, err = unversioned.NewDiscoveryClientForConfig(c)
	if err != nil {
		glog.Errorf("failed to create the DiscoveryClient: %v", err)
	}
	return &clientset, err
}
1348136
func NewGUID() GUID {
	result, err := version4()
	if err != nil {
		panic(err) //Version 4 (pseudo-random GUID) doesn't use anything that could fail.
	}
	return result
}
273571
func (factory *DevrantBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := DevrantBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
1033946
func NewAnd(qs graph.QuadStore, sub ...graph.Iterator) *And {
	it := &And{
		uid:               NextUID(),
		internalIterators: make([]graph.Iterator, 0, 20),
		qs:                qs,
	}
	for _, s := range sub {
		it.AddSubIterator(s)
	}
	return it
}
1059454
func (md *MDCacheStandard) ChangeHandleForID(
	oldHandle *tlfhandle.Handle, newHandle *tlfhandle.Handle) {
	md.lock.RLock()
	defer md.lock.RUnlock()
	oldKey := oldHandle.GetCanonicalPath()
	tmp, ok := md.idLRU.Get(oldKey)
	if !ok {
		return
	}
	md.idLRU.Remove(oldKey)
	newKey := newHandle.GetCanonicalPath()
	md.idLRU.Add(newKey, tmp)
	return
}
439325
func newPendingID() (string, error) {
	uuid, err := utils.NewUUID()
	if err != nil {
		return "", errors.Annotate(err, "could not create new resource ID")
	}
	return uuid.String(), nil
}
896630
func (factory *FSNotifyBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := FSNotifyBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
286297
func NewForConfigOrDie(c *rest.Config) *Clientset {
	var cs Clientset
	cs.fluxV1beta1 = fluxv1beta1.NewForConfigOrDie(c)
	cs.helmV1alpha2 = helmv1alpha2.NewForConfigOrDie(c)

	cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
	return &cs
}
887541
func (factory *CronBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := CronBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
7405
func NewPollArg(AsyncJobId string) *PollArg {
	s := new(PollArg)
	s.AsyncJobId = AsyncJobId
	return s
}