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

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

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

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

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

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

	for the post carupdate ID vehicle cancel operation.

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

	/* ID.

	   Car update id to cancel
	*/
	ID string

	/* Vin.

	   VIN of vehicle to send to
	*/
	Vin string

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

// WithDefaults hydrates default values in the post carupdate ID vehicle cancel params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostCarupdateIDVehicleCancelParams) WithDefaults() *PostCarupdateIDVehicleCancelParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the post carupdate ID vehicle cancel params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostCarupdateIDVehicleCancelParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the post carupdate ID vehicle cancel params
func (o *PostCarupdateIDVehicleCancelParams) WithTimeout(timeout time.Duration) *PostCarupdateIDVehicleCancelParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the post carupdate ID vehicle cancel params
func (o *PostCarupdateIDVehicleCancelParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the post carupdate ID vehicle cancel params
func (o *PostCarupdateIDVehicleCancelParams) WithContext(ctx context.Context) *PostCarupdateIDVehicleCancelParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post carupdate ID vehicle cancel params
func (o *PostCarupdateIDVehicleCancelParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the post carupdate ID vehicle cancel params
func (o *PostCarupdateIDVehicleCancelParams) WithHTTPClient(client *http.Client) *PostCarupdateIDVehicleCancelParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the post carupdate ID vehicle cancel params
func (o *PostCarupdateIDVehicleCancelParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithID adds the id to the post carupdate ID vehicle cancel params
func (o *PostCarupdateIDVehicleCancelParams) WithID(id string) *PostCarupdateIDVehicleCancelParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the post carupdate ID vehicle cancel params
func (o *PostCarupdateIDVehicleCancelParams) SetID(id string) {
	o.ID = id
}

// WithVin adds the vin to the post carupdate ID vehicle cancel params
func (o *PostCarupdateIDVehicleCancelParams) WithVin(vin string) *PostCarupdateIDVehicleCancelParams {
	o.SetVin(vin)
	return o
}

// SetVin adds the vin to the post carupdate ID vehicle cancel params
func (o *PostCarupdateIDVehicleCancelParams) SetVin(vin string) {
	o.Vin = vin
}

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

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

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

	// query param vin
	qrVin := o.Vin
	qVin := qrVin
	if qVin != "" {

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

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