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

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

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

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

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

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

	for the delete flashpack version operation.

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

	/* Data.

	   Flashpack version
	*/
	Data *models.CommonCarFlashpackVersionRequest

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

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

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

// WithTimeout adds the timeout to the delete flashpack version params
func (o *DeleteFlashpackVersionParams) WithTimeout(timeout time.Duration) *DeleteFlashpackVersionParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the delete flashpack version params
func (o *DeleteFlashpackVersionParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the delete flashpack version params
func (o *DeleteFlashpackVersionParams) WithContext(ctx context.Context) *DeleteFlashpackVersionParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the delete flashpack version params
func (o *DeleteFlashpackVersionParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the delete flashpack version params
func (o *DeleteFlashpackVersionParams) WithHTTPClient(client *http.Client) *DeleteFlashpackVersionParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the delete flashpack version params
func (o *DeleteFlashpackVersionParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithData adds the data to the delete flashpack version params
func (o *DeleteFlashpackVersionParams) WithData(data *models.CommonCarFlashpackVersionRequest) *DeleteFlashpackVersionParams {
	o.SetData(data)
	return o
}

// SetData adds the data to the delete flashpack version params
func (o *DeleteFlashpackVersionParams) SetData(data *models.CommonCarFlashpackVersionRequest) {
	o.Data = data
}

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

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

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