func (o *CreateBackendSwitchingRuleDefault) WithPayload(payload *models.Error) *CreateBackendSwitchingRuleDefault {
	o.Payload = payload
	return o
}
WithPayload adds the payload to the create backend switching rule default response
package backend_switching_rule
import (
	"net/http"
	"github.com/go-openapi/runtime"
	"github.com/haproxytech/client-native/v2/models"
)
const CreateBackendSwitchingRuleCreatedCode int = 201
type CreateBackendSwitchingRuleCreated struct {
	Payload *models.BackendSwitchingRule `json:"body,omitempty"`
}
func NewCreateBackendSwitchingRuleCreated() *CreateBackendSwitchingRuleCreated {
	return &CreateBackendSwitchingRuleCreated{}
}
func (o *CreateBackendSwitchingRuleCreated) WithPayload(payload *models.BackendSwitchingRule) *CreateBackendSwitchingRuleCreated {
	o.Payload = payload
	return o
}
func (o *CreateBackendSwitchingRuleCreated) SetPayload(payload *models.BackendSwitchingRule) {
	o.Payload = payload
}
func (o *CreateBackendSwitchingRuleCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
	rw.WriteHeader(201)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err)  
		}
	}
}
const CreateBackendSwitchingRuleAcceptedCode int = 202
type CreateBackendSwitchingRuleAccepted struct {
	ReloadID string `json:"Reload-ID"`
	Payload *models.BackendSwitchingRule `json:"body,omitempty"`
}
func NewCreateBackendSwitchingRuleAccepted() *CreateBackendSwitchingRuleAccepted {
	return &CreateBackendSwitchingRuleAccepted{}
}
func (o *CreateBackendSwitchingRuleAccepted) WithReloadID(reloadID string) *CreateBackendSwitchingRuleAccepted {
	o.ReloadID = reloadID
	return o
}
func (o *CreateBackendSwitchingRuleAccepted) SetReloadID(reloadID string) {
	o.ReloadID = reloadID
}
func (o *CreateBackendSwitchingRuleAccepted) WithPayload(payload *models.BackendSwitchingRule) *CreateBackendSwitchingRuleAccepted {
	o.Payload = payload
	return o
}
func (o *CreateBackendSwitchingRuleAccepted) SetPayload(payload *models.BackendSwitchingRule) {
	o.Payload = payload
}
func (o *CreateBackendSwitchingRuleAccepted) 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 CreateBackendSwitchingRuleBadRequestCode int = 400
type CreateBackendSwitchingRuleBadRequest struct {
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewCreateBackendSwitchingRuleBadRequest() *CreateBackendSwitchingRuleBadRequest {
	return &CreateBackendSwitchingRuleBadRequest{}
}
func (o *CreateBackendSwitchingRuleBadRequest) WithConfigurationVersion(configurationVersion string) *CreateBackendSwitchingRuleBadRequest {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *CreateBackendSwitchingRuleBadRequest) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}
func (o *CreateBackendSwitchingRuleBadRequest) WithPayload(payload *models.Error) *CreateBackendSwitchingRuleBadRequest {
	o.Payload = payload
	return o
}
func (o *CreateBackendSwitchingRuleBadRequest) SetPayload(payload *models.Error) {
	o.Payload = payload
}
func (o *CreateBackendSwitchingRuleBadRequest) 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 CreateBackendSwitchingRuleConflictCode int = 409
type CreateBackendSwitchingRuleConflict struct {
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewCreateBackendSwitchingRuleConflict() *CreateBackendSwitchingRuleConflict {
	return &CreateBackendSwitchingRuleConflict{}
}
func (o *CreateBackendSwitchingRuleConflict) WithConfigurationVersion(configurationVersion string) *CreateBackendSwitchingRuleConflict {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *CreateBackendSwitchingRuleConflict) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}
func (o *CreateBackendSwitchingRuleConflict) WithPayload(payload *models.Error) *CreateBackendSwitchingRuleConflict {
	o.Payload = payload
	return o
}
func (o *CreateBackendSwitchingRuleConflict) SetPayload(payload *models.Error) {
	o.Payload = payload
}
func (o *CreateBackendSwitchingRuleConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
	configurationVersion := o.ConfigurationVersion
	if configurationVersion != "" {
		rw.Header().Set("Configuration-Version", configurationVersion)
	}
	rw.WriteHeader(409)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err)  
		}
	}
}
type CreateBackendSwitchingRuleDefault struct {
	_statusCode int
	ConfigurationVersion string `json:"Configuration-Version"`
	Payload *models.Error `json:"body,omitempty"`
}
func NewCreateBackendSwitchingRuleDefault(code int) *CreateBackendSwitchingRuleDefault {
	if code <= 0 {
		code = 500
	}
	return &CreateBackendSwitchingRuleDefault{
		_statusCode: code,
	}
}
func (o *CreateBackendSwitchingRuleDefault) WithStatusCode(code int) *CreateBackendSwitchingRuleDefault {
	o._statusCode = code
	return o
}
func (o *CreateBackendSwitchingRuleDefault) SetStatusCode(code int) {
	o._statusCode = code
}
func (o *CreateBackendSwitchingRuleDefault) WithConfigurationVersion(configurationVersion string) *CreateBackendSwitchingRuleDefault {
	o.ConfigurationVersion = configurationVersion
	return o
}
func (o *CreateBackendSwitchingRuleDefault) SetConfigurationVersion(configurationVersion string) {
	o.ConfigurationVersion = configurationVersion
}