func (o *ReplaceSpoeMessageBadRequest) 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)  
		}
	}
}
WriteResponse to the client
package spoe
import (
	"net/http"
	"github.com/go-openapi/runtime"
	"github.com/haproxytech/client-native/v2/models"
)
const ReplaceSpoeMessageOKCode int = 200
type ReplaceSpoeMessageOK struct {
	Payload *models.SpoeMessage `json:"body,omitempty"`
}
func NewReplaceSpoeMessageOK() *ReplaceSpoeMessageOK {
	return &ReplaceSpoeMessageOK{}
}
func (o *ReplaceSpoeMessageOK) WithPayload(payload *models.SpoeMessage) *ReplaceSpoeMessageOK {
	o.Payload = payload
	return o
}
func (o *ReplaceSpoeMessageOK) SetPayload(payload *models.SpoeMessage) {
	o.Payload = payload
}
func (o *ReplaceSpoeMessageOK) 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 ReplaceSpoeMessageBadRequestCode int = 400
type ReplaceSpoeMessageBadRequest struct {
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewReplaceSpoeMessageBadRequest() *ReplaceSpoeMessageBadRequest {
	return &ReplaceSpoeMessageBadRequest{}
}
func (o *ReplaceSpoeMessageBadRequest) WithConfigurationVersion(configurationVersion string) *ReplaceSpoeMessageBadRequest {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *ReplaceSpoeMessageBadRequest) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}
func (o *ReplaceSpoeMessageBadRequest) WithPayload(payload *models.Error) *ReplaceSpoeMessageBadRequest {
	o.Payload = payload
	return o
}
func (o *ReplaceSpoeMessageBadRequest) SetPayload(payload *models.Error) {
	o.Payload = payload
}