/*
Copyright The Volcano Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1alpha1

// JobFlowStatusApplyConfiguration represents a declarative configuration of the JobFlowStatus type for use
// with apply.
//
// JobFlowStatus defines the observed state of JobFlow
type JobFlowStatusApplyConfiguration struct {
	PendingJobs    []string                               `json:"pendingJobs,omitempty"`
	RunningJobs    []string                               `json:"runningJobs,omitempty"`
	FailedJobs     []string                               `json:"failedJobs,omitempty"`
	CompletedJobs  []string                               `json:"completedJobs,omitempty"`
	TerminatedJobs []string                               `json:"terminatedJobs,omitempty"`
	UnKnowJobs     []string                               `json:"unKnowJobs,omitempty"`
	JobStatusList  []JobStatusApplyConfiguration          `json:"jobStatusList,omitempty"`
	Conditions     map[string]ConditionApplyConfiguration `json:"conditions,omitempty"`
	State          *StateApplyConfiguration               `json:"state,omitempty"`
}

// JobFlowStatusApplyConfiguration constructs a declarative configuration of the JobFlowStatus type for use with
// apply.
func JobFlowStatus() *JobFlowStatusApplyConfiguration {
	return &JobFlowStatusApplyConfiguration{}
}

// WithPendingJobs adds the given value to the PendingJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the PendingJobs field.
func (b *JobFlowStatusApplyConfiguration) WithPendingJobs(values ...string) *JobFlowStatusApplyConfiguration {
	for i := range values {
		b.PendingJobs = append(b.PendingJobs, values[i])
	}
	return b
}

// WithRunningJobs adds the given value to the RunningJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the RunningJobs field.
func (b *JobFlowStatusApplyConfiguration) WithRunningJobs(values ...string) *JobFlowStatusApplyConfiguration {
	for i := range values {
		b.RunningJobs = append(b.RunningJobs, values[i])
	}
	return b
}

// WithFailedJobs adds the given value to the FailedJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the FailedJobs field.
func (b *JobFlowStatusApplyConfiguration) WithFailedJobs(values ...string) *JobFlowStatusApplyConfiguration {
	for i := range values {
		b.FailedJobs = append(b.FailedJobs, values[i])
	}
	return b
}

// WithCompletedJobs adds the given value to the CompletedJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the CompletedJobs field.
func (b *JobFlowStatusApplyConfiguration) WithCompletedJobs(values ...string) *JobFlowStatusApplyConfiguration {
	for i := range values {
		b.CompletedJobs = append(b.CompletedJobs, values[i])
	}
	return b
}

// WithTerminatedJobs adds the given value to the TerminatedJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the TerminatedJobs field.
func (b *JobFlowStatusApplyConfiguration) WithTerminatedJobs(values ...string) *JobFlowStatusApplyConfiguration {
	for i := range values {
		b.TerminatedJobs = append(b.TerminatedJobs, values[i])
	}
	return b
}

// WithUnKnowJobs adds the given value to the UnKnowJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the UnKnowJobs field.
func (b *JobFlowStatusApplyConfiguration) WithUnKnowJobs(values ...string) *JobFlowStatusApplyConfiguration {
	for i := range values {
		b.UnKnowJobs = append(b.UnKnowJobs, values[i])
	}
	return b
}

// WithJobStatusList adds the given value to the JobStatusList field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the JobStatusList field.
func (b *JobFlowStatusApplyConfiguration) WithJobStatusList(values ...*JobStatusApplyConfiguration) *JobFlowStatusApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithJobStatusList")
		}
		b.JobStatusList = append(b.JobStatusList, *values[i])
	}
	return b
}

// WithConditions puts the entries into the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Conditions field,
// overwriting an existing map entries in Conditions field with the same key.
func (b *JobFlowStatusApplyConfiguration) WithConditions(entries map[string]ConditionApplyConfiguration) *JobFlowStatusApplyConfiguration {
	if b.Conditions == nil && len(entries) > 0 {
		b.Conditions = make(map[string]ConditionApplyConfiguration, len(entries))
	}
	for k, v := range entries {
		b.Conditions[k] = v
	}
	return b
}

// WithState sets the State field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the State field is set to the value of the last call.
func (b *JobFlowStatusApplyConfiguration) WithState(value *StateApplyConfiguration) *JobFlowStatusApplyConfiguration {
	b.State = value
	return b
}
