//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"
	resource "k8s.io/apimachinery/pkg/api/resource"
	safe "k8s.io/apimachinery/pkg/api/safe"
	validate "k8s.io/apimachinery/pkg/api/validate"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
	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 "/", "/status":
				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
		fn := func(
			fldPath *field.Path,
			obj, oldObj *resourcev1alpha3.DeviceTaintEffect,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkBeta().MarkShortCircuit(); 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
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.DeviceTaint) *resourcev1alpha3.DeviceTaintEffect {
				return &oldObj.Effect
			})
		errs = append(errs, fn(fldPath.Child("effect"), &obj.Effect, oldVal, 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) {

	if e := validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTaintEffect, nil).MarkBeta(); len(e) != 0 {
		errs = append(errs, e...)
	}

	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
		fn := func(
			fldPath *field.Path,
			obj, oldObj *v1.ObjectMeta,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if equality.Semantic.DeepEqual(obj, oldObj) {
					return nil
				}
			}
			// call the type's validation function
			errs = append(errs, validation.Validate_ObjectMeta(ctx, op, fldPath, obj, oldObj)...)
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.DeviceTaintRule) *v1.ObjectMeta {
				return &oldObj.ObjectMeta
			})
		errs = append(errs, fn(fldPath.Child("metadata"), &obj.ObjectMeta, oldVal, oldObj != nil)...)
	}

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

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

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

	return errs
}

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

	{ // field resourcev1alpha3.DeviceTaintRuleStatus.Conditions
		fn := func(
			fldPath *field.Path,
			obj, oldObj []v1.Condition,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if equality.Semantic.DeepEqual(obj, oldObj) {
					return nil
				}
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			// lists with map semantics require unique keys
			if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj,
				func(a *v1.Condition, b *v1.Condition) bool { return a.Type == b.Type }).MarkAlpha(); len(e) != 0 {
				errs = append(errs, e...)
			}
			// iterate the list and call the type's validation function
			if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj,
				func(a *v1.Condition, b *v1.Condition) bool { return a.Type == b.Type }, validate.SemanticDeepEqual, validation.Validate_Condition); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.DeviceTaintRuleStatus) []v1.Condition {
				return oldObj.Conditions
			})
		errs = append(errs, fn(fldPath.Child("conditions"), obj.Conditions, oldVal, oldObj != nil)...)
	}

	return errs
}

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

	{ // field resourcev1alpha3.PartitionTypeStatus.Attribute
		fn := func(
			fldPath *field.Path,
			obj, oldObj *string,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.PartitionTypeStatus) *string {
				return &oldObj.Attribute
			})
		errs = append(errs, fn(fldPath.Child("attribute"), &obj.Attribute, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.PartitionTypeStatus.Type
		fn := func(
			fldPath *field.Path,
			obj, oldObj *string,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.PartitionTypeStatus) *string {
				return &oldObj.Type
			})
		errs = append(errs, fn(fldPath.Child("type"), &obj.Type, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.PartitionTypeStatus.Total
		fn := func(
			fldPath *field.Path,
			obj, oldObj *int32,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 0); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.PartitionTypeStatus) *int32 {
				return oldObj.Total
			})
		errs = append(errs, fn(fldPath.Child("total"), obj.Total, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.PartitionTypeStatus.Allocatable
		fn := func(
			fldPath *field.Path,
			obj, oldObj *int32,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 0); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.PartitionTypeStatus) *int32 {
				return oldObj.Allocatable
			})
		errs = append(errs, fn(fldPath.Child("allocatable"), obj.Allocatable, oldVal, 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
		fn := func(
			fldPath *field.Path,
			obj, oldObj *string,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			if e := validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.PoolStatus) *string {
				return &oldObj.Driver
			})
		errs = append(errs, fn(fldPath.Child("driver"), &obj.Driver, oldVal, oldObj != nil)...)
	}

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

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

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

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

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

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

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

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

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

	{ // field resourcev1alpha3.PoolStatus.PartitionSummary
		fn := func(
			fldPath *field.Path,
			obj, oldObj []resourcev1alpha3.PartitionTypeStatus,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if equality.Semantic.DeepEqual(obj, oldObj) {
					return nil
				}
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			// lists with map semantics require unique keys
			if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj,
				func(a *resourcev1alpha3.PartitionTypeStatus, b *resourcev1alpha3.PartitionTypeStatus) bool {
					return a.Attribute == b.Attribute && a.Type == b.Type
				}); len(e) != 0 {
				errs = append(errs, e...)
			}
			// iterate the list and call the type's validation function
			if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj,
				func(a *resourcev1alpha3.PartitionTypeStatus, b *resourcev1alpha3.PartitionTypeStatus) bool {
					return a.Attribute == b.Attribute && a.Type == b.Type
				}, validate.SemanticDeepEqual, Validate_PartitionTypeStatus); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.PoolStatus) []resourcev1alpha3.PartitionTypeStatus {
				return oldObj.PartitionSummary
			})
		errs = append(errs, fn(fldPath.Child("partitionSummary"), obj.PartitionSummary, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.PoolStatus.ShareableSummary
		fn := func(
			fldPath *field.Path,
			obj, oldObj *resourcev1alpha3.ShareableSummaryStatus,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if equality.Semantic.DeepEqual(obj, oldObj) {
					return nil
				}
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			// call the type's validation function
			errs = append(errs, Validate_ShareableSummaryStatus(ctx, op, fldPath, obj, oldObj)...)
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.PoolStatus) *resourcev1alpha3.ShareableSummaryStatus {
				return oldObj.ShareableSummary
			})
		errs = append(errs, fn(fldPath.Child("shareableSummary"), obj.ShareableSummary, oldVal, 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
		fn := func(
			fldPath *field.Path,
			obj, oldObj *v1.ObjectMeta,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if equality.Semantic.DeepEqual(obj, oldObj) {
					return nil
				}
			}
			// call the type's validation function
			errs = append(errs, validation.Validate_ObjectMeta(ctx, op, fldPath, obj, oldObj)...)
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ResourcePoolStatusRequest) *v1.ObjectMeta {
				return &oldObj.ObjectMeta
			})
		errs = append(errs, fn(fldPath.Child("metadata"), &obj.ObjectMeta, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.ResourcePoolStatusRequest.Spec
		fn := func(
			fldPath *field.Path,
			obj, oldObj *resourcev1alpha3.ResourcePoolStatusRequestSpec,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if equality.Semantic.DeepEqual(obj, oldObj) {
					return nil
				}
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); 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
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ResourcePoolStatusRequest) *resourcev1alpha3.ResourcePoolStatusRequestSpec {
				return &oldObj.Spec
			})
		errs = append(errs, fn(fldPath.Child("spec"), &obj.Spec, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.ResourcePoolStatusRequest.Status
		fn := func(
			fldPath *field.Path,
			obj, oldObj *resourcev1alpha3.ResourcePoolStatusRequestStatus,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if equality.Semantic.DeepEqual(obj, oldObj) {
					return nil
				}
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); 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
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ResourcePoolStatusRequest) *resourcev1alpha3.ResourcePoolStatusRequestStatus {
				return oldObj.Status
			})
		errs = append(errs, fn(fldPath.Child("status"), obj.Status, oldVal, 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
		fn := func(
			fldPath *field.Path,
			obj, oldObj *string,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			if e := validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ResourcePoolStatusRequestSpec) *string {
				return &oldObj.Driver
			})
		errs = append(errs, fn(fldPath.Child("driver"), &obj.Driver, oldVal, oldObj != nil)...)
	}

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

	{ // field resourcev1alpha3.ResourcePoolStatusRequestSpec.Limit
		fn := func(
			fldPath *field.Path,
			obj, oldObj *int32,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			if e := validate.Maximum(ctx, op, fldPath, obj, oldObj, 1000); len(e) != 0 {
				errs = append(errs, e...)
			}
			if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 1); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ResourcePoolStatusRequestSpec) *int32 {
				return oldObj.Limit
			})
		errs = append(errs, fn(fldPath.Child("limit"), obj.Limit, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.ResourcePoolStatusRequestSpec.DefaultPartitionTypeAttribute
		fn := func(
			fldPath *field.Path,
			obj, oldObj *string,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) {
					return nil
				}
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "DRAPartitionableDevicesType", false, validate.ForbiddenPointer).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "DRAPartitionableDevicesType", false, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 {
				earlyReturn = true
			}
			if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "DRAPartitionableDevicesType", true, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 {
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "DRAPartitionableDevicesType", true, validate.ResourceFullyQualifiedName); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ResourcePoolStatusRequestSpec) *string {
				return oldObj.DefaultPartitionTypeAttribute
			})
		errs = append(errs, fn(fldPath.Child("defaultPartitionTypeAttribute"), obj.DefaultPartitionTypeAttribute, oldVal, 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
		fn := func(
			fldPath *field.Path,
			obj, oldObj *int32,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 0); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ResourcePoolStatusRequestStatus) *int32 {
				return oldObj.PoolCount
			})
		errs = append(errs, fn(fldPath.Child("poolCount"), obj.PoolCount, oldVal, oldObj != nil)...)
	}

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

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

	return errs
}

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

	{ // field resourcev1alpha3.ShareableCapacityStatus.Name
		fn := func(
			fldPath *field.Path,
			obj, oldObj *string,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ShareableCapacityStatus) *string {
				return &oldObj.Name
			})
		errs = append(errs, fn(fldPath.Child("name"), &obj.Name, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.ShareableCapacityStatus.Total
		fn := func(
			fldPath *field.Path,
			obj, oldObj *resource.Quantity,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if equality.Semantic.DeepEqual(obj, oldObj) {
					return nil
				}
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ShareableCapacityStatus) *resource.Quantity {
				return oldObj.Total
			})
		errs = append(errs, fn(fldPath.Child("total"), obj.Total, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.ShareableCapacityStatus.Consumed
		fn := func(
			fldPath *field.Path,
			obj, oldObj *resource.Quantity,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if equality.Semantic.DeepEqual(obj, oldObj) {
					return nil
				}
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ShareableCapacityStatus) *resource.Quantity {
				return oldObj.Consumed
			})
		errs = append(errs, fn(fldPath.Child("consumed"), obj.Consumed, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.ShareableCapacityStatus.Available
		fn := func(
			fldPath *field.Path,
			obj, oldObj *resource.Quantity,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if equality.Semantic.DeepEqual(obj, oldObj) {
					return nil
				}
			}
			// call field-attached validations
			earlyReturn := false
			if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ShareableCapacityStatus) *resource.Quantity {
				return oldObj.Available
			})
		errs = append(errs, fn(fldPath.Child("available"), obj.Available, oldVal, oldObj != nil)...)
	}

	return errs
}

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

	{ // field resourcev1alpha3.ShareableSummaryStatus.FullyAvailableDevices
		fn := func(
			fldPath *field.Path,
			obj, oldObj *int32,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 0); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ShareableSummaryStatus) *int32 {
				return oldObj.FullyAvailableDevices
			})
		errs = append(errs, fn(fldPath.Child("fullyAvailableDevices"), obj.FullyAvailableDevices, oldVal, oldObj != nil)...)
	}

	{ // field resourcev1alpha3.ShareableSummaryStatus.PartiallyAvailableDevices
		fn := func(
			fldPath *field.Path,
			obj, oldObj *int32,
			oldValueCorrelated bool) (errs field.ErrorList) {
			// don't revalidate unchanged data
			if oldValueCorrelated && op.Type == operation.Update {
				if 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).MarkShortCircuit(); len(e) != 0 {
				errs = append(errs, e...)
				earlyReturn = true
			}
			if earlyReturn {
				return // do not proceed
			}
			if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 0); len(e) != 0 {
				errs = append(errs, e...)
			}
			return
		}
		oldVal := safe.Field(oldObj,
			func(oldObj *resourcev1alpha3.ShareableSummaryStatus) *int32 {
				return oldObj.PartiallyAvailableDevices
			})
		errs = append(errs, fn(fldPath.Child("partiallyAvailableDevices"), obj.PartiallyAvailableDevices, oldVal, oldObj != nil)...)
	}

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

	return errs
}
