// Code generated by go-swagger; DO NOT EDIT.

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

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

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

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

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

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

	for the delete package operation.

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

	/* Name.

	   name of the package
	*/
	Name string

	/* Owner.

	   owner of the package
	*/
	Owner string

	/* Type.

	   type of the package
	*/
	Type string

	/* Version.

	   version of the package
	*/
	Version string

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

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

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

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

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

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

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

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

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

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

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

// WithOwner adds the owner to the delete package params
func (o *DeletePackageParams) WithOwner(owner string) *DeletePackageParams {
	o.SetOwner(owner)
	return o
}

// SetOwner adds the owner to the delete package params
func (o *DeletePackageParams) SetOwner(owner string) {
	o.Owner = owner
}

// WithType adds the typeVar to the delete package params
func (o *DeletePackageParams) WithType(typeVar string) *DeletePackageParams {
	o.SetType(typeVar)
	return o
}

// SetType adds the type to the delete package params
func (o *DeletePackageParams) SetType(typeVar string) {
	o.Type = typeVar
}

// WithVersion adds the version to the delete package params
func (o *DeletePackageParams) WithVersion(version string) *DeletePackageParams {
	o.SetVersion(version)
	return o
}

// SetVersion adds the version to the delete package params
func (o *DeletePackageParams) SetVersion(version string) {
	o.Version = version
}

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

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

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

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

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

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

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