// 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/go-openapi/swag"
)

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

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

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

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

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

	for the query public dashboard operation.

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

	// AccessToken.
	AccessToken string

	// PanelID.
	//
	// Format: int64
	PanelID int64

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

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

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

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

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

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

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

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

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

// WithAccessToken adds the accessToken to the query public dashboard params
func (o *QueryPublicDashboardParams) WithAccessToken(accessToken string) *QueryPublicDashboardParams {
	o.SetAccessToken(accessToken)
	return o
}

// SetAccessToken adds the accessToken to the query public dashboard params
func (o *QueryPublicDashboardParams) SetAccessToken(accessToken string) {
	o.AccessToken = accessToken
}

// WithPanelID adds the panelID to the query public dashboard params
func (o *QueryPublicDashboardParams) WithPanelID(panelID int64) *QueryPublicDashboardParams {
	o.SetPanelID(panelID)
	return o
}

// SetPanelID adds the panelId to the query public dashboard params
func (o *QueryPublicDashboardParams) SetPanelID(panelID int64) {
	o.PanelID = panelID
}

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

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

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

	// path param panelId
	if err := r.SetPathParam("panelId", swag.FormatInt64(o.PanelID)); err != nil {
		return err
	}

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