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-18 23:59:15 +03:00
|
|
|
// Validate checks the field values on PackagesModulesReq 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 *PackagesModulesReq) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on PackagesModulesReq 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
|
|
|
|
// PackagesModulesReqMultiError, or nil if none found.
|
|
|
|
func (m *PackagesModulesReq) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PackagesModulesReq) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
// no validation rules for Id
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
return PackagesModulesReqMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// PackagesModulesReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesModulesReq.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type PackagesModulesReqMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m PackagesModulesReqMultiError) 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 PackagesModulesReqMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// PackagesModulesReqValidationError is the validation error returned by
|
|
|
|
// PackagesModulesReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesModulesReqValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e PackagesModulesReqValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e PackagesModulesReqValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e PackagesModulesReqValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e PackagesModulesReqValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e PackagesModulesReqValidationError) ErrorName() string {
|
|
|
|
return "PackagesModulesReqValidationError"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e PackagesModulesReqValidationError) 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 %sPackagesModulesReq.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = PackagesModulesReqValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = PackagesModulesReqValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on PackagesModulesRsp 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 *PackagesModulesRsp) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on PackagesModulesRsp 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
|
|
|
|
// PackagesModulesRspMultiError, or nil if none found.
|
|
|
|
func (m *PackagesModulesRsp) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PackagesModulesRsp) validate(all bool) error {
|
|
|
|
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 {
|
|
|
|
errors = append(errors, PackagesModulesRspValidationError{
|
|
|
|
field: fmt.Sprintf("Modules[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, PackagesModulesRspValidationError{
|
|
|
|
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 {
|
|
|
|
return PackagesModulesRspValidationError{
|
|
|
|
field: fmt.Sprintf("Modules[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
return PackagesModulesRspMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// PackagesModulesRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesModulesRsp.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type PackagesModulesRspMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m PackagesModulesRspMultiError) 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 PackagesModulesRspMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// PackagesModulesRspValidationError is the validation error returned by
|
|
|
|
// PackagesModulesRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesModulesRspValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e PackagesModulesRspValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e PackagesModulesRspValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e PackagesModulesRspValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e PackagesModulesRspValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e PackagesModulesRspValidationError) ErrorName() string {
|
|
|
|
return "PackagesModulesRspValidationError"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e PackagesModulesRspValidationError) 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 %sPackagesModulesRsp.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = PackagesModulesRspValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = PackagesModulesRspValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on PackagesLookupReq 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 *PackagesLookupReq) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on PackagesLookupReq 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
|
|
|
|
// PackagesLookupReqMultiError, or nil if none found.
|
|
|
|
func (m *PackagesLookupReq) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PackagesLookupReq) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
// no validation rules for Id
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
return PackagesLookupReqMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// PackagesLookupReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesLookupReq.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type PackagesLookupReqMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m PackagesLookupReqMultiError) 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 PackagesLookupReqMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// PackagesLookupReqValidationError is the validation error returned by
|
|
|
|
// PackagesLookupReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesLookupReqValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e PackagesLookupReqValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e PackagesLookupReqValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e PackagesLookupReqValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e PackagesLookupReqValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e PackagesLookupReqValidationError) ErrorName() string {
|
|
|
|
return "PackagesLookupReqValidationError"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e PackagesLookupReqValidationError) 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 %sPackagesLookupReq.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = PackagesLookupReqValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = PackagesLookupReqValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on PackagesLookupRsp 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 *PackagesLookupRsp) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on PackagesLookupRsp 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
|
|
|
|
// PackagesLookupRspMultiError, or nil if none found.
|
|
|
|
func (m *PackagesLookupRsp) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PackagesLookupRsp) validate(all bool) error {
|
|
|
|
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 {
|
|
|
|
errors = append(errors, PackagesLookupRspValidationError{
|
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, PackagesLookupRspValidationError{
|
|
|
|
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 {
|
|
|
|
return PackagesLookupRspValidationError{
|
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
return PackagesLookupRspMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// PackagesLookupRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesLookupRsp.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type PackagesLookupRspMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m PackagesLookupRspMultiError) 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 PackagesLookupRspMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// PackagesLookupRspValidationError is the validation error returned by
|
|
|
|
// PackagesLookupRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesLookupRspValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e PackagesLookupRspValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e PackagesLookupRspValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e PackagesLookupRspValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e PackagesLookupRspValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e PackagesLookupRspValidationError) ErrorName() string {
|
|
|
|
return "PackagesLookupRspValidationError"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e PackagesLookupRspValidationError) 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 %sPackagesLookupRsp.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = PackagesLookupRspValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = PackagesLookupRspValidationError{}
|
|
|
|
|
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-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)
|
|
|
|
}
|
|
|
|
|
|
|
|
if m.GetPackage() <= 0 {
|
|
|
|
err := ModuleValidationError{
|
|
|
|
field: "Package",
|
|
|
|
reason: "value must be greater than 0",
|
|
|
|
}
|
|
|
|
if !all {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
errors = append(errors, err)
|
|
|
|
}
|
|
|
|
|
2023-08-11 20:12:15 +03:00
|
|
|
if utf8.RuneCountInString(m.GetLastVersion()) < 1 {
|
|
|
|
err := ModuleValidationError{
|
|
|
|
field: "LastVersion",
|
|
|
|
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 {
|
|
|
|
switch v := interface{}(m.GetCreated()).(type) {
|
|
|
|
case interface{ ValidateAll() error }:
|
|
|
|
if err := v.ValidateAll(); err != nil {
|
|
|
|
errors = append(errors, ModuleValidationError{
|
|
|
|
field: "Created",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, ModuleValidationError{
|
|
|
|
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 ModuleValidationError{
|
|
|
|
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, ModuleValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, ModuleValidationError{
|
|
|
|
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 ModuleValidationError{
|
|
|
|
field: "Updated",
|
|
|
|
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-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on CommentsDeleteReq 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 *CommentsDeleteReq) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on CommentsDeleteReq 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
|
|
|
|
// CommentsDeleteReqMultiError, or nil if none found.
|
|
|
|
func (m *CommentsDeleteReq) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *CommentsDeleteReq) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
// no validation rules for Id
|
|
|
|
|
|
|
|
// no validation rules for PackageId
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
return CommentsDeleteReqMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// CommentsDeleteReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentsDeleteReq.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type CommentsDeleteReqMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m CommentsDeleteReqMultiError) 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 CommentsDeleteReqMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// CommentsDeleteReqValidationError is the validation error returned by
|
|
|
|
// CommentsDeleteReq.Validate if the designated constraints aren't met.
|
|
|
|
type CommentsDeleteReqValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e CommentsDeleteReqValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e CommentsDeleteReqValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e CommentsDeleteReqValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e CommentsDeleteReqValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e CommentsDeleteReqValidationError) ErrorName() string {
|
|
|
|
return "CommentsDeleteReqValidationError"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e CommentsDeleteReqValidationError) 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 %sCommentsDeleteReq.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = CommentsDeleteReqValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = CommentsDeleteReqValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on CommentsDeleteRsp 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.
|
|
|
|
func (m *CommentsDeleteRsp) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on CommentsDeleteRsp 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
|
|
|
|
// CommentsDeleteRspMultiError, or nil if none found.
|
|
|
|
func (m *CommentsDeleteRsp) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *CommentsDeleteRsp) 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-16 13:17:42 +03:00
|
|
|
return CommentsDeleteRspMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// CommentsDeleteRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentsDeleteRsp.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type CommentsDeleteRspMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m CommentsDeleteRspMultiError) Error() string {
|
|
|
|
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.
|
|
|
|
func (m CommentsDeleteRspMultiError) AllErrors() []error { return m }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsDeleteRspValidationError is the validation error returned by
|
|
|
|
// CommentsDeleteRsp.Validate if the designated constraints aren't met.
|
|
|
|
type CommentsDeleteRspValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e CommentsDeleteRspValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e CommentsDeleteRspValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e CommentsDeleteRspValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e CommentsDeleteRspValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e CommentsDeleteRspValidationError) ErrorName() string {
|
|
|
|
return "CommentsDeleteRspValidationError"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e CommentsDeleteRspValidationError) 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 %sCommentsDeleteRsp.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = CommentsDeleteRspValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = CommentsDeleteRspValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on PackagesDeleteReq 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 *PackagesDeleteReq) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on PackagesDeleteReq 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
|
|
|
|
// PackagesDeleteReqMultiError, or nil if none found.
|
|
|
|
func (m *PackagesDeleteReq) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PackagesDeleteReq) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
// no validation rules for Id
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
return PackagesDeleteReqMultiError(errors)
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// PackagesDeleteReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesDeleteReq.ValidateAll() if the designated constraints
|
2023-08-07 21:30:30 +03:00
|
|
|
// aren't met.
|
2023-08-16 13:17:42 +03:00
|
|
|
type PackagesDeleteReqMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m PackagesDeleteReqMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m PackagesDeleteReqMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// PackagesDeleteReqValidationError is the validation error returned by
|
|
|
|
// PackagesDeleteReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesDeleteReqValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesDeleteReqValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesDeleteReqValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesDeleteReqValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesDeleteReqValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesDeleteReqValidationError) ErrorName() string {
|
|
|
|
return "PackagesDeleteReqValidationError"
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesDeleteReqValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sPackagesDeleteReq.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = PackagesDeleteReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = PackagesDeleteReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on PackagesDeleteRsp 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 *PackagesDeleteRsp) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on PackagesDeleteRsp 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
|
|
|
|
// PackagesDeleteRspMultiError, or nil if none found.
|
|
|
|
func (m *PackagesDeleteRsp) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PackagesDeleteRsp) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
return PackagesDeleteRspMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// PackagesDeleteRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesDeleteRsp.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type PackagesDeleteRspMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m PackagesDeleteRspMultiError) 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 PackagesDeleteRspMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// PackagesDeleteRspValidationError is the validation error returned by
|
|
|
|
// PackagesDeleteRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesDeleteRspValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e PackagesDeleteRspValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e PackagesDeleteRspValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e PackagesDeleteRspValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e PackagesDeleteRspValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e PackagesDeleteRspValidationError) ErrorName() string {
|
|
|
|
return "PackagesDeleteRspValidationError"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e PackagesDeleteRspValidationError) 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 %sPackagesDeleteRsp.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = PackagesDeleteRspValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = PackagesDeleteRspValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on PackagesListReq 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.
|
|
|
|
func (m *PackagesListReq) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on PackagesListReq 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
|
|
|
|
// PackagesListReqMultiError, or nil if none found.
|
|
|
|
func (m *PackagesListReq) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PackagesListReq) validate(all bool) error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
return PackagesListReqMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// PackagesListReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesListReq.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type PackagesListReqMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m PackagesListReqMultiError) 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 PackagesListReqMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// PackagesListReqValidationError is the validation error returned by
|
|
|
|
// PackagesListReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesListReqValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e PackagesListReqValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e PackagesListReqValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e PackagesListReqValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e PackagesListReqValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e PackagesListReqValidationError) ErrorName() string { return "PackagesListReqValidationError" }
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e PackagesListReqValidationError) 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 %sPackagesListReq.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = PackagesListReqValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = PackagesListReqValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on PackagesListRsp 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 *PackagesListRsp) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on PackagesListRsp 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
|
|
|
|
// PackagesListRspMultiError, or nil if none found.
|
|
|
|
func (m *PackagesListRsp) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *PackagesListRsp) 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-16 13:17:42 +03:00
|
|
|
errors = append(errors, PackagesListRspValidationError{
|
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-16 13:17:42 +03:00
|
|
|
errors = append(errors, PackagesListRspValidationError{
|
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-16 13:17:42 +03:00
|
|
|
return PackagesListRspValidationError{
|
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-16 13:17:42 +03:00
|
|
|
return PackagesListRspMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// PackagesListRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesListRsp.ValidateAll() if the designated constraints
|
2023-08-07 21:30:30 +03:00
|
|
|
// aren't met.
|
2023-08-16 13:17:42 +03:00
|
|
|
type PackagesListRspMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m PackagesListRspMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m PackagesListRspMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// PackagesListRspValidationError is the validation error returned by
|
|
|
|
// PackagesListRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesListRspValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesListRspValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesListRspValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesListRspValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesListRspValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesListRspValidationError) ErrorName() string { return "PackagesListRspValidationError" }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesListRspValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sPackagesListRsp.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = PackagesListRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = PackagesListRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on PackagesUpdateReq 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-16 13:17:42 +03:00
|
|
|
func (m *PackagesUpdateReq) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on PackagesUpdateReq 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-16 13:17:42 +03:00
|
|
|
// PackagesUpdateReqMultiError, or nil if none found.
|
|
|
|
func (m *PackagesUpdateReq) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *PackagesUpdateReq) 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-16 13:17:42 +03:00
|
|
|
err := PackagesUpdateReqValidationError{
|
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-16 13:17:42 +03:00
|
|
|
err := PackagesUpdateReqValidationError{
|
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-16 13:17:42 +03:00
|
|
|
err := PackagesUpdateReqValidationError{
|
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 {
|
|
|
|
return PackagesUpdateReqMultiError(errors)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// PackagesUpdateReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesUpdateReq.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type PackagesUpdateReqMultiError []error
|
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
|
|
func (m PackagesUpdateReqMultiError) 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 PackagesUpdateReqMultiError) AllErrors() []error { return m }
|
|
|
|
|
|
|
|
// PackagesUpdateReqValidationError is the validation error returned by
|
|
|
|
// PackagesUpdateReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesUpdateReqValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e PackagesUpdateReqValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e PackagesUpdateReqValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e PackagesUpdateReqValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e PackagesUpdateReqValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e PackagesUpdateReqValidationError) ErrorName() string {
|
|
|
|
return "PackagesUpdateReqValidationError"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e PackagesUpdateReqValidationError) 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 %sPackagesUpdateReq.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = PackagesUpdateReqValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = PackagesUpdateReqValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on PackagesUpdateRsp 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 *PackagesUpdateRsp) Validate() error {
|
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ValidateAll checks the field values on PackagesUpdateRsp 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
|
|
|
|
// PackagesUpdateRspMultiError, or nil if none found.
|
|
|
|
func (m *PackagesUpdateRsp) ValidateAll() error {
|
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PackagesUpdateRsp) validate(all bool) error {
|
|
|
|
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 {
|
|
|
|
errors = append(errors, PackagesUpdateRspValidationError{
|
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, PackagesUpdateRspValidationError{
|
|
|
|
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 {
|
|
|
|
return PackagesUpdateRspValidationError{
|
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-16 13:17:42 +03:00
|
|
|
return PackagesUpdateRspMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// PackagesUpdateRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesUpdateRsp.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-16 13:17:42 +03:00
|
|
|
type PackagesUpdateRspMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m PackagesUpdateRspMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m PackagesUpdateRspMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// PackagesUpdateRspValidationError is the validation error returned by
|
|
|
|
// PackagesUpdateRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesUpdateRspValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesUpdateRspValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesUpdateRspValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesUpdateRspValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesUpdateRspValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesUpdateRspValidationError) ErrorName() string {
|
|
|
|
return "PackagesUpdateRspValidationError"
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesUpdateRspValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sPackagesUpdateRsp.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = PackagesUpdateRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = PackagesUpdateRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on CommentsCreateReq 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-16 13:17:42 +03:00
|
|
|
func (m *CommentsCreateReq) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on CommentsCreateReq 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-16 13:17:42 +03:00
|
|
|
// CommentsCreateReqMultiError, or nil if none found.
|
|
|
|
func (m *CommentsCreateReq) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *CommentsCreateReq) 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 {
|
|
|
|
err := CommentsCreateReqValidationError{
|
|
|
|
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-16 13:17:42 +03:00
|
|
|
return CommentsCreateReqMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsCreateReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentsCreateReq.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-16 13:17:42 +03:00
|
|
|
type CommentsCreateReqMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m CommentsCreateReqMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m CommentsCreateReqMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsCreateReqValidationError is the validation error returned by
|
|
|
|
// CommentsCreateReq.Validate if the designated constraints aren't met.
|
|
|
|
type CommentsCreateReqValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateReqValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateReqValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateReqValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateReqValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateReqValidationError) ErrorName() string {
|
|
|
|
return "CommentsCreateReqValidationError"
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateReqValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sCommentsCreateReq.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = CommentsCreateReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = CommentsCreateReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on CommentsCreateRsp 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 *CommentsCreateRsp) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on CommentsCreateRsp 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
|
|
|
|
// CommentsCreateRspMultiError, or nil if none found.
|
|
|
|
func (m *CommentsCreateRsp) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *CommentsCreateRsp) 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 {
|
|
|
|
errors = append(errors, CommentsCreateRspValidationError{
|
|
|
|
field: "Comment",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, CommentsCreateRspValidationError{
|
|
|
|
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 {
|
|
|
|
return CommentsCreateRspValidationError{
|
|
|
|
field: "Comment",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-16 13:17:42 +03:00
|
|
|
return CommentsCreateRspMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsCreateRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentsCreateRsp.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type CommentsCreateRspMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m CommentsCreateRspMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m CommentsCreateRspMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsCreateRspValidationError is the validation error returned by
|
|
|
|
// CommentsCreateRsp.Validate if the designated constraints aren't met.
|
|
|
|
type CommentsCreateRspValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateRspValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateRspValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateRspValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateRspValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateRspValidationError) ErrorName() string {
|
|
|
|
return "CommentsCreateRspValidationError"
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsCreateRspValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sCommentsCreateRsp.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = CommentsCreateRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = CommentsCreateRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on PackagesCreateReq 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 *PackagesCreateReq) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on PackagesCreateReq 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
|
|
|
|
// PackagesCreateReqMultiError, or nil if none found.
|
|
|
|
func (m *PackagesCreateReq) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *PackagesCreateReq) 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 {
|
|
|
|
err := PackagesCreateReqValidationError{
|
|
|
|
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 {
|
|
|
|
err := PackagesCreateReqValidationError{
|
|
|
|
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-16 13:17:42 +03:00
|
|
|
return PackagesCreateReqMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// PackagesCreateReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesCreateReq.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-16 13:17:42 +03:00
|
|
|
type PackagesCreateReqMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m PackagesCreateReqMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m PackagesCreateReqMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// PackagesCreateReqValidationError is the validation error returned by
|
|
|
|
// PackagesCreateReq.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesCreateReqValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateReqValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateReqValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateReqValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateReqValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateReqValidationError) ErrorName() string {
|
|
|
|
return "PackagesCreateReqValidationError"
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateReqValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sPackagesCreateReq.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = PackagesCreateReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = PackagesCreateReqValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on PackagesCreateRsp 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 *PackagesCreateRsp) Validate() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on PackagesCreateRsp 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
|
|
|
|
// PackagesCreateRspMultiError, or nil if none found.
|
|
|
|
func (m *PackagesCreateRsp) ValidateAll() error {
|
2023-08-07 21:30:30 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *PackagesCreateRsp) 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 {
|
|
|
|
errors = append(errors, PackagesCreateRspValidationError{
|
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, PackagesCreateRspValidationError{
|
|
|
|
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 {
|
|
|
|
return PackagesCreateRspValidationError{
|
|
|
|
field: "Package",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-16 13:17:42 +03:00
|
|
|
return PackagesCreateRspMultiError(errors)
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// PackagesCreateRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by PackagesCreateRsp.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-16 13:17:42 +03:00
|
|
|
type PackagesCreateRspMultiError []error
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m PackagesCreateRspMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m PackagesCreateRspMultiError) AllErrors() []error { return m }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// PackagesCreateRspValidationError is the validation error returned by
|
|
|
|
// PackagesCreateRsp.Validate if the designated constraints aren't met.
|
|
|
|
type PackagesCreateRspValidationError struct {
|
2023-08-11 20:12:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateRspValidationError) Field() string { return e.field }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateRspValidationError) Reason() string { return e.reason }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateRspValidationError) Cause() error { return e.cause }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateRspValidationError) Key() bool { return e.key }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateRspValidationError) ErrorName() string {
|
|
|
|
return "PackagesCreateRspValidationError"
|
|
|
|
}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e PackagesCreateRspValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sPackagesCreateRsp.%s: %s%s",
|
2023-08-11 20:12:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = PackagesCreateRspValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = PackagesCreateRspValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on ModulesListReq 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-16 13:17:42 +03:00
|
|
|
func (m *ModulesListReq) Validate() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on ModulesListReq 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-16 13:17:42 +03:00
|
|
|
// result is a list of violation errors wrapped in ModulesListReqMultiError,
|
|
|
|
// or nil if none found.
|
|
|
|
func (m *ModulesListReq) ValidateAll() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *ModulesListReq) 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-16 13:17:42 +03:00
|
|
|
return ModulesListReqMultiError(errors)
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ModulesListReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by ModulesListReq.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-16 13:17:42 +03:00
|
|
|
type ModulesListReqMultiError []error
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m ModulesListReqMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m ModulesListReqMultiError) AllErrors() []error { return m }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ModulesListReqValidationError is the validation error returned by
|
|
|
|
// ModulesListReq.Validate if the designated constraints aren't met.
|
|
|
|
type ModulesListReqValidationError struct {
|
2023-08-11 20:12:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListReqValidationError) Field() string { return e.field }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListReqValidationError) Reason() string { return e.reason }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListReqValidationError) Cause() error { return e.cause }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListReqValidationError) Key() bool { return e.key }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListReqValidationError) ErrorName() string { return "ModulesListReqValidationError" }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListReqValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sModulesListReq.%s: %s%s",
|
2023-08-11 20:12:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = ModulesListReqValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = ModulesListReqValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on ModulesListRsp 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-16 13:17:42 +03:00
|
|
|
func (m *ModulesListRsp) Validate() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on ModulesListRsp 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-16 13:17:42 +03:00
|
|
|
// result is a list of violation errors wrapped in ModulesListRspMultiError,
|
|
|
|
// or nil if none found.
|
|
|
|
func (m *ModulesListRsp) ValidateAll() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *ModulesListRsp) 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 {
|
|
|
|
errors = append(errors, ModulesListRspValidationError{
|
|
|
|
field: fmt.Sprintf("Modules[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
case interface{ Validate() error }:
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
errors = append(errors, ModulesListRspValidationError{
|
|
|
|
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 {
|
|
|
|
return ModulesListRspValidationError{
|
|
|
|
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-16 13:17:42 +03:00
|
|
|
return ModulesListRspMultiError(errors)
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ModulesListRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by ModulesListRsp.ValidateAll() if the designated constraints
|
2023-08-11 20:12:15 +03:00
|
|
|
// aren't met.
|
2023-08-16 13:17:42 +03:00
|
|
|
type ModulesListRspMultiError []error
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m ModulesListRspMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m ModulesListRspMultiError) AllErrors() []error { return m }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ModulesListRspValidationError is the validation error returned by
|
|
|
|
// ModulesListRsp.Validate if the designated constraints aren't met.
|
|
|
|
type ModulesListRspValidationError struct {
|
2023-08-11 20:12:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListRspValidationError) Field() string { return e.field }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListRspValidationError) Reason() string { return e.reason }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListRspValidationError) Cause() error { return e.cause }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListRspValidationError) Key() bool { return e.key }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListRspValidationError) ErrorName() string { return "ModulesListRspValidationError" }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e ModulesListRspValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sModulesListRsp.%s: %s%s",
|
2023-08-11 20:12:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = ModulesListRspValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = ModulesListRspValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on CommentsListReq 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 *CommentsListReq) Validate() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on CommentsListReq 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
|
|
|
|
// CommentsListReqMultiError, or nil if none found.
|
|
|
|
func (m *CommentsListReq) ValidateAll() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *CommentsListReq) 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-16 13:17:42 +03:00
|
|
|
return CommentsListReqMultiError(errors)
|
2023-08-11 20:12:15 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsListReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentsListReq.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type CommentsListReqMultiError []error
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m CommentsListReqMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m CommentsListReqMultiError) AllErrors() []error { return m }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsListReqValidationError is the validation error returned by
|
|
|
|
// CommentsListReq.Validate if the designated constraints aren't met.
|
|
|
|
type CommentsListReqValidationError struct {
|
2023-08-11 20:12:15 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListReqValidationError) Field() string { return e.field }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListReqValidationError) Reason() string { return e.reason }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListReqValidationError) Cause() error { return e.cause }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListReqValidationError) Key() bool { return e.key }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListReqValidationError) ErrorName() string { return "CommentsListReqValidationError" }
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListReqValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sCommentsListReq.%s: %s%s",
|
2023-08-11 20:12:15 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = CommentsListReqValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = CommentsListReqValidationError{}
|
2023-08-11 20:12:15 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on CommentsListRsp 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 *CommentsListRsp) Validate() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on CommentsListRsp 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
|
|
|
|
// CommentsListRspMultiError, or nil if none found.
|
|
|
|
func (m *CommentsListRsp) ValidateAll() error {
|
2023-08-11 20:12:15 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *CommentsListRsp) 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-16 13:17:42 +03:00
|
|
|
errors = append(errors, CommentsListRspValidationError{
|
|
|
|
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-16 13:17:42 +03:00
|
|
|
errors = append(errors, CommentsListRspValidationError{
|
|
|
|
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-16 13:17:42 +03:00
|
|
|
return CommentsListRspValidationError{
|
|
|
|
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-16 13:17:42 +03:00
|
|
|
return CommentsListRspMultiError(errors)
|
2023-08-07 21:30:30 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsListRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentsListRsp.ValidateAll() if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type CommentsListRspMultiError []error
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m CommentsListRspMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m CommentsListRspMultiError) AllErrors() []error { return m }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsListRspValidationError is the validation error returned by
|
|
|
|
// CommentsListRsp.Validate if the designated constraints aren't met.
|
|
|
|
type CommentsListRspValidationError struct {
|
2023-08-07 21:30:30 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListRspValidationError) Field() string { return e.field }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListRspValidationError) Reason() string { return e.reason }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListRspValidationError) Cause() error { return e.cause }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListRspValidationError) Key() bool { return e.key }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListRspValidationError) ErrorName() string { return "CommentsListRspValidationError" }
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsListRspValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sCommentsListRsp.%s: %s%s",
|
2023-08-07 21:30:30 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = CommentsListRspValidationError{}
|
2023-08-07 21:30:30 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = CommentsListRspValidationError{}
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on CommentsLookupReq 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 *CommentsLookupReq) Validate() error {
|
2023-08-14 14:27:29 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on CommentsLookupReq 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
|
|
|
|
// CommentsLookupReqMultiError, or nil if none found.
|
|
|
|
func (m *CommentsLookupReq) ValidateAll() error {
|
2023-08-14 14:27:29 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *CommentsLookupReq) 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-16 13:17:42 +03:00
|
|
|
return CommentsLookupReqMultiError(errors)
|
2023-08-14 14:27:29 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsLookupReqMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentsLookupReq.ValidateAll() if the designated constraints
|
2023-08-14 14:27:29 +03:00
|
|
|
// aren't met.
|
2023-08-16 13:17:42 +03:00
|
|
|
type CommentsLookupReqMultiError []error
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m CommentsLookupReqMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m CommentsLookupReqMultiError) AllErrors() []error { return m }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsLookupReqValidationError is the validation error returned by
|
|
|
|
// CommentsLookupReq.Validate if the designated constraints aren't met.
|
|
|
|
type CommentsLookupReqValidationError struct {
|
2023-08-14 14:27:29 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupReqValidationError) Field() string { return e.field }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupReqValidationError) Reason() string { return e.reason }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupReqValidationError) Cause() error { return e.cause }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupReqValidationError) Key() bool { return e.key }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupReqValidationError) ErrorName() string {
|
|
|
|
return "CommentsLookupReqValidationError"
|
|
|
|
}
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupReqValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sCommentsLookupReq.%s: %s%s",
|
2023-08-14 14:27:29 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = CommentsLookupReqValidationError{}
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = CommentsLookupReqValidationError{}
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// Validate checks the field values on CommentsLookupRsp 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 *CommentsLookupRsp) Validate() error {
|
2023-08-14 14:27:29 +03:00
|
|
|
return m.validate(false)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// ValidateAll checks the field values on CommentsLookupRsp 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
|
|
|
|
// CommentsLookupRspMultiError, or nil if none found.
|
|
|
|
func (m *CommentsLookupRsp) ValidateAll() error {
|
2023-08-14 14:27:29 +03:00
|
|
|
return m.validate(true)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m *CommentsLookupRsp) 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 {
|
|
|
|
errors = append(errors, CommentsLookupRspValidationError{
|
|
|
|
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-16 13:17:42 +03:00
|
|
|
errors = append(errors, CommentsLookupRspValidationError{
|
|
|
|
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 {
|
|
|
|
return CommentsLookupRspValidationError{
|
|
|
|
field: "Comment",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
2023-08-14 14:27:29 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
2023-08-16 13:17:42 +03:00
|
|
|
return CommentsLookupRspMultiError(errors)
|
2023-08-14 14:27:29 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsLookupRspMultiError is an error wrapping multiple validation errors
|
|
|
|
// returned by CommentsLookupRsp.ValidateAll() if the designated constraints
|
2023-08-14 14:27:29 +03:00
|
|
|
// aren't met.
|
2023-08-16 13:17:42 +03:00
|
|
|
type CommentsLookupRspMultiError []error
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (m CommentsLookupRspMultiError) 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-16 13:17:42 +03:00
|
|
|
func (m CommentsLookupRspMultiError) AllErrors() []error { return m }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
// CommentsLookupRspValidationError is the validation error returned by
|
|
|
|
// CommentsLookupRsp.Validate if the designated constraints aren't met.
|
|
|
|
type CommentsLookupRspValidationError struct {
|
2023-08-14 14:27:29 +03:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupRspValidationError) Field() string { return e.field }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Reason function returns reason value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupRspValidationError) Reason() string { return e.reason }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Cause function returns cause value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupRspValidationError) Cause() error { return e.cause }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Key function returns key value.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupRspValidationError) Key() bool { return e.key }
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// ErrorName returns error name.
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupRspValidationError) ErrorName() string {
|
|
|
|
return "CommentsLookupRspValidationError"
|
|
|
|
}
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2023-08-16 13:17:42 +03:00
|
|
|
func (e CommentsLookupRspValidationError) 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-16 13:17:42 +03:00
|
|
|
"invalid %sCommentsLookupRsp.%s: %s%s",
|
2023-08-14 14:27:29 +03:00
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
var _ error = CommentsLookupRspValidationError{}
|
2023-08-14 14:27:29 +03:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
2023-08-16 13:17:42 +03:00
|
|
|
} = CommentsLookupRspValidationError{}
|