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

package rpc

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

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

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

	var errors []error

	if m.GetClusterId() <= 0 {
		err := CreateBranchReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for ParentId

	if l := utf8.RuneCountInString(m.GetDisplayName()); l < 1 || l > 64 {
		err := CreateBranchReqValidationError{
			field:  "DisplayName",
			reason: "value length must be between 1 and 64 runes, inclusive",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Annotation

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateBranchReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateBranchRespValidationError{}

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

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

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

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

	var errors []error

	if m.GetClusterId() <= 0 {
		err := GetBranchReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for BranchId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetBranchReqValidationError{}

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

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

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

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

	var errors []error

	if m.GetClusterId() <= 0 {
		err := DeleteBranchReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for BranchId

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DeleteBranchReqValidationError{}

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

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

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

func (m *FullBranch) 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 DisplayName

	// no validation rules for ClusterId

	// no validation rules for ParentId

	// no validation rules for State

	// no validation rules for UserPrefix

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

	if all {
		switch v := interface{}(m.GetCreateTime()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, FullBranchValidationError{
					field:  "CreateTime",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, FullBranchValidationError{
					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 FullBranchValidationError{
				field:  "CreateTime",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

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

	// no validation rules for Annotations

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

	// no validation rules for ParentDisplayName

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = FullBranchValidationError{}

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

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

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

func (m *BasicBranch) 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 DisplayName

	// no validation rules for ClusterId

	// no validation rules for ParentId

	// no validation rules for State

	if all {
		switch v := interface{}(m.GetCreateTime()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, BasicBranchValidationError{
					field:  "CreateTime",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, BasicBranchValidationError{
					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 BasicBranchValidationError{
				field:  "CreateTime",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

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

	// no validation rules for UserPrefix

	// no validation rules for Annotations

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

	// no validation rules for ParentDisplayName

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = BasicBranchValidationError{}

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

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

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

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

	var errors []error

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = EndpointsValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Host

	// no validation rules for Port

	// no validation rules for Disabled

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PublicEndpointValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for DisplayName

	// no validation rules for StartIpAddress

	// no validation rules for EndIpAddress

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = AuthorizedNetworkValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Host

	// no validation rules for Port

	// no validation rules for Disabled

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

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

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PrivateEndpointValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ServiceMame

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PrivateEndpointAwsValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TargetServiceAttachment

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PrivateEndpointGcpValidationError{}

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

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

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

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

	var errors []error

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetBranchRespValidationError{}

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

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

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

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

	var errors []error

	if m.GetClusterId() <= 0 {
		err := ListBranchesReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListBranchesReqValidationError{}

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

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

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

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

	var errors []error

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

	if m.DeleteAfterTime != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = BranchFilterValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListBranchesRespValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DBUserValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Username

	// no validation rules for AuthMethod

	// no validation rules for Credential

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DBUserOperatorValidationError{}

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

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

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

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

	var errors []error

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

	// no validation rules for ClusterId

	// no validation rules for BranchId

	// no validation rules for UserType

	// no validation rules for Username

	// no validation rules for AuthMethod

	// no validation rules for BuiltinRole

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

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

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

	if m.Settings != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateDBUserReqValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DeleteBranchRespValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateDBUserRespValidationError{}

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

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

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

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

	var errors []error

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

	// no validation rules for ClusterId

	// no validation rules for BranchId

	// no validation rules for Username

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DeleteDBUserReqValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DeleteDBUserRespValidationError{}

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

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

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

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

	var errors []error

	if m.GetClusterId() <= 0 {
		err := ResetBranchReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for BranchId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ResetBranchReqValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ResetBranchRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for IgnoreExists

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateDBUserReq_SettingsValidationError{}

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