/*
 * Pipeline API
 *
 * Pipeline is a feature rich application platform, built for containers on top of Kubernetes to automate the DevOps experience, continuous application development and the lifecycle of deployments. 
 *
 * API version: latest
 * Contact: info@banzaicloud.com
 * Generated by: OpenAPI Generator (https://openapi-generator.tech)
 */

package pipeline

// NodePoolAutoScaling - Node pool auto scaling settings.
type NodePoolAutoScaling struct {

	// Enable node pool autoscaling.
	Enabled bool `json:"enabled,omitempty"`

	// Minimum node pool size.
	MinSize int32 `json:"minSize"`

	// Maximum node pool size.
	MaxSize int32 `json:"maxSize"`
}

// AssertNodePoolAutoScalingRequired checks if the required fields are not zero-ed
func AssertNodePoolAutoScalingRequired(obj NodePoolAutoScaling) error {
	elements := map[string]interface{}{
		"minSize": obj.MinSize,
		"maxSize": obj.MaxSize,
	}
	for name, el := range elements {
		if isZero := IsZeroValue(el); isZero {
			return &RequiredError{Field: name}
		}
	}

	return nil
}

// AssertRecurseNodePoolAutoScalingRequired recursively checks if required fields are not zero-ed in a nested slice.
// Accepts only nested slice of NodePoolAutoScaling (e.g. [][]NodePoolAutoScaling), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseNodePoolAutoScalingRequired(objSlice interface{}) error {
	return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
		aNodePoolAutoScaling, ok := obj.(NodePoolAutoScaling)
		if !ok {
			return ErrTypeAssertionError
		}
		return AssertNodePoolAutoScalingRequired(aNodePoolAutoScaling)
	})
}
