Skip to content

Find, verify, and analyze leaked credentials

26.1 KB
Raw Blame
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: custom_detectors.proto

package custom_detectorspb

import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"net/mail"
	"net/url"
	"regexp"
	"sort"
	"strings"
	"time"
	"unicode/utf8"

	"google.golang.org/protobuf/types/known/anypb"
)

// ensure the imports are used
var (
	_ = bytes.MinRead
	_ = errors.New("")
	_ = fmt.Print
	_ = utf8.UTFMax
	_ = (*regexp.Regexp)(nil)
	_ = (*strings.Reader)(nil)
	_ = net.IPv4len
	_ = time.Duration(0)
	_ = (*url.URL)(nil)
	_ = (*mail.Address)(nil)
	_ = anypb.Any{}
	_ = sort.Sort
)

// Validate checks the field values on CustomDetectors with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *CustomDetectors) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CustomDetectors with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CustomDetectorsMultiError, or nil if none found.
func (m *CustomDetectors) ValidateAll() error {
	return m.validate(true)
}

func (m *CustomDetectors) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	for idx, item := range m.GetDetectors() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, CustomDetectorsValidationError{
						field:  fmt.Sprintf("Detectors[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, CustomDetectorsValidationError{
						field:  fmt.Sprintf("Detectors[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return CustomDetectorsValidationError{
					field:  fmt.Sprintf("Detectors[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return CustomDetectorsMultiError(errors)
	}

	return nil
}

// CustomDetectorsMultiError is an error wrapping multiple validation errors
// returned by CustomDetectors.ValidateAll() if the designated constraints
// aren't met.
type CustomDetectorsMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CustomDetectorsMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m CustomDetectorsMultiError) AllErrors() []error { return m }

// CustomDetectorsValidationError is the validation error returned by
// CustomDetectors.Validate if the designated constraints aren't met.
type CustomDetectorsValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CustomDetectorsValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CustomDetectorsValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CustomDetectorsValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CustomDetectorsValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CustomDetectorsValidationError) ErrorName() string { return "CustomDetectorsValidationError" }

// Error satisfies the builtin error interface
func (e CustomDetectorsValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sCustomDetectors.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CustomDetectorsValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CustomDetectorsValidationError{}

// Validate checks the field values on CustomRegex with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *CustomRegex) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CustomRegex with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in CustomRegexMultiError, or
// nil if none found.
func (m *CustomRegex) ValidateAll() error {
	return m.validate(true)
}

func (m *CustomRegex) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Name

	// no validation rules for Regex

	for idx, item := range m.GetVerify() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, CustomRegexValidationError{
						field:  fmt.Sprintf("Verify[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, CustomRegexValidationError{
						field:  fmt.Sprintf("Verify[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return CustomRegexValidationError{
					field:  fmt.Sprintf("Verify[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for Description

	// no validation rules for Entropy

	// no validation rules for PrimaryRegexName

	{
		sorted_keys := make([]string, len(m.GetValidations()))
		i := 0
		for key := range m.GetValidations() {
			sorted_keys[i] = key
			i++
		}
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
		for _, key := range sorted_keys {
			val := m.GetValidations()[key]
			_ = val

			// no validation rules for Validations[key]

			if all {
				switch v := interface{}(val).(type) {
				case interface{ ValidateAll() error }:
					if err := v.ValidateAll(); err != nil {
						errors = append(errors, CustomRegexValidationError{
							field:  fmt.Sprintf("Validations[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						})
					}
				case interface{ Validate() error }:
					if err := v.Validate(); err != nil {
						errors = append(errors, CustomRegexValidationError{
							field:  fmt.Sprintf("Validations[%v]", key),
							reason: "embedded message failed validation",
							cause:  err,
						})
					}
				}
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
				if err := v.Validate(); err != nil {
					return CustomRegexValidationError{
						field:  fmt.Sprintf("Validations[%v]", key),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}

		}
	}

	if len(errors) > 0 {
		return CustomRegexMultiError(errors)
	}

	return nil
}

// CustomRegexMultiError is an error wrapping multiple validation errors
// returned by CustomRegex.ValidateAll() if the designated constraints aren't met.
type CustomRegexMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CustomRegexMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m CustomRegexMultiError) AllErrors() []error { return m }

// CustomRegexValidationError is the validation error returned by
// CustomRegex.Validate if the designated constraints aren't met.
type CustomRegexValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CustomRegexValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CustomRegexValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CustomRegexValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CustomRegexValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CustomRegexValidationError) ErrorName() string { return "CustomRegexValidationError" }

// Error satisfies the builtin error interface
func (e CustomRegexValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sCustomRegex.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CustomRegexValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CustomRegexValidationError{}

// Validate checks the field values on VerifierConfig with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *VerifierConfig) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on VerifierConfig with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in VerifierConfigMultiError,
// or nil if none found.
func (m *VerifierConfig) ValidateAll() error {
	return m.validate(true)
}

func (m *VerifierConfig) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if _, err := url.Parse(m.GetEndpoint()); err != nil {
		err = VerifierConfigValidationError{
			field:  "Endpoint",
			reason: "value must be a valid URI",
			cause:  err,
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Unsafe

	if all {
		switch v := interface{}(m.GetAuth()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, VerifierConfigValidationError{
					field:  "Auth",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, VerifierConfigValidationError{
					field:  "Auth",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return VerifierConfigValidationError{
				field:  "Auth",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	if len(errors) > 0 {
		return VerifierConfigMultiError(errors)
	}

	return nil
}

// VerifierConfigMultiError is an error wrapping multiple validation errors
// returned by VerifierConfig.ValidateAll() if the designated constraints
// aren't met.
type VerifierConfigMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m VerifierConfigMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m VerifierConfigMultiError) AllErrors() []error { return m }

// VerifierConfigValidationError is the validation error returned by
// VerifierConfig.Validate if the designated constraints aren't met.
type VerifierConfigValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e VerifierConfigValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e VerifierConfigValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e VerifierConfigValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e VerifierConfigValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e VerifierConfigValidationError) ErrorName() string { return "VerifierConfigValidationError" }

// Error satisfies the builtin error interface
func (e VerifierConfigValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sVerifierConfig.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = VerifierConfigValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = VerifierConfigValidationError{}

// Validate checks the field values on VerifierAuth with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *VerifierAuth) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on VerifierAuth with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in VerifierAuthMultiError, or
// nil if none found.
func (m *VerifierAuth) ValidateAll() error {
	return m.validate(true)
}

func (m *VerifierAuth) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	switch v := m.AuthConfig.(type) {
	case *VerifierAuth_Oauth2:
		if v == nil {
			err := VerifierAuthValidationError{
				field:  "AuthConfig",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

		if all {
			switch v := interface{}(m.GetOauth2()).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, VerifierAuthValidationError{
						field:  "Oauth2",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, VerifierAuthValidationError{
						field:  "Oauth2",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(m.GetOauth2()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return VerifierAuthValidationError{
					field:  "Oauth2",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	default:
		_ = v // ensures v is used
	}

	if len(errors) > 0 {
		return VerifierAuthMultiError(errors)
	}

	return nil
}

// VerifierAuthMultiError is an error wrapping multiple validation errors
// returned by VerifierAuth.ValidateAll() if the designated constraints aren't met.
type VerifierAuthMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m VerifierAuthMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m VerifierAuthMultiError) AllErrors() []error { return m }

// VerifierAuthValidationError is the validation error returned by
// VerifierAuth.Validate if the designated constraints aren't met.
type VerifierAuthValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e VerifierAuthValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e VerifierAuthValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e VerifierAuthValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e VerifierAuthValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e VerifierAuthValidationError) ErrorName() string { return "VerifierAuthValidationError" }

// Error satisfies the builtin error interface
func (e VerifierAuthValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sVerifierAuth.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = VerifierAuthValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = VerifierAuthValidationError{}

// Validate checks the field values on OAuth2Config with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *OAuth2Config) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on OAuth2Config with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in OAuth2ConfigMultiError, or
// nil if none found.
func (m *OAuth2Config) ValidateAll() error {
	return m.validate(true)
}

func (m *OAuth2Config) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for TokenEndpoint

	// no validation rules for TokenHeader

	switch v := m.GrantConfig.(type) {
	case *OAuth2Config_Ropc:
		if v == nil {
			err := OAuth2ConfigValidationError{
				field:  "GrantConfig",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

		if all {
			switch v := interface{}(m.GetRopc()).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, OAuth2ConfigValidationError{
						field:  "Ropc",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, OAuth2ConfigValidationError{
						field:  "Ropc",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(m.GetRopc()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return OAuth2ConfigValidationError{
					field:  "Ropc",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	default:
		_ = v // ensures v is used
	}

	if len(errors) > 0 {
		return OAuth2ConfigMultiError(errors)
	}

	return nil
}

// OAuth2ConfigMultiError is an error wrapping multiple validation errors
// returned by OAuth2Config.ValidateAll() if the designated constraints aren't met.
type OAuth2ConfigMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m OAuth2ConfigMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m OAuth2ConfigMultiError) AllErrors() []error { return m }

// OAuth2ConfigValidationError is the validation error returned by
// OAuth2Config.Validate if the designated constraints aren't met.
type OAuth2ConfigValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e OAuth2ConfigValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e OAuth2ConfigValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e OAuth2ConfigValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e OAuth2ConfigValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e OAuth2ConfigValidationError) ErrorName() string { return "OAuth2ConfigValidationError" }

// Error satisfies the builtin error interface
func (e OAuth2ConfigValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sOAuth2Config.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = OAuth2ConfigValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = OAuth2ConfigValidationError{}

// Validate checks the field values on ROPCConfig with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *ROPCConfig) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ROPCConfig with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in ROPCConfigMultiError, or
// nil if none found.
func (m *ROPCConfig) ValidateAll() error {
	return m.validate(true)
}

func (m *ROPCConfig) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Username

	// no validation rules for Password

	// no validation rules for ClientId

	// no validation rules for ClientSecret

	// no validation rules for Scope

	if len(errors) > 0 {
		return ROPCConfigMultiError(errors)
	}

	return nil
}

// ROPCConfigMultiError is an error wrapping multiple validation errors
// returned by ROPCConfig.ValidateAll() if the designated constraints aren't met.
type ROPCConfigMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m ROPCConfigMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m ROPCConfigMultiError) AllErrors() []error { return m }

// ROPCConfigValidationError is the validation error returned by
// ROPCConfig.Validate if the designated constraints aren't met.
type ROPCConfigValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e ROPCConfigValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e ROPCConfigValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e ROPCConfigValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e ROPCConfigValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e ROPCConfigValidationError) ErrorName() string { return "ROPCConfigValidationError" }

// Error satisfies the builtin error interface
func (e ROPCConfigValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sROPCConfig.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ROPCConfigValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ROPCConfigValidationError{}

// Validate checks the field values on ValidationConfig with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *ValidationConfig) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ValidationConfig with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// ValidationConfigMultiError, or nil if none found.
func (m *ValidationConfig) ValidateAll() error {
	return m.validate(true)
}

func (m *ValidationConfig) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for ContainsDigit

	// no validation rules for ContainsLowercase

	// no validation rules for ContainsUppercase

	// no validation rules for ContainsSpecialChar

	if len(errors) > 0 {
		return ValidationConfigMultiError(errors)
	}

	return nil
}

// ValidationConfigMultiError is an error wrapping multiple validation errors
// returned by ValidationConfig.ValidateAll() if the designated constraints
// aren't met.
type ValidationConfigMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m ValidationConfigMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m ValidationConfigMultiError) AllErrors() []error { return m }

// ValidationConfigValidationError is the validation error returned by
// ValidationConfig.Validate if the designated constraints aren't met.
type ValidationConfigValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e ValidationConfigValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e ValidationConfigValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e ValidationConfigValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e ValidationConfigValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e ValidationConfigValidationError) ErrorName() string { return "ValidationConfigValidationError" }

// Error satisfies the builtin error interface
func (e ValidationConfigValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sValidationConfig.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ValidationConfigValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ValidationConfigValidationError{}