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

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

package v3

import (
	projectcalicov3 "github.com/projectcalico/api/pkg/apis/projectcalico/v3"
)

// AutoHostEndpointConfigApplyConfiguration represents a declarative configuration of the AutoHostEndpointConfig type for use
// with apply.
type AutoHostEndpointConfigApplyConfiguration struct {
	// AutoCreate enables automatic creation of host endpoints for every node. [Default: Disabled]
	// Valid values are: "Enabled", "Disabled".
	AutoCreate                *string                                  `json:"autoCreate,omitempty"`
	CreateDefaultHostEndpoint *projectcalicov3.DefaultHostEndpointMode `json:"createDefaultHostEndpoint,omitempty"`
	// Templates contains definition for creating AutoHostEndpoints
	Templates []TemplateApplyConfiguration `json:"templates,omitempty"`
}

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

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

// WithCreateDefaultHostEndpoint sets the CreateDefaultHostEndpoint 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 CreateDefaultHostEndpoint field is set to the value of the last call.
func (b *AutoHostEndpointConfigApplyConfiguration) WithCreateDefaultHostEndpoint(value projectcalicov3.DefaultHostEndpointMode) *AutoHostEndpointConfigApplyConfiguration {
	b.CreateDefaultHostEndpoint = &value
	return b
}

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