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

package v1beta1

import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"net/mail"
	"net/url"
	"regexp"
	"sort"
	"strings"
	"time"
	"unicode/utf8"

	"google.golang.org/protobuf/types/known/anypb"
)

// ensure the imports are used
var (
	_ = bytes.MinRead
	_ = errors.New("")
	_ = fmt.Print
	_ = utf8.UTFMax
	_ = (*regexp.Regexp)(nil)
	_ = (*strings.Reader)(nil)
	_ = net.IPv4len
	_ = time.Duration(0)
	_ = (*url.URL)(nil)
	_ = (*mail.Address)(nil)
	_ = anypb.Any{}
	_ = sort.Sort
)

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for BranchId

	// no validation rules for Username

	// no validation rules for Password

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UpdateSqlUserRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Username

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SqlUserValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateBranchRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for BranchId

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetBranchRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for BranchId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DeleteBranchRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for PageSize

	// no validation rules for PageToken

	// no validation rules for ClusterId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListBranchesRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for BranchId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ResetBranchRequestValidationError{}

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

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

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

func (m *ListBranchesResponse) 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, ListBranchesResponseValidationError{
						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, ListBranchesResponseValidationError{
						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 ListBranchesResponseValidationError{
					field:  fmt.Sprintf("Branches[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for NextPageToken

	// no validation rules for TotalSize

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListBranchesResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Name

	// no validation rules for BranchId

	// no validation rules for DisplayName

	// no validation rules for ClusterId

	// no validation rules for ParentId

	// no validation rules for CreatedBy

	// 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, BranchValidationError{
					field:  "CreateTime",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, BranchValidationError{
					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 BranchValidationError{
				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, BranchValidationError{
					field:  "UpdateTime",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, BranchValidationError{
					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 BranchValidationError{
				field:  "UpdateTime",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	// no validation rules for Annotations

	// no validation rules for ParentDisplayName

	// no validation rules for RootPassword

	if m.Endpoints != nil {

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

	}

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

	if m.ParentTimestamp != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = BranchValidationError{}

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

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

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

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

	var errors []error

	if m.Public != nil {

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

	}

	if m.Private != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = Branch_EndpointsValidationError{}

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

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

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

func (m *Branch_Endpoints_Public) 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, Branch_Endpoints_PublicValidationError{
						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, Branch_Endpoints_PublicValidationError{
						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 Branch_Endpoints_PublicValidationError{
					field:  fmt.Sprintf("AuthorizedNetworks[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = Branch_Endpoints_PublicValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Host

	// no validation rules for Port

	switch v := m.Provider.(type) {
	case *Branch_Endpoints_Private_Aws:
		if v == nil {
			err := Branch_Endpoints_PrivateValidationError{
				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, Branch_Endpoints_PrivateValidationError{
						field:  "Aws",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, Branch_Endpoints_PrivateValidationError{
						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 Branch_Endpoints_PrivateValidationError{
					field:  "Aws",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	case *Branch_Endpoints_Private_Gcp:
		if v == nil {
			err := Branch_Endpoints_PrivateValidationError{
				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, Branch_Endpoints_PrivateValidationError{
						field:  "Gcp",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, Branch_Endpoints_PrivateValidationError{
						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 Branch_Endpoints_PrivateValidationError{
					field:  "Gcp",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = Branch_Endpoints_PrivateValidationError{}

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

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

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

func (m *Branch_Endpoints_Public_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 Branch_Endpoints_Public_AuthorizedNetworkMultiError(errors)
	}

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = Branch_Endpoints_Public_AuthorizedNetworkValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ServiceName

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = Branch_Endpoints_Private_AWSValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ServiceAttachmentName

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = Branch_Endpoints_Private_GCPValidationError{}

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