// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: v1beta1/auditlogv1.proto

package v1beta1

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 AuditLogV1 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 *AuditLogV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AuditLogV1 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 AuditLogV1MultiError, or
// nil if none found.
func (m *AuditLogV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Name

	// no validation rules for Size

	// no validation rules for Url

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m AuditLogV1MultiError) 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 AuditLogV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = AuditLogV1ValidationError{}

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

// Validate checks the field values on ListAuditLogsRequestV1 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 *ListAuditLogsRequestV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ListAuditLogsRequestV1 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
// ListAuditLogsRequestV1MultiError, or nil if none found.
func (m *ListAuditLogsRequestV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for Date

	// no validation rules for PageSize

	// no validation rules for PageToken

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ListAuditLogsRequestV1MultiError) 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 ListAuditLogsRequestV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = ListAuditLogsRequestV1ValidationError{}

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

// Validate checks the field values on ListAuditLogsResponseV1 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 *ListAuditLogsResponseV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ListAuditLogsResponseV1 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
// ListAuditLogsResponseV1MultiError, or nil if none found.
func (m *ListAuditLogsResponseV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, ListAuditLogsResponseV1ValidationError{
						field:  fmt.Sprintf("AuditLogs[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, ListAuditLogsResponseV1ValidationError{
						field:  fmt.Sprintf("AuditLogs[%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 ListAuditLogsResponseV1ValidationError{
					field:  fmt.Sprintf("AuditLogs[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for NextPageToken

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ListAuditLogsResponseV1MultiError) 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 ListAuditLogsResponseV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = ListAuditLogsResponseV1ValidationError{}

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

// Validate checks the field values on DownloadAuditLogsRequestV1 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 *DownloadAuditLogsRequestV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DownloadAuditLogsRequestV1 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
// DownloadAuditLogsRequestV1MultiError, or nil if none found.
func (m *DownloadAuditLogsRequestV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m DownloadAuditLogsRequestV1MultiError) 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 DownloadAuditLogsRequestV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = DownloadAuditLogsRequestV1ValidationError{}

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

// Validate checks the field values on DownloadAuditLogsResponseV1 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 *DownloadAuditLogsResponseV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DownloadAuditLogsResponseV1 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
// DownloadAuditLogsResponseV1MultiError, or nil if none found.
func (m *DownloadAuditLogsResponseV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, DownloadAuditLogsResponseV1ValidationError{
						field:  fmt.Sprintf("AuditLogs[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, DownloadAuditLogsResponseV1ValidationError{
						field:  fmt.Sprintf("AuditLogs[%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 DownloadAuditLogsResponseV1ValidationError{
					field:  fmt.Sprintf("AuditLogs[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m DownloadAuditLogsResponseV1MultiError) 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 DownloadAuditLogsResponseV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = DownloadAuditLogsResponseV1ValidationError{}

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

// Validate checks the field values on AuditLogFilterRuleV1 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 *AuditLogFilterRuleV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AuditLogFilterRuleV1 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
// AuditLogFilterRuleV1MultiError, or nil if none found.
func (m *AuditLogFilterRuleV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Name

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, AuditLogFilterRuleV1ValidationError{
						field:  fmt.Sprintf("Filters[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, AuditLogFilterRuleV1ValidationError{
						field:  fmt.Sprintf("Filters[%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 AuditLogFilterRuleV1ValidationError{
					field:  fmt.Sprintf("Filters[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for Disabled

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m AuditLogFilterRuleV1MultiError) 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 AuditLogFilterRuleV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = AuditLogFilterRuleV1ValidationError{}

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

// Validate checks the field values on AuditLogFilterV1 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 *AuditLogFilterV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AuditLogFilterV1 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
// AuditLogFilterV1MultiError, or nil if none found.
func (m *AuditLogFilterV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m AuditLogFilterV1MultiError) 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 AuditLogFilterV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = AuditLogFilterV1ValidationError{}

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

// Validate checks the field values on GetAuditLogFilterRuleRequestV1 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 *GetAuditLogFilterRuleRequestV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on GetAuditLogFilterRuleRequestV1 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
// GetAuditLogFilterRuleRequestV1MultiError, or nil if none found.
func (m *GetAuditLogFilterRuleRequestV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for Name

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m GetAuditLogFilterRuleRequestV1MultiError) 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 GetAuditLogFilterRuleRequestV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = GetAuditLogFilterRuleRequestV1ValidationError{}

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

// Validate checks the field values on ListAuditLogFilterRulesRequestV1 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 *ListAuditLogFilterRulesRequestV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ListAuditLogFilterRulesRequestV1 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
// ListAuditLogFilterRulesRequestV1MultiError, or nil if none found.
func (m *ListAuditLogFilterRulesRequestV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ListAuditLogFilterRulesRequestV1MultiError) 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 ListAuditLogFilterRulesRequestV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = ListAuditLogFilterRulesRequestV1ValidationError{}

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

// Validate checks the field values on ListAuditLogFilterRulesResponseV1 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 *ListAuditLogFilterRulesResponseV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ListAuditLogFilterRulesResponseV1
// 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
// ListAuditLogFilterRulesResponseV1MultiError, or nil if none found.
func (m *ListAuditLogFilterRulesResponseV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, ListAuditLogFilterRulesResponseV1ValidationError{
						field:  fmt.Sprintf("FilterRules[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, ListAuditLogFilterRulesResponseV1ValidationError{
						field:  fmt.Sprintf("FilterRules[%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 ListAuditLogFilterRulesResponseV1ValidationError{
					field:  fmt.Sprintf("FilterRules[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ListAuditLogFilterRulesResponseV1MultiError) 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 ListAuditLogFilterRulesResponseV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = ListAuditLogFilterRulesResponseV1ValidationError{}

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

// Validate checks the field values on CreateAuditLogFilterRuleRequestV1 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 *CreateAuditLogFilterRuleRequestV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CreateAuditLogFilterRuleRequestV1
// 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
// CreateAuditLogFilterRuleRequestV1MultiError, or nil if none found.
func (m *CreateAuditLogFilterRuleRequestV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CreateAuditLogFilterRuleRequestV1MultiError) 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 CreateAuditLogFilterRuleRequestV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = CreateAuditLogFilterRuleRequestV1ValidationError{}

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

// Validate checks the field values on UpdateAuditLogFilterRuleRequestV1 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 *UpdateAuditLogFilterRuleRequestV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on UpdateAuditLogFilterRuleRequestV1
// 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
// UpdateAuditLogFilterRuleRequestV1MultiError, or nil if none found.
func (m *UpdateAuditLogFilterRuleRequestV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for Name

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, UpdateAuditLogFilterRuleRequestV1ValidationError{
						field:  fmt.Sprintf("Filters[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, UpdateAuditLogFilterRuleRequestV1ValidationError{
						field:  fmt.Sprintf("Filters[%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 UpdateAuditLogFilterRuleRequestV1ValidationError{
					field:  fmt.Sprintf("Filters[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if m.Disabled != nil {
		// no validation rules for Disabled
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m UpdateAuditLogFilterRuleRequestV1MultiError) 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 UpdateAuditLogFilterRuleRequestV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = UpdateAuditLogFilterRuleRequestV1ValidationError{}

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

// Validate checks the field values on DeleteAuditLogFilterRuleRequestV1 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 *DeleteAuditLogFilterRuleRequestV1) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DeleteAuditLogFilterRuleRequestV1
// 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
// DeleteAuditLogFilterRuleRequestV1MultiError, or nil if none found.
func (m *DeleteAuditLogFilterRuleRequestV1) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for Name

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m DeleteAuditLogFilterRuleRequestV1MultiError) 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 DeleteAuditLogFilterRuleRequestV1MultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = DeleteAuditLogFilterRuleRequestV1ValidationError{}

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