func (o *ReplaceNameserverDefault) SetPayload(payload *models.Error) {
	o.Payload = payload
}
SetPayload sets the payload to the replace nameserver default response
package nameserver
import (
	"net/http"
	"github.com/go-openapi/runtime"
	"github.com/haproxytech/client-native/v2/models"
)
const ReplaceNameserverOKCode int = 200
type ReplaceNameserverOK struct {
	Payload *models.Nameserver `json:"body,omitempty"`
}
func NewReplaceNameserverOK() *ReplaceNameserverOK {
	return &ReplaceNameserverOK{}
}
func (o *ReplaceNameserverOK) WithPayload(payload *models.Nameserver) *ReplaceNameserverOK {
	o.Payload = payload
	return o
}
func (o *ReplaceNameserverOK) SetPayload(payload *models.Nameserver) {
	o.Payload = payload
}
func (o *ReplaceNameserverOK) 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 ReplaceNameserverAcceptedCode int = 202
type ReplaceNameserverAccepted struct {
	ReloadID string `json:"Reload-ID"`
	Payload *models.Nameserver `json:"body,omitempty"`
}
func NewReplaceNameserverAccepted() *ReplaceNameserverAccepted {
	return &ReplaceNameserverAccepted{}
}
func (o *ReplaceNameserverAccepted) WithReloadID(reloadID string) *ReplaceNameserverAccepted {
	o.ReloadID = reloadID
	return o
}
func (o *ReplaceNameserverAccepted) SetReloadID(reloadID string) {
	o.ReloadID = reloadID
}
func (o *ReplaceNameserverAccepted) WithPayload(payload *models.Nameserver) *ReplaceNameserverAccepted {
	o.Payload = payload
	return o
}
func (o *ReplaceNameserverAccepted) SetPayload(payload *models.Nameserver) {
	o.Payload = payload
}
func (o *ReplaceNameserverAccepted) 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 ReplaceNameserverBadRequestCode int = 400
type ReplaceNameserverBadRequest struct {
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewReplaceNameserverBadRequest() *ReplaceNameserverBadRequest {
	return &ReplaceNameserverBadRequest{}
}
func (o *ReplaceNameserverBadRequest) WithConfigurationVersion(configurationVersion string) *ReplaceNameserverBadRequest {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *ReplaceNameserverBadRequest) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}
func (o *ReplaceNameserverBadRequest) WithPayload(payload *models.Error) *ReplaceNameserverBadRequest {
	o.Payload = payload
	return o
}
func (o *ReplaceNameserverBadRequest) SetPayload(payload *models.Error) {
	o.Payload = payload
}
func (o *ReplaceNameserverBadRequest) 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 ReplaceNameserverNotFoundCode int = 404
type ReplaceNameserverNotFound struct {
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewReplaceNameserverNotFound() *ReplaceNameserverNotFound {
	return &ReplaceNameserverNotFound{}
}
func (o *ReplaceNameserverNotFound) WithConfigurationVersion(configurationVersion string) *ReplaceNameserverNotFound {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *ReplaceNameserverNotFound) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}
func (o *ReplaceNameserverNotFound) WithPayload(payload *models.Error) *ReplaceNameserverNotFound {
	o.Payload = payload
	return o
}
func (o *ReplaceNameserverNotFound) SetPayload(payload *models.Error) {
	o.Payload = payload
}
func (o *ReplaceNameserverNotFound) 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 ReplaceNameserverDefault struct {
	_statusCode int
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewReplaceNameserverDefault(code int) *ReplaceNameserverDefault {
	if code <= 0 {
		code = 500
	}
	return &ReplaceNameserverDefault{
		_statusCode: code,
	}
}
func (o *ReplaceNameserverDefault) WithStatusCode(code int) *ReplaceNameserverDefault {
	o._statusCode = code
	return o
}
func (o *ReplaceNameserverDefault) SetStatusCode(code int) {
	o._statusCode = code
}
func (o *ReplaceNameserverDefault) WithConfigurationVersion(configurationVersion string) *ReplaceNameserverDefault {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *ReplaceNameserverDefault) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}
func (o *ReplaceNameserverDefault) WithPayload(payload *models.Error) *ReplaceNameserverDefault {
	o.Payload = payload
	return o
}