// NewParallelState returns a "ParallelState" with the supplied
// information
761711
func NewParallelState(parallelStateName string, states StateMachine) *ParallelState {
	return &ParallelState{
		baseInnerState: baseInnerState{
			name: parallelStateName,
			id:   rand.Int63(),
		},
		States: states,
	}
}
1059473
func NewMetadataState(db DB, machine, series string) (*Metadata, error) {
	// hostname could be derived from the model...
	hostname, err := os.Hostname()
	if err != nil {
		// If os.Hostname() is not working, something is woefully wrong.
		// Run for the hills.
		return nil, errors.Annotate(err, "could not get hostname (system unstable?)")
	}

	meta := NewMetadata()
	meta.Origin.Model = db.ModelTag().Id()
	meta.Origin.Machine = machine
	meta.Origin.Hostname = hostname
	meta.Origin.Series = series

	si, err := db.StateServingInfo()
	if err != nil {
		return nil, errors.Annotate(err, "could not get server secrets")
	}
	controllerCfg, err := db.ControllerConfig()
	if err != nil {
		return nil, errors.Annotate(err, "could not get controller config")
	}
	meta.CACert, _ = controllerCfg.CACert()
	meta.CAPrivateKey = si.CAPrivateKey
	return meta, nil
}
1354635
func NewWaitDelayState(stateName string, delay time.Duration) *WaitDelay {
	return &WaitDelay{
		baseInnerState: baseInnerState{
			name: stateName,
			id:   rand.Int63(),
		},
		delay: delay,
	}
}
859157
func New() (State, error) {
	state := &FusisState{
		services:     Services{},
		destinations: Destinations{},
	}

	return state, nil
}
1035503
func New(st *state.State, res facade.Resources, _ facade.Authorizer) (*API, error) {
	setter := common.NewStatusSetter(&common.UnitAgentFinder{st}, common.AuthAlways())
	return &API{
		st:           st,
		res:          res,
		statusSetter: setter,
	}, nil
}
426822
func (s *FlinkApplicationConfiguration) SetParallelismConfiguration(v *ParallelismConfiguration) *FlinkApplicationConfiguration {
	s.ParallelismConfiguration = v
	return s
}
319675
func (m *MockProviderClient) UpgradeResourceState(arg0 context.Context, arg1 *tfplugin5.UpgradeResourceState_Request, arg2 ...grpc.CallOption) (*tfplugin5.UpgradeResourceState_Response, error) {
	m.ctrl.T.Helper()
	varargs := []interface{}{arg0, arg1}
	for _, a := range arg2 {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "UpgradeResourceState", varargs...)
	ret0, _ := ret[0].(*tfplugin5.UpgradeResourceState_Response)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
966421
func NewState(opts ...Options) *LState {
	var ls *LState
	if len(opts) == 0 {
		ls = newLState(Options{
			CallStackSize: CallStackSize,
			RegistrySize:  RegistrySize,
		})
		ls.OpenLibs()
	} else {
		if opts[0].CallStackSize < 1 {
			opts[0].CallStackSize = CallStackSize
		}
		if opts[0].RegistrySize < 128 {
			opts[0].RegistrySize = RegistrySize
		}
		ls = newLState(opts[0])
		if !opts[0].SkipOpenLibs {
			ls.OpenLibs()
		}
	}
	return ls
}
532865
func newUniverse() *universeScope {
	sc := &universeScope{&Scope{nil, 0}, make(map[string]*Scope)}
	sc.block = &block{
		offset: 0,
		scope:  sc.Scope,
		global: true,
		defs:   make(map[string]Def),
	}
	return sc
}
845298
func (ps *ParallelState) MarshalJSON() ([]byte, error) {
	/*
		A state in a Parallel state branch “States” field MUST NOT have a “Next” field that targets a field outside of that “States” field. A state MUST NOT have a “Next” field which matches a state name inside a Parallel state branch’s “States” field unless it is also inside the same “States” field.

		Put another way, states in a branch’s “States” field can transition only to each other, and no state outside of that “States” field can transition into it.
	*/
	additionalParams := make(map[string]interface{})
	if ps.ResultPath != "" {
		additionalParams["ResultPath"] = ps.ResultPath
	}
	if len(ps.Retriers) != 0 {
		additionalParams["Retry"] = ps.Retriers
	}
	if ps.Catchers != nil {
		additionalParams["Catch"] = ps.Catchers
	}
	return ps.marshalStateJSON("Parallel", additionalParams)
}
694701
func NewState(caller base.APICaller) (*State, error) {
	facadeCaller := base.NewFacadeCaller(caller, storageProvisionerFacade)
	return &State{facadeCaller}, nil
}
886321
func NewReceivedTaskState(signature *Signature) *TaskState {
	return &TaskState{
		TaskUUID: signature.UUID,
		State:    StateReceived,
	}
}
454217
func ParallelBackends(nBackends uint) ClientParam {
	return func(cl *Client) error {
		if cl.backendParams == nil {
			return ErrClientNotNetworked
		}
		cl.nBackends = nBackends
		return nil
	}
}
801719
func (s *ParallelismConfigurationUpdate) SetParallelismUpdate(v int64) *ParallelismConfigurationUpdate {
	s.ParallelismUpdate = &v
	return s
}
535906
func NewRealStatefulSetStatusUpdater(
	client clientset.Interface,
	setLister appslisters.StatefulSetLister) StatefulSetStatusUpdaterInterface {
	return &realStatefulSetStatusUpdater{client, setLister}
}
361713
func (s *ParallelismConfiguration) SetParallelism(v int64) *ParallelismConfiguration {
	s.Parallelism = &v
	return s
}
1155914
func (s *FlinkApplicationConfigurationDescription) SetParallelismConfigurationDescription(v *ParallelismConfigurationDescription) *FlinkApplicationConfigurationDescription {
	s.ParallelismConfigurationDescription = v
	return s
}