func (o *ReplaceTCPRequestRuleDefault) WithPayload(payload *models.Error) *ReplaceTCPRequestRuleDefault {
	o.Payload = payload
	return o
}
WithPayload adds the payload to the replace TCP request rule default response
package tcp_request_rule
import (
	"net/http"
	"github.com/go-openapi/runtime"
	"github.com/haproxytech/client-native/v2/models"
)
const ReplaceTCPRequestRuleOKCode int = 200
type ReplaceTCPRequestRuleOK struct {
	Payload *models.TCPRequestRule `json:"body,omitempty"`
}
func NewReplaceTCPRequestRuleOK() *ReplaceTCPRequestRuleOK {
	return &ReplaceTCPRequestRuleOK{}
}
func (o *ReplaceTCPRequestRuleOK) WithPayload(payload *models.TCPRequestRule) *ReplaceTCPRequestRuleOK {
	o.Payload = payload
	return o
}
func (o *ReplaceTCPRequestRuleOK) SetPayload(payload *models.TCPRequestRule) {
	o.Payload = payload
}
func (o *ReplaceTCPRequestRuleOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
	rw.WriteHeader(200)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err)  
		}
	}
}
const ReplaceTCPRequestRuleAcceptedCode int = 202
type ReplaceTCPRequestRuleAccepted struct {
	ReloadID string `json:"Reload-ID"`
	Payload *models.TCPRequestRule `json:"body,omitempty"`
}
func NewReplaceTCPRequestRuleAccepted() *ReplaceTCPRequestRuleAccepted {
	return &ReplaceTCPRequestRuleAccepted{}
}
func (o *ReplaceTCPRequestRuleAccepted) WithReloadID(reloadID string) *ReplaceTCPRequestRuleAccepted {
	o.ReloadID = reloadID
	return o
}
func (o *ReplaceTCPRequestRuleAccepted) SetReloadID(reloadID string) {
	o.ReloadID = reloadID
}
func (o *ReplaceTCPRequestRuleAccepted) WithPayload(payload *models.TCPRequestRule) *ReplaceTCPRequestRuleAccepted {
	o.Payload = payload
	return o
}
func (o *ReplaceTCPRequestRuleAccepted) SetPayload(payload *models.TCPRequestRule) {
	o.Payload = payload
}
func (o *ReplaceTCPRequestRuleAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
	reloadID := o.ReloadID
	if reloadID != "" {
		rw.Header().Set("Reload-ID", reloadID)
	}
	rw.WriteHeader(202)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err)  
		}
	}
}
const ReplaceTCPRequestRuleBadRequestCode int = 400
type ReplaceTCPRequestRuleBadRequest struct {
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewReplaceTCPRequestRuleBadRequest() *ReplaceTCPRequestRuleBadRequest {
	return &ReplaceTCPRequestRuleBadRequest{}
}
func (o *ReplaceTCPRequestRuleBadRequest) WithConfigurationVersion(configurationVersion string) *ReplaceTCPRequestRuleBadRequest {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *ReplaceTCPRequestRuleBadRequest) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}
func (o *ReplaceTCPRequestRuleBadRequest) WithPayload(payload *models.Error) *ReplaceTCPRequestRuleBadRequest {
	o.Payload = payload
	return o
}
func (o *ReplaceTCPRequestRuleBadRequest) SetPayload(payload *models.Error) {
	o.Payload = payload
}
func (o *ReplaceTCPRequestRuleBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
	configurationVersion := o.ConfigurationVersion
	if configurationVersion != "" {
		rw.Header().Set("Configuration-Version", configurationVersion)
	}
	rw.WriteHeader(400)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err)  
		}
	}
}
const ReplaceTCPRequestRuleNotFoundCode int = 404
type ReplaceTCPRequestRuleNotFound struct {
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewReplaceTCPRequestRuleNotFound() *ReplaceTCPRequestRuleNotFound {
	return &ReplaceTCPRequestRuleNotFound{}
}
func (o *ReplaceTCPRequestRuleNotFound) WithConfigurationVersion(configurationVersion string) *ReplaceTCPRequestRuleNotFound {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *ReplaceTCPRequestRuleNotFound) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}
func (o *ReplaceTCPRequestRuleNotFound) WithPayload(payload *models.Error) *ReplaceTCPRequestRuleNotFound {
	o.Payload = payload
	return o
}
func (o *ReplaceTCPRequestRuleNotFound) SetPayload(payload *models.Error) {
	o.Payload = payload
}
func (o *ReplaceTCPRequestRuleNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
	configurationVersion := o.ConfigurationVersion
	if configurationVersion != "" {
		rw.Header().Set("Configuration-Version", configurationVersion)
	}
	rw.WriteHeader(404)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err)  
		}
	}
}
type ReplaceTCPRequestRuleDefault struct {
	_statusCode int
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewReplaceTCPRequestRuleDefault(code int) *ReplaceTCPRequestRuleDefault {
	if code <= 0 {
		code = 500
	}
	return &ReplaceTCPRequestRuleDefault{
		_statusCode: code,
	}
}
func (o *ReplaceTCPRequestRuleDefault) WithStatusCode(code int) *ReplaceTCPRequestRuleDefault {
	o._statusCode = code
	return o
}
func (o *ReplaceTCPRequestRuleDefault) SetStatusCode(code int) {
	o._statusCode = code
}
func (o *ReplaceTCPRequestRuleDefault) WithConfigurationVersion(configurationVersion string) *ReplaceTCPRequestRuleDefault {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *ReplaceTCPRequestRuleDefault) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}