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

2491 lines
64 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 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 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
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 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{}