aeus-admin/pb/organize.pb.validate.go

4453 lines
117 KiB
Go

// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: organize.proto
package pb
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 Menu 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 *Menu) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Menu 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 MenuMultiError, or nil if none found.
func (m *Menu) ValidateAll() error {
return m.validate(true)
}
func (m *Menu) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Id
// no validation rules for ParentId
if utf8.RuneCountInString(m.GetName()) > 60 {
err := MenuValidationError{
field: "Name",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetLabel()) > 120 {
err := MenuValidationError{
field: "Label",
reason: "value length must be at most 120 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetUri()) > 512 {
err := MenuValidationError{
field: "Uri",
reason: "value length must be at most 512 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetViewPath()) > 512 {
err := MenuValidationError{
field: "ViewPath",
reason: "value length must be at most 512 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetIcon()) > 60 {
err := MenuValidationError{
field: "Icon",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
// no validation rules for Hidden
// no validation rules for Public
if utf8.RuneCountInString(m.GetDescription()) > 1024 {
err := MenuValidationError{
field: "Description",
reason: "value length must be at most 1024 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return MenuMultiError(errors)
}
return nil
}
// MenuMultiError is an error wrapping multiple validation errors returned by
// Menu.ValidateAll() if the designated constraints aren't met.
type MenuMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m MenuMultiError) 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 MenuMultiError) AllErrors() []error { return m }
// MenuValidationError is the validation error returned by Menu.Validate if the
// designated constraints aren't met.
type MenuValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e MenuValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e MenuValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e MenuValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e MenuValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e MenuValidationError) ErrorName() string { return "MenuValidationError" }
// Error satisfies the builtin error interface
func (e MenuValidationError) 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 %sMenu.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = MenuValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = MenuValidationError{}
// Validate checks the field values on Role 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 *Role) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Role 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 RoleMultiError, or nil if none found.
func (m *Role) ValidateAll() error {
return m.validate(true)
}
func (m *Role) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Id
if utf8.RuneCountInString(m.GetName()) > 60 {
err := RoleValidationError{
field: "Name",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetLabel()) > 60 {
err := RoleValidationError{
field: "Label",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetDescription()) > 1024 {
err := RoleValidationError{
field: "Description",
reason: "value length must be at most 1024 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return RoleMultiError(errors)
}
return nil
}
// RoleMultiError is an error wrapping multiple validation errors returned by
// Role.ValidateAll() if the designated constraints aren't met.
type RoleMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m RoleMultiError) 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 RoleMultiError) AllErrors() []error { return m }
// RoleValidationError is the validation error returned by Role.Validate if the
// designated constraints aren't met.
type RoleValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RoleValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RoleValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RoleValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RoleValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RoleValidationError) ErrorName() string { return "RoleValidationError" }
// Error satisfies the builtin error interface
func (e RoleValidationError) 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 %sRole.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RoleValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RoleValidationError{}
// Validate checks the field values on Permission 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 *Permission) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Permission 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 PermissionMultiError, or
// nil if none found.
func (m *Permission) ValidateAll() error {
return m.validate(true)
}
func (m *Permission) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Id
// no validation rules for MenuId
if utf8.RuneCountInString(m.GetPermission()) > 60 {
err := PermissionValidationError{
field: "Permission",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetLabel()) > 60 {
err := PermissionValidationError{
field: "Label",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return PermissionMultiError(errors)
}
return nil
}
// PermissionMultiError is an error wrapping multiple validation errors
// returned by Permission.ValidateAll() if the designated constraints aren't met.
type PermissionMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m PermissionMultiError) 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 PermissionMultiError) AllErrors() []error { return m }
// PermissionValidationError is the validation error returned by
// Permission.Validate if the designated constraints aren't met.
type PermissionValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PermissionValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PermissionValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PermissionValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PermissionValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PermissionValidationError) ErrorName() string { return "PermissionValidationError" }
// Error satisfies the builtin error interface
func (e PermissionValidationError) 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 %sPermission.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PermissionValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PermissionValidationError{}
// Validate checks the field values on RolePermission 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 *RolePermission) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on RolePermission 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 RolePermissionMultiError,
// or nil if none found.
func (m *RolePermission) ValidateAll() error {
return m.validate(true)
}
func (m *RolePermission) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Id
if utf8.RuneCountInString(m.GetRole()) > 60 {
err := RolePermissionValidationError{
field: "Role",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
// no validation rules for PermissionId
if len(errors) > 0 {
return RolePermissionMultiError(errors)
}
return nil
}
// RolePermissionMultiError is an error wrapping multiple validation errors
// returned by RolePermission.ValidateAll() if the designated constraints
// aren't met.
type RolePermissionMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m RolePermissionMultiError) 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 RolePermissionMultiError) AllErrors() []error { return m }
// RolePermissionValidationError is the validation error returned by
// RolePermission.Validate if the designated constraints aren't met.
type RolePermissionValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RolePermissionValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RolePermissionValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RolePermissionValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RolePermissionValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RolePermissionValidationError) ErrorName() string { return "RolePermissionValidationError" }
// Error satisfies the builtin error interface
func (e RolePermissionValidationError) 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 %sRolePermission.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RolePermissionValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RolePermissionValidationError{}
// 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 CreatedAt
// no validation rules for UpdatedAt
if l := utf8.RuneCountInString(m.GetUid()); l < 5 || l > 20 {
err := UserValidationError{
field: "Uid",
reason: "value length must be between 5 and 20 runes, inclusive",
}
if !all {
return err
}
errors = append(errors, err)
}
if l := utf8.RuneCountInString(m.GetUsername()); l < 5 || l > 20 {
err := UserValidationError{
field: "Username",
reason: "value length must be between 5 and 20 runes, inclusive",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetRole()) > 60 {
err := UserValidationError{
field: "Role",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
// no validation rules for Admin
// no validation rules for DeptId
if utf8.RuneCountInString(m.GetTag()) > 60 {
err := UserValidationError{
field: "Tag",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetPassword()) > 60 {
err := UserValidationError{
field: "Password",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetEmail()) > 60 {
err := UserValidationError{
field: "Email",
reason: "value length must be at most 60 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetAvatar()) > 1024 {
err := UserValidationError{
field: "Avatar",
reason: "value length must be at most 1024 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetGender()) > 20 {
err := UserValidationError{
field: "Gender",
reason: "value length must be at most 20 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetDescription()) > 1024 {
err := UserValidationError{
field: "Description",
reason: "value length must be at most 1024 runes",
}
if !all {
return err
}
errors = append(errors, 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 {
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 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 Department 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 *Department) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Department 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 DepartmentMultiError, or
// nil if none found.
func (m *Department) ValidateAll() error {
return m.validate(true)
}
func (m *Department) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Id
// no validation rules for CreatedAt
// no validation rules for UpdatedAt
// no validation rules for ParentId
if utf8.RuneCountInString(m.GetName()) > 20 {
err := DepartmentValidationError{
field: "Name",
reason: "value length must be at most 20 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetDescription()) > 1024 {
err := DepartmentValidationError{
field: "Description",
reason: "value length must be at most 1024 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return DepartmentMultiError(errors)
}
return nil
}
// DepartmentMultiError is an error wrapping multiple validation errors
// returned by Department.ValidateAll() if the designated constraints aren't met.
type DepartmentMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m DepartmentMultiError) 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 DepartmentMultiError) AllErrors() []error { return m }
// DepartmentValidationError is the validation error returned by
// Department.Validate if the designated constraints aren't met.
type DepartmentValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DepartmentValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DepartmentValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DepartmentValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DepartmentValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DepartmentValidationError) ErrorName() string { return "DepartmentValidationError" }
// Error satisfies the builtin error interface
func (e DepartmentValidationError) 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 %sDepartment.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DepartmentValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DepartmentValidationError{}
// Validate checks the field values on Setting 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 *Setting) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Setting 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 SettingMultiError, or nil if none found.
func (m *Setting) ValidateAll() error {
return m.validate(true)
}
func (m *Setting) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Id
// no validation rules for CreatedAt
// no validation rules for UpdatedAt
if utf8.RuneCountInString(m.GetName()) > 20 {
err := SettingValidationError{
field: "Name",
reason: "value length must be at most 20 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetValue()) > 512 {
err := SettingValidationError{
field: "Value",
reason: "value length must be at most 512 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetDescription()) > 1024 {
err := SettingValidationError{
field: "Description",
reason: "value length must be at most 1024 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return SettingMultiError(errors)
}
return nil
}
// SettingMultiError is an error wrapping multiple validation errors returned
// by Setting.ValidateAll() if the designated constraints aren't met.
type SettingMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m SettingMultiError) 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 SettingMultiError) AllErrors() []error { return m }
// SettingValidationError is the validation error returned by Setting.Validate
// if the designated constraints aren't met.
type SettingValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SettingValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SettingValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SettingValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SettingValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SettingValidationError) ErrorName() string { return "SettingValidationError" }
// Error satisfies the builtin error interface
func (e SettingValidationError) 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 %sSetting.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SettingValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SettingValidationError{}
// Validate checks the field values on LabelValue 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 *LabelValue) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LabelValue 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 LabelValueMultiError, or
// nil if none found.
func (m *LabelValue) ValidateAll() error {
return m.validate(true)
}
func (m *LabelValue) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Label
// no validation rules for Value
if len(errors) > 0 {
return LabelValueMultiError(errors)
}
return nil
}
// LabelValueMultiError is an error wrapping multiple validation errors
// returned by LabelValue.ValidateAll() if the designated constraints aren't met.
type LabelValueMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LabelValueMultiError) 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 LabelValueMultiError) AllErrors() []error { return m }
// LabelValueValidationError is the validation error returned by
// LabelValue.Validate if the designated constraints aren't met.
type LabelValueValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LabelValueValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LabelValueValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LabelValueValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LabelValueValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LabelValueValidationError) ErrorName() string { return "LabelValueValidationError" }
// Error satisfies the builtin error interface
func (e LabelValueValidationError) 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 %sLabelValue.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LabelValueValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LabelValueValidationError{}
// Validate checks the field values on PermissionItem 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 *PermissionItem) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on PermissionItem 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 PermissionItemMultiError,
// or nil if none found.
func (m *PermissionItem) ValidateAll() error {
return m.validate(true)
}
func (m *PermissionItem) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Value
// no validation rules for Label
if len(errors) > 0 {
return PermissionItemMultiError(errors)
}
return nil
}
// PermissionItemMultiError is an error wrapping multiple validation errors
// returned by PermissionItem.ValidateAll() if the designated constraints
// aren't met.
type PermissionItemMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m PermissionItemMultiError) 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 PermissionItemMultiError) AllErrors() []error { return m }
// PermissionItemValidationError is the validation error returned by
// PermissionItem.Validate if the designated constraints aren't met.
type PermissionItemValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PermissionItemValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PermissionItemValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PermissionItemValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PermissionItemValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PermissionItemValidationError) ErrorName() string { return "PermissionItemValidationError" }
// Error satisfies the builtin error interface
func (e PermissionItemValidationError) 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 %sPermissionItem.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PermissionItemValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PermissionItemValidationError{}
// Validate checks the field values on MenuItem 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 *MenuItem) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on MenuItem 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 MenuItemMultiError, or nil
// if none found.
func (m *MenuItem) ValidateAll() error {
return m.validate(true)
}
func (m *MenuItem) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Label
// no validation rules for Name
// no validation rules for Icon
// no validation rules for Hidden
// no validation rules for Public
// no validation rules for Route
// no validation rules for View
for idx, item := range m.GetPermissions() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, MenuItemValidationError{
field: fmt.Sprintf("Permissions[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, MenuItemValidationError{
field: fmt.Sprintf("Permissions[%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 MenuItemValidationError{
field: fmt.Sprintf("Permissions[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
for idx, item := range m.GetChildren() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, MenuItemValidationError{
field: fmt.Sprintf("Children[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, MenuItemValidationError{
field: fmt.Sprintf("Children[%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 MenuItemValidationError{
field: fmt.Sprintf("Children[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return MenuItemMultiError(errors)
}
return nil
}
// MenuItemMultiError is an error wrapping multiple validation errors returned
// by MenuItem.ValidateAll() if the designated constraints aren't met.
type MenuItemMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m MenuItemMultiError) 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 MenuItemMultiError) AllErrors() []error { return m }
// MenuItemValidationError is the validation error returned by
// MenuItem.Validate if the designated constraints aren't met.
type MenuItemValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e MenuItemValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e MenuItemValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e MenuItemValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e MenuItemValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e MenuItemValidationError) ErrorName() string { return "MenuItemValidationError" }
// Error satisfies the builtin error interface
func (e MenuItemValidationError) 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 %sMenuItem.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = MenuItemValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = MenuItemValidationError{}
// Validate checks the field values on GetMenuRequest 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 *GetMenuRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetMenuRequest 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 GetMenuRequestMultiError,
// or nil if none found.
func (m *GetMenuRequest) ValidateAll() error {
return m.validate(true)
}
func (m *GetMenuRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Permission
if len(errors) > 0 {
return GetMenuRequestMultiError(errors)
}
return nil
}
// GetMenuRequestMultiError is an error wrapping multiple validation errors
// returned by GetMenuRequest.ValidateAll() if the designated constraints
// aren't met.
type GetMenuRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetMenuRequestMultiError) 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 GetMenuRequestMultiError) AllErrors() []error { return m }
// GetMenuRequestValidationError is the validation error returned by
// GetMenuRequest.Validate if the designated constraints aren't met.
type GetMenuRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetMenuRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetMenuRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetMenuRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetMenuRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetMenuRequestValidationError) ErrorName() string { return "GetMenuRequestValidationError" }
// Error satisfies the builtin error interface
func (e GetMenuRequestValidationError) 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 %sGetMenuRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetMenuRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetMenuRequestValidationError{}
// Validate checks the field values on GetMenuResponse 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 *GetMenuResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetMenuResponse 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
// GetMenuResponseMultiError, or nil if none found.
func (m *GetMenuResponse) ValidateAll() error {
return m.validate(true)
}
func (m *GetMenuResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetData() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, GetMenuResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, GetMenuResponseValidationError{
field: fmt.Sprintf("Data[%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 GetMenuResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return GetMenuResponseMultiError(errors)
}
return nil
}
// GetMenuResponseMultiError is an error wrapping multiple validation errors
// returned by GetMenuResponse.ValidateAll() if the designated constraints
// aren't met.
type GetMenuResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetMenuResponseMultiError) 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 GetMenuResponseMultiError) AllErrors() []error { return m }
// GetMenuResponseValidationError is the validation error returned by
// GetMenuResponse.Validate if the designated constraints aren't met.
type GetMenuResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetMenuResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetMenuResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetMenuResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetMenuResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetMenuResponseValidationError) ErrorName() string { return "GetMenuResponseValidationError" }
// Error satisfies the builtin error interface
func (e GetMenuResponseValidationError) 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 %sGetMenuResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetMenuResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetMenuResponseValidationError{}
// Validate checks the field values on GetProfileRequest 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 *GetProfileRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetProfileRequest 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
// GetProfileRequestMultiError, or nil if none found.
func (m *GetProfileRequest) ValidateAll() error {
return m.validate(true)
}
func (m *GetProfileRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Uid
if len(errors) > 0 {
return GetProfileRequestMultiError(errors)
}
return nil
}
// GetProfileRequestMultiError is an error wrapping multiple validation errors
// returned by GetProfileRequest.ValidateAll() if the designated constraints
// aren't met.
type GetProfileRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetProfileRequestMultiError) 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 GetProfileRequestMultiError) AllErrors() []error { return m }
// GetProfileRequestValidationError is the validation error returned by
// GetProfileRequest.Validate if the designated constraints aren't met.
type GetProfileRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetProfileRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetProfileRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetProfileRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetProfileRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetProfileRequestValidationError) ErrorName() string {
return "GetProfileRequestValidationError"
}
// Error satisfies the builtin error interface
func (e GetProfileRequestValidationError) 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 %sGetProfileRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetProfileRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetProfileRequestValidationError{}
// Validate checks the field values on GetProfileResponse 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 *GetProfileResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetProfileResponse 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
// GetProfileResponseMultiError, or nil if none found.
func (m *GetProfileResponse) ValidateAll() error {
return m.validate(true)
}
func (m *GetProfileResponse) 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
// no validation rules for Email
// no validation rules for Avatar
// no validation rules for Admin
// no validation rules for Description
if len(errors) > 0 {
return GetProfileResponseMultiError(errors)
}
return nil
}
// GetProfileResponseMultiError is an error wrapping multiple validation errors
// returned by GetProfileResponse.ValidateAll() if the designated constraints
// aren't met.
type GetProfileResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetProfileResponseMultiError) 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 GetProfileResponseMultiError) AllErrors() []error { return m }
// GetProfileResponseValidationError is the validation error returned by
// GetProfileResponse.Validate if the designated constraints aren't met.
type GetProfileResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetProfileResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetProfileResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetProfileResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetProfileResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetProfileResponseValidationError) ErrorName() string {
return "GetProfileResponseValidationError"
}
// Error satisfies the builtin error interface
func (e GetProfileResponseValidationError) 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 %sGetProfileResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetProfileResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetProfileResponseValidationError{}
// Validate checks the field values on ResetPasswordRequest 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 *ResetPasswordRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ResetPasswordRequest 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
// ResetPasswordRequestMultiError, or nil if none found.
func (m *ResetPasswordRequest) ValidateAll() error {
return m.validate(true)
}
func (m *ResetPasswordRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Uid
// no validation rules for OldPassword
// no validation rules for NewPassword
if len(errors) > 0 {
return ResetPasswordRequestMultiError(errors)
}
return nil
}
// ResetPasswordRequestMultiError is an error wrapping multiple validation
// errors returned by ResetPasswordRequest.ValidateAll() if the designated
// constraints aren't met.
type ResetPasswordRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ResetPasswordRequestMultiError) 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 ResetPasswordRequestMultiError) AllErrors() []error { return m }
// ResetPasswordRequestValidationError is the validation error returned by
// ResetPasswordRequest.Validate if the designated constraints aren't met.
type ResetPasswordRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ResetPasswordRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ResetPasswordRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ResetPasswordRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ResetPasswordRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ResetPasswordRequestValidationError) ErrorName() string {
return "ResetPasswordRequestValidationError"
}
// Error satisfies the builtin error interface
func (e ResetPasswordRequestValidationError) 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 %sResetPasswordRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ResetPasswordRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ResetPasswordRequestValidationError{}
// Validate checks the field values on ResetPasswordResponse 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 *ResetPasswordResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ResetPasswordResponse 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
// ResetPasswordResponseMultiError, or nil if none found.
func (m *ResetPasswordResponse) ValidateAll() error {
return m.validate(true)
}
func (m *ResetPasswordResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Uid
if len(errors) > 0 {
return ResetPasswordResponseMultiError(errors)
}
return nil
}
// ResetPasswordResponseMultiError is an error wrapping multiple validation
// errors returned by ResetPasswordResponse.ValidateAll() if the designated
// constraints aren't met.
type ResetPasswordResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ResetPasswordResponseMultiError) 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 ResetPasswordResponseMultiError) AllErrors() []error { return m }
// ResetPasswordResponseValidationError is the validation error returned by
// ResetPasswordResponse.Validate if the designated constraints aren't met.
type ResetPasswordResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ResetPasswordResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ResetPasswordResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ResetPasswordResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ResetPasswordResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ResetPasswordResponseValidationError) ErrorName() string {
return "ResetPasswordResponseValidationError"
}
// Error satisfies the builtin error interface
func (e ResetPasswordResponseValidationError) 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 %sResetPasswordResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ResetPasswordResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ResetPasswordResponseValidationError{}
// Validate checks the field values on UpdateProfileRequest 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 *UpdateProfileRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on UpdateProfileRequest 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
// UpdateProfileRequestMultiError, or nil if none found.
func (m *UpdateProfileRequest) ValidateAll() error {
return m.validate(true)
}
func (m *UpdateProfileRequest) 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 Email
// no validation rules for Avatar
// no validation rules for Description
if len(errors) > 0 {
return UpdateProfileRequestMultiError(errors)
}
return nil
}
// UpdateProfileRequestMultiError is an error wrapping multiple validation
// errors returned by UpdateProfileRequest.ValidateAll() if the designated
// constraints aren't met.
type UpdateProfileRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m UpdateProfileRequestMultiError) 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 UpdateProfileRequestMultiError) AllErrors() []error { return m }
// UpdateProfileRequestValidationError is the validation error returned by
// UpdateProfileRequest.Validate if the designated constraints aren't met.
type UpdateProfileRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e UpdateProfileRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e UpdateProfileRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e UpdateProfileRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e UpdateProfileRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e UpdateProfileRequestValidationError) ErrorName() string {
return "UpdateProfileRequestValidationError"
}
// Error satisfies the builtin error interface
func (e UpdateProfileRequestValidationError) 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 %sUpdateProfileRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = UpdateProfileRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = UpdateProfileRequestValidationError{}
// Validate checks the field values on UpdateProfileResponse 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 *UpdateProfileResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on UpdateProfileResponse 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
// UpdateProfileResponseMultiError, or nil if none found.
func (m *UpdateProfileResponse) ValidateAll() error {
return m.validate(true)
}
func (m *UpdateProfileResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Uid
if len(errors) > 0 {
return UpdateProfileResponseMultiError(errors)
}
return nil
}
// UpdateProfileResponseMultiError is an error wrapping multiple validation
// errors returned by UpdateProfileResponse.ValidateAll() if the designated
// constraints aren't met.
type UpdateProfileResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m UpdateProfileResponseMultiError) 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 UpdateProfileResponseMultiError) AllErrors() []error { return m }
// UpdateProfileResponseValidationError is the validation error returned by
// UpdateProfileResponse.Validate if the designated constraints aren't met.
type UpdateProfileResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e UpdateProfileResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e UpdateProfileResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e UpdateProfileResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e UpdateProfileResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e UpdateProfileResponseValidationError) ErrorName() string {
return "UpdateProfileResponseValidationError"
}
// Error satisfies the builtin error interface
func (e UpdateProfileResponseValidationError) 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 %sUpdateProfileResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = UpdateProfileResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = UpdateProfileResponseValidationError{}
// Validate checks the field values on GetPermissionRequest 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 *GetPermissionRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetPermissionRequest 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
// GetPermissionRequestMultiError, or nil if none found.
func (m *GetPermissionRequest) ValidateAll() error {
return m.validate(true)
}
func (m *GetPermissionRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Uid
if len(errors) > 0 {
return GetPermissionRequestMultiError(errors)
}
return nil
}
// GetPermissionRequestMultiError is an error wrapping multiple validation
// errors returned by GetPermissionRequest.ValidateAll() if the designated
// constraints aren't met.
type GetPermissionRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetPermissionRequestMultiError) 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 GetPermissionRequestMultiError) AllErrors() []error { return m }
// GetPermissionRequestValidationError is the validation error returned by
// GetPermissionRequest.Validate if the designated constraints aren't met.
type GetPermissionRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetPermissionRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetPermissionRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetPermissionRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetPermissionRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetPermissionRequestValidationError) ErrorName() string {
return "GetPermissionRequestValidationError"
}
// Error satisfies the builtin error interface
func (e GetPermissionRequestValidationError) 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 %sGetPermissionRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetPermissionRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetPermissionRequestValidationError{}
// Validate checks the field values on GetPermissionResponse 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 *GetPermissionResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetPermissionResponse 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
// GetPermissionResponseMultiError, or nil if none found.
func (m *GetPermissionResponse) ValidateAll() error {
return m.validate(true)
}
func (m *GetPermissionResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Uid
if len(errors) > 0 {
return GetPermissionResponseMultiError(errors)
}
return nil
}
// GetPermissionResponseMultiError is an error wrapping multiple validation
// errors returned by GetPermissionResponse.ValidateAll() if the designated
// constraints aren't met.
type GetPermissionResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetPermissionResponseMultiError) 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 GetPermissionResponseMultiError) AllErrors() []error { return m }
// GetPermissionResponseValidationError is the validation error returned by
// GetPermissionResponse.Validate if the designated constraints aren't met.
type GetPermissionResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetPermissionResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetPermissionResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetPermissionResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetPermissionResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetPermissionResponseValidationError) ErrorName() string {
return "GetPermissionResponseValidationError"
}
// Error satisfies the builtin error interface
func (e GetPermissionResponseValidationError) 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 %sGetPermissionResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetPermissionResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetPermissionResponseValidationError{}
// Validate checks the field values on GetUserLabelRequest 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 *GetUserLabelRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetUserLabelRequest 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
// GetUserLabelRequestMultiError, or nil if none found.
func (m *GetUserLabelRequest) ValidateAll() error {
return m.validate(true)
}
func (m *GetUserLabelRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return GetUserLabelRequestMultiError(errors)
}
return nil
}
// GetUserLabelRequestMultiError is an error wrapping multiple validation
// errors returned by GetUserLabelRequest.ValidateAll() if the designated
// constraints aren't met.
type GetUserLabelRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetUserLabelRequestMultiError) 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 GetUserLabelRequestMultiError) AllErrors() []error { return m }
// GetUserLabelRequestValidationError is the validation error returned by
// GetUserLabelRequest.Validate if the designated constraints aren't met.
type GetUserLabelRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetUserLabelRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetUserLabelRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetUserLabelRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetUserLabelRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetUserLabelRequestValidationError) ErrorName() string {
return "GetUserLabelRequestValidationError"
}
// Error satisfies the builtin error interface
func (e GetUserLabelRequestValidationError) 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 %sGetUserLabelRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetUserLabelRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetUserLabelRequestValidationError{}
// Validate checks the field values on GetUserLabelResponse 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 *GetUserLabelResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetUserLabelResponse 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
// GetUserLabelResponseMultiError, or nil if none found.
func (m *GetUserLabelResponse) ValidateAll() error {
return m.validate(true)
}
func (m *GetUserLabelResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetData() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, GetUserLabelResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, GetUserLabelResponseValidationError{
field: fmt.Sprintf("Data[%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 GetUserLabelResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return GetUserLabelResponseMultiError(errors)
}
return nil
}
// GetUserLabelResponseMultiError is an error wrapping multiple validation
// errors returned by GetUserLabelResponse.ValidateAll() if the designated
// constraints aren't met.
type GetUserLabelResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetUserLabelResponseMultiError) 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 GetUserLabelResponseMultiError) AllErrors() []error { return m }
// GetUserLabelResponseValidationError is the validation error returned by
// GetUserLabelResponse.Validate if the designated constraints aren't met.
type GetUserLabelResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetUserLabelResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetUserLabelResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetUserLabelResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetUserLabelResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetUserLabelResponseValidationError) ErrorName() string {
return "GetUserLabelResponseValidationError"
}
// Error satisfies the builtin error interface
func (e GetUserLabelResponseValidationError) 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 %sGetUserLabelResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetUserLabelResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetUserLabelResponseValidationError{}
// Validate checks the field values on GetUserTagRequest 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 *GetUserTagRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetUserTagRequest 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
// GetUserTagRequestMultiError, or nil if none found.
func (m *GetUserTagRequest) ValidateAll() error {
return m.validate(true)
}
func (m *GetUserTagRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return GetUserTagRequestMultiError(errors)
}
return nil
}
// GetUserTagRequestMultiError is an error wrapping multiple validation errors
// returned by GetUserTagRequest.ValidateAll() if the designated constraints
// aren't met.
type GetUserTagRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetUserTagRequestMultiError) 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 GetUserTagRequestMultiError) AllErrors() []error { return m }
// GetUserTagRequestValidationError is the validation error returned by
// GetUserTagRequest.Validate if the designated constraints aren't met.
type GetUserTagRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetUserTagRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetUserTagRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetUserTagRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetUserTagRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetUserTagRequestValidationError) ErrorName() string {
return "GetUserTagRequestValidationError"
}
// Error satisfies the builtin error interface
func (e GetUserTagRequestValidationError) 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 %sGetUserTagRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetUserTagRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetUserTagRequestValidationError{}
// Validate checks the field values on GetUserTagResponse 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 *GetUserTagResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetUserTagResponse 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
// GetUserTagResponseMultiError, or nil if none found.
func (m *GetUserTagResponse) ValidateAll() error {
return m.validate(true)
}
func (m *GetUserTagResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetData() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, GetUserTagResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, GetUserTagResponseValidationError{
field: fmt.Sprintf("Data[%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 GetUserTagResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return GetUserTagResponseMultiError(errors)
}
return nil
}
// GetUserTagResponseMultiError is an error wrapping multiple validation errors
// returned by GetUserTagResponse.ValidateAll() if the designated constraints
// aren't met.
type GetUserTagResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetUserTagResponseMultiError) 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 GetUserTagResponseMultiError) AllErrors() []error { return m }
// GetUserTagResponseValidationError is the validation error returned by
// GetUserTagResponse.Validate if the designated constraints aren't met.
type GetUserTagResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetUserTagResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetUserTagResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetUserTagResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetUserTagResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetUserTagResponseValidationError) ErrorName() string {
return "GetUserTagResponseValidationError"
}
// Error satisfies the builtin error interface
func (e GetUserTagResponseValidationError) 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 %sGetUserTagResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetUserTagResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetUserTagResponseValidationError{}
// Validate checks the field values on GetDepartmentLabelRequest 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 *GetDepartmentLabelRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetDepartmentLabelRequest 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
// GetDepartmentLabelRequestMultiError, or nil if none found.
func (m *GetDepartmentLabelRequest) ValidateAll() error {
return m.validate(true)
}
func (m *GetDepartmentLabelRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return GetDepartmentLabelRequestMultiError(errors)
}
return nil
}
// GetDepartmentLabelRequestMultiError is an error wrapping multiple validation
// errors returned by GetDepartmentLabelRequest.ValidateAll() if the
// designated constraints aren't met.
type GetDepartmentLabelRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetDepartmentLabelRequestMultiError) 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 GetDepartmentLabelRequestMultiError) AllErrors() []error { return m }
// GetDepartmentLabelRequestValidationError is the validation error returned by
// GetDepartmentLabelRequest.Validate if the designated constraints aren't met.
type GetDepartmentLabelRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetDepartmentLabelRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetDepartmentLabelRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetDepartmentLabelRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetDepartmentLabelRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetDepartmentLabelRequestValidationError) ErrorName() string {
return "GetDepartmentLabelRequestValidationError"
}
// Error satisfies the builtin error interface
func (e GetDepartmentLabelRequestValidationError) 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 %sGetDepartmentLabelRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetDepartmentLabelRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetDepartmentLabelRequestValidationError{}
// Validate checks the field values on GetDepartmentLabelResponse 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 *GetDepartmentLabelResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetDepartmentLabelResponse 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
// GetDepartmentLabelResponseMultiError, or nil if none found.
func (m *GetDepartmentLabelResponse) ValidateAll() error {
return m.validate(true)
}
func (m *GetDepartmentLabelResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetData() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, GetDepartmentLabelResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, GetDepartmentLabelResponseValidationError{
field: fmt.Sprintf("Data[%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 GetDepartmentLabelResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return GetDepartmentLabelResponseMultiError(errors)
}
return nil
}
// GetDepartmentLabelResponseMultiError is an error wrapping multiple
// validation errors returned by GetDepartmentLabelResponse.ValidateAll() if
// the designated constraints aren't met.
type GetDepartmentLabelResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetDepartmentLabelResponseMultiError) 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 GetDepartmentLabelResponseMultiError) AllErrors() []error { return m }
// GetDepartmentLabelResponseValidationError is the validation error returned
// by GetDepartmentLabelResponse.Validate if the designated constraints aren't met.
type GetDepartmentLabelResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetDepartmentLabelResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetDepartmentLabelResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetDepartmentLabelResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetDepartmentLabelResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetDepartmentLabelResponseValidationError) ErrorName() string {
return "GetDepartmentLabelResponseValidationError"
}
// Error satisfies the builtin error interface
func (e GetDepartmentLabelResponseValidationError) 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 %sGetDepartmentLabelResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetDepartmentLabelResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetDepartmentLabelResponseValidationError{}
// Validate checks the field values on GetRoleLabelRequest 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 *GetRoleLabelRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetRoleLabelRequest 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
// GetRoleLabelRequestMultiError, or nil if none found.
func (m *GetRoleLabelRequest) ValidateAll() error {
return m.validate(true)
}
func (m *GetRoleLabelRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return GetRoleLabelRequestMultiError(errors)
}
return nil
}
// GetRoleLabelRequestMultiError is an error wrapping multiple validation
// errors returned by GetRoleLabelRequest.ValidateAll() if the designated
// constraints aren't met.
type GetRoleLabelRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetRoleLabelRequestMultiError) 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 GetRoleLabelRequestMultiError) AllErrors() []error { return m }
// GetRoleLabelRequestValidationError is the validation error returned by
// GetRoleLabelRequest.Validate if the designated constraints aren't met.
type GetRoleLabelRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetRoleLabelRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetRoleLabelRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetRoleLabelRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetRoleLabelRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetRoleLabelRequestValidationError) ErrorName() string {
return "GetRoleLabelRequestValidationError"
}
// Error satisfies the builtin error interface
func (e GetRoleLabelRequestValidationError) 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 %sGetRoleLabelRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetRoleLabelRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetRoleLabelRequestValidationError{}
// Validate checks the field values on GetRoleLabelResponse 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 *GetRoleLabelResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetRoleLabelResponse 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
// GetRoleLabelResponseMultiError, or nil if none found.
func (m *GetRoleLabelResponse) ValidateAll() error {
return m.validate(true)
}
func (m *GetRoleLabelResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetData() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, GetRoleLabelResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, GetRoleLabelResponseValidationError{
field: fmt.Sprintf("Data[%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 GetRoleLabelResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return GetRoleLabelResponseMultiError(errors)
}
return nil
}
// GetRoleLabelResponseMultiError is an error wrapping multiple validation
// errors returned by GetRoleLabelResponse.ValidateAll() if the designated
// constraints aren't met.
type GetRoleLabelResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetRoleLabelResponseMultiError) 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 GetRoleLabelResponseMultiError) AllErrors() []error { return m }
// GetRoleLabelResponseValidationError is the validation error returned by
// GetRoleLabelResponse.Validate if the designated constraints aren't met.
type GetRoleLabelResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetRoleLabelResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetRoleLabelResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetRoleLabelResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetRoleLabelResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetRoleLabelResponseValidationError) ErrorName() string {
return "GetRoleLabelResponseValidationError"
}
// Error satisfies the builtin error interface
func (e GetRoleLabelResponseValidationError) 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 %sGetRoleLabelResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetRoleLabelResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetRoleLabelResponseValidationError{}
// Validate checks the field values on GetRolePermissionRequest 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 *GetRolePermissionRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetRolePermissionRequest 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
// GetRolePermissionRequestMultiError, or nil if none found.
func (m *GetRolePermissionRequest) ValidateAll() error {
return m.validate(true)
}
func (m *GetRolePermissionRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Role
if len(errors) > 0 {
return GetRolePermissionRequestMultiError(errors)
}
return nil
}
// GetRolePermissionRequestMultiError is an error wrapping multiple validation
// errors returned by GetRolePermissionRequest.ValidateAll() if the designated
// constraints aren't met.
type GetRolePermissionRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetRolePermissionRequestMultiError) 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 GetRolePermissionRequestMultiError) AllErrors() []error { return m }
// GetRolePermissionRequestValidationError is the validation error returned by
// GetRolePermissionRequest.Validate if the designated constraints aren't met.
type GetRolePermissionRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetRolePermissionRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetRolePermissionRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetRolePermissionRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetRolePermissionRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetRolePermissionRequestValidationError) ErrorName() string {
return "GetRolePermissionRequestValidationError"
}
// Error satisfies the builtin error interface
func (e GetRolePermissionRequestValidationError) 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 %sGetRolePermissionRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetRolePermissionRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetRolePermissionRequestValidationError{}
// Validate checks the field values on GetRolePermissionResponse 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 *GetRolePermissionResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetRolePermissionResponse 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
// GetRolePermissionResponseMultiError, or nil if none found.
func (m *GetRolePermissionResponse) ValidateAll() error {
return m.validate(true)
}
func (m *GetRolePermissionResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Role
if len(errors) > 0 {
return GetRolePermissionResponseMultiError(errors)
}
return nil
}
// GetRolePermissionResponseMultiError is an error wrapping multiple validation
// errors returned by GetRolePermissionResponse.ValidateAll() if the
// designated constraints aren't met.
type GetRolePermissionResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetRolePermissionResponseMultiError) 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 GetRolePermissionResponseMultiError) AllErrors() []error { return m }
// GetRolePermissionResponseValidationError is the validation error returned by
// GetRolePermissionResponse.Validate if the designated constraints aren't met.
type GetRolePermissionResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetRolePermissionResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetRolePermissionResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetRolePermissionResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetRolePermissionResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetRolePermissionResponseValidationError) ErrorName() string {
return "GetRolePermissionResponseValidationError"
}
// Error satisfies the builtin error interface
func (e GetRolePermissionResponseValidationError) 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 %sGetRolePermissionResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetRolePermissionResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetRolePermissionResponseValidationError{}
// 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
// no validation rules for Token
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 {
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 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 LoginResponse 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 *LoginResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LoginResponse 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 LoginResponseMultiError, or
// nil if none found.
func (m *LoginResponse) ValidateAll() error {
return m.validate(true)
}
func (m *LoginResponse) 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 Token
// no validation rules for Expires
if len(errors) > 0 {
return LoginResponseMultiError(errors)
}
return nil
}
// LoginResponseMultiError is an error wrapping multiple validation errors
// returned by LoginResponse.ValidateAll() if the designated constraints
// aren't met.
type LoginResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LoginResponseMultiError) 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 LoginResponseMultiError) AllErrors() []error { return m }
// LoginResponseValidationError is the validation error returned by
// LoginResponse.Validate if the designated constraints aren't met.
type LoginResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LoginResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LoginResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LoginResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LoginResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LoginResponseValidationError) ErrorName() string { return "LoginResponseValidationError" }
// Error satisfies the builtin error interface
func (e LoginResponseValidationError) 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 %sLoginResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LoginResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LoginResponseValidationError{}
// Validate checks the field values on LogoutRequest 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 *LogoutRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LogoutRequest 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 LogoutRequestMultiError, or
// nil if none found.
func (m *LogoutRequest) ValidateAll() error {
return m.validate(true)
}
func (m *LogoutRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Token
if len(errors) > 0 {
return LogoutRequestMultiError(errors)
}
return nil
}
// LogoutRequestMultiError is an error wrapping multiple validation errors
// returned by LogoutRequest.ValidateAll() if the designated constraints
// aren't met.
type LogoutRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LogoutRequestMultiError) 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 LogoutRequestMultiError) AllErrors() []error { return m }
// LogoutRequestValidationError is the validation error returned by
// LogoutRequest.Validate if the designated constraints aren't met.
type LogoutRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LogoutRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LogoutRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LogoutRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LogoutRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LogoutRequestValidationError) ErrorName() string { return "LogoutRequestValidationError" }
// Error satisfies the builtin error interface
func (e LogoutRequestValidationError) 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 %sLogoutRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LogoutRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LogoutRequestValidationError{}
// Validate checks the field values on LogoutResponse 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 *LogoutResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LogoutResponse 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 LogoutResponseMultiError,
// or nil if none found.
func (m *LogoutResponse) ValidateAll() error {
return m.validate(true)
}
func (m *LogoutResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Uid
if len(errors) > 0 {
return LogoutResponseMultiError(errors)
}
return nil
}
// LogoutResponseMultiError is an error wrapping multiple validation errors
// returned by LogoutResponse.ValidateAll() if the designated constraints
// aren't met.
type LogoutResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LogoutResponseMultiError) 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 LogoutResponseMultiError) AllErrors() []error { return m }
// LogoutResponseValidationError is the validation error returned by
// LogoutResponse.Validate if the designated constraints aren't met.
type LogoutResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LogoutResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LogoutResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LogoutResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LogoutResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LogoutResponseValidationError) ErrorName() string { return "LogoutResponseValidationError" }
// Error satisfies the builtin error interface
func (e LogoutResponseValidationError) 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 %sLogoutResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LogoutResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LogoutResponseValidationError{}
// Validate checks the field values on SettingItem 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 *SettingItem) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on SettingItem 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 SettingItemMultiError, or
// nil if none found.
func (m *SettingItem) ValidateAll() error {
return m.validate(true)
}
func (m *SettingItem) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Name
// no validation rules for Value
if len(errors) > 0 {
return SettingItemMultiError(errors)
}
return nil
}
// SettingItemMultiError is an error wrapping multiple validation errors
// returned by SettingItem.ValidateAll() if the designated constraints aren't met.
type SettingItemMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m SettingItemMultiError) 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 SettingItemMultiError) AllErrors() []error { return m }
// SettingItemValidationError is the validation error returned by
// SettingItem.Validate if the designated constraints aren't met.
type SettingItemValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SettingItemValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SettingItemValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SettingItemValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SettingItemValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SettingItemValidationError) ErrorName() string { return "SettingItemValidationError" }
// Error satisfies the builtin error interface
func (e SettingItemValidationError) 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 %sSettingItem.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SettingItemValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SettingItemValidationError{}
// Validate checks the field values on GetSettingRequest 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 *GetSettingRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetSettingRequest 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
// GetSettingRequestMultiError, or nil if none found.
func (m *GetSettingRequest) ValidateAll() error {
return m.validate(true)
}
func (m *GetSettingRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return GetSettingRequestMultiError(errors)
}
return nil
}
// GetSettingRequestMultiError is an error wrapping multiple validation errors
// returned by GetSettingRequest.ValidateAll() if the designated constraints
// aren't met.
type GetSettingRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetSettingRequestMultiError) 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 GetSettingRequestMultiError) AllErrors() []error { return m }
// GetSettingRequestValidationError is the validation error returned by
// GetSettingRequest.Validate if the designated constraints aren't met.
type GetSettingRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetSettingRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetSettingRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetSettingRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetSettingRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetSettingRequestValidationError) ErrorName() string {
return "GetSettingRequestValidationError"
}
// Error satisfies the builtin error interface
func (e GetSettingRequestValidationError) 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 %sGetSettingRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetSettingRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetSettingRequestValidationError{}
// Validate checks the field values on GetSettingResponse 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 *GetSettingResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on GetSettingResponse 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
// GetSettingResponseMultiError, or nil if none found.
func (m *GetSettingResponse) ValidateAll() error {
return m.validate(true)
}
func (m *GetSettingResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetData() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, GetSettingResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, GetSettingResponseValidationError{
field: fmt.Sprintf("Data[%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 GetSettingResponseValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return GetSettingResponseMultiError(errors)
}
return nil
}
// GetSettingResponseMultiError is an error wrapping multiple validation errors
// returned by GetSettingResponse.ValidateAll() if the designated constraints
// aren't met.
type GetSettingResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m GetSettingResponseMultiError) 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 GetSettingResponseMultiError) AllErrors() []error { return m }
// GetSettingResponseValidationError is the validation error returned by
// GetSettingResponse.Validate if the designated constraints aren't met.
type GetSettingResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GetSettingResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GetSettingResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GetSettingResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GetSettingResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GetSettingResponseValidationError) ErrorName() string {
return "GetSettingResponseValidationError"
}
// Error satisfies the builtin error interface
func (e GetSettingResponseValidationError) 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 %sGetSettingResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GetSettingResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GetSettingResponseValidationError{}