/*
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

import (
	batchv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/batch/v1alpha1"
)

// ReplicatedJobStatusApplyConfiguration represents a declarative configuration of the ReplicatedJobStatus type for use
// with apply.
type ReplicatedJobStatusApplyConfiguration struct {
	// Name of the replicated job.
	Name *string `json:"name,omitempty"`
	// JobStates stores the state of each volcano job created by the replicated job.
	JobStates map[string]batchv1alpha1.JobStateApplyConfiguration `json:"jobStates,omitempty"`
	// Pending is the total number of pods under the replicated job in pending state.
	Pending *int32 `json:"pending,omitempty"`
	// Running is the total number of pods under the replicated job in running state.
	Running *int32 `json:"running,omitempty"`
	// Succeeded is the total number of pods under the replicated job in succeeded state.
	Succeeded *int32 `json:"succeeded,omitempty"`
	// Failed is the total number of pods under the replicated job in failed state.
	Failed *int32 `json:"failed,omitempty"`
	// Terminating is the total number of pods under the replicated job in terminating state.
	Terminating *int32 `json:"terminating,omitempty"`
	// Unknown is the total number of pods under the replicated job in unknown state.
	Unknown *int32 `json:"unknown,omitempty"`
}

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

// WithName sets the Name 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 Name field is set to the value of the last call.
func (b *ReplicatedJobStatusApplyConfiguration) WithName(value string) *ReplicatedJobStatusApplyConfiguration {
	b.Name = &value
	return b
}

// WithJobStates puts the entries into the JobStates 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 JobStates field,
// overwriting an existing map entries in JobStates field with the same key.
func (b *ReplicatedJobStatusApplyConfiguration) WithJobStates(entries map[string]batchv1alpha1.JobStateApplyConfiguration) *ReplicatedJobStatusApplyConfiguration {
	if b.JobStates == nil && len(entries) > 0 {
		b.JobStates = make(map[string]batchv1alpha1.JobStateApplyConfiguration, len(entries))
	}
	for k, v := range entries {
		b.JobStates[k] = v
	}
	return b
}

// WithPending sets the Pending 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 Pending field is set to the value of the last call.
func (b *ReplicatedJobStatusApplyConfiguration) WithPending(value int32) *ReplicatedJobStatusApplyConfiguration {
	b.Pending = &value
	return b
}

// WithRunning sets the Running 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 Running field is set to the value of the last call.
func (b *ReplicatedJobStatusApplyConfiguration) WithRunning(value int32) *ReplicatedJobStatusApplyConfiguration {
	b.Running = &value
	return b
}

// WithSucceeded sets the Succeeded 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 Succeeded field is set to the value of the last call.
func (b *ReplicatedJobStatusApplyConfiguration) WithSucceeded(value int32) *ReplicatedJobStatusApplyConfiguration {
	b.Succeeded = &value
	return b
}

// WithFailed sets the Failed 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 Failed field is set to the value of the last call.
func (b *ReplicatedJobStatusApplyConfiguration) WithFailed(value int32) *ReplicatedJobStatusApplyConfiguration {
	b.Failed = &value
	return b
}

// WithTerminating sets the Terminating 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 Terminating field is set to the value of the last call.
func (b *ReplicatedJobStatusApplyConfiguration) WithTerminating(value int32) *ReplicatedJobStatusApplyConfiguration {
	b.Terminating = &value
	return b
}

// WithUnknown sets the Unknown 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 Unknown field is set to the value of the last call.
func (b *ReplicatedJobStatusApplyConfiguration) WithUnknown(value int32) *ReplicatedJobStatusApplyConfiguration {
	b.Unknown = &value
	return b
}
