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

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

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

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

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

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

	for the delete subscription operation.

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

	/* ID.

	   Subscription id
	*/
	ID *string

	/* Name.

	   Subscription type name
	*/
	Name *string

	/* Vin.

	   Subscription vin
	*/
	Vin *string

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

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

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

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

// SetTimeout adds the timeout to the delete subscription params
func (o *DeleteSubscriptionParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the delete subscription params
func (o *DeleteSubscriptionParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithID adds the id to the delete subscription params
func (o *DeleteSubscriptionParams) WithID(id *string) *DeleteSubscriptionParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the delete subscription params
func (o *DeleteSubscriptionParams) SetID(id *string) {
	o.ID = id
}

// WithName adds the name to the delete subscription params
func (o *DeleteSubscriptionParams) WithName(name *string) *DeleteSubscriptionParams {
	o.SetName(name)
	return o
}

// SetName adds the name to the delete subscription params
func (o *DeleteSubscriptionParams) SetName(name *string) {
	o.Name = name
}

// WithVin adds the vin to the delete subscription params
func (o *DeleteSubscriptionParams) WithVin(vin *string) *DeleteSubscriptionParams {
	o.SetVin(vin)
	return o
}

// SetVin adds the vin to the delete subscription params
func (o *DeleteSubscriptionParams) SetVin(vin *string) {
	o.Vin = vin
}

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

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

	if o.ID != nil {

		// query param id
		var qrID string

		if o.ID != nil {
			qrID = *o.ID
		}
		qID := qrID
		if qID != "" {

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

	if o.Name != nil {

		// query param name
		var qrName string

		if o.Name != nil {
			qrName = *o.Name
		}
		qName := qrName
		if qName != "" {

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

	if o.Vin != nil {

		// query param vin
		var qrVin string

		if o.Vin != nil {
			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
}
