// 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"
)

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

		timeout: cr.DefaultTimeout,
	}
}

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

		timeout: timeout,
	}
}

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

		Context: ctx,
	}
}

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

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

	/*AllowBurst
	  Are burst instances allowed in recommendation

	*/
	AllowBurst *bool
	/*AllowOlderGen
	  AllowOlderGen allow older generations of virtual machines (applies for EC2 only)

	*/
	AllowOlderGen *bool
	/*Category
	  Category specifies the virtual machine category

	*/
	Category []string
	/*Excludes
	  Excludes is a blacklist - a slice with vm types to be excluded from the recommendation

	*/
	Excludes []string
	/*Includes
	  Includes is a whitelist - a slice with vm types to be contained in the recommendation

	*/
	Includes []string
	/*MaxNodes
	  Maximum number of nodes in the recommended cluster

	*/
	MaxNodes *int64
	/*MinNodes
	  Minimum number of nodes in the recommended cluster

	*/
	MinNodes *int64
	/*NetworkPerf
	  NetworkPerf specifies the network performance category

	*/
	NetworkPerf []string
	/*OnDemandPct
	  Percentage of regular (on-demand) nodes in the recommended cluster

	*/
	OnDemandPct *int64
	/*Provider*/
	Provider string
	/*Region*/
	Region string
	/*SameSize
	  If true, recommended instance types will have a similar size

	*/
	SameSize *bool
	/*Service*/
	Service string
	/*SumCPU
	  Total number of CPUs requested for the cluster

	*/
	SumCPU *float64
	/*SumGpu
	  Total number of GPUs requested for the cluster

	*/
	SumGpu *int64
	/*SumMem
	  Total memory requested for the cluster (GB)

	*/
	SumMem *float64
	/*Zone
	  Availability zone that the cluster should expand to

	*/
	Zone *string

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

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

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

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

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

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

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

// WithAllowBurst adds the allowBurst to the recommend cluster params
func (o *RecommendClusterParams) WithAllowBurst(allowBurst *bool) *RecommendClusterParams {
	o.SetAllowBurst(allowBurst)
	return o
}

// SetAllowBurst adds the allowBurst to the recommend cluster params
func (o *RecommendClusterParams) SetAllowBurst(allowBurst *bool) {
	o.AllowBurst = allowBurst
}

// WithAllowOlderGen adds the allowOlderGen to the recommend cluster params
func (o *RecommendClusterParams) WithAllowOlderGen(allowOlderGen *bool) *RecommendClusterParams {
	o.SetAllowOlderGen(allowOlderGen)
	return o
}

// SetAllowOlderGen adds the allowOlderGen to the recommend cluster params
func (o *RecommendClusterParams) SetAllowOlderGen(allowOlderGen *bool) {
	o.AllowOlderGen = allowOlderGen
}

// WithCategory adds the category to the recommend cluster params
func (o *RecommendClusterParams) WithCategory(category []string) *RecommendClusterParams {
	o.SetCategory(category)
	return o
}

// SetCategory adds the category to the recommend cluster params
func (o *RecommendClusterParams) SetCategory(category []string) {
	o.Category = category
}

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

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

// WithIncludes adds the includes to the recommend cluster params
func (o *RecommendClusterParams) WithIncludes(includes []string) *RecommendClusterParams {
	o.SetIncludes(includes)
	return o
}

// SetIncludes adds the includes to the recommend cluster params
func (o *RecommendClusterParams) SetIncludes(includes []string) {
	o.Includes = includes
}

// WithMaxNodes adds the maxNodes to the recommend cluster params
func (o *RecommendClusterParams) WithMaxNodes(maxNodes *int64) *RecommendClusterParams {
	o.SetMaxNodes(maxNodes)
	return o
}

// SetMaxNodes adds the maxNodes to the recommend cluster params
func (o *RecommendClusterParams) SetMaxNodes(maxNodes *int64) {
	o.MaxNodes = maxNodes
}

// WithMinNodes adds the minNodes to the recommend cluster params
func (o *RecommendClusterParams) WithMinNodes(minNodes *int64) *RecommendClusterParams {
	o.SetMinNodes(minNodes)
	return o
}

// SetMinNodes adds the minNodes to the recommend cluster params
func (o *RecommendClusterParams) SetMinNodes(minNodes *int64) {
	o.MinNodes = minNodes
}

// WithNetworkPerf adds the networkPerf to the recommend cluster params
func (o *RecommendClusterParams) WithNetworkPerf(networkPerf []string) *RecommendClusterParams {
	o.SetNetworkPerf(networkPerf)
	return o
}

// SetNetworkPerf adds the networkPerf to the recommend cluster params
func (o *RecommendClusterParams) SetNetworkPerf(networkPerf []string) {
	o.NetworkPerf = networkPerf
}

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

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

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

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

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

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

// WithSameSize adds the sameSize to the recommend cluster params
func (o *RecommendClusterParams) WithSameSize(sameSize *bool) *RecommendClusterParams {
	o.SetSameSize(sameSize)
	return o
}

// SetSameSize adds the sameSize to the recommend cluster params
func (o *RecommendClusterParams) SetSameSize(sameSize *bool) {
	o.SameSize = sameSize
}

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

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

// WithSumCPU adds the sumCPU to the recommend cluster params
func (o *RecommendClusterParams) WithSumCPU(sumCPU *float64) *RecommendClusterParams {
	o.SetSumCPU(sumCPU)
	return o
}

// SetSumCPU adds the sumCpu to the recommend cluster params
func (o *RecommendClusterParams) SetSumCPU(sumCPU *float64) {
	o.SumCPU = sumCPU
}

// WithSumGpu adds the sumGpu to the recommend cluster params
func (o *RecommendClusterParams) WithSumGpu(sumGpu *int64) *RecommendClusterParams {
	o.SetSumGpu(sumGpu)
	return o
}

// SetSumGpu adds the sumGpu to the recommend cluster params
func (o *RecommendClusterParams) SetSumGpu(sumGpu *int64) {
	o.SumGpu = sumGpu
}

// WithSumMem adds the sumMem to the recommend cluster params
func (o *RecommendClusterParams) WithSumMem(sumMem *float64) *RecommendClusterParams {
	o.SetSumMem(sumMem)
	return o
}

// SetSumMem adds the sumMem to the recommend cluster params
func (o *RecommendClusterParams) SetSumMem(sumMem *float64) {
	o.SumMem = sumMem
}

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

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

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

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

	if o.AllowBurst != nil {

		// query param allowBurst
		var qrAllowBurst bool
		if o.AllowBurst != nil {
			qrAllowBurst = *o.AllowBurst
		}
		qAllowBurst := swag.FormatBool(qrAllowBurst)
		if qAllowBurst != "" {
			if err := r.SetQueryParam("allowBurst", qAllowBurst); err != nil {
				return err
			}
		}

	}

	if o.AllowOlderGen != nil {

		// query param allowOlderGen
		var qrAllowOlderGen bool
		if o.AllowOlderGen != nil {
			qrAllowOlderGen = *o.AllowOlderGen
		}
		qAllowOlderGen := swag.FormatBool(qrAllowOlderGen)
		if qAllowOlderGen != "" {
			if err := r.SetQueryParam("allowOlderGen", qAllowOlderGen); err != nil {
				return err
			}
		}

	}

	valuesCategory := o.Category

	joinedCategory := swag.JoinByFormat(valuesCategory, "")
	// query array param category
	if err := r.SetQueryParam("category", joinedCategory...); 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
	}

	valuesIncludes := o.Includes

	joinedIncludes := swag.JoinByFormat(valuesIncludes, "")
	// query array param includes
	if err := r.SetQueryParam("includes", joinedIncludes...); err != nil {
		return err
	}

	if o.MaxNodes != nil {

		// query param maxNodes
		var qrMaxNodes int64
		if o.MaxNodes != nil {
			qrMaxNodes = *o.MaxNodes
		}
		qMaxNodes := swag.FormatInt64(qrMaxNodes)
		if qMaxNodes != "" {
			if err := r.SetQueryParam("maxNodes", qMaxNodes); err != nil {
				return err
			}
		}

	}

	if o.MinNodes != nil {

		// query param minNodes
		var qrMinNodes int64
		if o.MinNodes != nil {
			qrMinNodes = *o.MinNodes
		}
		qMinNodes := swag.FormatInt64(qrMinNodes)
		if qMinNodes != "" {
			if err := r.SetQueryParam("minNodes", qMinNodes); err != nil {
				return err
			}
		}

	}

	valuesNetworkPerf := o.NetworkPerf

	joinedNetworkPerf := swag.JoinByFormat(valuesNetworkPerf, "")
	// query array param networkPerf
	if err := r.SetQueryParam("networkPerf", joinedNetworkPerf...); 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
	}

	if o.SameSize != nil {

		// query param sameSize
		var qrSameSize bool
		if o.SameSize != nil {
			qrSameSize = *o.SameSize
		}
		qSameSize := swag.FormatBool(qrSameSize)
		if qSameSize != "" {
			if err := r.SetQueryParam("sameSize", qSameSize); err != nil {
				return err
			}
		}

	}

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

	if o.SumCPU != nil {

		// query param sumCpu
		var qrSumCPU float64
		if o.SumCPU != nil {
			qrSumCPU = *o.SumCPU
		}
		qSumCPU := swag.FormatFloat64(qrSumCPU)
		if qSumCPU != "" {
			if err := r.SetQueryParam("sumCpu", qSumCPU); err != nil {
				return err
			}
		}

	}

	if o.SumGpu != nil {

		// query param sumGpu
		var qrSumGpu int64
		if o.SumGpu != nil {
			qrSumGpu = *o.SumGpu
		}
		qSumGpu := swag.FormatInt64(qrSumGpu)
		if qSumGpu != "" {
			if err := r.SetQueryParam("sumGpu", qSumGpu); err != nil {
				return err
			}
		}

	}

	if o.SumMem != nil {

		// query param sumMem
		var qrSumMem float64
		if o.SumMem != nil {
			qrSumMem = *o.SumMem
		}
		qSumMem := swag.FormatFloat64(qrSumMem)
		if qSumMem != "" {
			if err := r.SetQueryParam("sumMem", qSumMem); 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
}
