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

type CreateGkePropertiesGke struct {

	ProjectId string `json:"projectId,omitempty"`

	Master CreateGkePropertiesGkeMaster `json:"master,omitempty"`

	NodeVersion string `json:"nodeVersion,omitempty"`

	// Name of the GCP Network (VPC) to deploy the cluster to. If omitted than the \"default\" VPC is used.
	Vpc string `json:"vpc,omitempty"`

	// Name of the GCP Subnet to deploy the cluster to. If \"default\" VPC is used this field can be omitted. The subnet must be in the same region as the location of the cluster.
	Subnet string `json:"subnet,omitempty"`

	NodePools map[string]NodePoolsGoogle `json:"nodePools"`
}

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

	if err := AssertCreateGkePropertiesGkeMasterRequired(obj.Master); err != nil {
		return err
	}
	return nil
}

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