/*
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 v1

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

// ParentStatusApplyConfiguration represents a declarative configuration of the ParentStatus type for use
// with apply.
//
// ParentStatus defines the observed state of InferencePool from a Parent, i.e. Gateway.
type ParentStatusApplyConfiguration struct {
	// Conditions is a list of status conditions that provide information about the observed
	// state of the InferencePool. This field is required to be set by the controller that
	// manages the InferencePool.
	//
	// Supported condition types are:
	//
	// * "Accepted"
	// * "ResolvedRefs"
	Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
	// ParentRef is used to identify the parent resource that this status
	// is associated with. It is used to match the InferencePool with the parent
	// resource, such as a Gateway.
	ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"`
	// ControllerName is a domain/path string that indicates the name of the controller that
	// wrote this status. This corresponds with the GatewayClass controllerName field when the
	// parentRef references a Gateway kind.
	//
	// Example: "example.net/gateway-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
	//
	// Controllers MAY populate this field when writing status. When populating this field, controllers
	// should ensure that entries to status populated with their ControllerName are cleaned up when they
	// are no longer necessary.
	ControllerName *apiv1.ControllerName `json:"controllerName,omitempty"`
}

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

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

// WithParentRef sets the ParentRef 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 ParentRef field is set to the value of the last call.
func (b *ParentStatusApplyConfiguration) WithParentRef(value *ParentReferenceApplyConfiguration) *ParentStatusApplyConfiguration {
	b.ParentRef = value
	return b
}

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