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

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

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

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

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

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

	for the get vehicle vin trex logs operation.

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

	/* Count.

	   Count in bytes
	*/
	Count *int64

	/* Date.

	   Logs date
	*/
	Date string

	/* Direction.

	   Cursor direction 'up' or 'down', default is 'down'
	*/
	Direction *string

	/* Offset.

	   Offset in bytes
	*/
	Offset *int64

	/* Vin.

	   Car vin
	*/
	Vin string

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

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

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

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

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

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

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

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

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

// WithCount adds the count to the get vehicle vin trex logs params
func (o *GetVehicleVinTrexLogsParams) WithCount(count *int64) *GetVehicleVinTrexLogsParams {
	o.SetCount(count)
	return o
}

// SetCount adds the count to the get vehicle vin trex logs params
func (o *GetVehicleVinTrexLogsParams) SetCount(count *int64) {
	o.Count = count
}

// WithDate adds the date to the get vehicle vin trex logs params
func (o *GetVehicleVinTrexLogsParams) WithDate(date string) *GetVehicleVinTrexLogsParams {
	o.SetDate(date)
	return o
}

// SetDate adds the date to the get vehicle vin trex logs params
func (o *GetVehicleVinTrexLogsParams) SetDate(date string) {
	o.Date = date
}

// WithDirection adds the direction to the get vehicle vin trex logs params
func (o *GetVehicleVinTrexLogsParams) WithDirection(direction *string) *GetVehicleVinTrexLogsParams {
	o.SetDirection(direction)
	return o
}

// SetDirection adds the direction to the get vehicle vin trex logs params
func (o *GetVehicleVinTrexLogsParams) SetDirection(direction *string) {
	o.Direction = direction
}

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

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

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

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

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

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

	if o.Count != nil {

		// query param count
		var qrCount int64

		if o.Count != nil {
			qrCount = *o.Count
		}
		qCount := swag.FormatInt64(qrCount)
		if qCount != "" {

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

	// query param date
	qrDate := o.Date
	qDate := qrDate
	if qDate != "" {

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

	if o.Direction != nil {

		// query param direction
		var qrDirection string

		if o.Direction != nil {
			qrDirection = *o.Direction
		}
		qDirection := qrDirection
		if qDirection != "" {

			if err := r.SetQueryParam("direction", qDirection); 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
			}
		}
	}

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

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