// NewFacadeV5 is used for API registration.
487605
func NewFacadeV5(ctx facade.Context) (*ModelManagerAPIV5, error) {
	v6, err := NewFacadeV6(ctx)
	if err != nil {
		return nil, err
	}
	return &ModelManagerAPIV5{v6}, nil
}
703
func NewMockClientFacade(ctrl *gomock.Controller) *MockClientFacade {
	mock := &MockClientFacade{ctrl: ctrl}
	mock.recorder = &MockClientFacadeMockRecorder{mock}
	return mock
}
1245082
func (g *rfc4122Generator) NewV5(ns UUID, name string) UUID {
	u := newFromHash(sha1.New(), ns, name)
	u.SetVersion(V5)
	u.SetVariant(VariantRFC4122)

	return u
}
574872
func NewFacade(st *state.State, resources facade.Resources, authorizer facade.Authorizer) (*API, error) {
	model, err := st.Model()
	if err != nil {
		return nil, errors.Trace(err)
	}
	return NewAPI(&stateShim{st, model}, resources, authorizer)
}
148629
func NewControllerAPIv5(ctx facade.Context) (*ControllerAPIv5, error) {
	v6, err := NewControllerAPIv6(ctx)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return &ControllerAPIv5{v6}, nil
}
42339
func NewConnFacade(caller base.APICaller) (ConnFacade, error) {
	facadeCaller := base.NewFacadeCaller(caller, "Agent")
	return &connFacade{
		caller: facadeCaller,
	}, nil
}
667535
func NewFacadeV6(ctx facade.Context) (*APIv6, error) {
	api, err := NewFacadeV7(ctx)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return &APIv6{api}, nil
}
685522
func NewFacade(backend Backend, res facade.Resources, auth facade.Authorizer) (*Facade, error) {
	if !auth.AuthController() {
		return nil, common.ErrPerm
	}
	return &Facade{
		backend:   backend,
		resources: res,
	}, nil
}
581209
func NewFacade(cxt *Context) *Facade {
	return &Facade{Cxt: cxt, commands: make(map[string]cli.CommandFactory)}
}
1130886
func DescribeFacades(registry *facade.Registry) []params.FacadeVersions {
	facades := registry.List()
	result := make([]params.FacadeVersions, len(facades))
	for i, f := range facades {
		result[i].Name = f.Name
		result[i].Versions = f.Versions
	}
	return result
}
257692
func NewMockFacade(ctrl *gomock.Controller) *MockFacade {
	mock := &MockFacade{ctrl: ctrl}
	mock.recorder = &MockFacadeMockRecorder{mock}
	return mock
}
830184
func NewFacade(caller base.APICaller) *Facade {
	facadeCaller := base.NewFacadeCaller(caller, apiName)
	return &Facade{facadeCaller}
}
1155155
func NewFacade(
	st *state.State,
	resources facade.Resources,
	authorizer facade.Authorizer,
) (*API, error) {
	return NewAPI(st, resources, authorizer)
}
936918
func NewFacade(apiCaller base.APICaller, claimant names.MachineTag, entity names.Tag) (Facade, error) {
	facade, err := singular.NewAPI(apiCaller, claimant, entity)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return facade, nil
}
956465
func NewFacade(
	backend Backend,
	pool Pool,
	providers ProviderRegistry,
	entityWatcher EntityWatcher,
	statusSetter StatusSetter,
	auth facade.Authorizer,
) (*Facade, error) {
	if !auth.AuthController() {
		return nil, common.ErrPerm
	}
	return &Facade{
		backend:       backend,
		pool:          pool,
		providers:     providers,
		entityWatcher: entityWatcher,
		statusSetter:  statusSetter,
	}, nil
}
147586
func NewFacade(caller base.APICaller) *Facade {
	return &Facade{
		caller: base.NewFacadeCaller(caller, "FanConfigurer"),
	}
}
699738
func NewFacadeV7(ctx facade.Context) (*ModelManagerAPI, error) {
	st := ctx.State()
	pool := ctx.StatePool()
	ctlrSt := pool.SystemState()
	auth := ctx.Auth()

	var err error
	model, err := st.Model()
	if err != nil {
		return nil, errors.Trace(err)
	}

	configGetter := stateenvirons.EnvironConfigGetter{State: st, Model: model}

	ctrlModel, err := ctlrSt.Model()
	if err != nil {
		return nil, err
	}

	return NewModelManagerAPI(
		common.NewModelManagerBackend(model, pool),
		common.NewModelManagerBackend(ctrlModel, pool),
		configGetter,
		caas.New,
		auth,
		model,
		state.CallContext(st),
	)
}