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

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

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

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

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

/* BootstrapUpdateBootstrapAgentParams contains all the parameters to send to the API endpoint
   for the bootstrap update bootstrap agent operation.

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

	// Body.
	Body *models.SentryBootstrapAgent

	/* MetadataName.

	   name of the resource
	*/
	MetadataName string

	// SpecTemplateRef.
	SpecTemplateRef string

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

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

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

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

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

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

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

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

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

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

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

// WithMetadataName adds the metadataName to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) WithMetadataName(metadataName string) *BootstrapUpdateBootstrapAgentParams {
	o.SetMetadataName(metadataName)
	return o
}

// SetMetadataName adds the metadataName to the bootstrap update bootstrap agent params
func (o *BootstrapUpdateBootstrapAgentParams) SetMetadataName(metadataName string) {
	o.MetadataName = metadataName
}

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

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

// WriteToRequest writes these params to a swagger request
func (o *BootstrapUpdateBootstrapAgentParams) 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 metadata.name
	if err := r.SetPathParam("metadata.name", o.MetadataName); 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
}
