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

package teams

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for Name

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m TeamMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m TeamMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = TeamValidationError{}

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

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

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

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

	var errors []error

	if !_GetTeamReq_Id_Pattern.MatchString(m.GetId()) {
		err := GetTeamReqValidationError{
			field:  "Id",
			reason: "value does not match regex pattern \"\\\\S\"",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m GetTeamReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m GetTeamReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = GetTeamReqValidationError{}

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

var _GetTeamReq_Id_Pattern = regexp.MustCompile("\\S")

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

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

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

	var errors []error

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m GetTeamRespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m GetTeamRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = GetTeamRespValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ListTeamsReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m ListTeamsReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = ListTeamsReqValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ListTeamsRespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m ListTeamsRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = ListTeamsRespValidationError{}

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

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

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

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

	var errors []error

	if !_UpdateTeamReq_Id_Pattern.MatchString(m.GetId()) {
		err := UpdateTeamReqValidationError{
			field:  "Id",
			reason: "value does not match regex pattern \"\\\\S\"",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Name

	_UpdateTeamReq_Projects_Unique := make(map[string]struct{}, len(m.GetProjects()))

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

		if _, exists := _UpdateTeamReq_Projects_Unique[item]; exists {
			err := UpdateTeamReqValidationError{
				field:  fmt.Sprintf("Projects[%v]", idx),
				reason: "repeated value must contain unique items",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		} else {
			_UpdateTeamReq_Projects_Unique[item] = struct{}{}
		}

		if !_UpdateTeamReq_Projects_Pattern.MatchString(item) {
			err := UpdateTeamReqValidationError{
				field:  fmt.Sprintf("Projects[%v]", idx),
				reason: "value does not match regex pattern \"^[a-z0-9-_]{1,64}$\"",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m UpdateTeamReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m UpdateTeamReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = UpdateTeamReqValidationError{}

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

var _UpdateTeamReq_Id_Pattern = regexp.MustCompile("\\S")

var _UpdateTeamReq_Projects_Pattern = regexp.MustCompile("^[a-z0-9-_]{1,64}$")

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

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

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

	var errors []error

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m UpdateTeamRespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m UpdateTeamRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = UpdateTeamRespValidationError{}

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

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

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

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

	var errors []error

	if !_DeleteTeamReq_Id_Pattern.MatchString(m.GetId()) {
		err := DeleteTeamReqValidationError{
			field:  "Id",
			reason: "value does not match regex pattern \"\\\\S\"",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m DeleteTeamReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DeleteTeamReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = DeleteTeamReqValidationError{}

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

var _DeleteTeamReq_Id_Pattern = regexp.MustCompile("\\S")

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

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

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

	var errors []error

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m DeleteTeamRespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DeleteTeamRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = DeleteTeamRespValidationError{}

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

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

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

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

	var errors []error

	if !_CreateTeamReq_Id_Pattern.MatchString(m.GetId()) {
		err := CreateTeamReqValidationError{
			field:  "Id",
			reason: "value does not match regex pattern \"^[a-z0-9-_]{1,64}$\"",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Name

	_CreateTeamReq_Projects_Unique := make(map[string]struct{}, len(m.GetProjects()))

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

		if _, exists := _CreateTeamReq_Projects_Unique[item]; exists {
			err := CreateTeamReqValidationError{
				field:  fmt.Sprintf("Projects[%v]", idx),
				reason: "repeated value must contain unique items",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		} else {
			_CreateTeamReq_Projects_Unique[item] = struct{}{}
		}

		if !_CreateTeamReq_Projects_Pattern.MatchString(item) {
			err := CreateTeamReqValidationError{
				field:  fmt.Sprintf("Projects[%v]", idx),
				reason: "value does not match regex pattern \"^[a-z0-9-_]{1,64}$\"",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CreateTeamReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m CreateTeamReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = CreateTeamReqValidationError{}

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

var _CreateTeamReq_Id_Pattern = regexp.MustCompile("^[a-z0-9-_]{1,64}$")

var _CreateTeamReq_Projects_Pattern = regexp.MustCompile("^[a-z0-9-_]{1,64}$")

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

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

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

	var errors []error

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CreateTeamRespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m CreateTeamRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = CreateTeamRespValidationError{}

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

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

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

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

	var errors []error

	if !_AddTeamMembersReq_Id_Pattern.MatchString(m.GetId()) {
		err := AddTeamMembersReqValidationError{
			field:  "Id",
			reason: "value does not match regex pattern \"\\\\S\"",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if len(m.GetUserIds()) < 1 {
		err := AddTeamMembersReqValidationError{
			field:  "UserIds",
			reason: "value must contain at least 1 item(s)",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	_AddTeamMembersReq_UserIds_Unique := make(map[string]struct{}, len(m.GetUserIds()))

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

		if _, exists := _AddTeamMembersReq_UserIds_Unique[item]; exists {
			err := AddTeamMembersReqValidationError{
				field:  fmt.Sprintf("UserIds[%v]", idx),
				reason: "repeated value must contain unique items",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		} else {
			_AddTeamMembersReq_UserIds_Unique[item] = struct{}{}
		}

		if !_AddTeamMembersReq_UserIds_Pattern.MatchString(item) {
			err := AddTeamMembersReqValidationError{
				field:  fmt.Sprintf("UserIds[%v]", idx),
				reason: "value does not match regex pattern \"^[[:alnum:]_.+@-]+$\"",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m AddTeamMembersReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AddTeamMembersReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = AddTeamMembersReqValidationError{}

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

var _AddTeamMembersReq_Id_Pattern = regexp.MustCompile("\\S")

var _AddTeamMembersReq_UserIds_Pattern = regexp.MustCompile("^[[:alnum:]_.+@-]+$")

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

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

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m AddTeamMembersRespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AddTeamMembersRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = AddTeamMembersRespValidationError{}

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

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

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

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

	var errors []error

	if !_RemoveTeamMembersReq_Id_Pattern.MatchString(m.GetId()) {
		err := RemoveTeamMembersReqValidationError{
			field:  "Id",
			reason: "value does not match regex pattern \"\\\\S\"",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if len(m.GetUserIds()) < 1 {
		err := RemoveTeamMembersReqValidationError{
			field:  "UserIds",
			reason: "value must contain at least 1 item(s)",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	_RemoveTeamMembersReq_UserIds_Unique := make(map[string]struct{}, len(m.GetUserIds()))

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

		if _, exists := _RemoveTeamMembersReq_UserIds_Unique[item]; exists {
			err := RemoveTeamMembersReqValidationError{
				field:  fmt.Sprintf("UserIds[%v]", idx),
				reason: "repeated value must contain unique items",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		} else {
			_RemoveTeamMembersReq_UserIds_Unique[item] = struct{}{}
		}

		if !_RemoveTeamMembersReq_UserIds_Pattern.MatchString(item) {
			err := RemoveTeamMembersReqValidationError{
				field:  fmt.Sprintf("UserIds[%v]", idx),
				reason: "value does not match regex pattern \"^[[:alnum:]_.+@-]+$\"",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m RemoveTeamMembersReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m RemoveTeamMembersReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = RemoveTeamMembersReqValidationError{}

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

var _RemoveTeamMembersReq_Id_Pattern = regexp.MustCompile("\\S")

var _RemoveTeamMembersReq_UserIds_Pattern = regexp.MustCompile("^[[:alnum:]_.+@-]+$")

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

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

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m RemoveTeamMembersRespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m RemoveTeamMembersRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = RemoveTeamMembersRespValidationError{}

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

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

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

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

	var errors []error

	if !_GetTeamsForMemberReq_UserId_Pattern.MatchString(m.GetUserId()) {
		err := GetTeamsForMemberReqValidationError{
			field:  "UserId",
			reason: "value does not match regex pattern \"^[[:alnum:]_.+@-]+$\"",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m GetTeamsForMemberReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m GetTeamsForMemberReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = GetTeamsForMemberReqValidationError{}

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

var _GetTeamsForMemberReq_UserId_Pattern = regexp.MustCompile("^[[:alnum:]_.+@-]+$")

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

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

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

	var errors []error

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

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

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m GetTeamsForMemberRespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m GetTeamsForMemberRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = GetTeamsForMemberRespValidationError{}

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

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

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

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

	var errors []error

	if !_GetTeamMembershipReq_Id_Pattern.MatchString(m.GetId()) {
		err := GetTeamMembershipReqValidationError{
			field:  "Id",
			reason: "value does not match regex pattern \"\\\\S\"",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m GetTeamMembershipReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m GetTeamMembershipReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = GetTeamMembershipReqValidationError{}

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

var _GetTeamMembershipReq_Id_Pattern = regexp.MustCompile("\\S")

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

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

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m GetTeamMembershipRespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m GetTeamMembershipRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = GetTeamMembershipRespValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m UpgradeToV2ReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m UpgradeToV2ReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = UpgradeToV2ReqValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m UpgradeToV2RespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m UpgradeToV2RespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = UpgradeToV2RespValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ResetToV1ReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m ResetToV1ReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = ResetToV1ReqValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ResetToV1RespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m ResetToV1RespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = ResetToV1RespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for UserId

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m PurgeUserMembershipReqMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m PurgeUserMembershipReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = PurgeUserMembershipReqValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m PurgeUserMembershipRespMultiError) Error() string {
	msgs := make([]string, 0, len(m))
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m PurgeUserMembershipRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

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

var _ error = PurgeUserMembershipRespValidationError{}

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