// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1

import (
	appsv1 "github.com/openshift/api/apps/v1"
	corev1 "k8s.io/api/core/v1"
)

// DeploymentConfigSpecApplyConfiguration represents a declarative configuration of the DeploymentConfigSpec type for use
// with apply.
//
// DeploymentConfigSpec represents the desired state of the deployment.
type DeploymentConfigSpecApplyConfiguration struct {
	// strategy describes how a deployment is executed.
	Strategy *DeploymentStrategyApplyConfiguration `json:"strategy,omitempty"`
	// minReadySeconds is the minimum number of seconds for which a newly created pod should
	// be ready without any of its container crashing, for it to be considered available.
	// Defaults to 0 (pod will be considered available as soon as it is ready)
	MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
	// triggers determine how updates to a DeploymentConfig result in new deployments. If no triggers
	// are defined, a new deployment can only occur as a result of an explicit client update to the
	// DeploymentConfig with a new LatestVersion. If null, defaults to having a config change trigger.
	Triggers *appsv1.DeploymentTriggerPolicies `json:"triggers,omitempty"`
	// replicas is the number of desired replicas.
	Replicas *int32 `json:"replicas,omitempty"`
	// revisionHistoryLimit is the number of old ReplicationControllers to retain to allow for rollbacks.
	// This field is a pointer to allow for differentiation between an explicit zero and not specified.
	// Defaults to 10. (This only applies to DeploymentConfigs created via the new group API resource, not the legacy resource.)
	RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
	// test ensures that this deployment config will have zero replicas except while a deployment is running. This allows the
	// deployment config to be used as a continuous deployment test - triggering on images, running the deployment, and then succeeding
	// or failing. Post strategy hooks and After actions can be used to integrate successful deployment with an action.
	Test *bool `json:"test,omitempty"`
	// paused indicates that the deployment config is paused resulting in no new deployments on template
	// changes or changes in the template caused by other triggers.
	Paused *bool `json:"paused,omitempty"`
	// selector is a label query over pods that should match the Replicas count.
	Selector map[string]string `json:"selector,omitempty"`
	// template is the object that describes the pod that will be created if
	// insufficient replicas are detected.
	Template *corev1.PodTemplateSpec `json:"template,omitempty"`
}

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

// WithStrategy sets the Strategy 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 Strategy field is set to the value of the last call.
func (b *DeploymentConfigSpecApplyConfiguration) WithStrategy(value *DeploymentStrategyApplyConfiguration) *DeploymentConfigSpecApplyConfiguration {
	b.Strategy = value
	return b
}

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

// WithTriggers sets the Triggers 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 Triggers field is set to the value of the last call.
func (b *DeploymentConfigSpecApplyConfiguration) WithTriggers(value appsv1.DeploymentTriggerPolicies) *DeploymentConfigSpecApplyConfiguration {
	b.Triggers = &value
	return b
}

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

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

// WithTest sets the Test 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 Test field is set to the value of the last call.
func (b *DeploymentConfigSpecApplyConfiguration) WithTest(value bool) *DeploymentConfigSpecApplyConfiguration {
	b.Test = &value
	return b
}

// WithPaused sets the Paused 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 Paused field is set to the value of the last call.
func (b *DeploymentConfigSpecApplyConfiguration) WithPaused(value bool) *DeploymentConfigSpecApplyConfiguration {
	b.Paused = &value
	return b
}

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

// WithTemplate sets the Template 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 Template field is set to the value of the last call.
func (b *DeploymentConfigSpecApplyConfiguration) WithTemplate(value corev1.PodTemplateSpec) *DeploymentConfigSpecApplyConfiguration {
	b.Template = &value
	return b
}
