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

// BaseUpdateNodePoolOptions - Base node pool update options object for all cluster distributions.
type BaseUpdateNodePoolOptions struct {

	// Maximum number of extra nodes that can be created during the update.
	MaxSurge int32 `json:"maxSurge,omitempty"`

	// Maximum number of nodes that can be updated simultaneously.
	MaxBatchSize int32 `json:"maxBatchSize,omitempty"`

	// Maximum number of nodes that can be unavailable during the update.
	MaxUnavailable int32 `json:"maxUnavailable,omitempty"`

	Drain UpdateNodePoolDrainOptions `json:"drain,omitempty"`
}

// AssertBaseUpdateNodePoolOptionsRequired checks if the required fields are not zero-ed
func AssertBaseUpdateNodePoolOptionsRequired(obj BaseUpdateNodePoolOptions) error {
	if err := AssertUpdateNodePoolDrainOptionsRequired(obj.Drain); err != nil {
		return err
	}
	return nil
}

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