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

package bootstrap

// 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/RafayLabs/rcloud-base/api/def/clients/sentry/models"
)

// NewBootstrapCreateBootstrapAgentParams creates a new BootstrapCreateBootstrapAgentParams 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 NewBootstrapCreateBootstrapAgentParams() *BootstrapCreateBootstrapAgentParams {
	return &BootstrapCreateBootstrapAgentParams{
		timeout: cr.DefaultTimeout,
	}
}

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

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

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

/* BootstrapCreateBootstrapAgentParams contains all the parameters to send to the API endpoint
   for the bootstrap create bootstrap agent operation.

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

	// Body.
	Body *models.SentryBootstrapAgent

	// SpecTemplateRef.
	SpecTemplateRef string

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

// WithDefaults hydrates default values in the bootstrap create bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapCreateBootstrapAgentParams) WithDefaults() *BootstrapCreateBootstrapAgentParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the bootstrap create bootstrap agent params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *BootstrapCreateBootstrapAgentParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) WithTimeout(timeout time.Duration) *BootstrapCreateBootstrapAgentParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) WithContext(ctx context.Context) *BootstrapCreateBootstrapAgentParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) WithHTTPClient(client *http.Client) *BootstrapCreateBootstrapAgentParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) WithBody(body *models.SentryBootstrapAgent) *BootstrapCreateBootstrapAgentParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) SetBody(body *models.SentryBootstrapAgent) {
	o.Body = body
}

// WithSpecTemplateRef adds the specTemplateRef to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) WithSpecTemplateRef(specTemplateRef string) *BootstrapCreateBootstrapAgentParams {
	o.SetSpecTemplateRef(specTemplateRef)
	return o
}

// SetSpecTemplateRef adds the specTemplateRef to the bootstrap create bootstrap agent params
func (o *BootstrapCreateBootstrapAgentParams) SetSpecTemplateRef(specTemplateRef string) {
	o.SpecTemplateRef = specTemplateRef
}

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

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

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

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