// 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"
)

// Global Global
//
// # HAProxy global configuration
//
// swagger:model global
type Global struct {

	// CPU maps
	CPUMaps []*CPUMap `json:"cpu_maps,omitempty"`

	// h1 case adjusts
	H1CaseAdjusts []*H1CaseAdjust `json:"h1_case_adjust,omitempty"`

	// preset envs
	PresetEnvs []*PresetEnv `json:"presetenv,omitempty"`

	// runtime a p is
	RuntimeAPIs []*RuntimeAPI `json:"runtime_apis,omitempty"`

	// set envs
	SetEnvs []*SetEnv `json:"setenv,omitempty"`

	// set var fmts
	SetVarFmts []*SetVarFmt `json:"set_var_fmt,omitempty"`

	// set vars
	SetVars []*SetVar `json:"set_var,omitempty"`

	// ssl engines
	SslEngines []*SslEngine `json:"ssl_engines,omitempty"`

	// thread group lines
	ThreadGroupLines []*ThreadGroup `json:"thread_group_lines,omitempty"`

	// anonkey
	// Maximum: 4.294967295e+09
	// Minimum: 0
	Anonkey *int64 `json:"anonkey,omitempty"`

	// busy polling
	BusyPolling bool `json:"busy_polling,omitempty"`

	// ca base
	CaBase string `json:"ca_base,omitempty"`

	// chroot
	// Pattern: ^[^\s]+$
	Chroot string `json:"chroot,omitempty"`

	// close spread time
	CloseSpreadTime *int64 `json:"close_spread_time,omitempty"`

	// cluster secret
	ClusterSecret string `json:"cluster_secret,omitempty"`

	// crt base
	CrtBase string `json:"crt_base,omitempty"`

	// daemon
	// Enum: [enabled disabled]
	Daemon string `json:"daemon,omitempty"`

	// default path
	DefaultPath *GlobalDefaultPath `json:"default_path,omitempty"`

	// description
	Description string `json:"description,omitempty"`

	// device atlas options
	DeviceAtlasOptions *GlobalDeviceAtlasOptions `json:"device_atlas_options,omitempty"`

	// expose experimental directives
	ExposeExperimentalDirectives bool `json:"expose_experimental_directives,omitempty"`

	// external check
	ExternalCheck bool `json:"external_check,omitempty"`

	// fifty one degrees options
	FiftyOneDegreesOptions *GlobalFiftyOneDegreesOptions `json:"fifty_one_degrees_options,omitempty"`

	// gid
	Gid int64 `json:"gid,omitempty"`

	// grace
	Grace *int64 `json:"grace,omitempty"`

	// group
	// Pattern: ^[^\s]+$
	Group string `json:"group,omitempty"`

	// h1 case adjust file
	H1CaseAdjustFile string `json:"h1_case_adjust_file,omitempty"`

	// h2 workaround bogus websocket clients
	H2WorkaroundBogusWebsocketClients bool `json:"h2_workaround_bogus_websocket_clients,omitempty"`

	// hard stop after
	HardStopAfter *int64 `json:"hard_stop_after,omitempty"`

	// httpclient resolvers disabled
	// Enum: [enabled disabled]
	HttpclientResolversDisabled string `json:"httpclient_resolvers_disabled,omitempty"`

	// httpclient resolvers id
	HttpclientResolversID string `json:"httpclient_resolvers_id,omitempty"`

	// httpclient resolvers prefer
	// Enum: [ipv4 ipv6]
	HttpclientResolversPrefer string `json:"httpclient_resolvers_prefer,omitempty"`

	// httpclient retries
	HttpclientRetries int64 `json:"httpclient_retries,omitempty"`

	// httpclient ssl ca file
	HttpclientSslCaFile string `json:"httpclient_ssl_ca_file,omitempty"`

	// httpclient ssl verify
	// Enum: [ none required]
	HttpclientSslVerify *string `json:"httpclient_ssl_verify,omitempty"`

	// httpclient timeout connect
	HttpclientTimeoutConnect *int64 `json:"httpclient_timeout_connect,omitempty"`

	// insecure fork wanted
	InsecureForkWanted bool `json:"insecure_fork_wanted,omitempty"`

	// insecure setuid wanted
	InsecureSetuidWanted bool `json:"insecure_setuid_wanted,omitempty"`

	// issuers chain path
	IssuersChainPath string `json:"issuers_chain_path,omitempty"`

	// limited quic
	LimitedQuic bool `json:"limited_quic,omitempty"`

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

	// localpeer
	// Pattern: ^[^\s]+$
	Localpeer string `json:"localpeer,omitempty"`

	// log send hostname
	LogSendHostname *GlobalLogSendHostname `json:"log_send_hostname,omitempty"`

	// lua load per thread
	LuaLoadPerThread string `json:"lua_load_per_thread,omitempty"`

	// lua loads
	LuaLoads []*LuaLoad `json:"lua_loads,omitempty"`

	// lua prepend path
	LuaPrependPath []*LuaPrependPath `json:"lua_prepend_path,omitempty"`

	// master worker
	MasterWorker bool `json:"master-worker,omitempty"`

	// max spread checks
	MaxSpreadChecks *int64 `json:"max_spread_checks,omitempty"`

	// maxcompcpuusage
	Maxcompcpuusage int64 `json:"maxcompcpuusage,omitempty"`

	// maxcomprate
	Maxcomprate int64 `json:"maxcomprate,omitempty"`

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

	// maxconnrate
	Maxconnrate int64 `json:"maxconnrate,omitempty"`

	// maxpipes
	Maxpipes int64 `json:"maxpipes,omitempty"`

	// maxsessrate
	Maxsessrate int64 `json:"maxsessrate,omitempty"`

	// maxsslconn
	Maxsslconn int64 `json:"maxsslconn,omitempty"`

	// maxsslrate
	Maxsslrate int64 `json:"maxsslrate,omitempty"`

	// maxzlibmem
	Maxzlibmem int64 `json:"maxzlibmem,omitempty"`

	// mworker max reloads
	// Minimum: 0
	MworkerMaxReloads *int64 `json:"mworker_max_reloads,omitempty"`

	// nbproc
	Nbproc int64 `json:"nbproc,omitempty"`

	// nbthread
	Nbthread int64 `json:"nbthread,omitempty"`

	// no quic
	NoQuic bool `json:"no-quic,omitempty"`

	// node
	Node string `json:"node,omitempty"`

	// noepoll
	Noepoll bool `json:"noepoll,omitempty"`

	// noevports
	Noevports bool `json:"noevports,omitempty"`

	// nogetaddrinfo
	Nogetaddrinfo bool `json:"nogetaddrinfo,omitempty"`

	// nokqueue
	Nokqueue bool `json:"nokqueue,omitempty"`

	// nopoll
	Nopoll bool `json:"nopoll,omitempty"`

	// noreuseport
	Noreuseport bool `json:"noreuseport,omitempty"`

	// nosplice
	Nosplice bool `json:"nosplice,omitempty"`

	// numa cpu mapping
	// Enum: [enabled disabled]
	NumaCPUMapping string `json:"numa_cpu_mapping,omitempty"`

	// pidfile
	Pidfile string `json:"pidfile,omitempty"`

	// pp2 never send local
	Pp2NeverSendLocal bool `json:"pp2_never_send_local,omitempty"`

	// prealloc fd
	PreallocFd bool `json:"prealloc-fd,omitempty"`

	// profiling tasks
	// Enum: [auto on off]
	ProfilingTasks string `json:"profiling_tasks,omitempty"`

	// quiet
	Quiet bool `json:"quiet,omitempty"`

	// resetenv
	Resetenv string `json:"resetenv,omitempty"`

	// server state base
	// Pattern: ^[^\s]+$
	ServerStateBase string `json:"server_state_base,omitempty"`

	// server state file
	// Pattern: ^[^\s]+$
	ServerStateFile string `json:"server_state_file,omitempty"`

	// set dumpable
	SetDumpable bool `json:"set_dumpable,omitempty"`

	// setcap
	// Pattern: ^[^\s]+$
	Setcap string `json:"setcap,omitempty"`

	// spread checks
	SpreadChecks int64 `json:"spread_checks,omitempty"`

	// ssl default bind ciphers
	SslDefaultBindCiphers string `json:"ssl_default_bind_ciphers,omitempty"`

	// ssl default bind ciphersuites
	SslDefaultBindCiphersuites string `json:"ssl_default_bind_ciphersuites,omitempty"`

	// ssl default bind client sigalgs
	SslDefaultBindClientSigalgs string `json:"ssl_default_bind_client_sigalgs,omitempty"`

	// ssl default bind curves
	SslDefaultBindCurves string `json:"ssl_default_bind_curves,omitempty"`

	// ssl default bind options
	SslDefaultBindOptions string `json:"ssl_default_bind_options,omitempty"`

	// ssl default bind sigalgs
	SslDefaultBindSigalgs string `json:"ssl_default_bind_sigalgs,omitempty"`

	// ssl default server ciphers
	SslDefaultServerCiphers string `json:"ssl_default_server_ciphers,omitempty"`

	// ssl default server ciphersuites
	SslDefaultServerCiphersuites string `json:"ssl_default_server_ciphersuites,omitempty"`

	// ssl default server client sigalgs
	SslDefaultServerClientSigalgs string `json:"ssl_default_server_client_sigalgs,omitempty"`

	// ssl default server curves
	SslDefaultServerCurves string `json:"ssl_default_server_curves,omitempty"`

	// ssl default server options
	SslDefaultServerOptions string `json:"ssl_default_server_options,omitempty"`

	// ssl default server sigalgs
	SslDefaultServerSigalgs string `json:"ssl_default_server_sigalgs,omitempty"`

	// ssl dh param file
	SslDhParamFile string `json:"ssl_dh_param_file,omitempty"`

	// ssl load extra files
	SslLoadExtraFiles string `json:"ssl_load_extra_files,omitempty"`

	// ssl mode async
	// Enum: [enabled disabled]
	SslModeAsync string `json:"ssl_mode_async,omitempty"`

	// ssl propquery
	SslPropquery string `json:"ssl_propquery,omitempty"`

	// ssl provider
	SslProvider string `json:"ssl_provider,omitempty"`

	// ssl provider path
	SslProviderPath string `json:"ssl_provider_path,omitempty"`

	// ssl server verify
	// Enum: [none required]
	SslServerVerify string `json:"ssl_server_verify,omitempty"`

	// ssl skip self issued ca
	SslSkipSelfIssuedCa bool `json:"ssl_skip_self_issued_ca,omitempty"`

	// stats maxconn
	StatsMaxconn *int64 `json:"stats_maxconn,omitempty"`

	// stats timeout
	StatsTimeout *int64 `json:"stats_timeout,omitempty"`

	// strict limits
	StrictLimits bool `json:"strict_limits,omitempty"`

	// thread groups
	ThreadGroups int64 `json:"thread_groups,omitempty"`

	// tune options
	TuneOptions *GlobalTuneOptions `json:"tune_options,omitempty"`

	// tune ssl default dh param
	TuneSslDefaultDhParam int64 `json:"tune_ssl_default_dh_param,omitempty"`

	// uid
	UID int64 `json:"uid,omitempty"`

	// ulimit n
	Ulimitn int64 `json:"ulimit_n,omitempty"`

	// unsetenv
	Unsetenv string `json:"unsetenv,omitempty"`

	// user
	// Pattern: ^[^\s]+$
	User string `json:"user,omitempty"`

	// wurfl options
	WurflOptions *GlobalWurflOptions `json:"wurfl_options,omitempty"`

	// zero warning
	ZeroWarning bool `json:"zero_warning,omitempty"`
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func (m *Global) validateCPUMaps(formats strfmt.Registry) error {
	if swag.IsZero(m.CPUMaps) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validateH1CaseAdjusts(formats strfmt.Registry) error {
	if swag.IsZero(m.H1CaseAdjusts) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validatePresetEnvs(formats strfmt.Registry) error {
	if swag.IsZero(m.PresetEnvs) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validateRuntimeAPIs(formats strfmt.Registry) error {
	if swag.IsZero(m.RuntimeAPIs) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validateSetEnvs(formats strfmt.Registry) error {
	if swag.IsZero(m.SetEnvs) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validateSetVarFmts(formats strfmt.Registry) error {
	if swag.IsZero(m.SetVarFmts) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validateSetVars(formats strfmt.Registry) error {
	if swag.IsZero(m.SetVars) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validateSslEngines(formats strfmt.Registry) error {
	if swag.IsZero(m.SslEngines) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validateThreadGroupLines(formats strfmt.Registry) error {
	if swag.IsZero(m.ThreadGroupLines) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validateAnonkey(formats strfmt.Registry) error {
	if swag.IsZero(m.Anonkey) { // not required
		return nil
	}

	if err := validate.MinimumInt("anonkey", "body", *m.Anonkey, 0, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("anonkey", "body", *m.Anonkey, 4.294967295e+09, false); err != nil {
		return err
	}

	return nil
}

func (m *Global) validateChroot(formats strfmt.Registry) error {
	if swag.IsZero(m.Chroot) { // not required
		return nil
	}

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

	return nil
}

var globalTypeDaemonPropEnum []interface{}

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

const (

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

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

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

func (m *Global) validateDaemon(formats strfmt.Registry) error {
	if swag.IsZero(m.Daemon) { // not required
		return nil
	}

	// value enum
	if err := m.validateDaemonEnum("daemon", "body", m.Daemon); err != nil {
		return err
	}

	return nil
}

func (m *Global) validateDefaultPath(formats strfmt.Registry) error {
	if swag.IsZero(m.DefaultPath) { // not required
		return nil
	}

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

	return nil
}

func (m *Global) validateDeviceAtlasOptions(formats strfmt.Registry) error {
	if swag.IsZero(m.DeviceAtlasOptions) { // not required
		return nil
	}

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

	return nil
}

func (m *Global) validateFiftyOneDegreesOptions(formats strfmt.Registry) error {
	if swag.IsZero(m.FiftyOneDegreesOptions) { // not required
		return nil
	}

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

	return nil
}

func (m *Global) validateGroup(formats strfmt.Registry) error {
	if swag.IsZero(m.Group) { // not required
		return nil
	}

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

	return nil
}

var globalTypeHttpclientResolversDisabledPropEnum []interface{}

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

const (

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

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

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

func (m *Global) validateHttpclientResolversDisabled(formats strfmt.Registry) error {
	if swag.IsZero(m.HttpclientResolversDisabled) { // not required
		return nil
	}

	// value enum
	if err := m.validateHttpclientResolversDisabledEnum("httpclient_resolvers_disabled", "body", m.HttpclientResolversDisabled); err != nil {
		return err
	}

	return nil
}

var globalTypeHttpclientResolversPreferPropEnum []interface{}

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

const (

	// GlobalHttpclientResolversPreferIPV4 captures enum value "ipv4"
	GlobalHttpclientResolversPreferIPV4 string = "ipv4"

	// GlobalHttpclientResolversPreferIPV6 captures enum value "ipv6"
	GlobalHttpclientResolversPreferIPV6 string = "ipv6"
)

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

func (m *Global) validateHttpclientResolversPrefer(formats strfmt.Registry) error {
	if swag.IsZero(m.HttpclientResolversPrefer) { // not required
		return nil
	}

	// value enum
	if err := m.validateHttpclientResolversPreferEnum("httpclient_resolvers_prefer", "body", m.HttpclientResolversPrefer); err != nil {
		return err
	}

	return nil
}

var globalTypeHttpclientSslVerifyPropEnum []interface{}

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

const (

	// GlobalHttpclientSslVerifyEmpty captures enum value ""
	GlobalHttpclientSslVerifyEmpty string = ""

	// GlobalHttpclientSslVerifyNone captures enum value "none"
	GlobalHttpclientSslVerifyNone string = "none"

	// GlobalHttpclientSslVerifyRequired captures enum value "required"
	GlobalHttpclientSslVerifyRequired string = "required"
)

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

func (m *Global) validateHttpclientSslVerify(formats strfmt.Registry) error {
	if swag.IsZero(m.HttpclientSslVerify) { // not required
		return nil
	}

	// value enum
	if err := m.validateHttpclientSslVerifyEnum("httpclient_ssl_verify", "body", *m.HttpclientSslVerify); err != nil {
		return err
	}

	return nil
}

var globalTypeLoadServerStateFromFilePropEnum []interface{}

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

const (

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

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

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

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

func (m *Global) 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
}

func (m *Global) validateLocalpeer(formats strfmt.Registry) error {
	if swag.IsZero(m.Localpeer) { // not required
		return nil
	}

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

	return nil
}

func (m *Global) validateLogSendHostname(formats strfmt.Registry) error {
	if swag.IsZero(m.LogSendHostname) { // not required
		return nil
	}

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

	return nil
}

func (m *Global) validateLuaLoads(formats strfmt.Registry) error {
	if swag.IsZero(m.LuaLoads) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validateLuaPrependPath(formats strfmt.Registry) error {
	if swag.IsZero(m.LuaPrependPath) { // not required
		return nil
	}

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

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

	}

	return nil
}

func (m *Global) validateMworkerMaxReloads(formats strfmt.Registry) error {
	if swag.IsZero(m.MworkerMaxReloads) { // not required
		return nil
	}

	if err := validate.MinimumInt("mworker_max_reloads", "body", *m.MworkerMaxReloads, 0, false); err != nil {
		return err
	}

	return nil
}

var globalTypeNumaCPUMappingPropEnum []interface{}

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

const (

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

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

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

func (m *Global) validateNumaCPUMapping(formats strfmt.Registry) error {
	if swag.IsZero(m.NumaCPUMapping) { // not required
		return nil
	}

	// value enum
	if err := m.validateNumaCPUMappingEnum("numa_cpu_mapping", "body", m.NumaCPUMapping); err != nil {
		return err
	}

	return nil
}

var globalTypeProfilingTasksPropEnum []interface{}

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

const (

	// GlobalProfilingTasksAuto captures enum value "auto"
	GlobalProfilingTasksAuto string = "auto"

	// GlobalProfilingTasksOn captures enum value "on"
	GlobalProfilingTasksOn string = "on"

	// GlobalProfilingTasksOff captures enum value "off"
	GlobalProfilingTasksOff string = "off"
)

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

func (m *Global) validateProfilingTasks(formats strfmt.Registry) error {
	if swag.IsZero(m.ProfilingTasks) { // not required
		return nil
	}

	// value enum
	if err := m.validateProfilingTasksEnum("profiling_tasks", "body", m.ProfilingTasks); err != nil {
		return err
	}

	return nil
}

func (m *Global) validateServerStateBase(formats strfmt.Registry) error {
	if swag.IsZero(m.ServerStateBase) { // not required
		return nil
	}

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

	return nil
}

func (m *Global) validateServerStateFile(formats strfmt.Registry) error {
	if swag.IsZero(m.ServerStateFile) { // not required
		return nil
	}

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

	return nil
}

func (m *Global) validateSetcap(formats strfmt.Registry) error {
	if swag.IsZero(m.Setcap) { // not required
		return nil
	}

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

	return nil
}

var globalTypeSslModeAsyncPropEnum []interface{}

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

const (

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

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

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

func (m *Global) validateSslModeAsync(formats strfmt.Registry) error {
	if swag.IsZero(m.SslModeAsync) { // not required
		return nil
	}

	// value enum
	if err := m.validateSslModeAsyncEnum("ssl_mode_async", "body", m.SslModeAsync); err != nil {
		return err
	}

	return nil
}

var globalTypeSslServerVerifyPropEnum []interface{}

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

const (

	// GlobalSslServerVerifyNone captures enum value "none"
	GlobalSslServerVerifyNone string = "none"

	// GlobalSslServerVerifyRequired captures enum value "required"
	GlobalSslServerVerifyRequired string = "required"
)

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

func (m *Global) validateSslServerVerify(formats strfmt.Registry) error {
	if swag.IsZero(m.SslServerVerify) { // not required
		return nil
	}

	// value enum
	if err := m.validateSslServerVerifyEnum("ssl_server_verify", "body", m.SslServerVerify); err != nil {
		return err
	}

	return nil
}

func (m *Global) validateTuneOptions(formats strfmt.Registry) error {
	if swag.IsZero(m.TuneOptions) { // not required
		return nil
	}

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

	return nil
}

func (m *Global) validateUser(formats strfmt.Registry) error {
	if swag.IsZero(m.User) { // not required
		return nil
	}

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

	return nil
}

func (m *Global) validateWurflOptions(formats strfmt.Registry) error {
	if swag.IsZero(m.WurflOptions) { // not required
		return nil
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func (m *Global) contextValidateCPUMaps(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidateH1CaseAdjusts(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidatePresetEnvs(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidateRuntimeAPIs(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidateSetEnvs(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidateSetVarFmts(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidateSetVars(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidateSslEngines(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidateThreadGroupLines(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidateDefaultPath(ctx context.Context, formats strfmt.Registry) error {

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

	return nil
}

func (m *Global) contextValidateDeviceAtlasOptions(ctx context.Context, formats strfmt.Registry) error {

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

	return nil
}

func (m *Global) contextValidateFiftyOneDegreesOptions(ctx context.Context, formats strfmt.Registry) error {

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

	return nil
}

func (m *Global) contextValidateLogSendHostname(ctx context.Context, formats strfmt.Registry) error {

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

	return nil
}

func (m *Global) contextValidateLuaLoads(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidateLuaPrependPath(ctx context.Context, formats strfmt.Registry) error {

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

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

	}

	return nil
}

func (m *Global) contextValidateTuneOptions(ctx context.Context, formats strfmt.Registry) error {

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

	return nil
}

func (m *Global) contextValidateWurflOptions(ctx context.Context, formats strfmt.Registry) error {

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

	return nil
}

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

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

// CPUMap CPU map
//
// swagger:model CPUMap
type CPUMap struct {

	// cpu set
	// Required: true
	CPUSet *string `json:"cpu_set"`

	// process
	// Required: true
	Process *string `json:"process"`
}

// Validate validates this CPU map
func (m *CPUMap) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *CPUMap) validateCPUSet(formats strfmt.Registry) error {

	if err := validate.Required("cpu_set", "body", m.CPUSet); err != nil {
		return err
	}

	return nil
}

func (m *CPUMap) validateProcess(formats strfmt.Registry) error {

	if err := validate.Required("process", "body", m.Process); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this CPU map based on context it is used
func (m *CPUMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// GlobalDefaultPath global default path
//
// swagger:model GlobalDefaultPath
type GlobalDefaultPath struct {

	// path
	// Pattern: ^[^\s]+$
	Path string `json:"path,omitempty"`

	// type
	// Required: true
	// Enum: [current config parent origin]
	Type string `json:"type"`
}

// Validate validates this global default path
func (m *GlobalDefaultPath) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *GlobalDefaultPath) validatePath(formats strfmt.Registry) error {
	if swag.IsZero(m.Path) { // not required
		return nil
	}

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

	return nil
}

var globalDefaultPathTypeTypePropEnum []interface{}

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

const (

	// GlobalDefaultPathTypeCurrent captures enum value "current"
	GlobalDefaultPathTypeCurrent string = "current"

	// GlobalDefaultPathTypeConfig captures enum value "config"
	GlobalDefaultPathTypeConfig string = "config"

	// GlobalDefaultPathTypeParent captures enum value "parent"
	GlobalDefaultPathTypeParent string = "parent"

	// GlobalDefaultPathTypeOrigin captures enum value "origin"
	GlobalDefaultPathTypeOrigin string = "origin"
)

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

func (m *GlobalDefaultPath) validateType(formats strfmt.Registry) error {

	if err := validate.RequiredString("default_path"+"."+"type", "body", m.Type); err != nil {
		return err
	}

	// value enum
	if err := m.validateTypeEnum("default_path"+"."+"type", "body", m.Type); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this global default path based on context it is used
func (m *GlobalDefaultPath) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// GlobalDeviceAtlasOptions global device atlas options
//
// swagger:model GlobalDeviceAtlasOptions
type GlobalDeviceAtlasOptions struct {

	// json file
	JSONFile string `json:"json_file,omitempty"`

	// log level
	LogLevel string `json:"log_level,omitempty"`

	// properties cookie
	PropertiesCookie string `json:"properties_cookie,omitempty"`

	// separator
	Separator string `json:"separator,omitempty"`
}

// Validate validates this global device atlas options
func (m *GlobalDeviceAtlasOptions) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this global device atlas options based on context it is used
func (m *GlobalDeviceAtlasOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// GlobalFiftyOneDegreesOptions global fifty one degrees options
//
// swagger:model GlobalFiftyOneDegreesOptions
type GlobalFiftyOneDegreesOptions struct {

	// cache size
	CacheSize int64 `json:"cache_size,omitempty"`

	// data file
	DataFile string `json:"data_file,omitempty"`

	// property name list
	PropertyNameList string `json:"property_name_list,omitempty"`

	// property separator
	PropertySeparator string `json:"property_separator,omitempty"`
}

// Validate validates this global fifty one degrees options
func (m *GlobalFiftyOneDegreesOptions) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this global fifty one degrees options based on context it is used
func (m *GlobalFiftyOneDegreesOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// H1CaseAdjust h1 case adjust
//
// swagger:model H1CaseAdjust
type H1CaseAdjust struct {

	// from
	// Required: true
	From *string `json:"from"`

	// to
	// Required: true
	To *string `json:"to"`
}

// Validate validates this h1 case adjust
func (m *H1CaseAdjust) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *H1CaseAdjust) validateFrom(formats strfmt.Registry) error {

	if err := validate.Required("from", "body", m.From); err != nil {
		return err
	}

	return nil
}

func (m *H1CaseAdjust) validateTo(formats strfmt.Registry) error {

	if err := validate.Required("to", "body", m.To); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this h1 case adjust based on context it is used
func (m *H1CaseAdjust) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// GlobalLogSendHostname global log send hostname
//
// swagger:model GlobalLogSendHostname
type GlobalLogSendHostname struct {

	// enabled
	// Required: true
	// Enum: [enabled disabled]
	Enabled *string `json:"enabled"`

	// param
	// Pattern: ^[^\s]+$
	Param string `json:"param,omitempty"`
}

// Validate validates this global log send hostname
func (m *GlobalLogSendHostname) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

var globalLogSendHostnameTypeEnabledPropEnum []interface{}

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

const (

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

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

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

func (m *GlobalLogSendHostname) validateEnabled(formats strfmt.Registry) error {

	if err := validate.Required("log_send_hostname"+"."+"enabled", "body", m.Enabled); err != nil {
		return err
	}

	// value enum
	if err := m.validateEnabledEnum("log_send_hostname"+"."+"enabled", "body", *m.Enabled); err != nil {
		return err
	}

	return nil
}

func (m *GlobalLogSendHostname) validateParam(formats strfmt.Registry) error {
	if swag.IsZero(m.Param) { // not required
		return nil
	}

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

	return nil
}

// ContextValidate validates this global log send hostname based on context it is used
func (m *GlobalLogSendHostname) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// LuaLoad lua load
//
// swagger:model LuaLoad
type LuaLoad struct {

	// file
	// Required: true
	// Pattern: ^[^\s]+$
	File *string `json:"file"`
}

// Validate validates this lua load
func (m *LuaLoad) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *LuaLoad) validateFile(formats strfmt.Registry) error {

	if err := validate.Required("file", "body", m.File); err != nil {
		return err
	}

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

	return nil
}

// ContextValidate validates this lua load based on context it is used
func (m *LuaLoad) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// LuaPrependPath lua prepend path
//
// swagger:model LuaPrependPath
type LuaPrependPath struct {

	// path
	// Required: true
	// Pattern: ^[^\s]+$
	Path *string `json:"path"`

	// type
	// Enum: [path cpath]
	Type string `json:"type,omitempty"`
}

// Validate validates this lua prepend path
func (m *LuaPrependPath) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *LuaPrependPath) validatePath(formats strfmt.Registry) error {

	if err := validate.Required("path", "body", m.Path); err != nil {
		return err
	}

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

	return nil
}

var luaPrependPathTypeTypePropEnum []interface{}

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

const (

	// LuaPrependPathTypePath captures enum value "path"
	LuaPrependPathTypePath string = "path"

	// LuaPrependPathTypeCpath captures enum value "cpath"
	LuaPrependPathTypeCpath string = "cpath"
)

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

func (m *LuaPrependPath) validateType(formats strfmt.Registry) error {
	if swag.IsZero(m.Type) { // not required
		return nil
	}

	// value enum
	if err := m.validateTypeEnum("type", "body", m.Type); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this lua prepend path based on context it is used
func (m *LuaPrependPath) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// PresetEnv preset env
//
// swagger:model PresetEnv
type PresetEnv struct {

	// name
	// Required: true
	Name *string `json:"name"`

	// value
	// Required: true
	Value *string `json:"value"`
}

// Validate validates this preset env
func (m *PresetEnv) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *PresetEnv) validateName(formats strfmt.Registry) error {

	if err := validate.Required("name", "body", m.Name); err != nil {
		return err
	}

	return nil
}

func (m *PresetEnv) validateValue(formats strfmt.Registry) error {

	if err := validate.Required("value", "body", m.Value); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this preset env based on context it is used
func (m *PresetEnv) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// RuntimeAPI runtime API
//
// swagger:model RuntimeAPI
type RuntimeAPI struct {
	BindParams

	// address
	// Required: true
	// Pattern: ^[^\s]+$
	Address *string `json:"address"`
}

// UnmarshalJSON unmarshals this object from a JSON structure
func (m *RuntimeAPI) UnmarshalJSON(raw []byte) error {
	// AO0
	var aO0 BindParams
	if err := swag.ReadJSON(raw, &aO0); err != nil {
		return err
	}
	m.BindParams = aO0

	// now for regular properties
	var propsRuntimeAPI struct {
		Address *string `json:"address"`
	}
	if err := swag.ReadJSON(raw, &propsRuntimeAPI); err != nil {
		return err
	}
	m.Address = propsRuntimeAPI.Address

	return nil
}

// MarshalJSON marshals this object to a JSON structure
func (m RuntimeAPI) MarshalJSON() ([]byte, error) {
	_parts := make([][]byte, 0, 1)

	aO0, err := swag.WriteJSON(m.BindParams)
	if err != nil {
		return nil, err
	}
	_parts = append(_parts, aO0)

	// now for regular properties
	var propsRuntimeAPI struct {
		Address *string `json:"address"`
	}
	propsRuntimeAPI.Address = m.Address

	jsonDataPropsRuntimeAPI, errRuntimeAPI := swag.WriteJSON(propsRuntimeAPI)
	if errRuntimeAPI != nil {
		return nil, errRuntimeAPI
	}
	_parts = append(_parts, jsonDataPropsRuntimeAPI)
	return swag.ConcatJSON(_parts...), nil
}

// Validate validates this runtime API
func (m *RuntimeAPI) Validate(formats strfmt.Registry) error {
	var res []error

	// validation for a type composition with BindParams
	if err := m.BindParams.Validate(formats); err != nil {
		res = append(res, err)
	}

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

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

func (m *RuntimeAPI) validateAddress(formats strfmt.Registry) error {

	if err := validate.Required("address", "body", m.Address); err != nil {
		return err
	}

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

	return nil
}

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

	// validation for a type composition with BindParams
	if err := m.BindParams.ContextValidate(ctx, formats); err != nil {
		res = append(res, err)
	}

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

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

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

// SetVarFmt set var fmt
//
// swagger:model SetVarFmt
type SetVarFmt struct {

	// format
	// Required: true
	Format *string `json:"format"`

	// name
	// Required: true
	Name *string `json:"name"`
}

// Validate validates this set var fmt
func (m *SetVarFmt) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *SetVarFmt) validateFormat(formats strfmt.Registry) error {

	if err := validate.Required("format", "body", m.Format); err != nil {
		return err
	}

	return nil
}

func (m *SetVarFmt) validateName(formats strfmt.Registry) error {

	if err := validate.Required("name", "body", m.Name); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this set var fmt based on context it is used
func (m *SetVarFmt) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// SetVar set var
//
// swagger:model SetVar
type SetVar struct {

	// expr
	// Required: true
	Expr *string `json:"expr"`

	// name
	// Required: true
	Name *string `json:"name"`
}

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

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

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

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

func (m *SetVar) validateExpr(formats strfmt.Registry) error {

	if err := validate.Required("expr", "body", m.Expr); err != nil {
		return err
	}

	return nil
}

func (m *SetVar) validateName(formats strfmt.Registry) error {

	if err := validate.Required("name", "body", m.Name); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this set var based on context it is used
func (m *SetVar) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// SetEnv set env
//
// swagger:model SetEnv
type SetEnv struct {

	// name
	// Required: true
	Name *string `json:"name"`

	// value
	// Required: true
	Value *string `json:"value"`
}

// Validate validates this set env
func (m *SetEnv) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *SetEnv) validateName(formats strfmt.Registry) error {

	if err := validate.Required("name", "body", m.Name); err != nil {
		return err
	}

	return nil
}

func (m *SetEnv) validateValue(formats strfmt.Registry) error {

	if err := validate.Required("value", "body", m.Value); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this set env based on context it is used
func (m *SetEnv) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// SslEngine ssl engine
//
// swagger:model SslEngine
type SslEngine struct {

	// algorithms
	Algorithms *string `json:"algorithms,omitempty"`

	// name
	// Required: true
	Name *string `json:"name"`
}

// Validate validates this ssl engine
func (m *SslEngine) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *SslEngine) validateName(formats strfmt.Registry) error {

	if err := validate.Required("name", "body", m.Name); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this ssl engine based on context it is used
func (m *SslEngine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// ThreadGroup thread group
//
// swagger:model ThreadGroup
type ThreadGroup struct {

	// group
	// Required: true
	Group *string `json:"group"`

	// num or range
	// Required: true
	NumOrRange *string `json:"num_or_range"`
}

// Validate validates this thread group
func (m *ThreadGroup) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *ThreadGroup) validateGroup(formats strfmt.Registry) error {

	if err := validate.Required("group", "body", m.Group); err != nil {
		return err
	}

	return nil
}

func (m *ThreadGroup) validateNumOrRange(formats strfmt.Registry) error {

	if err := validate.Required("num_or_range", "body", m.NumOrRange); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this thread group based on context it is used
func (m *ThreadGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// GlobalTuneOptions global tune options
//
// swagger:model GlobalTuneOptions
type GlobalTuneOptions struct {

	// buffers limit
	BuffersLimit *int64 `json:"buffers_limit,omitempty"`

	// buffers reserve
	// Minimum: 2
	BuffersReserve int64 `json:"buffers_reserve,omitempty"`

	// bufsize
	Bufsize int64 `json:"bufsize,omitempty"`

	// comp maxlevel
	CompMaxlevel int64 `json:"comp_maxlevel,omitempty"`

	// disable zero copy forwarding
	DisableZeroCopyForwarding bool `json:"disable_zero_copy_forwarding,omitempty"`

	// events max events at once
	// Maximum: 10000
	// Minimum: 1
	EventsMaxEventsAtOnce int64 `json:"events_max_events_at_once,omitempty"`

	// fail alloc
	FailAlloc bool `json:"fail_alloc,omitempty"`

	// fd edge triggered
	// Enum: [enabled disabled]
	FdEdgeTriggered string `json:"fd_edge_triggered,omitempty"`

	// h1 zero copy fwd recv
	// Enum: [enabled disabled]
	H1ZeroCopyFwdRecv string `json:"h1_zero_copy_fwd_recv,omitempty"`

	// h1 zero copy fwd send
	// Enum: [enabled disabled]
	H1ZeroCopyFwdSend string `json:"h1_zero_copy_fwd_send,omitempty"`

	// h2 be initial window size
	H2BeInitialWindowSize int64 `json:"h2_be_initial_window_size,omitempty"`

	// h2 be max concurrent streams
	H2BeMaxConcurrentStreams int64 `json:"h2_be_max_concurrent_streams,omitempty"`

	// h2 fe initial window size
	H2FeInitialWindowSize int64 `json:"h2_fe_initial_window_size,omitempty"`

	// h2 fe max concurrent streams
	H2FeMaxConcurrentStreams int64 `json:"h2_fe_max_concurrent_streams,omitempty"`

	// h2 header table size
	// Maximum: 65535
	H2HeaderTableSize int64 `json:"h2_header_table_size,omitempty"`

	// h2 initial window size
	H2InitialWindowSize *int64 `json:"h2_initial_window_size,omitempty"`

	// h2 max concurrent streams
	H2MaxConcurrentStreams int64 `json:"h2_max_concurrent_streams,omitempty"`

	// h2 max frame size
	H2MaxFrameSize int64 `json:"h2_max_frame_size,omitempty"`

	// h2 zero copy fwd send
	// Enum: [enabled disabled]
	H2ZeroCopyFwdSend string `json:"h2_zero_copy_fwd_send,omitempty"`

	// http cookielen
	HTTPCookielen int64 `json:"http_cookielen,omitempty"`

	// http logurilen
	HTTPLogurilen int64 `json:"http_logurilen,omitempty"`

	// http maxhdr
	// Maximum: 32767
	// Minimum: 1
	HTTPMaxhdr int64 `json:"http_maxhdr,omitempty"`

	// idle pool shared
	// Enum: [enabled disabled]
	IdlePoolShared string `json:"idle_pool_shared,omitempty"`

	// idletimer
	// Maximum: 65535
	// Minimum: 0
	Idletimer *int64 `json:"idletimer,omitempty"`

	// listener default shards
	// Enum: [by-process by-thread by-group]
	ListenerDefaultShards string `json:"listener_default_shards,omitempty"`

	// listener multi queue
	// Enum: [enabled disabled]
	ListenerMultiQueue string `json:"listener_multi_queue,omitempty"`

	// lua burst timeout
	LuaBurstTimeout *int64 `json:"lua_burst_timeout,omitempty"`

	// lua forced yield
	LuaForcedYield int64 `json:"lua_forced_yield,omitempty"`

	// lua log loggers
	// Enum: [enabled disabled]
	LuaLogLoggers string `json:"lua_log_loggers,omitempty"`

	// lua log stderr
	// Enum: [auto enabled disabled]
	LuaLogStderr string `json:"lua_log_stderr,omitempty"`

	// lua maxmem
	LuaMaxmem bool `json:"lua_maxmem,omitempty"`

	// lua service timeout
	LuaServiceTimeout *int64 `json:"lua_service_timeout,omitempty"`

	// lua session timeout
	LuaSessionTimeout *int64 `json:"lua_session_timeout,omitempty"`

	// lua task timeout
	LuaTaskTimeout *int64 `json:"lua_task_timeout,omitempty"`

	// max checks per thread
	MaxChecksPerThread *int64 `json:"max_checks_per_thread,omitempty"`

	// maxaccept
	Maxaccept int64 `json:"maxaccept,omitempty"`

	// maxpollevents
	Maxpollevents int64 `json:"maxpollevents,omitempty"`

	// maxrewrite
	Maxrewrite int64 `json:"maxrewrite,omitempty"`

	// memory hot size
	MemoryHotSize *int64 `json:"memory_hot_size,omitempty"`

	// pattern cache size
	PatternCacheSize *int64 `json:"pattern_cache_size,omitempty"`

	// peers max updates at once
	PeersMaxUpdatesAtOnce int64 `json:"peers_max_updates_at_once,omitempty"`

	// pipesize
	Pipesize int64 `json:"pipesize,omitempty"`

	// pool high fd ratio
	PoolHighFdRatio int64 `json:"pool_high_fd_ratio,omitempty"`

	// pool low fd ratio
	PoolLowFdRatio int64 `json:"pool_low_fd_ratio,omitempty"`

	// pt zero copy forwarding
	// Enum: [enabled disabled]
	PtZeroCopyForwarding string `json:"pt_zero_copy_forwarding,omitempty"`

	// quic frontend conn tx buffers limit
	QuicFrontendConnTxBuffersLimit *int64 `json:"quic_frontend_conn_tx_buffers_limit,omitempty"`

	// quic frontend max idle timeout
	QuicFrontendMaxIdleTimeout *int64 `json:"quic_frontend_max_idle_timeout,omitempty"`

	// quic frontend max streams bidi
	QuicFrontendMaxStreamsBidi *int64 `json:"quic_frontend_max_streams_bidi,omitempty"`

	// quic max frame loss
	QuicMaxFrameLoss *int64 `json:"quic_max_frame_loss,omitempty"`

	// quic retry threshold
	QuicRetryThreshold *int64 `json:"quic_retry_threshold,omitempty"`

	// quic socket owner
	// Enum: [listener connection]
	QuicSocketOwner string `json:"quic_socket_owner,omitempty"`

	// rcvbuf backend
	RcvbufBackend *int64 `json:"rcvbuf_backend,omitempty"`

	// rcvbuf client
	RcvbufClient *int64 `json:"rcvbuf_client,omitempty"`

	// rcvbuf frontend
	RcvbufFrontend *int64 `json:"rcvbuf_frontend,omitempty"`

	// rcvbuf server
	RcvbufServer *int64 `json:"rcvbuf_server,omitempty"`

	// recv enough
	RecvEnough int64 `json:"recv_enough,omitempty"`

	// runqueue depth
	RunqueueDepth int64 `json:"runqueue_depth,omitempty"`

	// sched low latency
	// Enum: [enabled disabled]
	SchedLowLatency string `json:"sched_low_latency,omitempty"`

	// sndbuf backend
	SndbufBackend *int64 `json:"sndbuf_backend,omitempty"`

	// sndbuf client
	SndbufClient *int64 `json:"sndbuf_client,omitempty"`

	// sndbuf frontend
	SndbufFrontend *int64 `json:"sndbuf_frontend,omitempty"`

	// sndbuf server
	SndbufServer *int64 `json:"sndbuf_server,omitempty"`

	// ssl cachesize
	SslCachesize *int64 `json:"ssl_cachesize,omitempty"`

	// ssl capture buffer size
	SslCaptureBufferSize *int64 `json:"ssl_capture_buffer_size,omitempty"`

	// ssl ctx cache size
	SslCtxCacheSize int64 `json:"ssl_ctx_cache_size,omitempty"`

	// ssl default dh param
	SslDefaultDhParam int64 `json:"ssl_default_dh_param,omitempty"`

	// ssl force private cache
	SslForcePrivateCache bool `json:"ssl_force_private_cache,omitempty"`

	// ssl keylog
	// Enum: [enabled disabled]
	SslKeylog string `json:"ssl_keylog,omitempty"`

	// ssl lifetime
	SslLifetime *int64 `json:"ssl_lifetime,omitempty"`

	// ssl maxrecord
	SslMaxrecord *int64 `json:"ssl_maxrecord,omitempty"`

	// ssl ocsp update max delay
	SslOcspUpdateMaxDelay *int64 `json:"ssl_ocsp_update_max_delay,omitempty"`

	// ssl ocsp update min delay
	SslOcspUpdateMinDelay *int64 `json:"ssl_ocsp_update_min_delay,omitempty"`

	// stick counters
	StickCounters *int64 `json:"stick_counters,omitempty"`

	// vars global max size
	VarsGlobalMaxSize *int64 `json:"vars_global_max_size,omitempty"`

	// vars proc max size
	VarsProcMaxSize *int64 `json:"vars_proc_max_size,omitempty"`

	// vars reqres max size
	VarsReqresMaxSize *int64 `json:"vars_reqres_max_size,omitempty"`

	// vars sess max size
	VarsSessMaxSize *int64 `json:"vars_sess_max_size,omitempty"`

	// vars txn max size
	VarsTxnMaxSize *int64 `json:"vars_txn_max_size,omitempty"`

	// zlib memlevel
	// Maximum: 9
	// Minimum: 1
	ZlibMemlevel int64 `json:"zlib_memlevel,omitempty"`

	// zlib windowsize
	// Maximum: 15
	// Minimum: 8
	ZlibWindowsize int64 `json:"zlib_windowsize,omitempty"`
}

// Validate validates this global tune options
func (m *GlobalTuneOptions) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func (m *GlobalTuneOptions) validateBuffersReserve(formats strfmt.Registry) error {
	if swag.IsZero(m.BuffersReserve) { // not required
		return nil
	}

	if err := validate.MinimumInt("tune_options"+"."+"buffers_reserve", "body", m.BuffersReserve, 2, false); err != nil {
		return err
	}

	return nil
}

func (m *GlobalTuneOptions) validateEventsMaxEventsAtOnce(formats strfmt.Registry) error {
	if swag.IsZero(m.EventsMaxEventsAtOnce) { // not required
		return nil
	}

	if err := validate.MinimumInt("tune_options"+"."+"events_max_events_at_once", "body", m.EventsMaxEventsAtOnce, 1, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("tune_options"+"."+"events_max_events_at_once", "body", m.EventsMaxEventsAtOnce, 10000, false); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeFdEdgeTriggeredPropEnum []interface{}

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

const (

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

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

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

func (m *GlobalTuneOptions) validateFdEdgeTriggered(formats strfmt.Registry) error {
	if swag.IsZero(m.FdEdgeTriggered) { // not required
		return nil
	}

	// value enum
	if err := m.validateFdEdgeTriggeredEnum("tune_options"+"."+"fd_edge_triggered", "body", m.FdEdgeTriggered); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeH1ZeroCopyFwdRecvPropEnum []interface{}

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

const (

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

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

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

func (m *GlobalTuneOptions) validateH1ZeroCopyFwdRecv(formats strfmt.Registry) error {
	if swag.IsZero(m.H1ZeroCopyFwdRecv) { // not required
		return nil
	}

	// value enum
	if err := m.validateH1ZeroCopyFwdRecvEnum("tune_options"+"."+"h1_zero_copy_fwd_recv", "body", m.H1ZeroCopyFwdRecv); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeH1ZeroCopyFwdSendPropEnum []interface{}

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

const (

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

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

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

func (m *GlobalTuneOptions) validateH1ZeroCopyFwdSend(formats strfmt.Registry) error {
	if swag.IsZero(m.H1ZeroCopyFwdSend) { // not required
		return nil
	}

	// value enum
	if err := m.validateH1ZeroCopyFwdSendEnum("tune_options"+"."+"h1_zero_copy_fwd_send", "body", m.H1ZeroCopyFwdSend); err != nil {
		return err
	}

	return nil
}

func (m *GlobalTuneOptions) validateH2HeaderTableSize(formats strfmt.Registry) error {
	if swag.IsZero(m.H2HeaderTableSize) { // not required
		return nil
	}

	if err := validate.MaximumInt("tune_options"+"."+"h2_header_table_size", "body", m.H2HeaderTableSize, 65535, false); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeH2ZeroCopyFwdSendPropEnum []interface{}

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

const (

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

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

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

func (m *GlobalTuneOptions) validateH2ZeroCopyFwdSend(formats strfmt.Registry) error {
	if swag.IsZero(m.H2ZeroCopyFwdSend) { // not required
		return nil
	}

	// value enum
	if err := m.validateH2ZeroCopyFwdSendEnum("tune_options"+"."+"h2_zero_copy_fwd_send", "body", m.H2ZeroCopyFwdSend); err != nil {
		return err
	}

	return nil
}

func (m *GlobalTuneOptions) validateHTTPMaxhdr(formats strfmt.Registry) error {
	if swag.IsZero(m.HTTPMaxhdr) { // not required
		return nil
	}

	if err := validate.MinimumInt("tune_options"+"."+"http_maxhdr", "body", m.HTTPMaxhdr, 1, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("tune_options"+"."+"http_maxhdr", "body", m.HTTPMaxhdr, 32767, false); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeIdlePoolSharedPropEnum []interface{}

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

const (

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

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

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

func (m *GlobalTuneOptions) validateIdlePoolShared(formats strfmt.Registry) error {
	if swag.IsZero(m.IdlePoolShared) { // not required
		return nil
	}

	// value enum
	if err := m.validateIdlePoolSharedEnum("tune_options"+"."+"idle_pool_shared", "body", m.IdlePoolShared); err != nil {
		return err
	}

	return nil
}

func (m *GlobalTuneOptions) validateIdletimer(formats strfmt.Registry) error {
	if swag.IsZero(m.Idletimer) { // not required
		return nil
	}

	if err := validate.MinimumInt("tune_options"+"."+"idletimer", "body", *m.Idletimer, 0, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("tune_options"+"."+"idletimer", "body", *m.Idletimer, 65535, false); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeListenerDefaultShardsPropEnum []interface{}

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

const (

	// GlobalTuneOptionsListenerDefaultShardsByDashProcess captures enum value "by-process"
	GlobalTuneOptionsListenerDefaultShardsByDashProcess string = "by-process"

	// GlobalTuneOptionsListenerDefaultShardsByDashThread captures enum value "by-thread"
	GlobalTuneOptionsListenerDefaultShardsByDashThread string = "by-thread"

	// GlobalTuneOptionsListenerDefaultShardsByDashGroup captures enum value "by-group"
	GlobalTuneOptionsListenerDefaultShardsByDashGroup string = "by-group"
)

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

func (m *GlobalTuneOptions) validateListenerDefaultShards(formats strfmt.Registry) error {
	if swag.IsZero(m.ListenerDefaultShards) { // not required
		return nil
	}

	// value enum
	if err := m.validateListenerDefaultShardsEnum("tune_options"+"."+"listener_default_shards", "body", m.ListenerDefaultShards); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeListenerMultiQueuePropEnum []interface{}

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

const (

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

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

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

func (m *GlobalTuneOptions) validateListenerMultiQueue(formats strfmt.Registry) error {
	if swag.IsZero(m.ListenerMultiQueue) { // not required
		return nil
	}

	// value enum
	if err := m.validateListenerMultiQueueEnum("tune_options"+"."+"listener_multi_queue", "body", m.ListenerMultiQueue); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeLuaLogLoggersPropEnum []interface{}

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

const (

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

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

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

func (m *GlobalTuneOptions) validateLuaLogLoggers(formats strfmt.Registry) error {
	if swag.IsZero(m.LuaLogLoggers) { // not required
		return nil
	}

	// value enum
	if err := m.validateLuaLogLoggersEnum("tune_options"+"."+"lua_log_loggers", "body", m.LuaLogLoggers); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeLuaLogStderrPropEnum []interface{}

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

const (

	// GlobalTuneOptionsLuaLogStderrAuto captures enum value "auto"
	GlobalTuneOptionsLuaLogStderrAuto string = "auto"

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

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

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

func (m *GlobalTuneOptions) validateLuaLogStderr(formats strfmt.Registry) error {
	if swag.IsZero(m.LuaLogStderr) { // not required
		return nil
	}

	// value enum
	if err := m.validateLuaLogStderrEnum("tune_options"+"."+"lua_log_stderr", "body", m.LuaLogStderr); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypePtZeroCopyForwardingPropEnum []interface{}

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

const (

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

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

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

func (m *GlobalTuneOptions) validatePtZeroCopyForwarding(formats strfmt.Registry) error {
	if swag.IsZero(m.PtZeroCopyForwarding) { // not required
		return nil
	}

	// value enum
	if err := m.validatePtZeroCopyForwardingEnum("tune_options"+"."+"pt_zero_copy_forwarding", "body", m.PtZeroCopyForwarding); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeQuicSocketOwnerPropEnum []interface{}

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

const (

	// GlobalTuneOptionsQuicSocketOwnerListener captures enum value "listener"
	GlobalTuneOptionsQuicSocketOwnerListener string = "listener"

	// GlobalTuneOptionsQuicSocketOwnerConnection captures enum value "connection"
	GlobalTuneOptionsQuicSocketOwnerConnection string = "connection"
)

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

func (m *GlobalTuneOptions) validateQuicSocketOwner(formats strfmt.Registry) error {
	if swag.IsZero(m.QuicSocketOwner) { // not required
		return nil
	}

	// value enum
	if err := m.validateQuicSocketOwnerEnum("tune_options"+"."+"quic_socket_owner", "body", m.QuicSocketOwner); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeSchedLowLatencyPropEnum []interface{}

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

const (

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

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

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

func (m *GlobalTuneOptions) validateSchedLowLatency(formats strfmt.Registry) error {
	if swag.IsZero(m.SchedLowLatency) { // not required
		return nil
	}

	// value enum
	if err := m.validateSchedLowLatencyEnum("tune_options"+"."+"sched_low_latency", "body", m.SchedLowLatency); err != nil {
		return err
	}

	return nil
}

var globalTuneOptionsTypeSslKeylogPropEnum []interface{}

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

const (

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

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

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

func (m *GlobalTuneOptions) validateSslKeylog(formats strfmt.Registry) error {
	if swag.IsZero(m.SslKeylog) { // not required
		return nil
	}

	// value enum
	if err := m.validateSslKeylogEnum("tune_options"+"."+"ssl_keylog", "body", m.SslKeylog); err != nil {
		return err
	}

	return nil
}

func (m *GlobalTuneOptions) validateZlibMemlevel(formats strfmt.Registry) error {
	if swag.IsZero(m.ZlibMemlevel) { // not required
		return nil
	}

	if err := validate.MinimumInt("tune_options"+"."+"zlib_memlevel", "body", m.ZlibMemlevel, 1, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("tune_options"+"."+"zlib_memlevel", "body", m.ZlibMemlevel, 9, false); err != nil {
		return err
	}

	return nil
}

func (m *GlobalTuneOptions) validateZlibWindowsize(formats strfmt.Registry) error {
	if swag.IsZero(m.ZlibWindowsize) { // not required
		return nil
	}

	if err := validate.MinimumInt("tune_options"+"."+"zlib_windowsize", "body", m.ZlibWindowsize, 8, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("tune_options"+"."+"zlib_windowsize", "body", m.ZlibWindowsize, 15, false); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this global tune options based on context it is used
func (m *GlobalTuneOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

// GlobalWurflOptions global wurfl options
//
// swagger:model GlobalWurflOptions
type GlobalWurflOptions struct {

	// cache size
	CacheSize int64 `json:"cache_size,omitempty"`

	// data file
	DataFile string `json:"data_file,omitempty"`

	// information list
	InformationList string `json:"information_list,omitempty"`

	// information list separator
	InformationListSeparator string `json:"information_list_separator,omitempty"`

	// patch file
	PatchFile string `json:"patch_file,omitempty"`
}

// Validate validates this global wurfl options
func (m *GlobalWurflOptions) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this global wurfl options based on context it is used
func (m *GlobalWurflOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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