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

package query_history

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

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

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

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

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

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

	for the unstar query operation.

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

	// QueryHistoryUID.
	QueryHistoryUID string

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

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

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

// WithTimeout adds the timeout to the unstar query params
func (o *UnstarQueryParams) WithTimeout(timeout time.Duration) *UnstarQueryParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the unstar query params
func (o *UnstarQueryParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the unstar query params
func (o *UnstarQueryParams) WithContext(ctx context.Context) *UnstarQueryParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the unstar query params
func (o *UnstarQueryParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the unstar query params
func (o *UnstarQueryParams) WithHTTPClient(client *http.Client) *UnstarQueryParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the unstar query params
func (o *UnstarQueryParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithQueryHistoryUID adds the queryHistoryUID to the unstar query params
func (o *UnstarQueryParams) WithQueryHistoryUID(queryHistoryUID string) *UnstarQueryParams {
	o.SetQueryHistoryUID(queryHistoryUID)
	return o
}

// SetQueryHistoryUID adds the queryHistoryUid to the unstar query params
func (o *UnstarQueryParams) SetQueryHistoryUID(queryHistoryUID string) {
	o.QueryHistoryUID = queryHistoryUID
}

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

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

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

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