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

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

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

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

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

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

	for the get manifests manifest ID vehicles operation.

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

	/* Limit.

	   Max number of records
	*/
	Limit *int64

	/* ManifestID.

	   Manifest ID
	*/
	ManifestID int64

	/* Offset.

	   Records offset
	*/
	Offset *int64

	/* Order.

	   Sort on column with asc or desc
	*/
	Order *string

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

// WithDefaults hydrates default values in the get manifests manifest ID vehicles params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetManifestsManifestIDVehiclesParams) WithDefaults() *GetManifestsManifestIDVehiclesParams {
	o.SetDefaults()
	return o
}

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

// WithTimeout adds the timeout to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) WithTimeout(timeout time.Duration) *GetManifestsManifestIDVehiclesParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) WithContext(ctx context.Context) *GetManifestsManifestIDVehiclesParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) WithHTTPClient(client *http.Client) *GetManifestsManifestIDVehiclesParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithLimit adds the limit to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) WithLimit(limit *int64) *GetManifestsManifestIDVehiclesParams {
	o.SetLimit(limit)
	return o
}

// SetLimit adds the limit to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) SetLimit(limit *int64) {
	o.Limit = limit
}

// WithManifestID adds the manifestID to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) WithManifestID(manifestID int64) *GetManifestsManifestIDVehiclesParams {
	o.SetManifestID(manifestID)
	return o
}

// SetManifestID adds the manifestId to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) SetManifestID(manifestID int64) {
	o.ManifestID = manifestID
}

// WithOffset adds the offset to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) WithOffset(offset *int64) *GetManifestsManifestIDVehiclesParams {
	o.SetOffset(offset)
	return o
}

// SetOffset adds the offset to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) SetOffset(offset *int64) {
	o.Offset = offset
}

// WithOrder adds the order to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) WithOrder(order *string) *GetManifestsManifestIDVehiclesParams {
	o.SetOrder(order)
	return o
}

// SetOrder adds the order to the get manifests manifest ID vehicles params
func (o *GetManifestsManifestIDVehiclesParams) SetOrder(order *string) {
	o.Order = order
}

// WriteToRequest writes these params to a swagger request
func (o *GetManifestsManifestIDVehiclesParams) 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
			}
		}
	}

	// path param manifest_id
	if err := r.SetPathParam("manifest_id", swag.FormatInt64(o.ManifestID)); 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 o.Order != nil {

		// query param order
		var qrOrder string

		if o.Order != nil {
			qrOrder = *o.Order
		}
		qOrder := qrOrder
		if qOrder != "" {

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

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