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

package pipeline_service

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

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

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

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

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

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

	for the pipeline service delete pipeline operation.

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

	/* Cascade.

	     Optional. If true, the pipeline and all its versions will be deleted.
	If false (default), only the pipeline will be deleted if it has no versions.
	*/
	Cascade *bool

	/* PipelineID.

	   Required input. ID of the pipeline to be deleted.
	*/
	PipelineID string

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

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

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

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

// SetTimeout adds the timeout to the pipeline service delete pipeline params
func (o *PipelineServiceDeletePipelineParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

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

// SetContext adds the context to the pipeline service delete pipeline params
func (o *PipelineServiceDeletePipelineParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

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

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

// WithCascade adds the cascade to the pipeline service delete pipeline params
func (o *PipelineServiceDeletePipelineParams) WithCascade(cascade *bool) *PipelineServiceDeletePipelineParams {
	o.SetCascade(cascade)
	return o
}

// SetCascade adds the cascade to the pipeline service delete pipeline params
func (o *PipelineServiceDeletePipelineParams) SetCascade(cascade *bool) {
	o.Cascade = cascade
}

// WithPipelineID adds the pipelineID to the pipeline service delete pipeline params
func (o *PipelineServiceDeletePipelineParams) WithPipelineID(pipelineID string) *PipelineServiceDeletePipelineParams {
	o.SetPipelineID(pipelineID)
	return o
}

// SetPipelineID adds the pipelineId to the pipeline service delete pipeline params
func (o *PipelineServiceDeletePipelineParams) SetPipelineID(pipelineID string) {
	o.PipelineID = pipelineID
}

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

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

	if o.Cascade != nil {

		// query param cascade
		var qrCascade bool

		if o.Cascade != nil {
			qrCascade = *o.Cascade
		}
		qCascade := swag.FormatBool(qrCascade)
		if qCascade != "" {

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

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

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