// Copyright (c) 2026 Tigera, Inc. All rights reserved.

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

package v3

// RuleMetadataApplyConfiguration represents a declarative configuration of the RuleMetadata type for use
// with apply.
type RuleMetadataApplyConfiguration struct {
	// Annotations is a set of key value pairs that give extra information about the rule
	Annotations map[string]string `json:"annotations,omitempty"`
}

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

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