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

package operations

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

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

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

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

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

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

	for the get can signals dbc operation.

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

	/* Dbc.

	   DBC hash
	*/
	Dbc string

	/* Limit.

	   Max number of records
	*/
	Limit *int64

	/* Offset.

	   Records offset
	*/
	Offset *int64

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

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

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

// WithTimeout adds the timeout to the get can signals dbc params
func (o *GetCanSignalsDbcParams) WithTimeout(timeout time.Duration) *GetCanSignalsDbcParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get can signals dbc params
func (o *GetCanSignalsDbcParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get can signals dbc params
func (o *GetCanSignalsDbcParams) WithContext(ctx context.Context) *GetCanSignalsDbcParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get can signals dbc params
func (o *GetCanSignalsDbcParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get can signals dbc params
func (o *GetCanSignalsDbcParams) WithHTTPClient(client *http.Client) *GetCanSignalsDbcParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get can signals dbc params
func (o *GetCanSignalsDbcParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithDbc adds the dbc to the get can signals dbc params
func (o *GetCanSignalsDbcParams) WithDbc(dbc string) *GetCanSignalsDbcParams {
	o.SetDbc(dbc)
	return o
}

// SetDbc adds the dbc to the get can signals dbc params
func (o *GetCanSignalsDbcParams) SetDbc(dbc string) {
	o.Dbc = dbc
}

// WithLimit adds the limit to the get can signals dbc params
func (o *GetCanSignalsDbcParams) WithLimit(limit *int64) *GetCanSignalsDbcParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the get can signals dbc params
func (o *GetCanSignalsDbcParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithOffset adds the offset to the get can signals dbc params
func (o *GetCanSignalsDbcParams) WithOffset(offset *int64) *GetCanSignalsDbcParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the get can signals dbc params
func (o *GetCanSignalsDbcParams) SetOffset(offset *int64) {
	o.Offset = offset
}

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

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

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

	if o.Limit != nil {

		// query param limit
		var qrLimit int64

		if o.Limit != nil {
			qrLimit = *o.Limit
		}
		qLimit := swag.FormatInt64(qrLimit)
		if qLimit != "" {

			if err := r.SetQueryParam("limit", qLimit); err != nil {
				return err
			}
		}
	}

	if o.Offset != nil {

		// query param offset
		var qrOffset int64

		if o.Offset != nil {
			qrOffset = *o.Offset
		}
		qOffset := swag.FormatInt64(qrOffset)
		if qOffset != "" {

			if err := r.SetQueryParam("offset", qOffset); err != nil {
				return err
			}
		}
	}

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