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

package util

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = EmptyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for IsDone

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = StatusValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Page

	// no validation rules for Length

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PageValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Page

	// no validation rules for Pagesize

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DefaultPageRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Page

	// no validation rules for Pagesize

	// no validation rules for Total

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PagesValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Data

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = IntValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Data

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = StringValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Code

	// no validation rules for Msg

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CommonResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Code

	// no validation rules for Msg

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CommonAarrayResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for FileName

	// no validation rules for FileUrl

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UploadFileValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Value

	// no validation rules for Name

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SelectorOptionValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Name

	// no validation rules for Url

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImgFileValidationError{}

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