// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: v1beta1/import.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 StartUploadRequest 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 *StartUploadRequest) Validate() error {
	return m.validate(false)
}

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for FileName

	// no validation rules for PartNumber

	// no validation rules for TargetDatabase

	// no validation rules for TargetTable

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = StartUploadRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for UploadId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = StartUploadResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for UploadId

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CompleteUploadRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for UploadId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CancelUploadRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for PartNumber

	// no validation rules for Etag

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CompletePartValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Separator

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

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

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

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CSVFormatValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for Id

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetImportRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for Id

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CancelImportRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateImportRequestValidationError{}

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

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

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

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

	var errors []error

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreationDetailsValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for FileType

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportOptionsValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Type

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

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

	case *ImportSource_S3:
		if v == nil {
			err := ImportSourceValidationError{
				field:  "Source",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

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

	case *ImportSource_Gcs:
		if v == nil {
			err := ImportSourceValidationError{
				field:  "Source",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

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

	case *ImportSource_AzureBlob:
		if v == nil {
			err := ImportSourceValidationError{
				field:  "Source",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

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

	case *ImportSource_S3Compatible:
		if v == nil {
			err := ImportSourceValidationError{
				field:  "Source",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

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

	case *ImportSource_Oss:
		if v == nil {
			err := ImportSourceValidationError{
				field:  "Source",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportSourceValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for UploadId

	// no validation rules for TargetDatabase

	// no validation rules for TargetTable

	// no validation rules for FileName

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = LocalSourceValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Uri

	// no validation rules for AuthType

	switch v := m.Auth.(type) {
	case *S3Source_RoleArn:
		if v == nil {
			err := S3SourceValidationError{
				field:  "Auth",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}
		// no validation rules for RoleArn
	case *S3Source_AccessKey_:
		if v == nil {
			err := S3SourceValidationError{
				field:  "Auth",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = S3SourceValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Uri

	// no validation rules for AuthType

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

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = S3CompatibleSourceValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Uri

	// no validation rules for AuthType

	switch v := m.Auth.(type) {
	case *GCSSource_ServiceAccountKey:
		if v == nil {
			err := GCSSourceValidationError{
				field:  "Auth",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}
		// no validation rules for ServiceAccountKey
	default:
		_ = v // ensures v is used
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GCSSourceValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for AuthType

	// no validation rules for Uri

	switch v := m.Auth.(type) {
	case *AzureBlobSource_SasToken:
		if v == nil {
			err := AzureBlobSourceValidationError{
				field:  "Auth",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}
		// no validation rules for SasToken
	default:
		_ = v // ensures v is used
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = AzureBlobSourceValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Uri

	// no validation rules for AuthType

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = OSSSourceValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for Name

	// no validation rules for ClusterId

	// no validation rules for TotalSize

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

	// no validation rules for State

	// no validation rules for CompletePercent

	// no validation rules for Message

	// no validation rules for CreatedBy

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

	// no validation rules for ImportId

	if m.CompleteTime != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for PageToken

	// no validation rules for PageSize

	// no validation rules for OrderBy

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListImportsRequestValidationError{}

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

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

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

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

	var errors []error

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

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

	}

	// no validation rules for TotalSize

	// no validation rules for NextPageToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListImportsResponseValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportSourceTypeValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportStateValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportFileTypeValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportS3AuthTypeValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportS3CompatibleAuthTypeValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportGcsAuthTypeValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportAzureBlobAuthTypeValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ImportOSSAuthTypeValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for Secret

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = S3Source_AccessKeyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for Secret

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = S3CompatibleSource_AccessKeyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for Secret

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = OSSSource_AccessKeyValidationError{}

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