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

package v1

import (
	v1 "github.com/openshift/api/config/v1"
)

// AuditApplyConfiguration represents an declarative configuration of the Audit type for use
// with apply.
type AuditApplyConfiguration struct {
	Profile     *v1.AuditProfileType                `json:"profile,omitempty"`
	CustomRules []AuditCustomRuleApplyConfiguration `json:"customRules,omitempty"`
}

// AuditApplyConfiguration constructs an declarative configuration of the Audit type for use with
// apply.
func Audit() *AuditApplyConfiguration {
	return &AuditApplyConfiguration{}
}

// WithProfile sets the Profile 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 Profile field is set to the value of the last call.
func (b *AuditApplyConfiguration) WithProfile(value v1.AuditProfileType) *AuditApplyConfiguration {
	b.Profile = &value
	return b
}

// WithCustomRules adds the given value to the CustomRules 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 CustomRules field.
func (b *AuditApplyConfiguration) WithCustomRules(values ...*AuditCustomRuleApplyConfiguration) *AuditApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithCustomRules")
		}
		b.CustomRules = append(b.CustomRules, *values[i])
	}
	return b
}
