// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: api/core/v1/core.proto

package v1

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ResetPasswordReplyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Parent

	// no validation rules for PageSize

	// no validation rules for PageToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListUserGroupsRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Total

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

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

	}

	// no validation rules for NextPageToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListUserGroupReplyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ID

	// no validation rules for Name

	// no validation rules for Avatar

	// no validation rules for Description

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GroupInfoRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ID

	// no validation rules for Name

	// no validation rules for Avatar

	// no validation rules for Description

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

	// no validation rules for CreatedBy

	// no validation rules for Headcount

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GroupInfoValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ID

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DeleteUserGroupRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Uid

	// no validation rules for Username

	// no validation rules for Role

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

	// no validation rules for CreatedBy

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GroupMemberValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UserLatestActivityReplyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Total

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UserProjectListReplyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for Name

	// no validation rules for Identifier

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

	// no validation rules for CreatedBy

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

	// no validation rules for UpdatedBy

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

	// no validation rules for DeletedBy

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

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

	// no validation rules for Description

	// no validation rules for Remark

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ProjectInfoValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Machine

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ExecuteTokenRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ExecuteToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ExecuteTokenReplyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Data

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = TrackReportDataRequestValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetPassword()) < 8 {
		err := UpdatePasswordRequestValidationError{
			field:  "Password",
			reason: "value length must be at least 8 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UpdatePasswordRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ID

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DeleteUserRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for PageToken

	// no validation rules for PageSize

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListUserRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Total

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListUserReplyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for Username

	// no validation rules for ChineseName

	if err := m._validateEmail(m.GetEmail()); err != nil {
		err = UserInfoRequestValidationError{
			field:  "Email",
			reason: "value must be a valid email address",
			cause:  err,
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetPhone()) != 11 {
		err := UserInfoRequestValidationError{
			field:  "Phone",
			reason: "value length must be 11 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)

	}

	// no validation rules for Avatar

	// no validation rules for Location

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

	return nil
}

func (m *UserInfoRequest) _validateHostname(host string) error {
	s := strings.ToLower(strings.TrimSuffix(host, "."))

	if len(host) > 253 {
		return errors.New("hostname cannot exceed 253 characters")
	}

	for _, part := range strings.Split(s, ".") {
		if l := len(part); l == 0 || l > 63 {
			return errors.New("hostname part must be non-empty and cannot exceed 63 characters")
		}

		if part[0] == '-' {
			return errors.New("hostname parts cannot begin with hyphens")
		}

		if part[len(part)-1] == '-' {
			return errors.New("hostname parts cannot end with hyphens")
		}

		for _, r := range part {
			if (r < 'a' || r > 'z') && (r < '0' || r > '9') && r != '-' {
				return fmt.Errorf("hostname parts can only contain alphanumeric characters or hyphens, got %q", string(r))
			}
		}
	}

	return nil
}

func (m *UserInfoRequest) _validateEmail(addr string) error {
	a, err := mail.ParseAddress(addr)
	if err != nil {
		return err
	}
	addr = a.Address

	if len(addr) > 254 {
		return errors.New("email addresses cannot exceed 254 characters")
	}

	parts := strings.SplitN(addr, "@", 2)

	if len(parts[0]) > 64 {
		return errors.New("email address local phrase cannot exceed 64 characters")
	}

	return m._validateHostname(parts[1])
}

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

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

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

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

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

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

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

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

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

var _ error = UserInfoRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ID

	// no validation rules for Username

	// no validation rules for ChineseName

	// no validation rules for Email

	// no validation rules for Phone

	// no validation rules for Avatar

	// no validation rules for Active

	// no validation rules for Location

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UserValidationError{}

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

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

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

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

	var errors []error

	if l := utf8.RuneCountInString(m.GetUsername()); l < 3 || l > 16 {
		err := RegisterRequestValidationError{
			field:  "Username",
			reason: "value length must be between 3 and 16 runes, inclusive",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetPassword()) < 8 {
		err := RegisterRequestValidationError{
			field:  "Password",
			reason: "value length must be at least 8 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetPhone()) != 11 {
		err := RegisterRequestValidationError{
			field:  "Phone",
			reason: "value length must be 11 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)

	}

	if err := m._validateEmail(m.GetEmail()); err != nil {
		err = RegisterRequestValidationError{
			field:  "Email",
			reason: "value must be a valid email address",
			cause:  err,
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

func (m *RegisterRequest) _validateHostname(host string) error {
	s := strings.ToLower(strings.TrimSuffix(host, "."))

	if len(host) > 253 {
		return errors.New("hostname cannot exceed 253 characters")
	}

	for _, part := range strings.Split(s, ".") {
		if l := len(part); l == 0 || l > 63 {
			return errors.New("hostname part must be non-empty and cannot exceed 63 characters")
		}

		if part[0] == '-' {
			return errors.New("hostname parts cannot begin with hyphens")
		}

		if part[len(part)-1] == '-' {
			return errors.New("hostname parts cannot end with hyphens")
		}

		for _, r := range part {
			if (r < 'a' || r > 'z') && (r < '0' || r > '9') && r != '-' {
				return fmt.Errorf("hostname parts can only contain alphanumeric characters or hyphens, got %q", string(r))
			}
		}
	}

	return nil
}

func (m *RegisterRequest) _validateEmail(addr string) error {
	a, err := mail.ParseAddress(addr)
	if err != nil {
		return err
	}
	addr = a.Address

	if len(addr) > 254 {
		return errors.New("email addresses cannot exceed 254 characters")
	}

	parts := strings.SplitN(addr, "@", 2)

	if len(parts[0]) > 64 {
		return errors.New("email address local phrase cannot exceed 64 characters")
	}

	return m._validateHostname(parts[1])
}

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

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

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

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

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

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

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

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

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

var _ error = RegisterRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Username

	// no validation rules for Password

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = LoginRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Token

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = LoginReplyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Type

	// no validation rules for Token

	// no validation rules for ExpiresAt

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = TokenInfoValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UnregisterRequestValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UnregisterReplyValidationError{}

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