/*
Copyright The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

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

package v1alpha1

import (
	metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
	apixv1alpha1 "sigs.k8s.io/gateway-api-inference-extension/apix/v1alpha1"
	v1 "sigs.k8s.io/gateway-api-inference-extension/client-go/applyconfiguration/api/v1"
)

// ImportControllerApplyConfiguration represents a declarative configuration of the ImportController type for use
// with apply.
//
// ImportController defines a controller that is responsible for managing the InferencePoolImport.
type ImportControllerApplyConfiguration struct {
	// Name is a domain/path string that indicates the name of the controller that manages the
	// InferencePoolImport. Name corresponds to the GatewayClass controllerName field when the
	// controller will manage parents of type "Gateway". Otherwise, the name is implementation-specific.
	//
	// Example: "example.net/import-controller".
	//
	// The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes
	// names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
	//
	// A controller MUST populate this field when writing status and ensure that entries to status
	// populated with their controller name are removed when they are no longer necessary.
	Name *apixv1alpha1.ControllerName `json:"name,omitempty"`
	// ExportingClusters is a list of clusters that exported the InferencePool(s) that back the
	// InferencePoolImport. Required when the controller is responsible for CRUD'ing the InferencePoolImport
	// from the exported InferencePool(s).
	ExportingClusters []ExportingClusterApplyConfiguration `json:"exportingClusters,omitempty"`
	// Parents is a list of parent resources, typically Gateways, that are associated with the
	// InferencePoolImport, and the status of the InferencePoolImport with respect to each parent.
	//
	// Ancestor would be a more accurate name, but Parent is consistent with InferencePool terminology.
	//
	// Required when the controller manages the InferencePoolImport as an HTTPRoute backendRef. The controller
	// must add an entry for each parent it manages and remove the parent entry when the controller no longer
	// considers the InferencePoolImport to be associated with that parent.
	Parents []v1.ParentStatusApplyConfiguration `json:"parents,omitempty"`
	// Conditions track the state of the InferencePoolImport.
	//
	// Known condition types are:
	//
	// * "Accepted"
	Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}

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

// WithName sets the Name 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 Name field is set to the value of the last call.
func (b *ImportControllerApplyConfiguration) WithName(value apixv1alpha1.ControllerName) *ImportControllerApplyConfiguration {
	b.Name = &value
	return b
}

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

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

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