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

package filters

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

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

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

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

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

/*
FilterKeywordPutParams contains all the parameters to send to the API endpoint

	for the filter keyword put operation.

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

	/* ID.

	   ID of the filter keyword to update.
	*/
	ID string

	/* Keyword.

	     The text to be filtered

	Sample: fnord
	*/
	Keyword string

	/* WholeWord.

	     Should the filter consider word boundaries?

	Sample: true
	*/
	WholeWord *bool

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

// WithDefaults hydrates default values in the filter keyword put params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *FilterKeywordPutParams) WithDefaults() *FilterKeywordPutParams {
	o.SetDefaults()
	return o
}

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

// WithTimeout adds the timeout to the filter keyword put params
func (o *FilterKeywordPutParams) WithTimeout(timeout time.Duration) *FilterKeywordPutParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the filter keyword put params
func (o *FilterKeywordPutParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the filter keyword put params
func (o *FilterKeywordPutParams) WithContext(ctx context.Context) *FilterKeywordPutParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the filter keyword put params
func (o *FilterKeywordPutParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the filter keyword put params
func (o *FilterKeywordPutParams) WithHTTPClient(client *http.Client) *FilterKeywordPutParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the filter keyword put params
func (o *FilterKeywordPutParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithID adds the id to the filter keyword put params
func (o *FilterKeywordPutParams) WithID(id string) *FilterKeywordPutParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the filter keyword put params
func (o *FilterKeywordPutParams) SetID(id string) {
	o.ID = id
}

// WithKeyword adds the keyword to the filter keyword put params
func (o *FilterKeywordPutParams) WithKeyword(keyword string) *FilterKeywordPutParams {
	o.SetKeyword(keyword)
	return o
}

// SetKeyword adds the keyword to the filter keyword put params
func (o *FilterKeywordPutParams) SetKeyword(keyword string) {
	o.Keyword = keyword
}

// WithWholeWord adds the wholeWord to the filter keyword put params
func (o *FilterKeywordPutParams) WithWholeWord(wholeWord *bool) *FilterKeywordPutParams {
	o.SetWholeWord(wholeWord)
	return o
}

// SetWholeWord adds the wholeWord to the filter keyword put params
func (o *FilterKeywordPutParams) SetWholeWord(wholeWord *bool) {
	o.WholeWord = wholeWord
}

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

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

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

	// form param keyword
	frKeyword := o.Keyword
	fKeyword := frKeyword
	if fKeyword != "" {
		if err := r.SetFormParam("keyword", fKeyword); err != nil {
			return err
		}
	}

	if o.WholeWord != nil {

		// form param whole_word
		var frWholeWord bool
		if o.WholeWord != nil {
			frWholeWord = *o.WholeWord
		}
		fWholeWord := swag.FormatBool(frWholeWord)
		if fWholeWord != "" {
			if err := r.SetFormParam("whole_word", fWholeWord); err != nil {
				return err
			}
		}
	}

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