//go:build !ignore_autogenerated
// +build !ignore_autogenerated

/*
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 validation-gen. DO NOT EDIT.

package v1alpha3

import (
	context "context"
	fmt "fmt"

	resourcev1alpha3 "k8s.io/api/resource/v1alpha3"
	equality "k8s.io/apimachinery/pkg/api/equality"
	operation "k8s.io/apimachinery/pkg/api/operation"
	safe "k8s.io/apimachinery/pkg/api/safe"
	validate "k8s.io/apimachinery/pkg/api/validate"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	runtime "k8s.io/apimachinery/pkg/runtime"
	sets "k8s.io/apimachinery/pkg/util/sets"
	field "k8s.io/apimachinery/pkg/util/validation/field"
)

func init() { localSchemeBuilder.Register(RegisterValidations) }

// RegisterValidations adds validation functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterValidations(scheme *runtime.Scheme) error {
	// type DeviceTaintRule
	scheme.AddValidationFunc((*resourcev1alpha3.DeviceTaintRule)(nil), func(ctx context.Context, op operation.Operation, obj, oldObj interface{}) field.ErrorList {
		switch op.Request.SubresourcePath() {
		case "/":
			return Validate_DeviceTaintRule(ctx, op, nil /* fldPath */, obj.(*resourcev1alpha3.DeviceTaintRule), safe.Cast[*resourcev1alpha3.DeviceTaintRule](oldObj))
		}
		return field.ErrorList{field.InternalError(nil, fmt.Errorf("no validation found for %T, subresource: %v", obj, op.Request.SubresourcePath()))}
	})
	// type ResourcePoolStatusRequest
	scheme.AddValidationFunc((*resourcev1alpha3.ResourcePoolStatusRequest)(nil), func(ctx context.Context, op operation.Operation, obj, oldObj interface{}) field.ErrorList {
		switch op.Request.SubresourcePath() {
		case "/", "/status":
			return Validate_ResourcePoolStatusRequest(ctx, op, nil /* fldPath */, obj.(*resourcev1alpha3.ResourcePoolStatusRequest), safe.Cast[*resourcev1alpha3.ResourcePoolStatusRequest](oldObj))
		}
		return field.ErrorList{field.InternalError(nil, fmt.Errorf("no validation found for %T, subresource: %v", obj, op.Request.SubresourcePath()))}
	})
	return nil
}

// Validate_DeviceTaint validates an instance of DeviceTaint according
// to declarative validation rules in the API schema.
func Validate_DeviceTaint(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1alpha3.DeviceTaint) (errs field.ErrorList) {
	// field resourcev1alpha3.DeviceTaint.Key has no validation
	// field resourcev1alpha3.DeviceTaint.Value has no validation

	// field resourcev1alpha3.DeviceTaint.Effect
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *resourcev1alpha3.DeviceTaintEffect, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			// call the type's validation function
			errs = append(errs, Validate_DeviceTaintEffect(ctx, op, fldPath, obj, oldObj)...)
			return
		}(fldPath.Child("effect"), &obj.Effect, safe.Field(oldObj, func(oldObj *resourcev1alpha3.DeviceTaint) *resourcev1alpha3.DeviceTaintEffect { return &oldObj.Effect }), oldObj != nil)...)

	// field resourcev1alpha3.DeviceTaint.TimeAdded has no validation
	return errs
}

var symbolsForDeviceTaintEffect = sets.New(resourcev1alpha3.DeviceTaintEffectNoExecute, resourcev1alpha3.DeviceTaintEffectNoSchedule, resourcev1alpha3.DeviceTaintEffectNone)

// Validate_DeviceTaintEffect validates an instance of DeviceTaintEffect according
// to declarative validation rules in the API schema.
func Validate_DeviceTaintEffect(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1alpha3.DeviceTaintEffect) (errs field.ErrorList) {
	errs = append(errs, validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTaintEffect, nil)...)

	return errs
}

// Validate_DeviceTaintRule validates an instance of DeviceTaintRule according
// to declarative validation rules in the API schema.
func Validate_DeviceTaintRule(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1alpha3.DeviceTaintRule) (errs field.ErrorList) {
	// field resourcev1alpha3.DeviceTaintRule.TypeMeta has no validation
	// field resourcev1alpha3.DeviceTaintRule.ObjectMeta has no validation

	// field resourcev1alpha3.DeviceTaintRule.Spec
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *resourcev1alpha3.DeviceTaintRuleSpec, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
				return nil
			}
			// call the type's validation function
			errs = append(errs, Validate_DeviceTaintRuleSpec(ctx, op, fldPath, obj, oldObj)...)
			return
		}(fldPath.Child("spec"), &obj.Spec, safe.Field(oldObj, func(oldObj *resourcev1alpha3.DeviceTaintRule) *resourcev1alpha3.DeviceTaintRuleSpec {
			return &oldObj.Spec
		}), oldObj != nil)...)

	// field resourcev1alpha3.DeviceTaintRule.Status has no validation
	return errs
}

// Validate_DeviceTaintRuleSpec validates an instance of DeviceTaintRuleSpec according
// to declarative validation rules in the API schema.
func Validate_DeviceTaintRuleSpec(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1alpha3.DeviceTaintRuleSpec) (errs field.ErrorList) {
	// field resourcev1alpha3.DeviceTaintRuleSpec.DeviceSelector has no validation

	// field resourcev1alpha3.DeviceTaintRuleSpec.Taint
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *resourcev1alpha3.DeviceTaint, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
				return nil
			}
			// call the type's validation function
			errs = append(errs, Validate_DeviceTaint(ctx, op, fldPath, obj, oldObj)...)
			return
		}(fldPath.Child("taint"), &obj.Taint, safe.Field(oldObj, func(oldObj *resourcev1alpha3.DeviceTaintRuleSpec) *resourcev1alpha3.DeviceTaint { return &oldObj.Taint }), oldObj != nil)...)

	return errs
}

// Validate_PoolStatus validates an instance of PoolStatus according
// to declarative validation rules in the API schema.
func Validate_PoolStatus(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1alpha3.PoolStatus) (errs field.ErrorList) {
	// field resourcev1alpha3.PoolStatus.Driver
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *string, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
			return
		}(fldPath.Child("driver"), &obj.Driver, safe.Field(oldObj, func(oldObj *resourcev1alpha3.PoolStatus) *string { return &oldObj.Driver }), oldObj != nil)...)

	// field resourcev1alpha3.PoolStatus.PoolName
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *string, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.ResourcePoolName(ctx, op, fldPath, obj, oldObj)...)
			return
		}(fldPath.Child("poolName"), &obj.PoolName, safe.Field(oldObj, func(oldObj *resourcev1alpha3.PoolStatus) *string { return &oldObj.PoolName }), oldObj != nil)...)

	// field resourcev1alpha3.PoolStatus.Generation
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *int64, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
			return
		}(fldPath.Child("generation"), &obj.Generation, safe.Field(oldObj, func(oldObj *resourcev1alpha3.PoolStatus) *int64 { return &oldObj.Generation }), oldObj != nil)...)

	// field resourcev1alpha3.PoolStatus.ResourceSliceCount
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 1)...)
			return
		}(fldPath.Child("resourceSliceCount"), obj.ResourceSliceCount, safe.Field(oldObj, func(oldObj *resourcev1alpha3.PoolStatus) *int32 { return oldObj.ResourceSliceCount }), oldObj != nil)...)

	// field resourcev1alpha3.PoolStatus.TotalDevices
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
			return
		}(fldPath.Child("totalDevices"), obj.TotalDevices, safe.Field(oldObj, func(oldObj *resourcev1alpha3.PoolStatus) *int32 { return oldObj.TotalDevices }), oldObj != nil)...)

	// field resourcev1alpha3.PoolStatus.AllocatedDevices
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
			return
		}(fldPath.Child("allocatedDevices"), obj.AllocatedDevices, safe.Field(oldObj, func(oldObj *resourcev1alpha3.PoolStatus) *int32 { return oldObj.AllocatedDevices }), oldObj != nil)...)

	// field resourcev1alpha3.PoolStatus.AvailableDevices
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
			return
		}(fldPath.Child("availableDevices"), obj.AvailableDevices, safe.Field(oldObj, func(oldObj *resourcev1alpha3.PoolStatus) *int32 { return oldObj.AvailableDevices }), oldObj != nil)...)

	// field resourcev1alpha3.PoolStatus.UnavailableDevices
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
			return
		}(fldPath.Child("unavailableDevices"), obj.UnavailableDevices, safe.Field(oldObj, func(oldObj *resourcev1alpha3.PoolStatus) *int32 { return oldObj.UnavailableDevices }), oldObj != nil)...)

	// field resourcev1alpha3.PoolStatus.NodeName
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *string, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.LongName(ctx, op, fldPath, obj, oldObj)...)
			return
		}(fldPath.Child("nodeName"), obj.NodeName, safe.Field(oldObj, func(oldObj *resourcev1alpha3.PoolStatus) *string { return oldObj.NodeName }), oldObj != nil)...)

	// field resourcev1alpha3.PoolStatus.ValidationError
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *string, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.MaxBytes(ctx, op, fldPath, obj, oldObj, 256)...)
			return
		}(fldPath.Child("validationError"), obj.ValidationError, safe.Field(oldObj, func(oldObj *resourcev1alpha3.PoolStatus) *string { return oldObj.ValidationError }), oldObj != nil)...)

	return errs
}

// Validate_ResourcePoolStatusRequest validates an instance of ResourcePoolStatusRequest according
// to declarative validation rules in the API schema.
func Validate_ResourcePoolStatusRequest(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1alpha3.ResourcePoolStatusRequest) (errs field.ErrorList) {
	// field resourcev1alpha3.ResourcePoolStatusRequest.TypeMeta has no validation
	// field resourcev1alpha3.ResourcePoolStatusRequest.ObjectMeta has no validation

	// field resourcev1alpha3.ResourcePoolStatusRequest.Spec
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *resourcev1alpha3.ResourcePoolStatusRequestSpec, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.Immutable(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			// call the type's validation function
			errs = append(errs, Validate_ResourcePoolStatusRequestSpec(ctx, op, fldPath, obj, oldObj)...)
			return
		}(fldPath.Child("spec"), &obj.Spec, safe.Field(oldObj, func(oldObj *resourcev1alpha3.ResourcePoolStatusRequest) *resourcev1alpha3.ResourcePoolStatusRequestSpec {
			return &oldObj.Spec
		}), oldObj != nil)...)

	// field resourcev1alpha3.ResourcePoolStatusRequest.Status
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *resourcev1alpha3.ResourcePoolStatusRequestStatus, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			// call the type's validation function
			errs = append(errs, Validate_ResourcePoolStatusRequestStatus(ctx, op, fldPath, obj, oldObj)...)
			return
		}(fldPath.Child("status"), obj.Status, safe.Field(oldObj, func(oldObj *resourcev1alpha3.ResourcePoolStatusRequest) *resourcev1alpha3.ResourcePoolStatusRequestStatus {
			return oldObj.Status
		}), oldObj != nil)...)

	return errs
}

// Validate_ResourcePoolStatusRequestSpec validates an instance of ResourcePoolStatusRequestSpec according
// to declarative validation rules in the API schema.
func Validate_ResourcePoolStatusRequestSpec(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1alpha3.ResourcePoolStatusRequestSpec) (errs field.ErrorList) {
	// field resourcev1alpha3.ResourcePoolStatusRequestSpec.Driver
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *string, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj)...)
			return
		}(fldPath.Child("driver"), &obj.Driver, safe.Field(oldObj, func(oldObj *resourcev1alpha3.ResourcePoolStatusRequestSpec) *string { return &oldObj.Driver }), oldObj != nil)...)

	// field resourcev1alpha3.ResourcePoolStatusRequestSpec.PoolName
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *string, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.ResourcePoolName(ctx, op, fldPath, obj, oldObj)...)
			return
		}(fldPath.Child("poolName"), obj.PoolName, safe.Field(oldObj, func(oldObj *resourcev1alpha3.ResourcePoolStatusRequestSpec) *string { return oldObj.PoolName }), oldObj != nil)...)

	// field resourcev1alpha3.ResourcePoolStatusRequestSpec.Limit
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			// optional fields with default values are effectively required
			if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.Maximum(ctx, op, fldPath, obj, oldObj, 1000)...)
			errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 1)...)
			return
		}(fldPath.Child("limit"), obj.Limit, safe.Field(oldObj, func(oldObj *resourcev1alpha3.ResourcePoolStatusRequestSpec) *int32 { return oldObj.Limit }), oldObj != nil)...)

	return errs
}

// Validate_ResourcePoolStatusRequestStatus validates an instance of ResourcePoolStatusRequestStatus according
// to declarative validation rules in the API schema.
func Validate_ResourcePoolStatusRequestStatus(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *resourcev1alpha3.ResourcePoolStatusRequestStatus) (errs field.ErrorList) {
	// field resourcev1alpha3.ResourcePoolStatusRequestStatus.PoolCount
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
			return
		}(fldPath.Child("poolCount"), obj.PoolCount, safe.Field(oldObj, func(oldObj *resourcev1alpha3.ResourcePoolStatusRequestStatus) *int32 { return oldObj.PoolCount }), oldObj != nil)...)

	// field resourcev1alpha3.ResourcePoolStatusRequestStatus.Pools
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj []resourcev1alpha3.PoolStatus, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 1000); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			// iterate the list and call the type's validation function
			errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_PoolStatus)...)
			return
		}(fldPath.Child("pools"), obj.Pools, safe.Field(oldObj, func(oldObj *resourcev1alpha3.ResourcePoolStatusRequestStatus) []resourcev1alpha3.PoolStatus {
			return oldObj.Pools
		}), oldObj != nil)...)

	// field resourcev1alpha3.ResourcePoolStatusRequestStatus.Conditions
	errs = append(errs,
		func(fldPath *field.Path, obj, oldObj []v1.Condition, oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) {
				return nil
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 10); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			// lists with map semantics require unique keys
			errs = append(errs, validate.Unique(ctx, op, fldPath, obj, oldObj, func(a v1.Condition, b v1.Condition) bool { return a.Type == b.Type })...)
			return
		}(fldPath.Child("conditions"), obj.Conditions, safe.Field(oldObj, func(oldObj *resourcev1alpha3.ResourcePoolStatusRequestStatus) []v1.Condition {
			return oldObj.Conditions
		}), oldObj != nil)...)

	return errs
}
