// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"strconv"

	strfmt "github.com/go-openapi/strfmt"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
)

// ClusterScaleoutRecommendationReq ClusterScaleoutRecommendationReq encapsulates the recommendation input data
// swagger:model ClusterScaleoutRecommendationReq
type ClusterScaleoutRecommendationReq struct {

	// Description of the current cluster layout
	// in:body
	ActualLayout []*NodePoolDesc `json:"actualLayout"`

	// Total desired number of CPUs in the cluster after the scale out
	DesiredCPU float64 `json:"desiredCpu,omitempty"`

	// Total desired number of GPUs in the cluster after the scale out
	DesiredGpu int64 `json:"desiredGpu,omitempty"`

	// Total desired memory (GB) in the cluster after the scale out
	DesiredMem float64 `json:"desiredMem,omitempty"`

	// Excludes is a blacklist - a slice with vm types to be excluded from the recommendation
	Excludes []string `json:"excludes"`

	// Percentage of regular (on-demand) nodes among the scale out nodes
	OnDemandPct int64 `json:"onDemandPct,omitempty"`

	// Availability zone to be included in the recommendation
	Zone string `json:"zone,omitempty"`
}

// Validate validates this cluster scaleout recommendation req
func (m *ClusterScaleoutRecommendationReq) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateActualLayout(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *ClusterScaleoutRecommendationReq) validateActualLayout(formats strfmt.Registry) error {

	if swag.IsZero(m.ActualLayout) { // not required
		return nil
	}

	for i := 0; i < len(m.ActualLayout); i++ {
		if swag.IsZero(m.ActualLayout[i]) { // not required
			continue
		}

		if m.ActualLayout[i] != nil {
			if err := m.ActualLayout[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("actualLayout" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

// MarshalBinary interface implementation
func (m *ClusterScaleoutRecommendationReq) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *ClusterScaleoutRecommendationReq) UnmarshalBinary(b []byte) error {
	var res ClusterScaleoutRecommendationReq
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
