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

package v1alpha1

import (
	configv1alpha1 "github.com/openshift/api/config/v1alpha1"
)

// RetentionPolicyApplyConfiguration represents a declarative configuration of the RetentionPolicy type for use
// with apply.
//
// RetentionPolicy defines the retention policy for retaining and deleting existing backups.
// This struct is a discriminated union that allows users to select the type of retention policy from the supported types.
type RetentionPolicyApplyConfiguration struct {
	// retentionType sets the type of retention policy.
	// Currently, the only valid policies are retention by number of backups (RetentionNumber), by the size of backups (RetentionSize). More policies or types may be added in the future.
	// Empty string means no opinion and the platform is left to choose a reasonable default which is subject to change without notice.
	// The current default is RetentionNumber with 15 backups kept.
	RetentionType *configv1alpha1.RetentionType `json:"retentionType,omitempty"`
	// retentionNumber configures the retention policy based on the number of backups
	RetentionNumber *RetentionNumberConfigApplyConfiguration `json:"retentionNumber,omitempty"`
	// retentionSize configures the retention policy based on the size of backups
	RetentionSize *RetentionSizeConfigApplyConfiguration `json:"retentionSize,omitempty"`
}

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

// WithRetentionType sets the RetentionType 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 RetentionType field is set to the value of the last call.
func (b *RetentionPolicyApplyConfiguration) WithRetentionType(value configv1alpha1.RetentionType) *RetentionPolicyApplyConfiguration {
	b.RetentionType = &value
	return b
}

// WithRetentionNumber sets the RetentionNumber 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 RetentionNumber field is set to the value of the last call.
func (b *RetentionPolicyApplyConfiguration) WithRetentionNumber(value *RetentionNumberConfigApplyConfiguration) *RetentionPolicyApplyConfiguration {
	b.RetentionNumber = value
	return b
}

// WithRetentionSize sets the RetentionSize 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 RetentionSize field is set to the value of the last call.
func (b *RetentionPolicyApplyConfiguration) WithRetentionSize(value *RetentionSizeConfigApplyConfiguration) *RetentionPolicyApplyConfiguration {
	b.RetentionSize = value
	return b
}
