// 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/fiskerinc/cloud-services/pkg/ota_api/models"
)

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

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

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

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

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

	for the post carsconnected operation.

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

	/* Vins.

	   VINs
	*/
	Vins *models.CommonVINs

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

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

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

// WithTimeout adds the timeout to the post carsconnected params
func (o *PostCarsconnectedParams) WithTimeout(timeout time.Duration) *PostCarsconnectedParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the post carsconnected params
func (o *PostCarsconnectedParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the post carsconnected params
func (o *PostCarsconnectedParams) WithContext(ctx context.Context) *PostCarsconnectedParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post carsconnected params
func (o *PostCarsconnectedParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the post carsconnected params
func (o *PostCarsconnectedParams) WithHTTPClient(client *http.Client) *PostCarsconnectedParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the post carsconnected params
func (o *PostCarsconnectedParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithVins adds the vins to the post carsconnected params
func (o *PostCarsconnectedParams) WithVins(vins *models.CommonVINs) *PostCarsconnectedParams {
	o.SetVins(vins)
	return o
}

// SetVins adds the vins to the post carsconnected params
func (o *PostCarsconnectedParams) SetVins(vins *models.CommonVINs) {
	o.Vins = vins
}

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

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

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