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

package dashboard_public

// 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/grafana/grafana-openapi-client-go/models"
)

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

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

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

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

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

	for the update public dashboard operation.

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

	// Body.
	Body *models.PublicDashboardDTO

	// DashboardUID.
	DashboardUID string

	// UID.
	UID string

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

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

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

// WithTimeout adds the timeout to the update public dashboard params
func (o *UpdatePublicDashboardParams) WithTimeout(timeout time.Duration) *UpdatePublicDashboardParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the update public dashboard params
func (o *UpdatePublicDashboardParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the update public dashboard params
func (o *UpdatePublicDashboardParams) WithContext(ctx context.Context) *UpdatePublicDashboardParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the update public dashboard params
func (o *UpdatePublicDashboardParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the update public dashboard params
func (o *UpdatePublicDashboardParams) WithHTTPClient(client *http.Client) *UpdatePublicDashboardParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the update public dashboard params
func (o *UpdatePublicDashboardParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the update public dashboard params
func (o *UpdatePublicDashboardParams) WithBody(body *models.PublicDashboardDTO) *UpdatePublicDashboardParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the update public dashboard params
func (o *UpdatePublicDashboardParams) SetBody(body *models.PublicDashboardDTO) {
	o.Body = body
}

// WithDashboardUID adds the dashboardUID to the update public dashboard params
func (o *UpdatePublicDashboardParams) WithDashboardUID(dashboardUID string) *UpdatePublicDashboardParams {
	o.SetDashboardUID(dashboardUID)
	return o
}

// SetDashboardUID adds the dashboardUid to the update public dashboard params
func (o *UpdatePublicDashboardParams) SetDashboardUID(dashboardUID string) {
	o.DashboardUID = dashboardUID
}

// WithUID adds the uid to the update public dashboard params
func (o *UpdatePublicDashboardParams) WithUID(uid string) *UpdatePublicDashboardParams {
	o.SetUID(uid)
	return o
}

// SetUID adds the uid to the update public dashboard params
func (o *UpdatePublicDashboardParams) SetUID(uid string) {
	o.UID = uid
}

// WriteToRequest writes these params to a swagger request
func (o *UpdatePublicDashboardParams) 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 dashboardUid
	if err := r.SetPathParam("dashboardUid", o.DashboardUID); err != nil {
		return err
	}

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

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