// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/extensions/filters/common/dependency/v3/dependency.proto

package envoy_extensions_filters_common_dependency_v3

import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"net/mail"
	"net/url"
	"regexp"
	"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{}
)

// Validate checks the field values on Dependency with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Dependency) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for Type

	if utf8.RuneCountInString(m.GetName()) < 1 {
		return DependencyValidationError{
			field:  "Name",
			reason: "value length must be at least 1 runes",
		}
	}

	return nil
}

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e DependencyValidationError) 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 %sDependency.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DependencyValidationError{}

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

// Validate checks the field values on FilterDependencies with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *FilterDependencies) Validate() error {
	if m == nil {
		return nil
	}

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

		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return FilterDependenciesValidationError{
					field:  fmt.Sprintf("DecodeRequired[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return FilterDependenciesValidationError{
					field:  fmt.Sprintf("DecodeProvided[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return FilterDependenciesValidationError{
					field:  fmt.Sprintf("EncodeRequired[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return FilterDependenciesValidationError{
					field:  fmt.Sprintf("EncodeProvided[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	return nil
}

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e FilterDependenciesValidationError) 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 %sFilterDependencies.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = FilterDependenciesValidationError{}

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

// Validate checks the field values on MatchingRequirements with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *MatchingRequirements) Validate() error {
	if m == nil {
		return nil
	}

	if v, ok := interface{}(m.GetDataInputAllowList()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return MatchingRequirementsValidationError{
				field:  "DataInputAllowList",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	return nil
}

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e MatchingRequirementsValidationError) 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 %sMatchingRequirements.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = MatchingRequirementsValidationError{}

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

// Validate checks the field values on MatchingRequirements_DataInputAllowList
// with the rules defined in the proto definition for this message. If any
// rules are violated, an error is returned.
func (m *MatchingRequirements_DataInputAllowList) Validate() error {
	if m == nil {
		return nil
	}

	return nil
}

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e MatchingRequirements_DataInputAllowListValidationError) 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 %sMatchingRequirements_DataInputAllowList.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = MatchingRequirements_DataInputAllowListValidationError{}

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