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

package recommend

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

import (
	"net/http"
	"time"

	"golang.org/x/net/context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/swag"

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

	models "github.com/banzaicloud/telescopes/pkg/recommender-client/models"
)

// NewRecommendClusterScaleOutParams creates a new RecommendClusterScaleOutParams object
// with the default values initialized.
func NewRecommendClusterScaleOutParams() *RecommendClusterScaleOutParams {
	var ()
	return &RecommendClusterScaleOutParams{

		timeout: cr.DefaultTimeout,
	}
}

// NewRecommendClusterScaleOutParamsWithTimeout creates a new RecommendClusterScaleOutParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewRecommendClusterScaleOutParamsWithTimeout(timeout time.Duration) *RecommendClusterScaleOutParams {
	var ()
	return &RecommendClusterScaleOutParams{

		timeout: timeout,
	}
}

// NewRecommendClusterScaleOutParamsWithContext creates a new RecommendClusterScaleOutParams object
// with the default values initialized, and the ability to set a context for a request
func NewRecommendClusterScaleOutParamsWithContext(ctx context.Context) *RecommendClusterScaleOutParams {
	var ()
	return &RecommendClusterScaleOutParams{

		Context: ctx,
	}
}

// NewRecommendClusterScaleOutParamsWithHTTPClient creates a new RecommendClusterScaleOutParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewRecommendClusterScaleOutParamsWithHTTPClient(client *http.Client) *RecommendClusterScaleOutParams {
	var ()
	return &RecommendClusterScaleOutParams{
		HTTPClient: client,
	}
}

/*
RecommendClusterScaleOutParams contains all the parameters to send to the API endpoint
for the recommend cluster scale out operation typically these are written to a http.Request
*/
type RecommendClusterScaleOutParams struct {

	/*ActualLayout
	  Description of the current cluster layout

	*/
	ActualLayout []*models.NodePoolDesc
	/*DesiredCPU
	  Total desired number of CPUs in the cluster after the scale out

	*/
	DesiredCPU *float64
	/*DesiredGpu
	  Total desired number of GPUs in the cluster after the scale out

	*/
	DesiredGpu *int64
	/*DesiredMem
	  Total desired memory (GB) in the cluster after the scale out

	*/
	DesiredMem *float64
	/*Excludes
	  Excludes is a blacklist - a slice with vm types to be excluded from the recommendation

	*/
	Excludes []string
	/*OnDemandPct
	  Percentage of regular (on-demand) nodes among the scale out nodes

	*/
	OnDemandPct *int64
	/*Provider*/
	Provider string
	/*Region*/
	Region string
	/*Service*/
	Service string
	/*Zone
	  Availability zone to be included in the recommendation

	*/
	Zone *string

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithTimeout adds the timeout to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithTimeout(timeout time.Duration) *RecommendClusterScaleOutParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithContext(ctx context.Context) *RecommendClusterScaleOutParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithHTTPClient(client *http.Client) *RecommendClusterScaleOutParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithActualLayout adds the actualLayout to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithActualLayout(actualLayout []*models.NodePoolDesc) *RecommendClusterScaleOutParams {
	o.SetActualLayout(actualLayout)
	return o
}

// SetActualLayout adds the actualLayout to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetActualLayout(actualLayout []*models.NodePoolDesc) {
	o.ActualLayout = actualLayout
}

// WithDesiredCPU adds the desiredCPU to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithDesiredCPU(desiredCPU *float64) *RecommendClusterScaleOutParams {
	o.SetDesiredCPU(desiredCPU)
	return o
}

// SetDesiredCPU adds the desiredCpu to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetDesiredCPU(desiredCPU *float64) {
	o.DesiredCPU = desiredCPU
}

// WithDesiredGpu adds the desiredGpu to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithDesiredGpu(desiredGpu *int64) *RecommendClusterScaleOutParams {
	o.SetDesiredGpu(desiredGpu)
	return o
}

// SetDesiredGpu adds the desiredGpu to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetDesiredGpu(desiredGpu *int64) {
	o.DesiredGpu = desiredGpu
}

// WithDesiredMem adds the desiredMem to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithDesiredMem(desiredMem *float64) *RecommendClusterScaleOutParams {
	o.SetDesiredMem(desiredMem)
	return o
}

// SetDesiredMem adds the desiredMem to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetDesiredMem(desiredMem *float64) {
	o.DesiredMem = desiredMem
}

// WithExcludes adds the excludes to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithExcludes(excludes []string) *RecommendClusterScaleOutParams {
	o.SetExcludes(excludes)
	return o
}

// SetExcludes adds the excludes to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetExcludes(excludes []string) {
	o.Excludes = excludes
}

// WithOnDemandPct adds the onDemandPct to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithOnDemandPct(onDemandPct *int64) *RecommendClusterScaleOutParams {
	o.SetOnDemandPct(onDemandPct)
	return o
}

// SetOnDemandPct adds the onDemandPct to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetOnDemandPct(onDemandPct *int64) {
	o.OnDemandPct = onDemandPct
}

// WithProvider adds the provider to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithProvider(provider string) *RecommendClusterScaleOutParams {
	o.SetProvider(provider)
	return o
}

// SetProvider adds the provider to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetProvider(provider string) {
	o.Provider = provider
}

// WithRegion adds the region to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithRegion(region string) *RecommendClusterScaleOutParams {
	o.SetRegion(region)
	return o
}

// SetRegion adds the region to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetRegion(region string) {
	o.Region = region
}

// WithService adds the service to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithService(service string) *RecommendClusterScaleOutParams {
	o.SetService(service)
	return o
}

// SetService adds the service to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetService(service string) {
	o.Service = service
}

// WithZone adds the zone to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) WithZone(zone *string) *RecommendClusterScaleOutParams {
	o.SetZone(zone)
	return o
}

// SetZone adds the zone to the recommend cluster scale out params
func (o *RecommendClusterScaleOutParams) SetZone(zone *string) {
	o.Zone = zone
}

// WriteToRequest writes these params to a swagger request
func (o *RecommendClusterScaleOutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	if o.ActualLayout != nil {
		if err := r.SetBodyParam(o.ActualLayout); err != nil {
			return err
		}
	}

	if o.DesiredCPU != nil {

		// query param desiredCpu
		var qrDesiredCPU float64
		if o.DesiredCPU != nil {
			qrDesiredCPU = *o.DesiredCPU
		}
		qDesiredCPU := swag.FormatFloat64(qrDesiredCPU)
		if qDesiredCPU != "" {
			if err := r.SetQueryParam("desiredCpu", qDesiredCPU); err != nil {
				return err
			}
		}

	}

	if o.DesiredGpu != nil {

		// query param desiredGpu
		var qrDesiredGpu int64
		if o.DesiredGpu != nil {
			qrDesiredGpu = *o.DesiredGpu
		}
		qDesiredGpu := swag.FormatInt64(qrDesiredGpu)
		if qDesiredGpu != "" {
			if err := r.SetQueryParam("desiredGpu", qDesiredGpu); err != nil {
				return err
			}
		}

	}

	if o.DesiredMem != nil {

		// query param desiredMem
		var qrDesiredMem float64
		if o.DesiredMem != nil {
			qrDesiredMem = *o.DesiredMem
		}
		qDesiredMem := swag.FormatFloat64(qrDesiredMem)
		if qDesiredMem != "" {
			if err := r.SetQueryParam("desiredMem", qDesiredMem); err != nil {
				return err
			}
		}

	}

	valuesExcludes := o.Excludes

	joinedExcludes := swag.JoinByFormat(valuesExcludes, "")
	// query array param excludes
	if err := r.SetQueryParam("excludes", joinedExcludes...); err != nil {
		return err
	}

	if o.OnDemandPct != nil {

		// query param onDemandPct
		var qrOnDemandPct int64
		if o.OnDemandPct != nil {
			qrOnDemandPct = *o.OnDemandPct
		}
		qOnDemandPct := swag.FormatInt64(qrOnDemandPct)
		if qOnDemandPct != "" {
			if err := r.SetQueryParam("onDemandPct", qOnDemandPct); err != nil {
				return err
			}
		}

	}

	// path param provider
	if err := r.SetPathParam("provider", o.Provider); err != nil {
		return err
	}

	// path param region
	if err := r.SetPathParam("region", o.Region); err != nil {
		return err
	}

	// path param service
	if err := r.SetPathParam("service", o.Service); err != nil {
		return err
	}

	if o.Zone != nil {

		// query param zone
		var qrZone string
		if o.Zone != nil {
			qrZone = *o.Zone
		}
		qZone := qrZone
		if qZone != "" {
			if err := r.SetQueryParam("zone", qZone); err != nil {
				return err
			}
		}

	}

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