// SetStage replaces a stage if it already exists
962688
func (p *Pipeline) SetStage(newStage *Stage) {
	for i, stage := range p.Stages {
		if stage.Name == newStage.Name {
			p.Stages[i] = newStage
			return
		}
	}
	p.AddStage(newStage)
}
1273675
func (s *FailureDetails) SetFailureStage(v string) *FailureDetails {
	s.FailureStage = &v
	return s
}
1011871
func (s *GetStagesOutput) SetItem(v []*Stage) *GetStagesOutput {
	s.Item = v
	return s
}
499689
func (s *StageState) SetStageName(v string) *StageState {
	s.StageName = &v
	return s
}
632871
func (s *H264Settings) SetLevel(v string) *H264Settings {
	s.Level = &v
	return s
}
1246238
func (s *DisableStageTransitionInput) SetStageName(v string) *DisableStageTransitionInput {
	s.StageName = &v
	return s
}
63334
func SetEnv(e Environment) {
	if e != DEV && e != STAGE && e != PROD {
		internalLog.Warn("could not set unknown environment value, ignoring")
		return
	}
	if e != GetEnv() {
		internalLog.
			WithField("prevEnv", GetEnv()).
			WithField("newEnv", e).
			Warn("Setting a new environment")
	}
	if e == PROD {
		Logger.Level = log.InfoLevel
		enableDebug = false
	} else {
		enableDebug = true
		Logger.Level = log.DebugLevel
	}
	atomic.StoreInt32(currentEnvironment, int32(e))
}
1133358
func addStage1ImageFlags(flags *pflag.FlagSet) {
	for _, data := range stage1FlagsData {
		wrapper := &stage1ImageLocationFlag{
			loc:  &overriddenStage1Location,
			kind: data.kind,
		}
		flags.Var(wrapper, data.flag, data.help)
	}
}
136029
func (s *PipelineContext) SetStage(v *StageContext) *PipelineContext {
	s.Stage = v
	return s
}
489991
func (s *ApiStage) SetStage(v string) *ApiStage {
	s.Stage = &v
	return s
}
157268
func (s *LoggingOptions) SetLevel(v string) *LoggingOptions {
	s.Level = &v
	return s
}
591346
func (s *GetTemplateInput) SetTemplateStage(v string) *GetTemplateInput {
	s.TemplateStage = &v
	return s
}
440429
func (s *CreateDeploymentInput) SetStageName(v string) *CreateDeploymentInput {
	s.StageName = &v
	return s
}
1312023
func CurrentStage(s []Stage) (*Stage, error) {
	if len(s) == 0 {
		return nil, errors.New("No build stage in current context")
	}
	return &s[len(s)-1], nil
}
1195171
func (s *Build) SetPhases(v []*BuildPhase) *Build {
	s.Phases = v
	return s
}
725722
func (s *PutSecretValueOutput) SetVersionStages(v []*string) *PutSecretValueOutput {
	s.VersionStages = v
	return s
}
974041
func (s *UpdateEnvironmentInput) SetTier(v *EnvironmentTier) *UpdateEnvironmentInput {
	s.Tier = v
	return s
}