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

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

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

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

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

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

	for the get vehicle vin fleets operation.

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

	/* Limit.

	   Max number of records
	*/
	Limit *int64

	/* Offset.

	   Records offset
	*/
	Offset *int64

	/* Search.

	   FLEET_NAME
	*/
	Search string

	/* Vin.

	   VIN
	*/
	Vin string

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

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

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

// WithTimeout adds the timeout to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) WithTimeout(timeout time.Duration) *GetVehicleVinFleetsParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) WithContext(ctx context.Context) *GetVehicleVinFleetsParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) WithHTTPClient(client *http.Client) *GetVehicleVinFleetsParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithLimit adds the limit to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) WithLimit(limit *int64) *GetVehicleVinFleetsParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithOffset adds the offset to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) WithOffset(offset *int64) *GetVehicleVinFleetsParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) SetOffset(offset *int64) {
	o.Offset = offset
}

// WithSearch adds the search to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) WithSearch(search string) *GetVehicleVinFleetsParams {
	o.SetSearch(search)
	return o
}

// SetSearch adds the search to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) SetSearch(search string) {
	o.Search = search
}

// WithVin adds the vin to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) WithVin(vin string) *GetVehicleVinFleetsParams {
	o.SetVin(vin)
	return o
}

// SetVin adds the vin to the get vehicle vin fleets params
func (o *GetVehicleVinFleetsParams) SetVin(vin string) {
	o.Vin = vin
}

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

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

	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
			}
		}
	}

	// query param search
	qrSearch := o.Search
	qSearch := qrSearch
	if qSearch != "" {

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

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

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