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

package lm

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

import (
	"context"
	"net/http"
	"time"

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

// NewGetCollectorInstallerParams creates a new GetCollectorInstallerParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetCollectorInstallerParams() *GetCollectorInstallerParams {
	return &GetCollectorInstallerParams{
		timeout: cr.DefaultTimeout,
	}
}

// NewGetCollectorInstallerParamsWithTimeout creates a new GetCollectorInstallerParams object
// with the ability to set a timeout on a request.
func NewGetCollectorInstallerParamsWithTimeout(timeout time.Duration) *GetCollectorInstallerParams {
	return &GetCollectorInstallerParams{
		timeout: timeout,
	}
}

// NewGetCollectorInstallerParamsWithContext creates a new GetCollectorInstallerParams object
// with the ability to set a context for a request.
func NewGetCollectorInstallerParamsWithContext(ctx context.Context) *GetCollectorInstallerParams {
	return &GetCollectorInstallerParams{
		Context: ctx,
	}
}

// NewGetCollectorInstallerParamsWithHTTPClient creates a new GetCollectorInstallerParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetCollectorInstallerParamsWithHTTPClient(client *http.Client) *GetCollectorInstallerParams {
	return &GetCollectorInstallerParams{
		HTTPClient: client,
	}
}

/* GetCollectorInstallerParams contains all the parameters to send to the API endpoint
   for the get collector installer operation.

   Typically these are written to a http.Request.
*/
type GetCollectorInstallerParams struct {

	// UserAgent.
	//
	// Default: "Logicmonitor/SDK: Argus Dist-v1.0.0-argus1"
	UserAgent *string

	// CollectorID.
	//
	// Format: int32
	CollectorID int32

	/* CollectorSize.

	   The size of the Collector you'd like to install. Options are nano, small (requires 2GB memory), medium (requires 4GB memory), large (requires 8GB memory), extra large (requires 16GB memory), double extra large (requires 32GB memory). Requires collector version 22.180 or higher. Defaults to small

	   Default: "medium"
	*/
	CollectorSize *string

	/* CollectorVersion.

	   The version of the installer you'd like to download. This defaults to the latest GD Collector, unless useEA is true

	   Format: int32
	*/
	CollectorVersion *int32

	// MonitorOthers.
	//
	// Default: true
	MonitorOthers *bool

	// OsAndArch.
	OsAndArch string

	// Token.
	Token *string

	/* UseEA.

	   If true, the latest EA Collector version will be used. Defaults to false
	*/
	UseEA *bool

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

// WithDefaults hydrates default values in the get collector installer params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetCollectorInstallerParams) WithDefaults() *GetCollectorInstallerParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the get collector installer params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetCollectorInstallerParams) SetDefaults() {
	var (
		userAgentDefault = string("Logicmonitor/SDK: Argus Dist-v1.0.0-argus1")

		collectorSizeDefault = string("medium")

		monitorOthersDefault = bool(true)

		useEADefault = bool(false)
	)

	val := GetCollectorInstallerParams{
		UserAgent:     &userAgentDefault,
		CollectorSize: &collectorSizeDefault,
		MonitorOthers: &monitorOthersDefault,
		UseEA:         &useEADefault,
	}

	val.timeout = o.timeout
	val.Context = o.Context
	val.HTTPClient = o.HTTPClient
	*o = val
}

// WithTimeout adds the timeout to the get collector installer params
func (o *GetCollectorInstallerParams) WithTimeout(timeout time.Duration) *GetCollectorInstallerParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get collector installer params
func (o *GetCollectorInstallerParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get collector installer params
func (o *GetCollectorInstallerParams) WithContext(ctx context.Context) *GetCollectorInstallerParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get collector installer params
func (o *GetCollectorInstallerParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get collector installer params
func (o *GetCollectorInstallerParams) WithHTTPClient(client *http.Client) *GetCollectorInstallerParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get collector installer params
func (o *GetCollectorInstallerParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithUserAgent adds the userAgent to the get collector installer params
func (o *GetCollectorInstallerParams) WithUserAgent(userAgent *string) *GetCollectorInstallerParams {
	o.SetUserAgent(userAgent)
	return o
}

// SetUserAgent adds the userAgent to the get collector installer params
func (o *GetCollectorInstallerParams) SetUserAgent(userAgent *string) {
	o.UserAgent = userAgent
}

// WithCollectorID adds the collectorID to the get collector installer params
func (o *GetCollectorInstallerParams) WithCollectorID(collectorID int32) *GetCollectorInstallerParams {
	o.SetCollectorID(collectorID)
	return o
}

// SetCollectorID adds the collectorId to the get collector installer params
func (o *GetCollectorInstallerParams) SetCollectorID(collectorID int32) {
	o.CollectorID = collectorID
}

// WithCollectorSize adds the collectorSize to the get collector installer params
func (o *GetCollectorInstallerParams) WithCollectorSize(collectorSize *string) *GetCollectorInstallerParams {
	o.SetCollectorSize(collectorSize)
	return o
}

// SetCollectorSize adds the collectorSize to the get collector installer params
func (o *GetCollectorInstallerParams) SetCollectorSize(collectorSize *string) {
	o.CollectorSize = collectorSize
}

// WithCollectorVersion adds the collectorVersion to the get collector installer params
func (o *GetCollectorInstallerParams) WithCollectorVersion(collectorVersion *int32) *GetCollectorInstallerParams {
	o.SetCollectorVersion(collectorVersion)
	return o
}

// SetCollectorVersion adds the collectorVersion to the get collector installer params
func (o *GetCollectorInstallerParams) SetCollectorVersion(collectorVersion *int32) {
	o.CollectorVersion = collectorVersion
}

// WithMonitorOthers adds the monitorOthers to the get collector installer params
func (o *GetCollectorInstallerParams) WithMonitorOthers(monitorOthers *bool) *GetCollectorInstallerParams {
	o.SetMonitorOthers(monitorOthers)
	return o
}

// SetMonitorOthers adds the monitorOthers to the get collector installer params
func (o *GetCollectorInstallerParams) SetMonitorOthers(monitorOthers *bool) {
	o.MonitorOthers = monitorOthers
}

// WithOsAndArch adds the osAndArch to the get collector installer params
func (o *GetCollectorInstallerParams) WithOsAndArch(osAndArch string) *GetCollectorInstallerParams {
	o.SetOsAndArch(osAndArch)
	return o
}

// SetOsAndArch adds the osAndArch to the get collector installer params
func (o *GetCollectorInstallerParams) SetOsAndArch(osAndArch string) {
	o.OsAndArch = osAndArch
}

// WithToken adds the token to the get collector installer params
func (o *GetCollectorInstallerParams) WithToken(token *string) *GetCollectorInstallerParams {
	o.SetToken(token)
	return o
}

// SetToken adds the token to the get collector installer params
func (o *GetCollectorInstallerParams) SetToken(token *string) {
	o.Token = token
}

// WithUseEA adds the useEA to the get collector installer params
func (o *GetCollectorInstallerParams) WithUseEA(useEA *bool) *GetCollectorInstallerParams {
	o.SetUseEA(useEA)
	return o
}

// SetUseEA adds the useEA to the get collector installer params
func (o *GetCollectorInstallerParams) SetUseEA(useEA *bool) {
	o.UseEA = useEA
}

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

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

	if o.UserAgent != nil {

		// header param User-Agent
		if err := r.SetHeaderParam("User-Agent", *o.UserAgent); err != nil {
			return err
		}
	}

	// path param collectorId
	if err := r.SetPathParam("collectorId", swag.FormatInt32(o.CollectorID)); err != nil {
		return err
	}

	if o.CollectorSize != nil {

		// query param collectorSize
		var qrCollectorSize string

		if o.CollectorSize != nil {
			qrCollectorSize = *o.CollectorSize
		}
		qCollectorSize := qrCollectorSize
		if qCollectorSize != "" {

			if err := r.SetQueryParam("collectorSize", qCollectorSize); err != nil {
				return err
			}
		}
	}

	if o.CollectorVersion != nil {

		// query param collectorVersion
		var qrCollectorVersion int32

		if o.CollectorVersion != nil {
			qrCollectorVersion = *o.CollectorVersion
		}
		qCollectorVersion := swag.FormatInt32(qrCollectorVersion)
		if qCollectorVersion != "" {

			if err := r.SetQueryParam("collectorVersion", qCollectorVersion); err != nil {
				return err
			}
		}
	}

	if o.MonitorOthers != nil {

		// query param monitorOthers
		var qrMonitorOthers bool

		if o.MonitorOthers != nil {
			qrMonitorOthers = *o.MonitorOthers
		}
		qMonitorOthers := swag.FormatBool(qrMonitorOthers)
		if qMonitorOthers != "" {

			if err := r.SetQueryParam("monitorOthers", qMonitorOthers); err != nil {
				return err
			}
		}
	}

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

	if o.Token != nil {

		// query param token
		var qrToken string

		if o.Token != nil {
			qrToken = *o.Token
		}
		qToken := qrToken
		if qToken != "" {

			if err := r.SetQueryParam("token", qToken); err != nil {
				return err
			}
		}
	}

	if o.UseEA != nil {

		// query param useEA
		var qrUseEA bool

		if o.UseEA != nil {
			qrUseEA = *o.UseEA
		}
		qUseEA := swag.FormatBool(qrUseEA)
		if qUseEA != "" {

			if err := r.SetQueryParam("useEA", qUseEA); err != nil {
				return err
			}
		}
	}

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