Files
cloud-services/pkg/ota_api/client/operations/put_vehicle_vin_parameters.go

176 lines
4.6 KiB
Go

// 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"
"fiskerinc.com/modules/ota_api/models"
)
// NewPutVehicleVinParams creates a new PutVehicleVinParams 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 NewPutVehicleVinParams() *PutVehicleVinParams {
return &PutVehicleVinParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutVehicleVinParamsWithTimeout creates a new PutVehicleVinParams object
// with the ability to set a timeout on a request.
func NewPutVehicleVinParamsWithTimeout(timeout time.Duration) *PutVehicleVinParams {
return &PutVehicleVinParams{
timeout: timeout,
}
}
// NewPutVehicleVinParamsWithContext creates a new PutVehicleVinParams object
// with the ability to set a context for a request.
func NewPutVehicleVinParamsWithContext(ctx context.Context) *PutVehicleVinParams {
return &PutVehicleVinParams{
Context: ctx,
}
}
// NewPutVehicleVinParamsWithHTTPClient creates a new PutVehicleVinParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutVehicleVinParamsWithHTTPClient(client *http.Client) *PutVehicleVinParams {
return &PutVehicleVinParams{
HTTPClient: client,
}
}
/*
PutVehicleVinParams contains all the parameters to send to the API endpoint
for the put vehicle vin operation.
Typically these are written to a http.Request.
*/
type PutVehicleVinParams struct {
/* Car.
vehicle data
*/
Car *models.CommonUpdateCarRequest
/* Vin.
VIN
*/
Vin string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put vehicle vin params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutVehicleVinParams) WithDefaults() *PutVehicleVinParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put vehicle vin params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutVehicleVinParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put vehicle vin params
func (o *PutVehicleVinParams) WithTimeout(timeout time.Duration) *PutVehicleVinParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put vehicle vin params
func (o *PutVehicleVinParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put vehicle vin params
func (o *PutVehicleVinParams) WithContext(ctx context.Context) *PutVehicleVinParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put vehicle vin params
func (o *PutVehicleVinParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put vehicle vin params
func (o *PutVehicleVinParams) WithHTTPClient(client *http.Client) *PutVehicleVinParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put vehicle vin params
func (o *PutVehicleVinParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithCar adds the car to the put vehicle vin params
func (o *PutVehicleVinParams) WithCar(car *models.CommonUpdateCarRequest) *PutVehicleVinParams {
o.SetCar(car)
return o
}
// SetCar adds the car to the put vehicle vin params
func (o *PutVehicleVinParams) SetCar(car *models.CommonUpdateCarRequest) {
o.Car = car
}
// WithVin adds the vin to the put vehicle vin params
func (o *PutVehicleVinParams) WithVin(vin string) *PutVehicleVinParams {
o.SetVin(vin)
return o
}
// SetVin adds the vin to the put vehicle vin params
func (o *PutVehicleVinParams) SetVin(vin string) {
o.Vin = vin
}
// WriteToRequest writes these params to a swagger request
func (o *PutVehicleVinParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Car != nil {
if err := r.SetBodyParam(o.Car); 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
}