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

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

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

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

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

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

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

	for the delete branch operation.

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

	/* BranchName.

	   The name of creating branch.
	*/
	BranchName string

	/* ClusterID.

	   The ID of the cluster.

	   Format: uint64
	*/
	ClusterID string

	/* ProjectID.

	   The ID of the project.

	   Format: uint64
	*/
	ProjectID string

	/* RootBranchID.

	   The id of the root branch.
	*/
	RootBranchID string

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

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

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

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

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

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

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

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

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

// WithBranchName adds the branchName to the delete branch params
func (o *DeleteBranchParams) WithBranchName(branchName string) *DeleteBranchParams {
	o.SetBranchName(branchName)
	return o
}

// SetBranchName adds the branchName to the delete branch params
func (o *DeleteBranchParams) SetBranchName(branchName string) {
	o.BranchName = branchName
}

// WithClusterID adds the clusterID to the delete branch params
func (o *DeleteBranchParams) WithClusterID(clusterID string) *DeleteBranchParams {
	o.SetClusterID(clusterID)
	return o
}

// SetClusterID adds the clusterId to the delete branch params
func (o *DeleteBranchParams) SetClusterID(clusterID string) {
	o.ClusterID = clusterID
}

// WithProjectID adds the projectID to the delete branch params
func (o *DeleteBranchParams) WithProjectID(projectID string) *DeleteBranchParams {
	o.SetProjectID(projectID)
	return o
}

// SetProjectID adds the projectId to the delete branch params
func (o *DeleteBranchParams) SetProjectID(projectID string) {
	o.ProjectID = projectID
}

// WithRootBranchID adds the rootBranchID to the delete branch params
func (o *DeleteBranchParams) WithRootBranchID(rootBranchID string) *DeleteBranchParams {
	o.SetRootBranchID(rootBranchID)
	return o
}

// SetRootBranchID adds the rootBranchId to the delete branch params
func (o *DeleteBranchParams) SetRootBranchID(rootBranchID string) {
	o.RootBranchID = rootBranchID
}

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

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

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

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

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

	// query param root_branch_id
	qrRootBranchID := o.RootBranchID
	qRootBranchID := qrRootBranchID
	if qRootBranchID != "" {

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

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