2023-08-07 21:30:30 +03:00
|
|
|
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
2023-08-11 21:27:38 +03:00
|
|
|
// source: pkgdash.proto
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-11 21:27:38 +03:00
|
|
|
package pkgdashpb
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageModulesReq 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 *PackageModulesReq) Validate() error {
|
2023-08-18 23:59:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageModulesReq with the rules
|
2023-08-18 23:59:15 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageModulesReqMultiError, or nil if none found.
|
|
|
|
func (m *PackageModulesReq) ValidateAll() error {
|
2023-08-18 23:59:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageModulesReq) validate(all bool) error {
|
2023-08-18 23:59:15 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-19 16:55:52 +03:00
|
|
|
// no validation rules for Package
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageModulesReqMultiError(errors)
|
2023-08-18 23:59:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageModulesReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageModulesReq.ValidateAll() if the designated constraints
|
2023-08-18 23:59:15 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageModulesReqMultiError []error
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageModulesReqMultiError) Error() string {
|
2023-08-18 23:59:15 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageModulesReqMultiError) AllErrors() []error { return m }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageModulesReqValidationError is the validation error returned by
|
|
|
|
// PackageModulesReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackageModulesReqValidationError struct {
|
2023-08-18 23:59:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesReqValidationError) Field() string { return e.field }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesReqValidationError) Reason() string { return e.reason }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesReqValidationError) Cause() error { return e.cause }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesReqValidationError) Key() bool { return e.key }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesReqValidationError) ErrorName() string {
|
|
|
|
return "PackageModulesReqValidationError"
|
2023-08-18 23:59:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesReqValidationError) Error() string {
|
2023-08-18 23:59:15 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageModulesReq.%s: %s%s",
|
2023-08-18 23:59:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageModulesReqValidationError{}
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageModulesReqValidationError{}
|
2023-08-18 23:59:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageModulesRsp 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 *PackageModulesRsp) Validate() error {
|
2023-08-18 23:59:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageModulesRsp with the rules
|
2023-08-18 23:59:15 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageModulesRspMultiError, or nil if none found.
|
|
|
|
func (m *PackageModulesRsp) ValidateAll() error {
|
2023-08-18 23:59:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageModulesRsp) validate(all bool) error {
|
2023-08-18 23:59:15 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
for idx, item := range m.GetModules() {
|
|
|
|
_, _ = idx, item
|
|
|
|
|
|
|
|
if all {
|
|
|
|
switch v := interface{}(item).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, PackageModulesRspValidationError{
|
2023-08-18 23:59:15 +03:00
|
|
|
field: fmt.Sprintf("Modules[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, PackageModulesRspValidationError{
|
2023-08-18 23:59:15 +03:00
|
|
|
field: fmt.Sprintf("Modules[%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 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageModulesRspValidationError{
|
2023-08-18 23:59:15 +03:00
|
|
|
field: fmt.Sprintf("Modules[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageModulesRspMultiError(errors)
|
2023-08-18 23:59:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageModulesRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageModulesRsp.ValidateAll() if the designated constraints
|
2023-08-18 23:59:15 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageModulesRspMultiError []error
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageModulesRspMultiError) Error() string {
|
2023-08-18 23:59:15 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageModulesRspMultiError) AllErrors() []error { return m }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageModulesRspValidationError is the validation error returned by
|
|
|
|
// PackageModulesRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackageModulesRspValidationError struct {
|
2023-08-18 23:59:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesRspValidationError) Field() string { return e.field }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesRspValidationError) Reason() string { return e.reason }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesRspValidationError) Cause() error { return e.cause }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesRspValidationError) Key() bool { return e.key }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesRspValidationError) ErrorName() string {
|
|
|
|
return "PackageModulesRspValidationError"
|
2023-08-18 23:59:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageModulesRspValidationError) Error() string {
|
2023-08-18 23:59:15 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageModulesRsp.%s: %s%s",
|
2023-08-18 23:59:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageModulesRspValidationError{}
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageModulesRspValidationError{}
|
2023-08-18 23:59:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageLookupReq with the rules defined
|
2023-08-18 23:59:15 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageLookupReq) Validate() error {
|
2023-08-18 23:59:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageLookupReq with the rules
|
2023-08-18 23:59:15 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageLookupReqMultiError, or nil if none found.
|
|
|
|
func (m *PackageLookupReq) ValidateAll() error {
|
2023-08-18 23:59:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageLookupReq) validate(all bool) error {
|
2023-08-18 23:59:15 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
// no validation rules for Id
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageLookupReqMultiError(errors)
|
2023-08-18 23:59:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageLookupReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageLookupReq.ValidateAll() if the designated constraints
|
2023-08-18 23:59:15 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageLookupReqMultiError []error
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageLookupReqMultiError) Error() string {
|
2023-08-18 23:59:15 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageLookupReqMultiError) AllErrors() []error { return m }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageLookupReqValidationError is the validation error returned by
|
|
|
|
// PackageLookupReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackageLookupReqValidationError struct {
|
2023-08-18 23:59:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupReqValidationError) Field() string { return e.field }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupReqValidationError) Reason() string { return e.reason }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupReqValidationError) Cause() error { return e.cause }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupReqValidationError) Key() bool { return e.key }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupReqValidationError) ErrorName() string { return "PackageLookupReqValidationError" }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupReqValidationError) Error() string {
|
2023-08-18 23:59:15 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageLookupReq.%s: %s%s",
|
2023-08-18 23:59:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageLookupReqValidationError{}
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageLookupReqValidationError{}
|
2023-08-18 23:59:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageLookupRsp with the rules defined
|
2023-08-18 23:59:15 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageLookupRsp) Validate() error {
|
2023-08-18 23:59:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageLookupRsp with the rules
|
2023-08-18 23:59:15 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageLookupRspMultiError, or nil if none found.
|
|
|
|
func (m *PackageLookupRsp) ValidateAll() error {
|
2023-08-18 23:59:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageLookupRsp) validate(all bool) error {
|
2023-08-18 23:59:15 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetPackage()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, PackageLookupRspValidationError{
|
2023-08-18 23:59:15 +03:00
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, PackageLookupRspValidationError{
|
2023-08-18 23:59:15 +03:00
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(m.GetPackage()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageLookupRspValidationError{
|
2023-08-18 23:59:15 +03:00
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageLookupRspMultiError(errors)
|
2023-08-18 23:59:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageLookupRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageLookupRsp.ValidateAll() if the designated constraints
|
2023-08-18 23:59:15 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageLookupRspMultiError []error
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageLookupRspMultiError) Error() string {
|
2023-08-18 23:59:15 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageLookupRspMultiError) AllErrors() []error { return m }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageLookupRspValidationError is the validation error returned by
|
|
|
|
// PackageLookupRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackageLookupRspValidationError struct {
|
2023-08-18 23:59:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupRspValidationError) Field() string { return e.field }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupRspValidationError) Reason() string { return e.reason }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupRspValidationError) Cause() error { return e.cause }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupRspValidationError) Key() bool { return e.key }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupRspValidationError) ErrorName() string { return "PackageLookupRspValidationError" }
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageLookupRspValidationError) Error() string {
|
2023-08-18 23:59:15 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageLookupRsp.%s: %s%s",
|
2023-08-18 23:59:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageLookupRspValidationError{}
|
2023-08-18 23:59:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageLookupRspValidationError{}
|
2023-08-18 23:59:15 +03:00
|
|
|
|
2023-08-09 14:31:23 +03:00
|
|
|
// Validate checks the field values on ErrorRsp 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 *ErrorRsp) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on ErrorRsp 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 ErrorRspMultiError, or nil
|
|
|
|
// if none found.
|
|
|
|
func (m *ErrorRsp) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ErrorRsp) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// no validation rules for Code
|
|
|
|
|
|
|
|
// no validation rules for Title
|
|
|
|
|
|
|
|
// no validation rules for Uuid
|
|
|
|
|
|
|
|
// no validation rules for Details
|
2023-08-09 14:31:23 +03:00
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
return ErrorRspMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrorRspMultiError is an error wrapping multiple validation errors returned
|
|
|
|
// by ErrorRsp.ValidateAll() if the designated constraints aren't met.
|
|
|
|
type ErrorRspMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m ErrorRspMultiError) Error() string {
|
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
|
|
func (m ErrorRspMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// ErrorRspValidationError is the validation error returned by
|
|
|
|
// ErrorRsp.Validate if the designated constraints aren't met.
|
|
|
|
type ErrorRspValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e ErrorRspValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e ErrorRspValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e ErrorRspValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e ErrorRspValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e ErrorRspValidationError) ErrorName() string { return "ErrorRspValidationError" }
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e ErrorRspValidationError) 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 %sErrorRsp.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = ErrorRspValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = ErrorRspValidationError{}
|
|
|
|
|
2023-08-07 21:30:30 +03:00
|
|
|
// Validate checks the field values on Package 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 *Package) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on Package 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 PackageMultiError, or nil if none found.
|
|
|
|
func (m *Package) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Package) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if m.GetId() <= 0 {
|
|
|
|
err := PackageValidationError{
|
|
|
|
field: "Id",
|
|
|
|
reason: "value must be greater than 0",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if utf8.RuneCountInString(m.GetName()) < 1 {
|
|
|
|
err := PackageValidationError{
|
|
|
|
field: "Name",
|
|
|
|
reason: "value length must be at least 1 runes",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if utf8.RuneCountInString(m.GetUrl()) < 1 {
|
|
|
|
err := PackageValidationError{
|
|
|
|
field: "Url",
|
|
|
|
reason: "value length must be at least 1 runes",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
if utf8.RuneCountInString(m.GetDescription()) < 1 {
|
|
|
|
err := PackageValidationError{
|
|
|
|
field: "Description",
|
|
|
|
reason: "value length must be at least 1 runes",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
2023-08-18 23:59:15 +03:00
|
|
|
// no validation rules for Modules
|
|
|
|
|
|
|
|
// no validation rules for Issues
|
|
|
|
|
|
|
|
// no validation rules for Comments
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetCreated()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
|
|
|
errors = append(errors, PackageValidationError{
|
|
|
|
field: "Created",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, PackageValidationError{
|
|
|
|
field: "Created",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(m.GetCreated()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return PackageValidationError{
|
|
|
|
field: "Created",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetUpdated()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
|
|
|
errors = append(errors, PackageValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, PackageValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(m.GetUpdated()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return PackageValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-18 23:59:15 +03:00
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetLastCheck()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
|
|
|
errors = append(errors, PackageValidationError{
|
|
|
|
field: "LastCheck",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, PackageValidationError{
|
|
|
|
field: "LastCheck",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(m.GetLastCheck()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return PackageValidationError{
|
|
|
|
field: "LastCheck",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-07 21:30:30 +03:00
|
|
|
if len(errors) > 0 {
|
|
|
|
return PackageMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// PackageMultiError is an error wrapping multiple validation errors returned
|
|
|
|
// by Package.ValidateAll() if the designated constraints aren't met.
|
|
|
|
type PackageMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m PackageMultiError) Error() string {
|
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
|
|
func (m PackageMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// PackageValidationError is the validation error returned by Package.Validate
|
|
|
|
// if the designated constraints aren't met.
|
|
|
|
type PackageValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e PackageValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e PackageValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e PackageValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e PackageValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e PackageValidationError) ErrorName() string { return "PackageValidationError" }
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e PackageValidationError) 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 %sPackage.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = PackageValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = PackageValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on Module 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 *Module) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on Module 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 ModuleMultiError, or nil if none found.
|
|
|
|
func (m *Module) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Module) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if m.GetId() <= 0 {
|
|
|
|
err := ModuleValidationError{
|
|
|
|
field: "Id",
|
|
|
|
reason: "value must be greater than 0",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if utf8.RuneCountInString(m.GetName()) < 1 {
|
|
|
|
err := ModuleValidationError{
|
|
|
|
field: "Name",
|
|
|
|
reason: "value length must be at least 1 runes",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if utf8.RuneCountInString(m.GetVersion()) < 1 {
|
|
|
|
err := ModuleValidationError{
|
|
|
|
field: "Version",
|
|
|
|
reason: "value length must be at least 1 runes",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
if all {
|
2023-08-19 16:55:52 +03:00
|
|
|
switch v := interface{}(m.GetLastCheck()).(type) {
|
2023-08-16 13:17:42 +03:00
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
|
|
|
errors = append(errors, ModuleValidationError{
|
2023-08-19 16:55:52 +03:00
|
|
|
field: "LastCheck",
|
2023-08-16 13:17:42 +03:00
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, ModuleValidationError{
|
2023-08-19 16:55:52 +03:00
|
|
|
field: "LastCheck",
|
2023-08-16 13:17:42 +03:00
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
2023-08-19 16:55:52 +03:00
|
|
|
} else if v, ok := interface{}(m.GetLastCheck()).(interface{ Validate() error }); ok {
|
2023-08-16 13:17:42 +03:00
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ModuleValidationError{
|
2023-08-19 16:55:52 +03:00
|
|
|
field: "LastCheck",
|
2023-08-16 13:17:42 +03:00
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-07 21:30:30 +03:00
|
|
|
if len(errors) > 0 {
|
|
|
|
return ModuleMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ModuleMultiError is an error wrapping multiple validation errors returned by
|
|
|
|
// Module.ValidateAll() if the designated constraints aren't met.
|
|
|
|
type ModuleMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m ModuleMultiError) Error() string {
|
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
|
|
func (m ModuleMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// ModuleValidationError is the validation error returned by Module.Validate if
|
|
|
|
// the designated constraints aren't met.
|
|
|
|
type ModuleValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e ModuleValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e ModuleValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e ModuleValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e ModuleValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e ModuleValidationError) ErrorName() string { return "ModuleValidationError" }
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e ModuleValidationError) 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 %sModule.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = ModuleValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = ModuleValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on Issue 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 *Issue) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on Issue 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 IssueMultiError, or nil if none found.
|
|
|
|
func (m *Issue) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Issue) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if m.GetId() <= 0 {
|
|
|
|
err := IssueValidationError{
|
|
|
|
field: "Id",
|
|
|
|
reason: "value must be greater than 0",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if m.GetStatus() <= 0 {
|
|
|
|
err := IssueValidationError{
|
|
|
|
field: "Status",
|
|
|
|
reason: "value must be greater than 0",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if utf8.RuneCountInString(m.GetDesc()) < 1 {
|
|
|
|
err := IssueValidationError{
|
|
|
|
field: "Desc",
|
|
|
|
reason: "value length must be at least 1 runes",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if m.GetPackage() <= 0 {
|
|
|
|
err := IssueValidationError{
|
|
|
|
field: "Package",
|
|
|
|
reason: "value must be greater than 0",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetCreated()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
|
|
|
errors = append(errors, IssueValidationError{
|
|
|
|
field: "Created",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, IssueValidationError{
|
|
|
|
field: "Created",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(m.GetCreated()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return IssueValidationError{
|
|
|
|
field: "Created",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetUpdated()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
|
|
|
errors = append(errors, IssueValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, IssueValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(m.GetUpdated()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return IssueValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-07 21:30:30 +03:00
|
|
|
if len(errors) > 0 {
|
|
|
|
return IssueMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// IssueMultiError is an error wrapping multiple validation errors returned by
|
|
|
|
// Issue.ValidateAll() if the designated constraints aren't met.
|
|
|
|
type IssueMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m IssueMultiError) Error() string {
|
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
|
|
func (m IssueMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// IssueValidationError is the validation error returned by Issue.Validate if
|
|
|
|
// the designated constraints aren't met.
|
|
|
|
type IssueValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e IssueValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e IssueValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e IssueValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e IssueValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e IssueValidationError) ErrorName() string { return "IssueValidationError" }
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e IssueValidationError) 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 %sIssue.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = IssueValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = IssueValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on Comment 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 *Comment) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on Comment 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 CommentMultiError, or nil if none found.
|
|
|
|
func (m *Comment) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Comment) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if m.GetId() <= 0 {
|
|
|
|
err := CommentValidationError{
|
|
|
|
field: "Id",
|
|
|
|
reason: "value must be greater than 0",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if m.GetPackage() <= 0 {
|
|
|
|
err := CommentValidationError{
|
|
|
|
field: "Package",
|
|
|
|
reason: "value must be greater than 0",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
2023-08-18 23:59:15 +03:00
|
|
|
// no validation rules for Comment
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetCreated()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
|
|
|
errors = append(errors, CommentValidationError{
|
|
|
|
field: "Created",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, CommentValidationError{
|
|
|
|
field: "Created",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(m.GetCreated()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return CommentValidationError{
|
|
|
|
field: "Created",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetUpdated()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
|
|
|
errors = append(errors, CommentValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, CommentValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(m.GetUpdated()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return CommentValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
return CommentMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// CommentMultiError is an error wrapping multiple validation errors returned
|
|
|
|
// by Comment.ValidateAll() if the designated constraints aren't met.
|
|
|
|
type CommentMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m CommentMultiError) Error() string {
|
|
|
|
var msgs []string
|
2023-08-07 21:30:30 +03:00
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
|
|
func (m CommentMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// CommentValidationError is the validation error returned by Comment.Validate
|
|
|
|
// if the designated constraints aren't met.
|
|
|
|
type CommentValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e CommentValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e CommentValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e CommentValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e CommentValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e CommentValidationError) ErrorName() string { return "CommentValidationError" }
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e CommentValidationError) 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 %sComment.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = CommentValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = CommentValidationError{}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on CommentDeleteReq with the rules defined
|
2023-08-16 13:17:42 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentDeleteReq) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on CommentDeleteReq with the rules
|
2023-08-16 13:17:42 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentDeleteReqMultiError, or nil if none found.
|
|
|
|
func (m *CommentDeleteReq) ValidateAll() error {
|
2023-08-16 13:17:42 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentDeleteReq) validate(all bool) error {
|
2023-08-16 13:17:42 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
// no validation rules for Id
|
|
|
|
|
|
|
|
// no validation rules for PackageId
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentDeleteReqMultiError(errors)
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentDeleteReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentDeleteReq.ValidateAll() if the designated constraints
|
2023-08-16 13:17:42 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type CommentDeleteReqMultiError []error
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentDeleteReqMultiError) Error() string {
|
2023-08-16 13:17:42 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentDeleteReqMultiError) AllErrors() []error { return m }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentDeleteReqValidationError is the validation error returned by
|
|
|
|
// CommentDeleteReq.Validate if the designated constraints aren't met.
|
|
|
|
type CommentDeleteReqValidationError struct {
|
2023-08-16 13:17:42 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteReqValidationError) Field() string { return e.field }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteReqValidationError) Reason() string { return e.reason }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteReqValidationError) Cause() error { return e.cause }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteReqValidationError) Key() bool { return e.key }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteReqValidationError) ErrorName() string { return "CommentDeleteReqValidationError" }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteReqValidationError) Error() string {
|
2023-08-16 13:17:42 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sCommentDeleteReq.%s: %s%s",
|
2023-08-16 13:17:42 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = CommentDeleteReqValidationError{}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = CommentDeleteReqValidationError{}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on CommentDeleteRsp with the rules defined
|
2023-08-07 21:30:30 +03:00
|
|
|
// in the proto definition for this message. If any rules are violated, the
|
2023-08-16 13:17:42 +03:00
|
|
|
// first error encountered is returned, or nil if there are no violations.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentDeleteRsp) Validate() error {
|
2023-08-16 13:17:42 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on CommentDeleteRsp with the rules
|
2023-08-16 13:17:42 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentDeleteRspMultiError, or nil if none found.
|
|
|
|
func (m *CommentDeleteRsp) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentDeleteRsp) validate(all bool) error {
|
2023-08-07 21:30:30 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentDeleteRspMultiError(errors)
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentDeleteRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentDeleteRsp.ValidateAll() if the designated constraints
|
2023-08-16 13:17:42 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type CommentDeleteRspMultiError []error
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentDeleteRspMultiError) Error() string {
|
2023-08-16 13:17:42 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
2023-08-16 13:17:42 +03:00
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentDeleteRspMultiError) AllErrors() []error { return m }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentDeleteRspValidationError is the validation error returned by
|
|
|
|
// CommentDeleteRsp.Validate if the designated constraints aren't met.
|
|
|
|
type CommentDeleteRspValidationError struct {
|
2023-08-16 13:17:42 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteRspValidationError) Field() string { return e.field }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteRspValidationError) Reason() string { return e.reason }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteRspValidationError) Cause() error { return e.cause }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteRspValidationError) Key() bool { return e.key }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteRspValidationError) ErrorName() string { return "CommentDeleteRspValidationError" }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentDeleteRspValidationError) Error() string {
|
2023-08-16 13:17:42 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sCommentDeleteRsp.%s: %s%s",
|
2023-08-16 13:17:42 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = CommentDeleteRspValidationError{}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = CommentDeleteRspValidationError{}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageDeleteReq with the rules defined
|
2023-08-16 13:17:42 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageDeleteReq) Validate() error {
|
2023-08-16 13:17:42 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageDeleteReq with the rules
|
2023-08-16 13:17:42 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageDeleteReqMultiError, or nil if none found.
|
|
|
|
func (m *PackageDeleteReq) ValidateAll() error {
|
2023-08-16 13:17:42 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageDeleteReq) validate(all bool) error {
|
2023-08-16 13:17:42 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
// no validation rules for Id
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageDeleteReqMultiError(errors)
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageDeleteReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageDeleteReq.ValidateAll() if the designated constraints
|
2023-08-07 21:30:30 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageDeleteReqMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageDeleteReqMultiError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageDeleteReqMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageDeleteReqValidationError is the validation error returned by
|
|
|
|
// PackageDeleteReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackageDeleteReqValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteReqValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteReqValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteReqValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteReqValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteReqValidationError) ErrorName() string { return "PackageDeleteReqValidationError" }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteReqValidationError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageDeleteReq.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageDeleteReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageDeleteReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageDeleteRsp with the rules defined
|
2023-08-16 13:17:42 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageDeleteRsp) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageDeleteRsp with the rules
|
2023-08-16 13:17:42 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageDeleteRspMultiError, or nil if none found.
|
|
|
|
func (m *PackageDeleteRsp) ValidateAll() error {
|
2023-08-16 13:17:42 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageDeleteRsp) validate(all bool) error {
|
2023-08-16 13:17:42 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageDeleteRspMultiError(errors)
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageDeleteRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageDeleteRsp.ValidateAll() if the designated constraints
|
2023-08-16 13:17:42 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageDeleteRspMultiError []error
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageDeleteRspMultiError) Error() string {
|
2023-08-16 13:17:42 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageDeleteRspMultiError) AllErrors() []error { return m }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageDeleteRspValidationError is the validation error returned by
|
|
|
|
// PackageDeleteRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackageDeleteRspValidationError struct {
|
2023-08-16 13:17:42 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteRspValidationError) Field() string { return e.field }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteRspValidationError) Reason() string { return e.reason }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteRspValidationError) Cause() error { return e.cause }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteRspValidationError) Key() bool { return e.key }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteRspValidationError) ErrorName() string { return "PackageDeleteRspValidationError" }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageDeleteRspValidationError) Error() string {
|
2023-08-16 13:17:42 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageDeleteRsp.%s: %s%s",
|
2023-08-16 13:17:42 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageDeleteRspValidationError{}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageDeleteRspValidationError{}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageListReq 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 *PackageListReq) Validate() error {
|
2023-08-16 13:17:42 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageListReq 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 PackageListReqMultiError,
|
|
|
|
// or nil if none found.
|
|
|
|
func (m *PackageListReq) ValidateAll() error {
|
2023-08-16 13:17:42 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageListReq) validate(all bool) error {
|
2023-08-16 13:17:42 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageListReqMultiError(errors)
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageListReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageListReq.ValidateAll() if the designated constraints
|
2023-08-16 13:17:42 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageListReqMultiError []error
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageListReqMultiError) Error() string {
|
2023-08-16 13:17:42 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageListReqMultiError) AllErrors() []error { return m }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageListReqValidationError is the validation error returned by
|
|
|
|
// PackageListReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackageListReqValidationError struct {
|
2023-08-16 13:17:42 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListReqValidationError) Field() string { return e.field }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListReqValidationError) Reason() string { return e.reason }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListReqValidationError) Cause() error { return e.cause }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListReqValidationError) Key() bool { return e.key }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListReqValidationError) ErrorName() string { return "PackageListReqValidationError" }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListReqValidationError) Error() string {
|
2023-08-16 13:17:42 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageListReq.%s: %s%s",
|
2023-08-16 13:17:42 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageListReqValidationError{}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageListReqValidationError{}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageListRsp 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 *PackageListRsp) Validate() error {
|
2023-08-16 13:17:42 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageListRsp 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 PackageListRspMultiError,
|
|
|
|
// or nil if none found.
|
|
|
|
func (m *PackageListRsp) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageListRsp) validate(all bool) error {
|
2023-08-07 21:30:30 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
for idx, item := range m.GetPackages() {
|
|
|
|
_, _ = idx, item
|
|
|
|
|
|
|
|
if all {
|
|
|
|
switch v := interface{}(item).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, PackageListRspValidationError{
|
2023-08-07 21:30:30 +03:00
|
|
|
field: fmt.Sprintf("Packages[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, PackageListRspValidationError{
|
2023-08-07 21:30:30 +03:00
|
|
|
field: fmt.Sprintf("Packages[%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 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageListRspValidationError{
|
2023-08-07 21:30:30 +03:00
|
|
|
field: fmt.Sprintf("Packages[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageListRspMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageListRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageListRsp.ValidateAll() if the designated constraints
|
2023-08-07 21:30:30 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageListRspMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageListRspMultiError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageListRspMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageListRspValidationError is the validation error returned by
|
|
|
|
// PackageListRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackageListRspValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListRspValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListRspValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListRspValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListRspValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListRspValidationError) ErrorName() string { return "PackageListRspValidationError" }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageListRspValidationError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageListRsp.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageListRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageListRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageUpdateReq with the rules defined
|
2023-08-11 20:12:15 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageUpdateReq) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageUpdateReq with the rules
|
2023-08-07 21:30:30 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageUpdateReqMultiError, or nil if none found.
|
|
|
|
func (m *PackageUpdateReq) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageUpdateReq) validate(all bool) error {
|
2023-08-07 21:30:30 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-12 19:26:50 +03:00
|
|
|
if m.GetId() <= 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
err := PackageUpdateReqValidationError{
|
2023-08-07 21:30:30 +03:00
|
|
|
field: "Id",
|
2023-08-12 19:26:50 +03:00
|
|
|
reason: "value must be greater than 0",
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
2023-08-12 19:26:50 +03:00
|
|
|
if utf8.RuneCountInString(m.GetName()) < 1 {
|
2023-08-20 14:19:57 +03:00
|
|
|
err := PackageUpdateReqValidationError{
|
2023-08-11 20:12:15 +03:00
|
|
|
field: "Name",
|
2023-08-12 19:26:50 +03:00
|
|
|
reason: "value length must be at least 1 runes",
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
2023-08-12 19:26:50 +03:00
|
|
|
if utf8.RuneCountInString(m.GetUrl()) < 1 {
|
2023-08-20 14:19:57 +03:00
|
|
|
err := PackageUpdateReqValidationError{
|
2023-08-11 20:12:15 +03:00
|
|
|
field: "Url",
|
2023-08-12 19:26:50 +03:00
|
|
|
reason: "value length must be at least 1 runes",
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
2023-08-16 13:17:42 +03:00
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageUpdateReqMultiError(errors)
|
2023-08-16 13:17:42 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageUpdateReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageUpdateReq.ValidateAll() if the designated constraints
|
2023-08-16 13:17:42 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageUpdateReqMultiError []error
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageUpdateReqMultiError) Error() string {
|
2023-08-16 13:17:42 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageUpdateReqMultiError) AllErrors() []error { return m }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageUpdateReqValidationError is the validation error returned by
|
|
|
|
// PackageUpdateReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackageUpdateReqValidationError struct {
|
2023-08-16 13:17:42 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateReqValidationError) Field() string { return e.field }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateReqValidationError) Reason() string { return e.reason }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateReqValidationError) Cause() error { return e.cause }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateReqValidationError) Key() bool { return e.key }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateReqValidationError) ErrorName() string { return "PackageUpdateReqValidationError" }
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateReqValidationError) Error() string {
|
2023-08-16 13:17:42 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageUpdateReq.%s: %s%s",
|
2023-08-16 13:17:42 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageUpdateReqValidationError{}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageUpdateReqValidationError{}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageUpdateRsp with the rules defined
|
2023-08-16 13:17:42 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageUpdateRsp) Validate() error {
|
2023-08-16 13:17:42 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageUpdateRsp with the rules
|
2023-08-16 13:17:42 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageUpdateRspMultiError, or nil if none found.
|
|
|
|
func (m *PackageUpdateRsp) ValidateAll() error {
|
2023-08-16 13:17:42 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageUpdateRsp) validate(all bool) error {
|
2023-08-16 13:17:42 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetPackage()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, PackageUpdateRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, PackageUpdateRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(m.GetPackage()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageUpdateRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageUpdateRspMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageUpdateRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageUpdateRsp.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageUpdateRspMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageUpdateRspMultiError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageUpdateRspMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageUpdateRspValidationError is the validation error returned by
|
|
|
|
// PackageUpdateRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackageUpdateRspValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateRspValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateRspValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateRspValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateRspValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateRspValidationError) ErrorName() string { return "PackageUpdateRspValidationError" }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageUpdateRspValidationError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageUpdateRsp.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageUpdateRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageUpdateRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on CommentCreateReq with the rules defined
|
2023-08-11 20:12:15 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentCreateReq) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on CommentCreateReq with the rules
|
2023-08-07 21:30:30 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentCreateReqMultiError, or nil if none found.
|
|
|
|
func (m *CommentCreateReq) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentCreateReq) validate(all bool) error {
|
2023-08-07 21:30:30 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
if m.GetPackageId() <= 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
err := CommentCreateReqValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "PackageId",
|
2023-08-07 21:30:30 +03:00
|
|
|
reason: "value must be greater than 0",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
2023-08-18 23:59:15 +03:00
|
|
|
// no validation rules for Comment
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-07 21:30:30 +03:00
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentCreateReqMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentCreateReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentCreateReq.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type CommentCreateReqMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentCreateReqMultiError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentCreateReqMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentCreateReqValidationError is the validation error returned by
|
|
|
|
// CommentCreateReq.Validate if the designated constraints aren't met.
|
|
|
|
type CommentCreateReqValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateReqValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateReqValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateReqValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateReqValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateReqValidationError) ErrorName() string { return "CommentCreateReqValidationError" }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateReqValidationError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sCommentCreateReq.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = CommentCreateReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = CommentCreateReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on CommentCreateRsp with the rules defined
|
2023-08-16 13:17:42 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentCreateRsp) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on CommentCreateRsp with the rules
|
2023-08-16 13:17:42 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentCreateRspMultiError, or nil if none found.
|
|
|
|
func (m *CommentCreateRsp) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentCreateRsp) validate(all bool) error {
|
2023-08-07 21:30:30 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetComment()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, CommentCreateRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Comment",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, CommentCreateRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Comment",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
2023-08-16 13:17:42 +03:00
|
|
|
} else if v, ok := interface{}(m.GetComment()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentCreateRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Comment",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentCreateRspMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentCreateRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentCreateRsp.ValidateAll() if the designated constraints
|
2023-08-16 13:17:42 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type CommentCreateRspMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentCreateRspMultiError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentCreateRspMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentCreateRspValidationError is the validation error returned by
|
|
|
|
// CommentCreateRsp.Validate if the designated constraints aren't met.
|
|
|
|
type CommentCreateRspValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateRspValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateRspValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateRspValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateRspValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateRspValidationError) ErrorName() string { return "CommentCreateRspValidationError" }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentCreateRspValidationError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sCommentCreateRsp.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = CommentCreateRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = CommentCreateRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageCreateReq with the rules defined
|
2023-08-16 13:17:42 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageCreateReq) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageCreateReq with the rules
|
2023-08-16 13:17:42 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageCreateReqMultiError, or nil if none found.
|
|
|
|
func (m *PackageCreateReq) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageCreateReq) validate(all bool) error {
|
2023-08-07 21:30:30 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
if utf8.RuneCountInString(m.GetName()) < 1 {
|
2023-08-20 14:19:57 +03:00
|
|
|
err := PackageCreateReqValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Name",
|
|
|
|
reason: "value length must be at least 1 runes",
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
if utf8.RuneCountInString(m.GetUrl()) < 1 {
|
2023-08-20 14:19:57 +03:00
|
|
|
err := PackageCreateReqValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Url",
|
|
|
|
reason: "value length must be at least 1 runes",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageCreateReqMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageCreateReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageCreateReq.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageCreateReqMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageCreateReqMultiError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageCreateReqMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageCreateReqValidationError is the validation error returned by
|
|
|
|
// PackageCreateReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackageCreateReqValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateReqValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateReqValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateReqValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateReqValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateReqValidationError) ErrorName() string { return "PackageCreateReqValidationError" }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateReqValidationError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageCreateReq.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageCreateReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageCreateReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on PackageCreateRsp with the rules defined
|
2023-08-16 13:17:42 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageCreateRsp) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on PackageCreateRsp with the rules
|
2023-08-16 13:17:42 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageCreateRspMultiError, or nil if none found.
|
|
|
|
func (m *PackageCreateRsp) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *PackageCreateRsp) validate(all bool) error {
|
2023-08-07 21:30:30 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-18 23:59:15 +03:00
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetPackage()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, PackageCreateRspValidationError{
|
2023-08-18 23:59:15 +03:00
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, PackageCreateRspValidationError{
|
2023-08-18 23:59:15 +03:00
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
2023-08-18 23:59:15 +03:00
|
|
|
} else if v, ok := interface{}(m.GetPackage()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageCreateRspValidationError{
|
2023-08-18 23:59:15 +03:00
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return PackageCreateRspMultiError(errors)
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageCreateRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackageCreateRsp.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type PackageCreateRspMultiError []error
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageCreateRspMultiError) Error() string {
|
2023-08-11 20:12:15 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m PackageCreateRspMultiError) AllErrors() []error { return m }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// PackageCreateRspValidationError is the validation error returned by
|
|
|
|
// PackageCreateRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackageCreateRspValidationError struct {
|
2023-08-11 20:12:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateRspValidationError) Field() string { return e.field }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateRspValidationError) Reason() string { return e.reason }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateRspValidationError) Cause() error { return e.cause }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateRspValidationError) Key() bool { return e.key }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateRspValidationError) ErrorName() string { return "PackageCreateRspValidationError" }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e PackageCreateRspValidationError) Error() string {
|
2023-08-11 20:12:15 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sPackageCreateRsp.%s: %s%s",
|
2023-08-11 20:12:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = PackageCreateRspValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = PackageCreateRspValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on ModuleListReq with the rules defined in
|
2023-08-11 20:12:15 +03:00
|
|
|
// the proto definition for this message. If any rules are violated, the first
|
|
|
|
// error encountered is returned, or nil if there are no violations.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *ModuleListReq) Validate() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on ModuleListReq with the rules defined
|
2023-08-11 20:12:15 +03:00
|
|
|
// in the proto definition for this message. If any rules are violated, the
|
2023-08-20 14:19:57 +03:00
|
|
|
// result is a list of violation errors wrapped in ModuleListReqMultiError, or
|
|
|
|
// nil if none found.
|
|
|
|
func (m *ModuleListReq) ValidateAll() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *ModuleListReq) validate(all bool) error {
|
2023-08-11 20:12:15 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return ModuleListReqMultiError(errors)
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ModuleListReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by ModuleListReq.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type ModuleListReqMultiError []error
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m ModuleListReqMultiError) Error() string {
|
2023-08-11 20:12:15 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m ModuleListReqMultiError) AllErrors() []error { return m }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ModuleListReqValidationError is the validation error returned by
|
|
|
|
// ModuleListReq.Validate if the designated constraints aren't met.
|
|
|
|
type ModuleListReqValidationError struct {
|
2023-08-11 20:12:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListReqValidationError) Field() string { return e.field }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListReqValidationError) Reason() string { return e.reason }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListReqValidationError) Cause() error { return e.cause }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListReqValidationError) Key() bool { return e.key }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListReqValidationError) ErrorName() string { return "ModuleListReqValidationError" }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListReqValidationError) Error() string {
|
2023-08-11 20:12:15 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sModuleListReq.%s: %s%s",
|
2023-08-11 20:12:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = ModuleListReqValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = ModuleListReqValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on ModuleListRsp with the rules defined in
|
2023-08-11 20:12:15 +03:00
|
|
|
// the proto definition for this message. If any rules are violated, the first
|
|
|
|
// error encountered is returned, or nil if there are no violations.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *ModuleListRsp) Validate() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on ModuleListRsp with the rules defined
|
2023-08-11 20:12:15 +03:00
|
|
|
// in the proto definition for this message. If any rules are violated, the
|
2023-08-20 14:19:57 +03:00
|
|
|
// result is a list of violation errors wrapped in ModuleListRspMultiError, or
|
|
|
|
// nil if none found.
|
|
|
|
func (m *ModuleListRsp) ValidateAll() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *ModuleListRsp) validate(all bool) error {
|
2023-08-11 20:12:15 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
for idx, item := range m.GetModules() {
|
|
|
|
_, _ = idx, item
|
|
|
|
|
|
|
|
if all {
|
|
|
|
switch v := interface{}(item).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, ModuleListRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: fmt.Sprintf("Modules[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, ModuleListRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: fmt.Sprintf("Modules[%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 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return ModuleListRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: fmt.Sprintf("Modules[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
2023-08-12 19:26:50 +03:00
|
|
|
}
|
2023-08-16 13:17:42 +03:00
|
|
|
|
2023-08-12 19:26:50 +03:00
|
|
|
}
|
|
|
|
|
2023-08-11 20:12:15 +03:00
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return ModuleListRspMultiError(errors)
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ModuleListRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by ModuleListRsp.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type ModuleListRspMultiError []error
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m ModuleListRspMultiError) Error() string {
|
2023-08-11 20:12:15 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m ModuleListRspMultiError) AllErrors() []error { return m }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ModuleListRspValidationError is the validation error returned by
|
|
|
|
// ModuleListRsp.Validate if the designated constraints aren't met.
|
|
|
|
type ModuleListRspValidationError struct {
|
2023-08-11 20:12:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListRspValidationError) Field() string { return e.field }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListRspValidationError) Reason() string { return e.reason }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListRspValidationError) Cause() error { return e.cause }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListRspValidationError) Key() bool { return e.key }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListRspValidationError) ErrorName() string { return "ModuleListRspValidationError" }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e ModuleListRspValidationError) Error() string {
|
2023-08-11 20:12:15 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sModuleListRsp.%s: %s%s",
|
2023-08-11 20:12:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = ModuleListRspValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = ModuleListRspValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on CommentListReq 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 *CommentListReq) Validate() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on CommentListReq 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 CommentListReqMultiError,
|
|
|
|
// or nil if none found.
|
|
|
|
func (m *CommentListReq) ValidateAll() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentListReq) validate(all bool) error {
|
2023-08-11 20:12:15 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// no validation rules for PackageId
|
|
|
|
|
2023-08-11 20:12:15 +03:00
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentListReqMultiError(errors)
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentListReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentListReq.ValidateAll() if the designated constraints
|
2023-08-16 13:17:42 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type CommentListReqMultiError []error
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentListReqMultiError) Error() string {
|
2023-08-11 20:12:15 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentListReqMultiError) AllErrors() []error { return m }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentListReqValidationError is the validation error returned by
|
|
|
|
// CommentListReq.Validate if the designated constraints aren't met.
|
|
|
|
type CommentListReqValidationError struct {
|
2023-08-11 20:12:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListReqValidationError) Field() string { return e.field }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListReqValidationError) Reason() string { return e.reason }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListReqValidationError) Cause() error { return e.cause }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListReqValidationError) Key() bool { return e.key }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListReqValidationError) ErrorName() string { return "CommentListReqValidationError" }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListReqValidationError) Error() string {
|
2023-08-11 20:12:15 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sCommentListReq.%s: %s%s",
|
2023-08-11 20:12:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = CommentListReqValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = CommentListReqValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on CommentListRsp 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 *CommentListRsp) Validate() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on CommentListRsp 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 CommentListRspMultiError,
|
|
|
|
// or nil if none found.
|
|
|
|
func (m *CommentListRsp) ValidateAll() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentListRsp) validate(all bool) error {
|
2023-08-11 20:12:15 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
for idx, item := range m.GetComments() {
|
2023-08-11 20:12:15 +03:00
|
|
|
_, _ = idx, item
|
|
|
|
|
|
|
|
if all {
|
|
|
|
switch v := interface{}(item).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, CommentListRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: fmt.Sprintf("Comments[%v]", idx),
|
2023-08-11 20:12:15 +03:00
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, CommentListRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: fmt.Sprintf("Comments[%v]", idx),
|
2023-08-11 20:12:15 +03:00
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentListRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: fmt.Sprintf("Comments[%v]", idx),
|
2023-08-11 20:12:15 +03:00
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-08-07 21:30:30 +03:00
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentListRspMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentListRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentListRsp.ValidateAll() if the designated constraints
|
2023-08-16 13:17:42 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type CommentListRspMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentListRspMultiError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentListRspMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentListRspValidationError is the validation error returned by
|
|
|
|
// CommentListRsp.Validate if the designated constraints aren't met.
|
|
|
|
type CommentListRspValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListRspValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListRspValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListRspValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListRspValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListRspValidationError) ErrorName() string { return "CommentListRspValidationError" }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentListRspValidationError) Error() string {
|
2023-08-07 21:30:30 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sCommentListRsp.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = CommentListRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = CommentListRspValidationError{}
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on CommentLookupReq with the rules defined
|
2023-08-16 13:17:42 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentLookupReq) Validate() error {
|
2023-08-14 14:27:29 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on CommentLookupReq with the rules
|
2023-08-16 13:17:42 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentLookupReqMultiError, or nil if none found.
|
|
|
|
func (m *CommentLookupReq) ValidateAll() error {
|
2023-08-14 14:27:29 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentLookupReq) validate(all bool) error {
|
2023-08-14 14:27:29 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// no validation rules for Id
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// no validation rules for PackageId
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentLookupReqMultiError(errors)
|
2023-08-14 14:27:29 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentLookupReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentLookupReq.ValidateAll() if the designated constraints
|
2023-08-14 14:27:29 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type CommentLookupReqMultiError []error
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentLookupReqMultiError) Error() string {
|
2023-08-14 14:27:29 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentLookupReqMultiError) AllErrors() []error { return m }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentLookupReqValidationError is the validation error returned by
|
|
|
|
// CommentLookupReq.Validate if the designated constraints aren't met.
|
|
|
|
type CommentLookupReqValidationError struct {
|
2023-08-14 14:27:29 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupReqValidationError) Field() string { return e.field }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupReqValidationError) Reason() string { return e.reason }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupReqValidationError) Cause() error { return e.cause }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupReqValidationError) Key() bool { return e.key }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupReqValidationError) ErrorName() string { return "CommentLookupReqValidationError" }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupReqValidationError) Error() string {
|
2023-08-14 14:27:29 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sCommentLookupReq.%s: %s%s",
|
2023-08-14 14:27:29 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = CommentLookupReqValidationError{}
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = CommentLookupReqValidationError{}
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// Validate checks the field values on CommentLookupRsp with the rules defined
|
2023-08-16 13:17:42 +03:00
|
|
|
// 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.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentLookupRsp) Validate() error {
|
2023-08-14 14:27:29 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// ValidateAll checks the field values on CommentLookupRsp with the rules
|
2023-08-16 13:17:42 +03:00
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, the result is a list of violation errors wrapped in
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentLookupRspMultiError, or nil if none found.
|
|
|
|
func (m *CommentLookupRsp) ValidateAll() error {
|
2023-08-14 14:27:29 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m *CommentLookupRsp) validate(all bool) error {
|
2023-08-14 14:27:29 +03:00
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
if all {
|
|
|
|
switch v := interface{}(m.GetComment()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, CommentLookupRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Comment",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
2023-08-14 14:27:29 +03:00
|
|
|
}
|
2023-08-16 13:17:42 +03:00
|
|
|
case interface{ Validate() error }:
|
2023-08-14 14:27:29 +03:00
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
errors = append(errors, CommentLookupRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Comment",
|
2023-08-14 14:27:29 +03:00
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
2023-08-16 13:17:42 +03:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if v, ok := interface{}(m.GetComment()).(interface{ Validate() error }); ok {
|
|
|
|
if err := v.Validate(); err != nil {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentLookupRspValidationError{
|
2023-08-16 13:17:42 +03:00
|
|
|
field: "Comment",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
2023-08-14 14:27:29 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-20 14:19:57 +03:00
|
|
|
return CommentLookupRspMultiError(errors)
|
2023-08-14 14:27:29 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentLookupRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentLookupRsp.ValidateAll() if the designated constraints
|
2023-08-14 14:27:29 +03:00
|
|
|
// aren't met.
|
2023-08-20 14:19:57 +03:00
|
|
|
type CommentLookupRspMultiError []error
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentLookupRspMultiError) Error() string {
|
2023-08-14 14:27:29 +03:00
|
|
|
var msgs []string
|
|
|
|
for _, err := range m {
|
|
|
|
msgs = append(msgs, err.Error())
|
|
|
|
}
|
|
|
|
return strings.Join(msgs, "; ")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (m CommentLookupRspMultiError) AllErrors() []error { return m }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
// CommentLookupRspValidationError is the validation error returned by
|
|
|
|
// CommentLookupRsp.Validate if the designated constraints aren't met.
|
|
|
|
type CommentLookupRspValidationError struct {
|
2023-08-14 14:27:29 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupRspValidationError) Field() string { return e.field }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupRspValidationError) Reason() string { return e.reason }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupRspValidationError) Cause() error { return e.cause }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupRspValidationError) Key() bool { return e.key }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupRspValidationError) ErrorName() string { return "CommentLookupRspValidationError" }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-20 14:19:57 +03:00
|
|
|
func (e CommentLookupRspValidationError) Error() string {
|
2023-08-14 14:27:29 +03:00
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
2023-08-20 14:19:57 +03:00
|
|
|
"invalid %sCommentLookupRsp.%s: %s%s",
|
2023-08-14 14:27:29 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-20 14:19:57 +03:00
|
|
|
var _ error = CommentLookupRspValidationError{}
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-20 14:19:57 +03:00
|
|
|
} = CommentLookupRspValidationError{}
|