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

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

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

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

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

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

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

	for the detach replication operation.

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

	// ClusterID.
	//
	// Format: uint64
	ClusterID string

	// DetachType.
	DetachType string

	// OrgID.
	//
	// Format: uint64
	OrgID string

	// RepID.
	//
	// Format: uint64
	RepID string

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

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

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

// WithTimeout adds the timeout to the detach replication params
func (o *DetachReplicationParams) WithTimeout(timeout time.Duration) *DetachReplicationParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the detach replication params
func (o *DetachReplicationParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the detach replication params
func (o *DetachReplicationParams) WithContext(ctx context.Context) *DetachReplicationParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the detach replication params
func (o *DetachReplicationParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the detach replication params
func (o *DetachReplicationParams) WithHTTPClient(client *http.Client) *DetachReplicationParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the detach replication params
func (o *DetachReplicationParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithClusterID adds the clusterID to the detach replication params
func (o *DetachReplicationParams) WithClusterID(clusterID string) *DetachReplicationParams {
	o.SetClusterID(clusterID)
	return o
}

// SetClusterID adds the clusterId to the detach replication params
func (o *DetachReplicationParams) SetClusterID(clusterID string) {
	o.ClusterID = clusterID
}

// WithDetachType adds the detachType to the detach replication params
func (o *DetachReplicationParams) WithDetachType(detachType string) *DetachReplicationParams {
	o.SetDetachType(detachType)
	return o
}

// SetDetachType adds the detachType to the detach replication params
func (o *DetachReplicationParams) SetDetachType(detachType string) {
	o.DetachType = detachType
}

// WithOrgID adds the orgID to the detach replication params
func (o *DetachReplicationParams) WithOrgID(orgID string) *DetachReplicationParams {
	o.SetOrgID(orgID)
	return o
}

// SetOrgID adds the orgId to the detach replication params
func (o *DetachReplicationParams) SetOrgID(orgID string) {
	o.OrgID = orgID
}

// WithRepID adds the repID to the detach replication params
func (o *DetachReplicationParams) WithRepID(repID string) *DetachReplicationParams {
	o.SetRepID(repID)
	return o
}

// SetRepID adds the repId to the detach replication params
func (o *DetachReplicationParams) SetRepID(repID string) {
	o.RepID = repID
}

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

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

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

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

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

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

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