func (o *GetTCPRequestRuleDefault) WithPayload(payload *models.Error) *GetTCPRequestRuleDefault {
	o.Payload = payload
	return o
}
WithPayload adds the payload to the get 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 GetTCPRequestRuleOKCode int = 200
type GetTCPRequestRuleOK struct {
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *GetTCPRequestRuleOKBody `json:"body,omitempty"`
}
func NewGetTCPRequestRuleOK() *GetTCPRequestRuleOK {
	return &GetTCPRequestRuleOK{}
}
func (o *GetTCPRequestRuleOK) WithConfigurationVersion(configurationVersion string) *GetTCPRequestRuleOK {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *GetTCPRequestRuleOK) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}
func (o *GetTCPRequestRuleOK) WithPayload(payload *GetTCPRequestRuleOKBody) *GetTCPRequestRuleOK {
	o.Payload = payload
	return o
}
func (o *GetTCPRequestRuleOK) SetPayload(payload *GetTCPRequestRuleOKBody) {
	o.Payload = payload
}
func (o *GetTCPRequestRuleOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
	configurationVersion := o.ConfigurationVersion
	if configurationVersion != "" {
		rw.Header().Set("Configuration-Version", configurationVersion)
	}
	rw.WriteHeader(200)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err)  
		}
	}
}
const GetTCPRequestRuleNotFoundCode int = 404
type GetTCPRequestRuleNotFound struct {
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewGetTCPRequestRuleNotFound() *GetTCPRequestRuleNotFound {
	return &GetTCPRequestRuleNotFound{}
}
func (o *GetTCPRequestRuleNotFound) WithConfigurationVersion(configurationVersion string) *GetTCPRequestRuleNotFound {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *GetTCPRequestRuleNotFound) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}
func (o *GetTCPRequestRuleNotFound) WithPayload(payload *models.Error) *GetTCPRequestRuleNotFound {
	o.Payload = payload
	return o
}
func (o *GetTCPRequestRuleNotFound) SetPayload(payload *models.Error) {
	o.Payload = payload
}
func (o *GetTCPRequestRuleNotFound) 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 GetTCPRequestRuleDefault struct {
	_statusCode int
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewGetTCPRequestRuleDefault(code int) *GetTCPRequestRuleDefault {
	if code <= 0 {
		code = 500
	}
	return &GetTCPRequestRuleDefault{
		_statusCode: code,
	}
}
func (o *GetTCPRequestRuleDefault) WithStatusCode(code int) *GetTCPRequestRuleDefault {
	o._statusCode = code
	return o
}
func (o *GetTCPRequestRuleDefault) SetStatusCode(code int) {
	o._statusCode = code
}
func (o *GetTCPRequestRuleDefault) WithConfigurationVersion(configurationVersion string) *GetTCPRequestRuleDefault {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *GetTCPRequestRuleDefault) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}