// Code generated by go-swagger; DO NOT EDIT.

// Copyright 2019 HAProxy Technologies
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"
	"encoding/json"
	"strconv"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// Defaults Defaults
//
// # HAProxy defaults configuration
//
// swagger:model defaults
type Defaults struct {

	// error files
	ErrorFiles []*Errorfile `json:"error_files,omitempty"`

	// error files from HTTP errors
	ErrorFilesFromHTTPErrors []*Errorfiles `json:"errorfiles_from_http_errors,omitempty"`

	// abortonclose
	// Enum: [enabled disabled]
	Abortonclose string `json:"abortonclose,omitempty"`

	// accept invalid http request
	// Enum: [enabled disabled]
	AcceptInvalidHTTPRequest string `json:"accept_invalid_http_request,omitempty"`

	// accept invalid http response
	// Enum: [enabled disabled]
	AcceptInvalidHTTPResponse string `json:"accept_invalid_http_response,omitempty"`

	// adv check
	// Enum: [ssl-hello-chk smtpchk ldap-check mysql-check pgsql-check tcp-check redis-check httpchk]
	AdvCheck string `json:"adv_check,omitempty"`

	// allbackups
	// Enum: [enabled disabled]
	Allbackups string `json:"allbackups,omitempty"`

	// backlog
	Backlog *int64 `json:"backlog,omitempty"`

	// balance
	Balance *Balance `json:"balance,omitempty"`

	// bind process
	// Pattern: ^[^\s]+$
	BindProcess string `json:"bind_process,omitempty"`

	// check timeout
	CheckTimeout *int64 `json:"check_timeout,omitempty"`

	// checkcache
	// Enum: [enabled disabled]
	Checkcache string `json:"checkcache,omitempty"`

	// clflog
	Clflog bool `json:"clflog,omitempty"`

	// client fin timeout
	ClientFinTimeout *int64 `json:"client_fin_timeout,omitempty"`

	// client timeout
	ClientTimeout *int64 `json:"client_timeout,omitempty"`

	// clitcpka
	// Enum: [enabled disabled]
	Clitcpka string `json:"clitcpka,omitempty"`

	// clitcpka cnt
	ClitcpkaCnt *int64 `json:"clitcpka_cnt,omitempty"`

	// clitcpka idle
	ClitcpkaIdle *int64 `json:"clitcpka_idle,omitempty"`

	// clitcpka intvl
	ClitcpkaIntvl *int64 `json:"clitcpka_intvl,omitempty"`

	// compression
	Compression *Compression `json:"compression,omitempty"`

	// connect timeout
	ConnectTimeout *int64 `json:"connect_timeout,omitempty"`

	// contstats
	// Enum: [enabled]
	Contstats string `json:"contstats,omitempty"`

	// cookie
	Cookie *Cookie `json:"cookie,omitempty"`

	// default backend
	// Pattern: ^[A-Za-z0-9-_.:]+$
	DefaultBackend string `json:"default_backend,omitempty"`

	// default server
	DefaultServer *DefaultServer `json:"default_server,omitempty"`

	// disable h2 upgrade
	// Enum: [enabled disabled]
	DisableH2Upgrade string `json:"disable_h2_upgrade,omitempty"`

	// disabled
	Disabled bool `json:"disabled,omitempty"`

	// dontlog normal
	// Enum: [enabled disabled]
	DontlogNormal string `json:"dontlog_normal,omitempty"`

	// dontlognull
	// Enum: [enabled disabled]
	Dontlognull string `json:"dontlognull,omitempty"`

	// dynamic cookie key
	// Pattern: ^[^\s]+$
	DynamicCookieKey string `json:"dynamic_cookie_key,omitempty"`

	// email alert
	EmailAlert *EmailAlert `json:"email_alert,omitempty"`

	// enabled
	Enabled bool `json:"enabled,omitempty"`

	// error log format
	ErrorLogFormat string `json:"error_log_format,omitempty"`

	// errorloc302
	Errorloc302 *Errorloc `json:"errorloc302,omitempty"`

	// errorloc303
	Errorloc303 *Errorloc `json:"errorloc303,omitempty"`

	// external check
	// Enum: [enabled disabled]
	ExternalCheck string `json:"external_check,omitempty"`

	// external check command
	// Pattern: ^[^\s]+$
	ExternalCheckCommand string `json:"external_check_command,omitempty"`

	// external check path
	// Pattern: ^[^\s]+$
	ExternalCheckPath string `json:"external_check_path,omitempty"`

	// forwardfor
	Forwardfor *Forwardfor `json:"forwardfor,omitempty"`

	// from
	// Pattern: ^[A-Za-z0-9-_.:]+$
	From string `json:"from,omitempty"`

	// fullconn
	Fullconn *int64 `json:"fullconn,omitempty"`

	// h1 case adjust bogus client
	// Enum: [enabled disabled]
	H1CaseAdjustBogusClient string `json:"h1_case_adjust_bogus_client,omitempty"`

	// h1 case adjust bogus server
	// Enum: [enabled disabled]
	H1CaseAdjustBogusServer string `json:"h1_case_adjust_bogus_server,omitempty"`

	// hash type
	HashType *HashType `json:"hash_type,omitempty"`

	// http buffer request
	// Enum: [enabled disabled]
	HTTPBufferRequest string `json:"http-buffer-request,omitempty"`

	// http check
	HTTPCheck *HTTPCheck `json:"http-check,omitempty"`

	// http use htx
	// Enum: [enabled disabled]
	HTTPUseHtx string `json:"http-use-htx,omitempty"`

	// http connection mode
	// Enum: [httpclose http-server-close http-keep-alive]
	HTTPConnectionMode string `json:"http_connection_mode,omitempty"`

	// http ignore probes
	// Enum: [enabled disabled]
	HTTPIgnoreProbes string `json:"http_ignore_probes,omitempty"`

	// http keep alive timeout
	HTTPKeepAliveTimeout *int64 `json:"http_keep_alive_timeout,omitempty"`

	// http no delay
	// Enum: [enabled disabled]
	HTTPNoDelay string `json:"http_no_delay,omitempty"`

	// http pretend keepalive
	// Enum: [enabled disabled]
	HTTPPretendKeepalive string `json:"http_pretend_keepalive,omitempty"`

	// http request timeout
	HTTPRequestTimeout *int64 `json:"http_request_timeout,omitempty"`

	// http restrict req hdr names
	// Enum: [preserve delete reject]
	HTTPRestrictReqHdrNames string `json:"http_restrict_req_hdr_names,omitempty"`

	// http reuse
	// Enum: [aggressive always never safe]
	HTTPReuse string `json:"http_reuse,omitempty"`

	// http send name header
	HTTPSendNameHeader *string `json:"http_send_name_header,omitempty"`

	// http use proxy header
	// Enum: [enabled disabled]
	HTTPUseProxyHeader string `json:"http_use_proxy_header,omitempty"`

	// httpchk params
	HttpchkParams *HttpchkParams `json:"httpchk_params,omitempty"`

	// httplog
	Httplog bool `json:"httplog,omitempty"`

	// httpslog
	// Enum: [enabled disabled]
	Httpslog string `json:"httpslog,omitempty"`

	// idle close on response
	// Enum: [enabled disabled]
	IdleCloseOnResponse string `json:"idle_close_on_response,omitempty"`

	// independent streams
	// Enum: [enabled disabled]
	IndependentStreams string `json:"independent_streams,omitempty"`

	// load server state from file
	// Enum: [global local none]
	LoadServerStateFromFile string `json:"load_server_state_from_file,omitempty"`

	// log format
	LogFormat string `json:"log_format,omitempty"`

	// log format sd
	LogFormatSd string `json:"log_format_sd,omitempty"`

	// log health checks
	// Enum: [enabled disabled]
	LogHealthChecks string `json:"log_health_checks,omitempty"`

	// log separate errors
	// Enum: [enabled disabled]
	LogSeparateErrors string `json:"log_separate_errors,omitempty"`

	// log tag
	// Pattern: ^[^\s]+$
	LogTag string `json:"log_tag,omitempty"`

	// logasap
	// Enum: [enabled disabled]
	Logasap string `json:"logasap,omitempty"`

	// max keep alive queue
	MaxKeepAliveQueue *int64 `json:"max_keep_alive_queue,omitempty"`

	// maxconn
	Maxconn *int64 `json:"maxconn,omitempty"`

	// mode
	// Enum: [tcp http log]
	Mode string `json:"mode,omitempty"`

	// monitor uri
	MonitorURI MonitorURI `json:"monitor_uri,omitempty"`

	// mysql check params
	MysqlCheckParams *MysqlCheckParams `json:"mysql_check_params,omitempty"`

	// name
	// Pattern: ^[A-Za-z0-9-_.:]+$
	Name string `json:"name,omitempty"`

	// nolinger
	// Enum: [enabled disabled]
	Nolinger string `json:"nolinger,omitempty"`

	// originalto
	Originalto *Originalto `json:"originalto,omitempty"`

	// persist
	// Enum: [enabled disabled]
	Persist string `json:"persist,omitempty"`

	// persist rule
	PersistRule *PersistRule `json:"persist_rule,omitempty"`

	// pgsql check params
	PgsqlCheckParams *PgsqlCheckParams `json:"pgsql_check_params,omitempty"`

	// prefer last server
	// Enum: [enabled disabled]
	PreferLastServer string `json:"prefer_last_server,omitempty"`

	// queue timeout
	QueueTimeout *int64 `json:"queue_timeout,omitempty"`

	// redispatch
	Redispatch *Redispatch `json:"redispatch,omitempty"`

	// retries
	Retries *int64 `json:"retries,omitempty"`

	// retry on
	RetryOn string `json:"retry_on,omitempty"`

	// server fin timeout
	ServerFinTimeout *int64 `json:"server_fin_timeout,omitempty"`

	// server timeout
	ServerTimeout *int64 `json:"server_timeout,omitempty"`

	// smtpchk params
	SmtpchkParams *SmtpchkParams `json:"smtpchk_params,omitempty"`

	// socket stats
	// Enum: [enabled disabled]
	SocketStats string `json:"socket_stats,omitempty"`

	// source
	Source *Source `json:"source,omitempty"`

	// splice auto
	// Enum: [enabled disabled]
	SpliceAuto string `json:"splice_auto,omitempty"`

	// splice request
	// Enum: [enabled disabled]
	SpliceRequest string `json:"splice_request,omitempty"`

	// splice response
	// Enum: [enabled disabled]
	SpliceResponse string `json:"splice_response,omitempty"`

	// srvtcpka
	// Enum: [enabled disabled]
	Srvtcpka string `json:"srvtcpka,omitempty"`

	// srvtcpka cnt
	SrvtcpkaCnt *int64 `json:"srvtcpka_cnt,omitempty"`

	// srvtcpka idle
	SrvtcpkaIdle *int64 `json:"srvtcpka_idle,omitempty"`

	// srvtcpka intvl
	SrvtcpkaIntvl *int64 `json:"srvtcpka_intvl,omitempty"`

	// stats options
	StatsOptions *StatsOptions `json:"stats_options,omitempty"`

	// tarpit timeout
	TarpitTimeout *int64 `json:"tarpit_timeout,omitempty"`

	// tcp smart accept
	// Enum: [enabled disabled]
	TCPSmartAccept string `json:"tcp_smart_accept,omitempty"`

	// tcp smart connect
	// Enum: [enabled disabled]
	TCPSmartConnect string `json:"tcp_smart_connect,omitempty"`

	// tcpka
	// Enum: [enabled disabled]
	Tcpka string `json:"tcpka,omitempty"`

	// tcplog
	Tcplog bool `json:"tcplog,omitempty"`

	// transparent
	// Enum: [enabled disabled]
	Transparent string `json:"transparent,omitempty"`

	// tunnel timeout
	TunnelTimeout *int64 `json:"tunnel_timeout,omitempty"`

	// unique id format
	UniqueIDFormat string `json:"unique_id_format,omitempty"`

	// unique id header
	UniqueIDHeader string `json:"unique_id_header,omitempty"`
}

// Validate validates this defaults
func (m *Defaults) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateErrorFiles(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateErrorFilesFromHTTPErrors(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateAbortonclose(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateAcceptInvalidHTTPRequest(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateAcceptInvalidHTTPResponse(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateAdvCheck(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateAllbackups(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateBalance(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateBindProcess(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateCheckcache(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateClitcpka(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateCompression(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateContstats(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateCookie(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateDefaultBackend(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateDefaultServer(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateDisableH2Upgrade(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateDontlogNormal(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateDontlognull(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateDynamicCookieKey(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateEmailAlert(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateErrorloc302(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateErrorloc303(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateExternalCheck(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateExternalCheckCommand(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateExternalCheckPath(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateForwardfor(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateFrom(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateH1CaseAdjustBogusClient(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateH1CaseAdjustBogusServer(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHashType(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHTTPBufferRequest(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHTTPCheck(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHTTPUseHtx(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHTTPConnectionMode(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHTTPIgnoreProbes(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHTTPNoDelay(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHTTPPretendKeepalive(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHTTPRestrictReqHdrNames(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHTTPReuse(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHTTPUseProxyHeader(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHttpchkParams(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHttpslog(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateIdleCloseOnResponse(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateIndependentStreams(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateLoadServerStateFromFile(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateLogHealthChecks(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateLogSeparateErrors(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateLogTag(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateLogasap(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateMode(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateMonitorURI(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateMysqlCheckParams(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateName(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateNolinger(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateOriginalto(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validatePersist(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validatePersistRule(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validatePgsqlCheckParams(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validatePreferLastServer(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateRedispatch(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateSmtpchkParams(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateSocketStats(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateSource(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateSpliceAuto(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateSpliceRequest(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateSpliceResponse(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateSrvtcpka(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateStatsOptions(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateTCPSmartAccept(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateTCPSmartConnect(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateTcpka(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateTransparent(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *Defaults) validateErrorFiles(formats strfmt.Registry) error {
	if swag.IsZero(m.ErrorFiles) { // not required
		return nil
	}

	for i := 0; i < len(m.ErrorFiles); i++ {
		if swag.IsZero(m.ErrorFiles[i]) { // not required
			continue
		}

		if m.ErrorFiles[i] != nil {
			if err := m.ErrorFiles[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("error_files" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("error_files" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

func (m *Defaults) validateErrorFilesFromHTTPErrors(formats strfmt.Registry) error {
	if swag.IsZero(m.ErrorFilesFromHTTPErrors) { // not required
		return nil
	}

	for i := 0; i < len(m.ErrorFilesFromHTTPErrors); i++ {
		if swag.IsZero(m.ErrorFilesFromHTTPErrors[i]) { // not required
			continue
		}

		if m.ErrorFilesFromHTTPErrors[i] != nil {
			if err := m.ErrorFilesFromHTTPErrors[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("errorfiles_from_http_errors" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("errorfiles_from_http_errors" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

var defaultsTypeAbortonclosePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeAbortonclosePropEnum = append(defaultsTypeAbortonclosePropEnum, v)
	}
}

const (

	// DefaultsAbortoncloseEnabled captures enum value "enabled"
	DefaultsAbortoncloseEnabled string = "enabled"

	// DefaultsAbortoncloseDisabled captures enum value "disabled"
	DefaultsAbortoncloseDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateAbortoncloseEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeAbortonclosePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateAbortonclose(formats strfmt.Registry) error {
	if swag.IsZero(m.Abortonclose) { // not required
		return nil
	}

	// value enum
	if err := m.validateAbortoncloseEnum("abortonclose", "body", m.Abortonclose); err != nil {
		return err
	}

	return nil
}

var defaultsTypeAcceptInvalidHTTPRequestPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeAcceptInvalidHTTPRequestPropEnum = append(defaultsTypeAcceptInvalidHTTPRequestPropEnum, v)
	}
}

const (

	// DefaultsAcceptInvalidHTTPRequestEnabled captures enum value "enabled"
	DefaultsAcceptInvalidHTTPRequestEnabled string = "enabled"

	// DefaultsAcceptInvalidHTTPRequestDisabled captures enum value "disabled"
	DefaultsAcceptInvalidHTTPRequestDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateAcceptInvalidHTTPRequestEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeAcceptInvalidHTTPRequestPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateAcceptInvalidHTTPRequest(formats strfmt.Registry) error {
	if swag.IsZero(m.AcceptInvalidHTTPRequest) { // not required
		return nil
	}

	// value enum
	if err := m.validateAcceptInvalidHTTPRequestEnum("accept_invalid_http_request", "body", m.AcceptInvalidHTTPRequest); err != nil {
		return err
	}

	return nil
}

var defaultsTypeAcceptInvalidHTTPResponsePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeAcceptInvalidHTTPResponsePropEnum = append(defaultsTypeAcceptInvalidHTTPResponsePropEnum, v)
	}
}

const (

	// DefaultsAcceptInvalidHTTPResponseEnabled captures enum value "enabled"
	DefaultsAcceptInvalidHTTPResponseEnabled string = "enabled"

	// DefaultsAcceptInvalidHTTPResponseDisabled captures enum value "disabled"
	DefaultsAcceptInvalidHTTPResponseDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateAcceptInvalidHTTPResponseEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeAcceptInvalidHTTPResponsePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateAcceptInvalidHTTPResponse(formats strfmt.Registry) error {
	if swag.IsZero(m.AcceptInvalidHTTPResponse) { // not required
		return nil
	}

	// value enum
	if err := m.validateAcceptInvalidHTTPResponseEnum("accept_invalid_http_response", "body", m.AcceptInvalidHTTPResponse); err != nil {
		return err
	}

	return nil
}

var defaultsTypeAdvCheckPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["ssl-hello-chk","smtpchk","ldap-check","mysql-check","pgsql-check","tcp-check","redis-check","httpchk"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeAdvCheckPropEnum = append(defaultsTypeAdvCheckPropEnum, v)
	}
}

const (

	// DefaultsAdvCheckSslDashHelloDashChk captures enum value "ssl-hello-chk"
	DefaultsAdvCheckSslDashHelloDashChk string = "ssl-hello-chk"

	// DefaultsAdvCheckSmtpchk captures enum value "smtpchk"
	DefaultsAdvCheckSmtpchk string = "smtpchk"

	// DefaultsAdvCheckLdapDashCheck captures enum value "ldap-check"
	DefaultsAdvCheckLdapDashCheck string = "ldap-check"

	// DefaultsAdvCheckMysqlDashCheck captures enum value "mysql-check"
	DefaultsAdvCheckMysqlDashCheck string = "mysql-check"

	// DefaultsAdvCheckPgsqlDashCheck captures enum value "pgsql-check"
	DefaultsAdvCheckPgsqlDashCheck string = "pgsql-check"

	// DefaultsAdvCheckTCPDashCheck captures enum value "tcp-check"
	DefaultsAdvCheckTCPDashCheck string = "tcp-check"

	// DefaultsAdvCheckRedisDashCheck captures enum value "redis-check"
	DefaultsAdvCheckRedisDashCheck string = "redis-check"

	// DefaultsAdvCheckHttpchk captures enum value "httpchk"
	DefaultsAdvCheckHttpchk string = "httpchk"
)

// prop value enum
func (m *Defaults) validateAdvCheckEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeAdvCheckPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateAdvCheck(formats strfmt.Registry) error {
	if swag.IsZero(m.AdvCheck) { // not required
		return nil
	}

	// value enum
	if err := m.validateAdvCheckEnum("adv_check", "body", m.AdvCheck); err != nil {
		return err
	}

	return nil
}

var defaultsTypeAllbackupsPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeAllbackupsPropEnum = append(defaultsTypeAllbackupsPropEnum, v)
	}
}

const (

	// DefaultsAllbackupsEnabled captures enum value "enabled"
	DefaultsAllbackupsEnabled string = "enabled"

	// DefaultsAllbackupsDisabled captures enum value "disabled"
	DefaultsAllbackupsDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateAllbackupsEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeAllbackupsPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateAllbackups(formats strfmt.Registry) error {
	if swag.IsZero(m.Allbackups) { // not required
		return nil
	}

	// value enum
	if err := m.validateAllbackupsEnum("allbackups", "body", m.Allbackups); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateBalance(formats strfmt.Registry) error {
	if swag.IsZero(m.Balance) { // not required
		return nil
	}

	if m.Balance != nil {
		if err := m.Balance.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("balance")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("balance")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) validateBindProcess(formats strfmt.Registry) error {
	if swag.IsZero(m.BindProcess) { // not required
		return nil
	}

	if err := validate.Pattern("bind_process", "body", m.BindProcess, `^[^\s]+$`); err != nil {
		return err
	}

	return nil
}

var defaultsTypeCheckcachePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeCheckcachePropEnum = append(defaultsTypeCheckcachePropEnum, v)
	}
}

const (

	// DefaultsCheckcacheEnabled captures enum value "enabled"
	DefaultsCheckcacheEnabled string = "enabled"

	// DefaultsCheckcacheDisabled captures enum value "disabled"
	DefaultsCheckcacheDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateCheckcacheEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeCheckcachePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateCheckcache(formats strfmt.Registry) error {
	if swag.IsZero(m.Checkcache) { // not required
		return nil
	}

	// value enum
	if err := m.validateCheckcacheEnum("checkcache", "body", m.Checkcache); err != nil {
		return err
	}

	return nil
}

var defaultsTypeClitcpkaPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeClitcpkaPropEnum = append(defaultsTypeClitcpkaPropEnum, v)
	}
}

const (

	// DefaultsClitcpkaEnabled captures enum value "enabled"
	DefaultsClitcpkaEnabled string = "enabled"

	// DefaultsClitcpkaDisabled captures enum value "disabled"
	DefaultsClitcpkaDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateClitcpkaEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeClitcpkaPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateClitcpka(formats strfmt.Registry) error {
	if swag.IsZero(m.Clitcpka) { // not required
		return nil
	}

	// value enum
	if err := m.validateClitcpkaEnum("clitcpka", "body", m.Clitcpka); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateCompression(formats strfmt.Registry) error {
	if swag.IsZero(m.Compression) { // not required
		return nil
	}

	if m.Compression != nil {
		if err := m.Compression.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("compression")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("compression")
			}
			return err
		}
	}

	return nil
}

var defaultsTypeContstatsPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeContstatsPropEnum = append(defaultsTypeContstatsPropEnum, v)
	}
}

const (

	// DefaultsContstatsEnabled captures enum value "enabled"
	DefaultsContstatsEnabled string = "enabled"
)

// prop value enum
func (m *Defaults) validateContstatsEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeContstatsPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateContstats(formats strfmt.Registry) error {
	if swag.IsZero(m.Contstats) { // not required
		return nil
	}

	// value enum
	if err := m.validateContstatsEnum("contstats", "body", m.Contstats); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateCookie(formats strfmt.Registry) error {
	if swag.IsZero(m.Cookie) { // not required
		return nil
	}

	if m.Cookie != nil {
		if err := m.Cookie.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("cookie")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("cookie")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) validateDefaultBackend(formats strfmt.Registry) error {
	if swag.IsZero(m.DefaultBackend) { // not required
		return nil
	}

	if err := validate.Pattern("default_backend", "body", m.DefaultBackend, `^[A-Za-z0-9-_.:]+$`); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateDefaultServer(formats strfmt.Registry) error {
	if swag.IsZero(m.DefaultServer) { // not required
		return nil
	}

	if m.DefaultServer != nil {
		if err := m.DefaultServer.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("default_server")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("default_server")
			}
			return err
		}
	}

	return nil
}

var defaultsTypeDisableH2UpgradePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeDisableH2UpgradePropEnum = append(defaultsTypeDisableH2UpgradePropEnum, v)
	}
}

const (

	// DefaultsDisableH2UpgradeEnabled captures enum value "enabled"
	DefaultsDisableH2UpgradeEnabled string = "enabled"

	// DefaultsDisableH2UpgradeDisabled captures enum value "disabled"
	DefaultsDisableH2UpgradeDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateDisableH2UpgradeEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeDisableH2UpgradePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateDisableH2Upgrade(formats strfmt.Registry) error {
	if swag.IsZero(m.DisableH2Upgrade) { // not required
		return nil
	}

	// value enum
	if err := m.validateDisableH2UpgradeEnum("disable_h2_upgrade", "body", m.DisableH2Upgrade); err != nil {
		return err
	}

	return nil
}

var defaultsTypeDontlogNormalPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeDontlogNormalPropEnum = append(defaultsTypeDontlogNormalPropEnum, v)
	}
}

const (

	// DefaultsDontlogNormalEnabled captures enum value "enabled"
	DefaultsDontlogNormalEnabled string = "enabled"

	// DefaultsDontlogNormalDisabled captures enum value "disabled"
	DefaultsDontlogNormalDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateDontlogNormalEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeDontlogNormalPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateDontlogNormal(formats strfmt.Registry) error {
	if swag.IsZero(m.DontlogNormal) { // not required
		return nil
	}

	// value enum
	if err := m.validateDontlogNormalEnum("dontlog_normal", "body", m.DontlogNormal); err != nil {
		return err
	}

	return nil
}

var defaultsTypeDontlognullPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeDontlognullPropEnum = append(defaultsTypeDontlognullPropEnum, v)
	}
}

const (

	// DefaultsDontlognullEnabled captures enum value "enabled"
	DefaultsDontlognullEnabled string = "enabled"

	// DefaultsDontlognullDisabled captures enum value "disabled"
	DefaultsDontlognullDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateDontlognullEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeDontlognullPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateDontlognull(formats strfmt.Registry) error {
	if swag.IsZero(m.Dontlognull) { // not required
		return nil
	}

	// value enum
	if err := m.validateDontlognullEnum("dontlognull", "body", m.Dontlognull); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateDynamicCookieKey(formats strfmt.Registry) error {
	if swag.IsZero(m.DynamicCookieKey) { // not required
		return nil
	}

	if err := validate.Pattern("dynamic_cookie_key", "body", m.DynamicCookieKey, `^[^\s]+$`); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateEmailAlert(formats strfmt.Registry) error {
	if swag.IsZero(m.EmailAlert) { // not required
		return nil
	}

	if m.EmailAlert != nil {
		if err := m.EmailAlert.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("email_alert")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("email_alert")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) validateErrorloc302(formats strfmt.Registry) error {
	if swag.IsZero(m.Errorloc302) { // not required
		return nil
	}

	if m.Errorloc302 != nil {
		if err := m.Errorloc302.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("errorloc302")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("errorloc302")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) validateErrorloc303(formats strfmt.Registry) error {
	if swag.IsZero(m.Errorloc303) { // not required
		return nil
	}

	if m.Errorloc303 != nil {
		if err := m.Errorloc303.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("errorloc303")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("errorloc303")
			}
			return err
		}
	}

	return nil
}

var defaultsTypeExternalCheckPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeExternalCheckPropEnum = append(defaultsTypeExternalCheckPropEnum, v)
	}
}

const (

	// DefaultsExternalCheckEnabled captures enum value "enabled"
	DefaultsExternalCheckEnabled string = "enabled"

	// DefaultsExternalCheckDisabled captures enum value "disabled"
	DefaultsExternalCheckDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateExternalCheckEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeExternalCheckPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateExternalCheck(formats strfmt.Registry) error {
	if swag.IsZero(m.ExternalCheck) { // not required
		return nil
	}

	// value enum
	if err := m.validateExternalCheckEnum("external_check", "body", m.ExternalCheck); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateExternalCheckCommand(formats strfmt.Registry) error {
	if swag.IsZero(m.ExternalCheckCommand) { // not required
		return nil
	}

	if err := validate.Pattern("external_check_command", "body", m.ExternalCheckCommand, `^[^\s]+$`); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateExternalCheckPath(formats strfmt.Registry) error {
	if swag.IsZero(m.ExternalCheckPath) { // not required
		return nil
	}

	if err := validate.Pattern("external_check_path", "body", m.ExternalCheckPath, `^[^\s]+$`); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateForwardfor(formats strfmt.Registry) error {
	if swag.IsZero(m.Forwardfor) { // not required
		return nil
	}

	if m.Forwardfor != nil {
		if err := m.Forwardfor.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("forwardfor")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("forwardfor")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) validateFrom(formats strfmt.Registry) error {
	if swag.IsZero(m.From) { // not required
		return nil
	}

	if err := validate.Pattern("from", "body", m.From, `^[A-Za-z0-9-_.:]+$`); err != nil {
		return err
	}

	return nil
}

var defaultsTypeH1CaseAdjustBogusClientPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeH1CaseAdjustBogusClientPropEnum = append(defaultsTypeH1CaseAdjustBogusClientPropEnum, v)
	}
}

const (

	// DefaultsH1CaseAdjustBogusClientEnabled captures enum value "enabled"
	DefaultsH1CaseAdjustBogusClientEnabled string = "enabled"

	// DefaultsH1CaseAdjustBogusClientDisabled captures enum value "disabled"
	DefaultsH1CaseAdjustBogusClientDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateH1CaseAdjustBogusClientEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeH1CaseAdjustBogusClientPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateH1CaseAdjustBogusClient(formats strfmt.Registry) error {
	if swag.IsZero(m.H1CaseAdjustBogusClient) { // not required
		return nil
	}

	// value enum
	if err := m.validateH1CaseAdjustBogusClientEnum("h1_case_adjust_bogus_client", "body", m.H1CaseAdjustBogusClient); err != nil {
		return err
	}

	return nil
}

var defaultsTypeH1CaseAdjustBogusServerPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeH1CaseAdjustBogusServerPropEnum = append(defaultsTypeH1CaseAdjustBogusServerPropEnum, v)
	}
}

const (

	// DefaultsH1CaseAdjustBogusServerEnabled captures enum value "enabled"
	DefaultsH1CaseAdjustBogusServerEnabled string = "enabled"

	// DefaultsH1CaseAdjustBogusServerDisabled captures enum value "disabled"
	DefaultsH1CaseAdjustBogusServerDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateH1CaseAdjustBogusServerEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeH1CaseAdjustBogusServerPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateH1CaseAdjustBogusServer(formats strfmt.Registry) error {
	if swag.IsZero(m.H1CaseAdjustBogusServer) { // not required
		return nil
	}

	// value enum
	if err := m.validateH1CaseAdjustBogusServerEnum("h1_case_adjust_bogus_server", "body", m.H1CaseAdjustBogusServer); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateHashType(formats strfmt.Registry) error {
	if swag.IsZero(m.HashType) { // not required
		return nil
	}

	if m.HashType != nil {
		if err := m.HashType.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("hash_type")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("hash_type")
			}
			return err
		}
	}

	return nil
}

var defaultsTypeHTTPBufferRequestPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeHTTPBufferRequestPropEnum = append(defaultsTypeHTTPBufferRequestPropEnum, v)
	}
}

const (

	// DefaultsHTTPBufferRequestEnabled captures enum value "enabled"
	DefaultsHTTPBufferRequestEnabled string = "enabled"

	// DefaultsHTTPBufferRequestDisabled captures enum value "disabled"
	DefaultsHTTPBufferRequestDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateHTTPBufferRequestEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeHTTPBufferRequestPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateHTTPBufferRequest(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPBufferRequest) { // not required
		return nil
	}

	// value enum
	if err := m.validateHTTPBufferRequestEnum("http-buffer-request", "body", m.HTTPBufferRequest); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateHTTPCheck(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPCheck) { // not required
		return nil
	}

	if m.HTTPCheck != nil {
		if err := m.HTTPCheck.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("http-check")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("http-check")
			}
			return err
		}
	}

	return nil
}

var defaultsTypeHTTPUseHtxPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeHTTPUseHtxPropEnum = append(defaultsTypeHTTPUseHtxPropEnum, v)
	}
}

const (

	// DefaultsHTTPUseHtxEnabled captures enum value "enabled"
	DefaultsHTTPUseHtxEnabled string = "enabled"

	// DefaultsHTTPUseHtxDisabled captures enum value "disabled"
	DefaultsHTTPUseHtxDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateHTTPUseHtxEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeHTTPUseHtxPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateHTTPUseHtx(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPUseHtx) { // not required
		return nil
	}

	// value enum
	if err := m.validateHTTPUseHtxEnum("http-use-htx", "body", m.HTTPUseHtx); err != nil {
		return err
	}

	return nil
}

var defaultsTypeHTTPConnectionModePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["httpclose","http-server-close","http-keep-alive"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeHTTPConnectionModePropEnum = append(defaultsTypeHTTPConnectionModePropEnum, v)
	}
}

const (

	// DefaultsHTTPConnectionModeHttpclose captures enum value "httpclose"
	DefaultsHTTPConnectionModeHttpclose string = "httpclose"

	// DefaultsHTTPConnectionModeHTTPDashServerDashClose captures enum value "http-server-close"
	DefaultsHTTPConnectionModeHTTPDashServerDashClose string = "http-server-close"

	// DefaultsHTTPConnectionModeHTTPDashKeepDashAlive captures enum value "http-keep-alive"
	DefaultsHTTPConnectionModeHTTPDashKeepDashAlive string = "http-keep-alive"
)

// prop value enum
func (m *Defaults) validateHTTPConnectionModeEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeHTTPConnectionModePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateHTTPConnectionMode(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPConnectionMode) { // not required
		return nil
	}

	// value enum
	if err := m.validateHTTPConnectionModeEnum("http_connection_mode", "body", m.HTTPConnectionMode); err != nil {
		return err
	}

	return nil
}

var defaultsTypeHTTPIgnoreProbesPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeHTTPIgnoreProbesPropEnum = append(defaultsTypeHTTPIgnoreProbesPropEnum, v)
	}
}

const (

	// DefaultsHTTPIgnoreProbesEnabled captures enum value "enabled"
	DefaultsHTTPIgnoreProbesEnabled string = "enabled"

	// DefaultsHTTPIgnoreProbesDisabled captures enum value "disabled"
	DefaultsHTTPIgnoreProbesDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateHTTPIgnoreProbesEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeHTTPIgnoreProbesPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateHTTPIgnoreProbes(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPIgnoreProbes) { // not required
		return nil
	}

	// value enum
	if err := m.validateHTTPIgnoreProbesEnum("http_ignore_probes", "body", m.HTTPIgnoreProbes); err != nil {
		return err
	}

	return nil
}

var defaultsTypeHTTPNoDelayPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeHTTPNoDelayPropEnum = append(defaultsTypeHTTPNoDelayPropEnum, v)
	}
}

const (

	// DefaultsHTTPNoDelayEnabled captures enum value "enabled"
	DefaultsHTTPNoDelayEnabled string = "enabled"

	// DefaultsHTTPNoDelayDisabled captures enum value "disabled"
	DefaultsHTTPNoDelayDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateHTTPNoDelayEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeHTTPNoDelayPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateHTTPNoDelay(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPNoDelay) { // not required
		return nil
	}

	// value enum
	if err := m.validateHTTPNoDelayEnum("http_no_delay", "body", m.HTTPNoDelay); err != nil {
		return err
	}

	return nil
}

var defaultsTypeHTTPPretendKeepalivePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeHTTPPretendKeepalivePropEnum = append(defaultsTypeHTTPPretendKeepalivePropEnum, v)
	}
}

const (

	// DefaultsHTTPPretendKeepaliveEnabled captures enum value "enabled"
	DefaultsHTTPPretendKeepaliveEnabled string = "enabled"

	// DefaultsHTTPPretendKeepaliveDisabled captures enum value "disabled"
	DefaultsHTTPPretendKeepaliveDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateHTTPPretendKeepaliveEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeHTTPPretendKeepalivePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateHTTPPretendKeepalive(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPPretendKeepalive) { // not required
		return nil
	}

	// value enum
	if err := m.validateHTTPPretendKeepaliveEnum("http_pretend_keepalive", "body", m.HTTPPretendKeepalive); err != nil {
		return err
	}

	return nil
}

var defaultsTypeHTTPRestrictReqHdrNamesPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["preserve","delete","reject"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeHTTPRestrictReqHdrNamesPropEnum = append(defaultsTypeHTTPRestrictReqHdrNamesPropEnum, v)
	}
}

const (

	// DefaultsHTTPRestrictReqHdrNamesPreserve captures enum value "preserve"
	DefaultsHTTPRestrictReqHdrNamesPreserve string = "preserve"

	// DefaultsHTTPRestrictReqHdrNamesDelete captures enum value "delete"
	DefaultsHTTPRestrictReqHdrNamesDelete string = "delete"

	// DefaultsHTTPRestrictReqHdrNamesReject captures enum value "reject"
	DefaultsHTTPRestrictReqHdrNamesReject string = "reject"
)

// prop value enum
func (m *Defaults) validateHTTPRestrictReqHdrNamesEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeHTTPRestrictReqHdrNamesPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateHTTPRestrictReqHdrNames(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPRestrictReqHdrNames) { // not required
		return nil
	}

	// value enum
	if err := m.validateHTTPRestrictReqHdrNamesEnum("http_restrict_req_hdr_names", "body", m.HTTPRestrictReqHdrNames); err != nil {
		return err
	}

	return nil
}

var defaultsTypeHTTPReusePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["aggressive","always","never","safe"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeHTTPReusePropEnum = append(defaultsTypeHTTPReusePropEnum, v)
	}
}

const (

	// DefaultsHTTPReuseAggressive captures enum value "aggressive"
	DefaultsHTTPReuseAggressive string = "aggressive"

	// DefaultsHTTPReuseAlways captures enum value "always"
	DefaultsHTTPReuseAlways string = "always"

	// DefaultsHTTPReuseNever captures enum value "never"
	DefaultsHTTPReuseNever string = "never"

	// DefaultsHTTPReuseSafe captures enum value "safe"
	DefaultsHTTPReuseSafe string = "safe"
)

// prop value enum
func (m *Defaults) validateHTTPReuseEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeHTTPReusePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateHTTPReuse(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPReuse) { // not required
		return nil
	}

	// value enum
	if err := m.validateHTTPReuseEnum("http_reuse", "body", m.HTTPReuse); err != nil {
		return err
	}

	return nil
}

var defaultsTypeHTTPUseProxyHeaderPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeHTTPUseProxyHeaderPropEnum = append(defaultsTypeHTTPUseProxyHeaderPropEnum, v)
	}
}

const (

	// DefaultsHTTPUseProxyHeaderEnabled captures enum value "enabled"
	DefaultsHTTPUseProxyHeaderEnabled string = "enabled"

	// DefaultsHTTPUseProxyHeaderDisabled captures enum value "disabled"
	DefaultsHTTPUseProxyHeaderDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateHTTPUseProxyHeaderEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeHTTPUseProxyHeaderPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateHTTPUseProxyHeader(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPUseProxyHeader) { // not required
		return nil
	}

	// value enum
	if err := m.validateHTTPUseProxyHeaderEnum("http_use_proxy_header", "body", m.HTTPUseProxyHeader); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateHttpchkParams(formats strfmt.Registry) error {
	if swag.IsZero(m.HttpchkParams) { // not required
		return nil
	}

	if m.HttpchkParams != nil {
		if err := m.HttpchkParams.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("httpchk_params")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("httpchk_params")
			}
			return err
		}
	}

	return nil
}

var defaultsTypeHttpslogPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeHttpslogPropEnum = append(defaultsTypeHttpslogPropEnum, v)
	}
}

const (

	// DefaultsHttpslogEnabled captures enum value "enabled"
	DefaultsHttpslogEnabled string = "enabled"

	// DefaultsHttpslogDisabled captures enum value "disabled"
	DefaultsHttpslogDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateHttpslogEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeHttpslogPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateHttpslog(formats strfmt.Registry) error {
	if swag.IsZero(m.Httpslog) { // not required
		return nil
	}

	// value enum
	if err := m.validateHttpslogEnum("httpslog", "body", m.Httpslog); err != nil {
		return err
	}

	return nil
}

var defaultsTypeIdleCloseOnResponsePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeIdleCloseOnResponsePropEnum = append(defaultsTypeIdleCloseOnResponsePropEnum, v)
	}
}

const (

	// DefaultsIdleCloseOnResponseEnabled captures enum value "enabled"
	DefaultsIdleCloseOnResponseEnabled string = "enabled"

	// DefaultsIdleCloseOnResponseDisabled captures enum value "disabled"
	DefaultsIdleCloseOnResponseDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateIdleCloseOnResponseEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeIdleCloseOnResponsePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateIdleCloseOnResponse(formats strfmt.Registry) error {
	if swag.IsZero(m.IdleCloseOnResponse) { // not required
		return nil
	}

	// value enum
	if err := m.validateIdleCloseOnResponseEnum("idle_close_on_response", "body", m.IdleCloseOnResponse); err != nil {
		return err
	}

	return nil
}

var defaultsTypeIndependentStreamsPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeIndependentStreamsPropEnum = append(defaultsTypeIndependentStreamsPropEnum, v)
	}
}

const (

	// DefaultsIndependentStreamsEnabled captures enum value "enabled"
	DefaultsIndependentStreamsEnabled string = "enabled"

	// DefaultsIndependentStreamsDisabled captures enum value "disabled"
	DefaultsIndependentStreamsDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateIndependentStreamsEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeIndependentStreamsPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateIndependentStreams(formats strfmt.Registry) error {
	if swag.IsZero(m.IndependentStreams) { // not required
		return nil
	}

	// value enum
	if err := m.validateIndependentStreamsEnum("independent_streams", "body", m.IndependentStreams); err != nil {
		return err
	}

	return nil
}

var defaultsTypeLoadServerStateFromFilePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["global","local","none"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeLoadServerStateFromFilePropEnum = append(defaultsTypeLoadServerStateFromFilePropEnum, v)
	}
}

const (

	// DefaultsLoadServerStateFromFileGlobal captures enum value "global"
	DefaultsLoadServerStateFromFileGlobal string = "global"

	// DefaultsLoadServerStateFromFileLocal captures enum value "local"
	DefaultsLoadServerStateFromFileLocal string = "local"

	// DefaultsLoadServerStateFromFileNone captures enum value "none"
	DefaultsLoadServerStateFromFileNone string = "none"
)

// prop value enum
func (m *Defaults) validateLoadServerStateFromFileEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeLoadServerStateFromFilePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateLoadServerStateFromFile(formats strfmt.Registry) error {
	if swag.IsZero(m.LoadServerStateFromFile) { // not required
		return nil
	}

	// value enum
	if err := m.validateLoadServerStateFromFileEnum("load_server_state_from_file", "body", m.LoadServerStateFromFile); err != nil {
		return err
	}

	return nil
}

var defaultsTypeLogHealthChecksPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeLogHealthChecksPropEnum = append(defaultsTypeLogHealthChecksPropEnum, v)
	}
}

const (

	// DefaultsLogHealthChecksEnabled captures enum value "enabled"
	DefaultsLogHealthChecksEnabled string = "enabled"

	// DefaultsLogHealthChecksDisabled captures enum value "disabled"
	DefaultsLogHealthChecksDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateLogHealthChecksEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeLogHealthChecksPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateLogHealthChecks(formats strfmt.Registry) error {
	if swag.IsZero(m.LogHealthChecks) { // not required
		return nil
	}

	// value enum
	if err := m.validateLogHealthChecksEnum("log_health_checks", "body", m.LogHealthChecks); err != nil {
		return err
	}

	return nil
}

var defaultsTypeLogSeparateErrorsPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeLogSeparateErrorsPropEnum = append(defaultsTypeLogSeparateErrorsPropEnum, v)
	}
}

const (

	// DefaultsLogSeparateErrorsEnabled captures enum value "enabled"
	DefaultsLogSeparateErrorsEnabled string = "enabled"

	// DefaultsLogSeparateErrorsDisabled captures enum value "disabled"
	DefaultsLogSeparateErrorsDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateLogSeparateErrorsEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeLogSeparateErrorsPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateLogSeparateErrors(formats strfmt.Registry) error {
	if swag.IsZero(m.LogSeparateErrors) { // not required
		return nil
	}

	// value enum
	if err := m.validateLogSeparateErrorsEnum("log_separate_errors", "body", m.LogSeparateErrors); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateLogTag(formats strfmt.Registry) error {
	if swag.IsZero(m.LogTag) { // not required
		return nil
	}

	if err := validate.Pattern("log_tag", "body", m.LogTag, `^[^\s]+$`); err != nil {
		return err
	}

	return nil
}

var defaultsTypeLogasapPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeLogasapPropEnum = append(defaultsTypeLogasapPropEnum, v)
	}
}

const (

	// DefaultsLogasapEnabled captures enum value "enabled"
	DefaultsLogasapEnabled string = "enabled"

	// DefaultsLogasapDisabled captures enum value "disabled"
	DefaultsLogasapDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateLogasapEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeLogasapPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateLogasap(formats strfmt.Registry) error {
	if swag.IsZero(m.Logasap) { // not required
		return nil
	}

	// value enum
	if err := m.validateLogasapEnum("logasap", "body", m.Logasap); err != nil {
		return err
	}

	return nil
}

var defaultsTypeModePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["tcp","http","log"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeModePropEnum = append(defaultsTypeModePropEnum, v)
	}
}

const (

	// DefaultsModeTCP captures enum value "tcp"
	DefaultsModeTCP string = "tcp"

	// DefaultsModeHTTP captures enum value "http"
	DefaultsModeHTTP string = "http"

	// DefaultsModeLog captures enum value "log"
	DefaultsModeLog string = "log"
)

// prop value enum
func (m *Defaults) validateModeEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeModePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateMode(formats strfmt.Registry) error {
	if swag.IsZero(m.Mode) { // not required
		return nil
	}

	// value enum
	if err := m.validateModeEnum("mode", "body", m.Mode); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateMonitorURI(formats strfmt.Registry) error {
	if swag.IsZero(m.MonitorURI) { // not required
		return nil
	}

	if err := m.MonitorURI.Validate(formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("monitor_uri")
		} else if ce, ok := err.(*errors.CompositeError); ok {
			return ce.ValidateName("monitor_uri")
		}
		return err
	}

	return nil
}

func (m *Defaults) validateMysqlCheckParams(formats strfmt.Registry) error {
	if swag.IsZero(m.MysqlCheckParams) { // not required
		return nil
	}

	if m.MysqlCheckParams != nil {
		if err := m.MysqlCheckParams.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("mysql_check_params")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("mysql_check_params")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) validateName(formats strfmt.Registry) error {
	if swag.IsZero(m.Name) { // not required
		return nil
	}

	if err := validate.Pattern("name", "body", m.Name, `^[A-Za-z0-9-_.:]+$`); err != nil {
		return err
	}

	return nil
}

var defaultsTypeNolingerPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeNolingerPropEnum = append(defaultsTypeNolingerPropEnum, v)
	}
}

const (

	// DefaultsNolingerEnabled captures enum value "enabled"
	DefaultsNolingerEnabled string = "enabled"

	// DefaultsNolingerDisabled captures enum value "disabled"
	DefaultsNolingerDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateNolingerEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeNolingerPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateNolinger(formats strfmt.Registry) error {
	if swag.IsZero(m.Nolinger) { // not required
		return nil
	}

	// value enum
	if err := m.validateNolingerEnum("nolinger", "body", m.Nolinger); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateOriginalto(formats strfmt.Registry) error {
	if swag.IsZero(m.Originalto) { // not required
		return nil
	}

	if m.Originalto != nil {
		if err := m.Originalto.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("originalto")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("originalto")
			}
			return err
		}
	}

	return nil
}

var defaultsTypePersistPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypePersistPropEnum = append(defaultsTypePersistPropEnum, v)
	}
}

const (

	// DefaultsPersistEnabled captures enum value "enabled"
	DefaultsPersistEnabled string = "enabled"

	// DefaultsPersistDisabled captures enum value "disabled"
	DefaultsPersistDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validatePersistEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypePersistPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validatePersist(formats strfmt.Registry) error {
	if swag.IsZero(m.Persist) { // not required
		return nil
	}

	// value enum
	if err := m.validatePersistEnum("persist", "body", m.Persist); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validatePersistRule(formats strfmt.Registry) error {
	if swag.IsZero(m.PersistRule) { // not required
		return nil
	}

	if m.PersistRule != nil {
		if err := m.PersistRule.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("persist_rule")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("persist_rule")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) validatePgsqlCheckParams(formats strfmt.Registry) error {
	if swag.IsZero(m.PgsqlCheckParams) { // not required
		return nil
	}

	if m.PgsqlCheckParams != nil {
		if err := m.PgsqlCheckParams.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("pgsql_check_params")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("pgsql_check_params")
			}
			return err
		}
	}

	return nil
}

var defaultsTypePreferLastServerPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypePreferLastServerPropEnum = append(defaultsTypePreferLastServerPropEnum, v)
	}
}

const (

	// DefaultsPreferLastServerEnabled captures enum value "enabled"
	DefaultsPreferLastServerEnabled string = "enabled"

	// DefaultsPreferLastServerDisabled captures enum value "disabled"
	DefaultsPreferLastServerDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validatePreferLastServerEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypePreferLastServerPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validatePreferLastServer(formats strfmt.Registry) error {
	if swag.IsZero(m.PreferLastServer) { // not required
		return nil
	}

	// value enum
	if err := m.validatePreferLastServerEnum("prefer_last_server", "body", m.PreferLastServer); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateRedispatch(formats strfmt.Registry) error {
	if swag.IsZero(m.Redispatch) { // not required
		return nil
	}

	if m.Redispatch != nil {
		if err := m.Redispatch.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("redispatch")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("redispatch")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) validateSmtpchkParams(formats strfmt.Registry) error {
	if swag.IsZero(m.SmtpchkParams) { // not required
		return nil
	}

	if m.SmtpchkParams != nil {
		if err := m.SmtpchkParams.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("smtpchk_params")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("smtpchk_params")
			}
			return err
		}
	}

	return nil
}

var defaultsTypeSocketStatsPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeSocketStatsPropEnum = append(defaultsTypeSocketStatsPropEnum, v)
	}
}

const (

	// DefaultsSocketStatsEnabled captures enum value "enabled"
	DefaultsSocketStatsEnabled string = "enabled"

	// DefaultsSocketStatsDisabled captures enum value "disabled"
	DefaultsSocketStatsDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateSocketStatsEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeSocketStatsPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateSocketStats(formats strfmt.Registry) error {
	if swag.IsZero(m.SocketStats) { // not required
		return nil
	}

	// value enum
	if err := m.validateSocketStatsEnum("socket_stats", "body", m.SocketStats); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateSource(formats strfmt.Registry) error {
	if swag.IsZero(m.Source) { // not required
		return nil
	}

	if m.Source != nil {
		if err := m.Source.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("source")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("source")
			}
			return err
		}
	}

	return nil
}

var defaultsTypeSpliceAutoPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeSpliceAutoPropEnum = append(defaultsTypeSpliceAutoPropEnum, v)
	}
}

const (

	// DefaultsSpliceAutoEnabled captures enum value "enabled"
	DefaultsSpliceAutoEnabled string = "enabled"

	// DefaultsSpliceAutoDisabled captures enum value "disabled"
	DefaultsSpliceAutoDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateSpliceAutoEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeSpliceAutoPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateSpliceAuto(formats strfmt.Registry) error {
	if swag.IsZero(m.SpliceAuto) { // not required
		return nil
	}

	// value enum
	if err := m.validateSpliceAutoEnum("splice_auto", "body", m.SpliceAuto); err != nil {
		return err
	}

	return nil
}

var defaultsTypeSpliceRequestPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeSpliceRequestPropEnum = append(defaultsTypeSpliceRequestPropEnum, v)
	}
}

const (

	// DefaultsSpliceRequestEnabled captures enum value "enabled"
	DefaultsSpliceRequestEnabled string = "enabled"

	// DefaultsSpliceRequestDisabled captures enum value "disabled"
	DefaultsSpliceRequestDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateSpliceRequestEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeSpliceRequestPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateSpliceRequest(formats strfmt.Registry) error {
	if swag.IsZero(m.SpliceRequest) { // not required
		return nil
	}

	// value enum
	if err := m.validateSpliceRequestEnum("splice_request", "body", m.SpliceRequest); err != nil {
		return err
	}

	return nil
}

var defaultsTypeSpliceResponsePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeSpliceResponsePropEnum = append(defaultsTypeSpliceResponsePropEnum, v)
	}
}

const (

	// DefaultsSpliceResponseEnabled captures enum value "enabled"
	DefaultsSpliceResponseEnabled string = "enabled"

	// DefaultsSpliceResponseDisabled captures enum value "disabled"
	DefaultsSpliceResponseDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateSpliceResponseEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeSpliceResponsePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateSpliceResponse(formats strfmt.Registry) error {
	if swag.IsZero(m.SpliceResponse) { // not required
		return nil
	}

	// value enum
	if err := m.validateSpliceResponseEnum("splice_response", "body", m.SpliceResponse); err != nil {
		return err
	}

	return nil
}

var defaultsTypeSrvtcpkaPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeSrvtcpkaPropEnum = append(defaultsTypeSrvtcpkaPropEnum, v)
	}
}

const (

	// DefaultsSrvtcpkaEnabled captures enum value "enabled"
	DefaultsSrvtcpkaEnabled string = "enabled"

	// DefaultsSrvtcpkaDisabled captures enum value "disabled"
	DefaultsSrvtcpkaDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateSrvtcpkaEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeSrvtcpkaPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateSrvtcpka(formats strfmt.Registry) error {
	if swag.IsZero(m.Srvtcpka) { // not required
		return nil
	}

	// value enum
	if err := m.validateSrvtcpkaEnum("srvtcpka", "body", m.Srvtcpka); err != nil {
		return err
	}

	return nil
}

func (m *Defaults) validateStatsOptions(formats strfmt.Registry) error {
	if swag.IsZero(m.StatsOptions) { // not required
		return nil
	}

	if m.StatsOptions != nil {
		if err := m.StatsOptions.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("stats_options")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("stats_options")
			}
			return err
		}
	}

	return nil
}

var defaultsTypeTCPSmartAcceptPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeTCPSmartAcceptPropEnum = append(defaultsTypeTCPSmartAcceptPropEnum, v)
	}
}

const (

	// DefaultsTCPSmartAcceptEnabled captures enum value "enabled"
	DefaultsTCPSmartAcceptEnabled string = "enabled"

	// DefaultsTCPSmartAcceptDisabled captures enum value "disabled"
	DefaultsTCPSmartAcceptDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateTCPSmartAcceptEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeTCPSmartAcceptPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateTCPSmartAccept(formats strfmt.Registry) error {
	if swag.IsZero(m.TCPSmartAccept) { // not required
		return nil
	}

	// value enum
	if err := m.validateTCPSmartAcceptEnum("tcp_smart_accept", "body", m.TCPSmartAccept); err != nil {
		return err
	}

	return nil
}

var defaultsTypeTCPSmartConnectPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeTCPSmartConnectPropEnum = append(defaultsTypeTCPSmartConnectPropEnum, v)
	}
}

const (

	// DefaultsTCPSmartConnectEnabled captures enum value "enabled"
	DefaultsTCPSmartConnectEnabled string = "enabled"

	// DefaultsTCPSmartConnectDisabled captures enum value "disabled"
	DefaultsTCPSmartConnectDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateTCPSmartConnectEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeTCPSmartConnectPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateTCPSmartConnect(formats strfmt.Registry) error {
	if swag.IsZero(m.TCPSmartConnect) { // not required
		return nil
	}

	// value enum
	if err := m.validateTCPSmartConnectEnum("tcp_smart_connect", "body", m.TCPSmartConnect); err != nil {
		return err
	}

	return nil
}

var defaultsTypeTcpkaPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeTcpkaPropEnum = append(defaultsTypeTcpkaPropEnum, v)
	}
}

const (

	// DefaultsTcpkaEnabled captures enum value "enabled"
	DefaultsTcpkaEnabled string = "enabled"

	// DefaultsTcpkaDisabled captures enum value "disabled"
	DefaultsTcpkaDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateTcpkaEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeTcpkaPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateTcpka(formats strfmt.Registry) error {
	if swag.IsZero(m.Tcpka) { // not required
		return nil
	}

	// value enum
	if err := m.validateTcpkaEnum("tcpka", "body", m.Tcpka); err != nil {
		return err
	}

	return nil
}

var defaultsTypeTransparentPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		defaultsTypeTransparentPropEnum = append(defaultsTypeTransparentPropEnum, v)
	}
}

const (

	// DefaultsTransparentEnabled captures enum value "enabled"
	DefaultsTransparentEnabled string = "enabled"

	// DefaultsTransparentDisabled captures enum value "disabled"
	DefaultsTransparentDisabled string = "disabled"
)

// prop value enum
func (m *Defaults) validateTransparentEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, defaultsTypeTransparentPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *Defaults) validateTransparent(formats strfmt.Registry) error {
	if swag.IsZero(m.Transparent) { // not required
		return nil
	}

	// value enum
	if err := m.validateTransparentEnum("transparent", "body", m.Transparent); err != nil {
		return err
	}

	return nil
}

// ContextValidate validate this defaults based on the context it is used
func (m *Defaults) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

	if err := m.contextValidateErrorFiles(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateErrorFilesFromHTTPErrors(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateBalance(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateCompression(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateCookie(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateDefaultServer(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateEmailAlert(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateErrorloc302(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateErrorloc303(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateForwardfor(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateHashType(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateHTTPCheck(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateHttpchkParams(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateMonitorURI(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateMysqlCheckParams(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateOriginalto(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidatePersistRule(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidatePgsqlCheckParams(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateRedispatch(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateSmtpchkParams(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateSource(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateStatsOptions(ctx, formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *Defaults) contextValidateErrorFiles(ctx context.Context, formats strfmt.Registry) error {

	for i := 0; i < len(m.ErrorFiles); i++ {

		if m.ErrorFiles[i] != nil {
			if err := m.ErrorFiles[i].ContextValidate(ctx, formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("error_files" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("error_files" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

func (m *Defaults) contextValidateErrorFilesFromHTTPErrors(ctx context.Context, formats strfmt.Registry) error {

	for i := 0; i < len(m.ErrorFilesFromHTTPErrors); i++ {

		if m.ErrorFilesFromHTTPErrors[i] != nil {
			if err := m.ErrorFilesFromHTTPErrors[i].ContextValidate(ctx, formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("errorfiles_from_http_errors" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("errorfiles_from_http_errors" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

func (m *Defaults) contextValidateBalance(ctx context.Context, formats strfmt.Registry) error {

	if m.Balance != nil {
		if err := m.Balance.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("balance")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("balance")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateCompression(ctx context.Context, formats strfmt.Registry) error {

	if m.Compression != nil {
		if err := m.Compression.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("compression")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("compression")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateCookie(ctx context.Context, formats strfmt.Registry) error {

	if m.Cookie != nil {
		if err := m.Cookie.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("cookie")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("cookie")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateDefaultServer(ctx context.Context, formats strfmt.Registry) error {

	if m.DefaultServer != nil {
		if err := m.DefaultServer.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("default_server")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("default_server")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateEmailAlert(ctx context.Context, formats strfmt.Registry) error {

	if m.EmailAlert != nil {
		if err := m.EmailAlert.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("email_alert")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("email_alert")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateErrorloc302(ctx context.Context, formats strfmt.Registry) error {

	if m.Errorloc302 != nil {
		if err := m.Errorloc302.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("errorloc302")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("errorloc302")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateErrorloc303(ctx context.Context, formats strfmt.Registry) error {

	if m.Errorloc303 != nil {
		if err := m.Errorloc303.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("errorloc303")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("errorloc303")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateForwardfor(ctx context.Context, formats strfmt.Registry) error {

	if m.Forwardfor != nil {
		if err := m.Forwardfor.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("forwardfor")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("forwardfor")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateHashType(ctx context.Context, formats strfmt.Registry) error {

	if m.HashType != nil {
		if err := m.HashType.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("hash_type")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("hash_type")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateHTTPCheck(ctx context.Context, formats strfmt.Registry) error {

	if m.HTTPCheck != nil {
		if err := m.HTTPCheck.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("http-check")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("http-check")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateHttpchkParams(ctx context.Context, formats strfmt.Registry) error {

	if m.HttpchkParams != nil {
		if err := m.HttpchkParams.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("httpchk_params")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("httpchk_params")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateMonitorURI(ctx context.Context, formats strfmt.Registry) error {

	if err := m.MonitorURI.ContextValidate(ctx, formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("monitor_uri")
		} else if ce, ok := err.(*errors.CompositeError); ok {
			return ce.ValidateName("monitor_uri")
		}
		return err
	}

	return nil
}

func (m *Defaults) contextValidateMysqlCheckParams(ctx context.Context, formats strfmt.Registry) error {

	if m.MysqlCheckParams != nil {
		if err := m.MysqlCheckParams.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("mysql_check_params")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("mysql_check_params")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateOriginalto(ctx context.Context, formats strfmt.Registry) error {

	if m.Originalto != nil {
		if err := m.Originalto.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("originalto")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("originalto")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidatePersistRule(ctx context.Context, formats strfmt.Registry) error {

	if m.PersistRule != nil {
		if err := m.PersistRule.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("persist_rule")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("persist_rule")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidatePgsqlCheckParams(ctx context.Context, formats strfmt.Registry) error {

	if m.PgsqlCheckParams != nil {
		if err := m.PgsqlCheckParams.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("pgsql_check_params")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("pgsql_check_params")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateRedispatch(ctx context.Context, formats strfmt.Registry) error {

	if m.Redispatch != nil {
		if err := m.Redispatch.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("redispatch")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("redispatch")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateSmtpchkParams(ctx context.Context, formats strfmt.Registry) error {

	if m.SmtpchkParams != nil {
		if err := m.SmtpchkParams.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("smtpchk_params")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("smtpchk_params")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateSource(ctx context.Context, formats strfmt.Registry) error {

	if m.Source != nil {
		if err := m.Source.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("source")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("source")
			}
			return err
		}
	}

	return nil
}

func (m *Defaults) contextValidateStatsOptions(ctx context.Context, formats strfmt.Registry) error {

	if m.StatsOptions != nil {
		if err := m.StatsOptions.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("stats_options")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("stats_options")
			}
			return err
		}
	}

	return nil
}

// MarshalBinary interface implementation
func (m *Defaults) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *Defaults) UnmarshalBinary(b []byte) error {
	var res Defaults
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
