// Code generated by protoc-gen-validate. DO NOT EDIT. // source: pkgdash.proto package pkgdashpb import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "sort" "strings" "time" "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" ) // ensure the imports are used var ( _ = bytes.MinRead _ = errors.New("") _ = fmt.Print _ = utf8.UTFMax _ = (*regexp.Regexp)(nil) _ = (*strings.Reader)(nil) _ = net.IPv4len _ = time.Duration(0) _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort ) // Validate checks the field values on HandlerListReq 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 *HandlerListReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on HandlerListReq 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 HandlerListReqMultiError, // or nil if none found. func (m *HandlerListReq) ValidateAll() error { return m.validate(true) } func (m *HandlerListReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Package if len(errors) > 0 { return HandlerListReqMultiError(errors) } return nil } // HandlerListReqMultiError is an error wrapping multiple validation errors // returned by HandlerListReq.ValidateAll() if the designated constraints // aren't met. type HandlerListReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m HandlerListReqMultiError) 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 HandlerListReqMultiError) AllErrors() []error { return m } // HandlerListReqValidationError is the validation error returned by // HandlerListReq.Validate if the designated constraints aren't met. type HandlerListReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e HandlerListReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e HandlerListReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e HandlerListReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e HandlerListReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e HandlerListReqValidationError) ErrorName() string { return "HandlerListReqValidationError" } // Error satisfies the builtin error interface func (e HandlerListReqValidationError) 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 %sHandlerListReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = HandlerListReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = HandlerListReqValidationError{} // Validate checks the field values on HandlerListRsp 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 *HandlerListRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on HandlerListRsp 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 HandlerListRspMultiError, // or nil if none found. func (m *HandlerListRsp) ValidateAll() error { return m.validate(true) } func (m *HandlerListRsp) validate(all bool) error { if m == nil { return nil } var errors []error for idx, item := range m.GetHandlers() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, HandlerListRspValidationError{ field: fmt.Sprintf("Handlers[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, HandlerListRspValidationError{ field: fmt.Sprintf("Handlers[%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 HandlerListRspValidationError{ field: fmt.Sprintf("Handlers[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return HandlerListRspMultiError(errors) } return nil } // HandlerListRspMultiError is an error wrapping multiple validation errors // returned by HandlerListRsp.ValidateAll() if the designated constraints // aren't met. type HandlerListRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m HandlerListRspMultiError) 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 HandlerListRspMultiError) AllErrors() []error { return m } // HandlerListRspValidationError is the validation error returned by // HandlerListRsp.Validate if the designated constraints aren't met. type HandlerListRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e HandlerListRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e HandlerListRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e HandlerListRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e HandlerListRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e HandlerListRspValidationError) ErrorName() string { return "HandlerListRspValidationError" } // Error satisfies the builtin error interface func (e HandlerListRspValidationError) 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 %sHandlerListRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = HandlerListRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = HandlerListRspValidationError{} // Validate checks the field values on PackageModulesReq with the rules defined // in the proto definition for this message. If any rules are violated, the // first error encountered is returned, or nil if there are no violations. func (m *PackageModulesReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageModulesReq 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 // PackageModulesReqMultiError, or nil if none found. func (m *PackageModulesReq) ValidateAll() error { return m.validate(true) } func (m *PackageModulesReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Package if len(errors) > 0 { return PackageModulesReqMultiError(errors) } return nil } // PackageModulesReqMultiError is an error wrapping multiple validation errors // returned by PackageModulesReq.ValidateAll() if the designated constraints // aren't met. type PackageModulesReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageModulesReqMultiError) 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 PackageModulesReqMultiError) AllErrors() []error { return m } // PackageModulesReqValidationError is the validation error returned by // PackageModulesReq.Validate if the designated constraints aren't met. type PackageModulesReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageModulesReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageModulesReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageModulesReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageModulesReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageModulesReqValidationError) ErrorName() string { return "PackageModulesReqValidationError" } // Error satisfies the builtin error interface func (e PackageModulesReqValidationError) 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 %sPackageModulesReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageModulesReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageModulesReqValidationError{} // Validate checks the field values on PackageModulesRsp with the rules defined // in the proto definition for this message. If any rules are violated, the // first error encountered is returned, or nil if there are no violations. func (m *PackageModulesRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageModulesRsp 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 // PackageModulesRspMultiError, or nil if none found. func (m *PackageModulesRsp) ValidateAll() error { return m.validate(true) } func (m *PackageModulesRsp) 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, PackageModulesRspValidationError{ 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, PackageModulesRspValidationError{ 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 PackageModulesRspValidationError{ field: fmt.Sprintf("Modules[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return PackageModulesRspMultiError(errors) } return nil } // PackageModulesRspMultiError is an error wrapping multiple validation errors // returned by PackageModulesRsp.ValidateAll() if the designated constraints // aren't met. type PackageModulesRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageModulesRspMultiError) 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 PackageModulesRspMultiError) AllErrors() []error { return m } // PackageModulesRspValidationError is the validation error returned by // PackageModulesRsp.Validate if the designated constraints aren't met. type PackageModulesRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageModulesRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageModulesRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageModulesRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageModulesRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageModulesRspValidationError) ErrorName() string { return "PackageModulesRspValidationError" } // Error satisfies the builtin error interface func (e PackageModulesRspValidationError) 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 %sPackageModulesRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageModulesRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageModulesRspValidationError{} // Validate checks the field values on PackageLookupReq 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 *PackageLookupReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageLookupReq 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 // PackageLookupReqMultiError, or nil if none found. func (m *PackageLookupReq) ValidateAll() error { return m.validate(true) } func (m *PackageLookupReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return PackageLookupReqMultiError(errors) } return nil } // PackageLookupReqMultiError is an error wrapping multiple validation errors // returned by PackageLookupReq.ValidateAll() if the designated constraints // aren't met. type PackageLookupReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageLookupReqMultiError) 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 PackageLookupReqMultiError) AllErrors() []error { return m } // PackageLookupReqValidationError is the validation error returned by // PackageLookupReq.Validate if the designated constraints aren't met. type PackageLookupReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageLookupReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageLookupReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageLookupReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageLookupReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageLookupReqValidationError) ErrorName() string { return "PackageLookupReqValidationError" } // Error satisfies the builtin error interface func (e PackageLookupReqValidationError) 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 %sPackageLookupReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageLookupReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageLookupReqValidationError{} // Validate checks the field values on PackageLookupRsp 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 *PackageLookupRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageLookupRsp 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 // PackageLookupRspMultiError, or nil if none found. func (m *PackageLookupRsp) ValidateAll() error { return m.validate(true) } func (m *PackageLookupRsp) 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, PackageLookupRspValidationError{ field: "Package", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, PackageLookupRspValidationError{ 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 PackageLookupRspValidationError{ field: "Package", reason: "embedded message failed validation", cause: err, } } } if len(errors) > 0 { return PackageLookupRspMultiError(errors) } return nil } // PackageLookupRspMultiError is an error wrapping multiple validation errors // returned by PackageLookupRsp.ValidateAll() if the designated constraints // aren't met. type PackageLookupRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageLookupRspMultiError) 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 PackageLookupRspMultiError) AllErrors() []error { return m } // PackageLookupRspValidationError is the validation error returned by // PackageLookupRsp.Validate if the designated constraints aren't met. type PackageLookupRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageLookupRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageLookupRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageLookupRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageLookupRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageLookupRspValidationError) ErrorName() string { return "PackageLookupRspValidationError" } // Error satisfies the builtin error interface func (e PackageLookupRspValidationError) 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 %sPackageLookupRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageLookupRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageLookupRspValidationError{} // 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 // no validation rules for Code // no validation rules for Title // no validation rules for Uuid // no validation rules for Details 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{} // 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) } if utf8.RuneCountInString(m.GetDescription()) < 1 { err := PackageValidationError{ field: "Description", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Modules // no validation rules for Issues // no validation rules for Comments // no validation rules for Handlers 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, } } } 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, } } } // no validation rules for Type // no validation rules for Coverage 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 Handler 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 *Handler) Validate() error { return m.validate(false) } // ValidateAll checks the field values on Handler 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 HandlerMultiError, or nil if none found. func (m *Handler) ValidateAll() error { return m.validate(true) } func (m *Handler) validate(all bool) error { if m == nil { return nil } var errors []error if m.GetId() <= 0 { err := HandlerValidationError{ field: "Id", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if m.GetPackage() <= 0 { err := HandlerValidationError{ field: "Package", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetName()) < 1 { err := HandlerValidationError{ field: "Name", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Coverage if len(errors) > 0 { return HandlerMultiError(errors) } return nil } // HandlerMultiError is an error wrapping multiple validation errors returned // by Handler.ValidateAll() if the designated constraints aren't met. type HandlerMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m HandlerMultiError) 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 HandlerMultiError) AllErrors() []error { return m } // HandlerValidationError is the validation error returned by Handler.Validate // if the designated constraints aren't met. type HandlerValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e HandlerValidationError) Field() string { return e.field } // Reason function returns reason value. func (e HandlerValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e HandlerValidationError) Cause() error { return e.cause } // Key function returns key value. func (e HandlerValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e HandlerValidationError) ErrorName() string { return "HandlerValidationError" } // Error satisfies the builtin error interface func (e HandlerValidationError) 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 %sHandler.%s: %s%s", key, e.field, e.reason, cause) } var _ error = HandlerValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = HandlerValidationError{} // 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 all { switch v := interface{}(m.GetLastCheck()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ModuleValidationError{ field: "LastCheck", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ModuleValidationError{ 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 ModuleValidationError{ field: "LastCheck", reason: "embedded message failed validation", cause: err, } } } 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) } 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, } } } 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) } // no validation rules for Comment 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 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{} // Validate checks the field values on CommentDeleteReq 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 *CommentDeleteReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CommentDeleteReq 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 // CommentDeleteReqMultiError, or nil if none found. func (m *CommentDeleteReq) ValidateAll() error { return m.validate(true) } func (m *CommentDeleteReq) 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 CommentDeleteReqMultiError(errors) } return nil } // CommentDeleteReqMultiError is an error wrapping multiple validation errors // returned by CommentDeleteReq.ValidateAll() if the designated constraints // aren't met. type CommentDeleteReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CommentDeleteReqMultiError) 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 CommentDeleteReqMultiError) AllErrors() []error { return m } // CommentDeleteReqValidationError is the validation error returned by // CommentDeleteReq.Validate if the designated constraints aren't met. type CommentDeleteReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CommentDeleteReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CommentDeleteReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CommentDeleteReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CommentDeleteReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CommentDeleteReqValidationError) ErrorName() string { return "CommentDeleteReqValidationError" } // Error satisfies the builtin error interface func (e CommentDeleteReqValidationError) 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 %sCommentDeleteReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CommentDeleteReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CommentDeleteReqValidationError{} // Validate checks the field values on CommentDeleteRsp 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 *CommentDeleteRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CommentDeleteRsp 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 // CommentDeleteRspMultiError, or nil if none found. func (m *CommentDeleteRsp) ValidateAll() error { return m.validate(true) } func (m *CommentDeleteRsp) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return CommentDeleteRspMultiError(errors) } return nil } // CommentDeleteRspMultiError is an error wrapping multiple validation errors // returned by CommentDeleteRsp.ValidateAll() if the designated constraints // aren't met. type CommentDeleteRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CommentDeleteRspMultiError) 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 CommentDeleteRspMultiError) AllErrors() []error { return m } // CommentDeleteRspValidationError is the validation error returned by // CommentDeleteRsp.Validate if the designated constraints aren't met. type CommentDeleteRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CommentDeleteRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CommentDeleteRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CommentDeleteRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CommentDeleteRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CommentDeleteRspValidationError) ErrorName() string { return "CommentDeleteRspValidationError" } // Error satisfies the builtin error interface func (e CommentDeleteRspValidationError) 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 %sCommentDeleteRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CommentDeleteRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CommentDeleteRspValidationError{} // Validate checks the field values on PackageDeleteReq 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 *PackageDeleteReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageDeleteReq 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 // PackageDeleteReqMultiError, or nil if none found. func (m *PackageDeleteReq) ValidateAll() error { return m.validate(true) } func (m *PackageDeleteReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id if len(errors) > 0 { return PackageDeleteReqMultiError(errors) } return nil } // PackageDeleteReqMultiError is an error wrapping multiple validation errors // returned by PackageDeleteReq.ValidateAll() if the designated constraints // aren't met. type PackageDeleteReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageDeleteReqMultiError) 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 PackageDeleteReqMultiError) AllErrors() []error { return m } // PackageDeleteReqValidationError is the validation error returned by // PackageDeleteReq.Validate if the designated constraints aren't met. type PackageDeleteReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageDeleteReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageDeleteReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageDeleteReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageDeleteReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageDeleteReqValidationError) ErrorName() string { return "PackageDeleteReqValidationError" } // Error satisfies the builtin error interface func (e PackageDeleteReqValidationError) 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 %sPackageDeleteReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageDeleteReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageDeleteReqValidationError{} // Validate checks the field values on PackageDeleteRsp 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 *PackageDeleteRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageDeleteRsp 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 // PackageDeleteRspMultiError, or nil if none found. func (m *PackageDeleteRsp) ValidateAll() error { return m.validate(true) } func (m *PackageDeleteRsp) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return PackageDeleteRspMultiError(errors) } return nil } // PackageDeleteRspMultiError is an error wrapping multiple validation errors // returned by PackageDeleteRsp.ValidateAll() if the designated constraints // aren't met. type PackageDeleteRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageDeleteRspMultiError) 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 PackageDeleteRspMultiError) AllErrors() []error { return m } // PackageDeleteRspValidationError is the validation error returned by // PackageDeleteRsp.Validate if the designated constraints aren't met. type PackageDeleteRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageDeleteRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageDeleteRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageDeleteRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageDeleteRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageDeleteRspValidationError) ErrorName() string { return "PackageDeleteRspValidationError" } // Error satisfies the builtin error interface func (e PackageDeleteRspValidationError) 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 %sPackageDeleteRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageDeleteRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageDeleteRspValidationError{} // Validate checks the field values on PackageListReq with the rules defined in // the proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. func (m *PackageListReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageListReq with the rules defined // in the proto definition for this message. If any rules are violated, the // result is a list of violation errors wrapped in PackageListReqMultiError, // or nil if none found. func (m *PackageListReq) ValidateAll() error { return m.validate(true) } func (m *PackageListReq) validate(all bool) error { if m == nil { return nil } var errors []error if len(errors) > 0 { return PackageListReqMultiError(errors) } return nil } // PackageListReqMultiError is an error wrapping multiple validation errors // returned by PackageListReq.ValidateAll() if the designated constraints // aren't met. type PackageListReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageListReqMultiError) 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 PackageListReqMultiError) AllErrors() []error { return m } // PackageListReqValidationError is the validation error returned by // PackageListReq.Validate if the designated constraints aren't met. type PackageListReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageListReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageListReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageListReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageListReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageListReqValidationError) ErrorName() string { return "PackageListReqValidationError" } // Error satisfies the builtin error interface func (e PackageListReqValidationError) 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 %sPackageListReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageListReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageListReqValidationError{} // Validate checks the field values on PackageListRsp with the rules defined in // the proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. func (m *PackageListRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageListRsp with the rules defined // in the proto definition for this message. If any rules are violated, the // result is a list of violation errors wrapped in PackageListRspMultiError, // or nil if none found. func (m *PackageListRsp) ValidateAll() error { return m.validate(true) } func (m *PackageListRsp) validate(all bool) error { 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 { errors = append(errors, PackageListRspValidationError{ field: fmt.Sprintf("Packages[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, PackageListRspValidationError{ 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 { return PackageListRspValidationError{ field: fmt.Sprintf("Packages[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return PackageListRspMultiError(errors) } return nil } // PackageListRspMultiError is an error wrapping multiple validation errors // returned by PackageListRsp.ValidateAll() if the designated constraints // aren't met. type PackageListRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageListRspMultiError) 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 PackageListRspMultiError) AllErrors() []error { return m } // PackageListRspValidationError is the validation error returned by // PackageListRsp.Validate if the designated constraints aren't met. type PackageListRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageListRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageListRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageListRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageListRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageListRspValidationError) ErrorName() string { return "PackageListRspValidationError" } // Error satisfies the builtin error interface func (e PackageListRspValidationError) 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 %sPackageListRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageListRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageListRspValidationError{} // Validate checks the field values on PackageUpdateReq 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 *PackageUpdateReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageUpdateReq 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 // PackageUpdateReqMultiError, or nil if none found. func (m *PackageUpdateReq) ValidateAll() error { return m.validate(true) } func (m *PackageUpdateReq) validate(all bool) error { if m == nil { return nil } var errors []error if m.GetId() <= 0 { err := PackageUpdateReqValidationError{ field: "Id", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } if utf8.RuneCountInString(m.GetName()) < 1 { err := PackageUpdateReqValidationError{ 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 := PackageUpdateReqValidationError{ field: "Url", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Coverprofile if len(errors) > 0 { return PackageUpdateReqMultiError(errors) } return nil } // PackageUpdateReqMultiError is an error wrapping multiple validation errors // returned by PackageUpdateReq.ValidateAll() if the designated constraints // aren't met. type PackageUpdateReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageUpdateReqMultiError) 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 PackageUpdateReqMultiError) AllErrors() []error { return m } // PackageUpdateReqValidationError is the validation error returned by // PackageUpdateReq.Validate if the designated constraints aren't met. type PackageUpdateReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageUpdateReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageUpdateReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageUpdateReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageUpdateReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageUpdateReqValidationError) ErrorName() string { return "PackageUpdateReqValidationError" } // Error satisfies the builtin error interface func (e PackageUpdateReqValidationError) 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 %sPackageUpdateReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageUpdateReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageUpdateReqValidationError{} // Validate checks the field values on PackageUpdateRsp 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 *PackageUpdateRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageUpdateRsp 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 // PackageUpdateRspMultiError, or nil if none found. func (m *PackageUpdateRsp) ValidateAll() error { return m.validate(true) } func (m *PackageUpdateRsp) 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, PackageUpdateRspValidationError{ field: "Package", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, PackageUpdateRspValidationError{ 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 PackageUpdateRspValidationError{ field: "Package", reason: "embedded message failed validation", cause: err, } } } if len(errors) > 0 { return PackageUpdateRspMultiError(errors) } return nil } // PackageUpdateRspMultiError is an error wrapping multiple validation errors // returned by PackageUpdateRsp.ValidateAll() if the designated constraints // aren't met. type PackageUpdateRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageUpdateRspMultiError) 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 PackageUpdateRspMultiError) AllErrors() []error { return m } // PackageUpdateRspValidationError is the validation error returned by // PackageUpdateRsp.Validate if the designated constraints aren't met. type PackageUpdateRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageUpdateRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageUpdateRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageUpdateRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageUpdateRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageUpdateRspValidationError) ErrorName() string { return "PackageUpdateRspValidationError" } // Error satisfies the builtin error interface func (e PackageUpdateRspValidationError) 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 %sPackageUpdateRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageUpdateRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageUpdateRspValidationError{} // Validate checks the field values on CommentCreateReq 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 *CommentCreateReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CommentCreateReq 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 // CommentCreateReqMultiError, or nil if none found. func (m *CommentCreateReq) ValidateAll() error { return m.validate(true) } func (m *CommentCreateReq) validate(all bool) error { if m == nil { return nil } var errors []error if m.GetPackageId() <= 0 { err := CommentCreateReqValidationError{ field: "PackageId", reason: "value must be greater than 0", } if !all { return err } errors = append(errors, err) } // no validation rules for Comment if len(errors) > 0 { return CommentCreateReqMultiError(errors) } return nil } // CommentCreateReqMultiError is an error wrapping multiple validation errors // returned by CommentCreateReq.ValidateAll() if the designated constraints // aren't met. type CommentCreateReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CommentCreateReqMultiError) 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 CommentCreateReqMultiError) AllErrors() []error { return m } // CommentCreateReqValidationError is the validation error returned by // CommentCreateReq.Validate if the designated constraints aren't met. type CommentCreateReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CommentCreateReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CommentCreateReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CommentCreateReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CommentCreateReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CommentCreateReqValidationError) ErrorName() string { return "CommentCreateReqValidationError" } // Error satisfies the builtin error interface func (e CommentCreateReqValidationError) 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 %sCommentCreateReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CommentCreateReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CommentCreateReqValidationError{} // Validate checks the field values on CommentCreateRsp 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 *CommentCreateRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CommentCreateRsp 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 // CommentCreateRspMultiError, or nil if none found. func (m *CommentCreateRsp) ValidateAll() error { return m.validate(true) } func (m *CommentCreateRsp) validate(all bool) error { if m == nil { return nil } var errors []error if all { switch v := interface{}(m.GetComment()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CommentCreateRspValidationError{ field: "Comment", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CommentCreateRspValidationError{ field: "Comment", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetComment()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CommentCreateRspValidationError{ field: "Comment", reason: "embedded message failed validation", cause: err, } } } if len(errors) > 0 { return CommentCreateRspMultiError(errors) } return nil } // CommentCreateRspMultiError is an error wrapping multiple validation errors // returned by CommentCreateRsp.ValidateAll() if the designated constraints // aren't met. type CommentCreateRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CommentCreateRspMultiError) 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 CommentCreateRspMultiError) AllErrors() []error { return m } // CommentCreateRspValidationError is the validation error returned by // CommentCreateRsp.Validate if the designated constraints aren't met. type CommentCreateRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CommentCreateRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CommentCreateRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CommentCreateRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CommentCreateRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CommentCreateRspValidationError) ErrorName() string { return "CommentCreateRspValidationError" } // Error satisfies the builtin error interface func (e CommentCreateRspValidationError) 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 %sCommentCreateRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CommentCreateRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CommentCreateRspValidationError{} // Validate checks the field values on PackageCreateReq 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 *PackageCreateReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageCreateReq 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 // PackageCreateReqMultiError, or nil if none found. func (m *PackageCreateReq) ValidateAll() error { return m.validate(true) } func (m *PackageCreateReq) validate(all bool) error { if m == nil { return nil } var errors []error if utf8.RuneCountInString(m.GetName()) < 1 { err := PackageCreateReqValidationError{ 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 := PackageCreateReqValidationError{ field: "Url", reason: "value length must be at least 1 runes", } if !all { return err } errors = append(errors, err) } // no validation rules for Description if len(errors) > 0 { return PackageCreateReqMultiError(errors) } return nil } // PackageCreateReqMultiError is an error wrapping multiple validation errors // returned by PackageCreateReq.ValidateAll() if the designated constraints // aren't met. type PackageCreateReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageCreateReqMultiError) 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 PackageCreateReqMultiError) AllErrors() []error { return m } // PackageCreateReqValidationError is the validation error returned by // PackageCreateReq.Validate if the designated constraints aren't met. type PackageCreateReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageCreateReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageCreateReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageCreateReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageCreateReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageCreateReqValidationError) ErrorName() string { return "PackageCreateReqValidationError" } // Error satisfies the builtin error interface func (e PackageCreateReqValidationError) 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 %sPackageCreateReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageCreateReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageCreateReqValidationError{} // Validate checks the field values on PackageCreateRsp 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 *PackageCreateRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on PackageCreateRsp 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 // PackageCreateRspMultiError, or nil if none found. func (m *PackageCreateRsp) ValidateAll() error { return m.validate(true) } func (m *PackageCreateRsp) 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, PackageCreateRspValidationError{ field: "Package", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, PackageCreateRspValidationError{ 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 PackageCreateRspValidationError{ field: "Package", reason: "embedded message failed validation", cause: err, } } } if len(errors) > 0 { return PackageCreateRspMultiError(errors) } return nil } // PackageCreateRspMultiError is an error wrapping multiple validation errors // returned by PackageCreateRsp.ValidateAll() if the designated constraints // aren't met. type PackageCreateRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m PackageCreateRspMultiError) 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 PackageCreateRspMultiError) AllErrors() []error { return m } // PackageCreateRspValidationError is the validation error returned by // PackageCreateRsp.Validate if the designated constraints aren't met. type PackageCreateRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PackageCreateRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PackageCreateRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PackageCreateRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PackageCreateRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PackageCreateRspValidationError) ErrorName() string { return "PackageCreateRspValidationError" } // Error satisfies the builtin error interface func (e PackageCreateRspValidationError) 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 %sPackageCreateRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PackageCreateRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PackageCreateRspValidationError{} // Validate checks the field values on ModuleListReq 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 *ModuleListReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ModuleListReq 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 ModuleListReqMultiError, or // nil if none found. func (m *ModuleListReq) ValidateAll() error { return m.validate(true) } func (m *ModuleListReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Package if len(errors) > 0 { return ModuleListReqMultiError(errors) } return nil } // ModuleListReqMultiError is an error wrapping multiple validation errors // returned by ModuleListReq.ValidateAll() if the designated constraints // aren't met. type ModuleListReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ModuleListReqMultiError) 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 ModuleListReqMultiError) AllErrors() []error { return m } // ModuleListReqValidationError is the validation error returned by // ModuleListReq.Validate if the designated constraints aren't met. type ModuleListReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ModuleListReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ModuleListReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ModuleListReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ModuleListReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ModuleListReqValidationError) ErrorName() string { return "ModuleListReqValidationError" } // Error satisfies the builtin error interface func (e ModuleListReqValidationError) 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 %sModuleListReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ModuleListReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ModuleListReqValidationError{} // Validate checks the field values on ModuleListRsp 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 *ModuleListRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ModuleListRsp 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 ModuleListRspMultiError, or // nil if none found. func (m *ModuleListRsp) ValidateAll() error { return m.validate(true) } func (m *ModuleListRsp) 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, ModuleListRspValidationError{ 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, ModuleListRspValidationError{ 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 ModuleListRspValidationError{ field: fmt.Sprintf("Modules[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return ModuleListRspMultiError(errors) } return nil } // ModuleListRspMultiError is an error wrapping multiple validation errors // returned by ModuleListRsp.ValidateAll() if the designated constraints // aren't met. type ModuleListRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ModuleListRspMultiError) 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 ModuleListRspMultiError) AllErrors() []error { return m } // ModuleListRspValidationError is the validation error returned by // ModuleListRsp.Validate if the designated constraints aren't met. type ModuleListRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ModuleListRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ModuleListRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ModuleListRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ModuleListRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ModuleListRspValidationError) ErrorName() string { return "ModuleListRspValidationError" } // Error satisfies the builtin error interface func (e ModuleListRspValidationError) 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 %sModuleListRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ModuleListRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ModuleListRspValidationError{} // Validate checks the field values on CommentListReq with the rules defined in // the proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. func (m *CommentListReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CommentListReq with the rules defined // in the proto definition for this message. If any rules are violated, the // result is a list of violation errors wrapped in CommentListReqMultiError, // or nil if none found. func (m *CommentListReq) ValidateAll() error { return m.validate(true) } func (m *CommentListReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Package if len(errors) > 0 { return CommentListReqMultiError(errors) } return nil } // CommentListReqMultiError is an error wrapping multiple validation errors // returned by CommentListReq.ValidateAll() if the designated constraints // aren't met. type CommentListReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CommentListReqMultiError) 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 CommentListReqMultiError) AllErrors() []error { return m } // CommentListReqValidationError is the validation error returned by // CommentListReq.Validate if the designated constraints aren't met. type CommentListReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CommentListReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CommentListReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CommentListReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CommentListReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CommentListReqValidationError) ErrorName() string { return "CommentListReqValidationError" } // Error satisfies the builtin error interface func (e CommentListReqValidationError) 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 %sCommentListReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CommentListReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CommentListReqValidationError{} // Validate checks the field values on CommentListRsp with the rules defined in // the proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. func (m *CommentListRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CommentListRsp with the rules defined // in the proto definition for this message. If any rules are violated, the // result is a list of violation errors wrapped in CommentListRspMultiError, // or nil if none found. func (m *CommentListRsp) ValidateAll() error { return m.validate(true) } func (m *CommentListRsp) validate(all bool) error { if m == nil { return nil } var errors []error for idx, item := range m.GetComments() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CommentListRspValidationError{ field: fmt.Sprintf("Comments[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CommentListRspValidationError{ field: fmt.Sprintf("Comments[%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 CommentListRspValidationError{ field: fmt.Sprintf("Comments[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return CommentListRspMultiError(errors) } return nil } // CommentListRspMultiError is an error wrapping multiple validation errors // returned by CommentListRsp.ValidateAll() if the designated constraints // aren't met. type CommentListRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CommentListRspMultiError) 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 CommentListRspMultiError) AllErrors() []error { return m } // CommentListRspValidationError is the validation error returned by // CommentListRsp.Validate if the designated constraints aren't met. type CommentListRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CommentListRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CommentListRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CommentListRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CommentListRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CommentListRspValidationError) ErrorName() string { return "CommentListRspValidationError" } // Error satisfies the builtin error interface func (e CommentListRspValidationError) 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 %sCommentListRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CommentListRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CommentListRspValidationError{} // Validate checks the field values on CommentLookupReq 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 *CommentLookupReq) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CommentLookupReq 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 // CommentLookupReqMultiError, or nil if none found. func (m *CommentLookupReq) ValidateAll() error { return m.validate(true) } func (m *CommentLookupReq) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for Id // no validation rules for Package if len(errors) > 0 { return CommentLookupReqMultiError(errors) } return nil } // CommentLookupReqMultiError is an error wrapping multiple validation errors // returned by CommentLookupReq.ValidateAll() if the designated constraints // aren't met. type CommentLookupReqMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CommentLookupReqMultiError) 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 CommentLookupReqMultiError) AllErrors() []error { return m } // CommentLookupReqValidationError is the validation error returned by // CommentLookupReq.Validate if the designated constraints aren't met. type CommentLookupReqValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CommentLookupReqValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CommentLookupReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CommentLookupReqValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CommentLookupReqValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CommentLookupReqValidationError) ErrorName() string { return "CommentLookupReqValidationError" } // Error satisfies the builtin error interface func (e CommentLookupReqValidationError) 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 %sCommentLookupReq.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CommentLookupReqValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CommentLookupReqValidationError{} // Validate checks the field values on CommentLookupRsp 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 *CommentLookupRsp) Validate() error { return m.validate(false) } // ValidateAll checks the field values on CommentLookupRsp 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 // CommentLookupRspMultiError, or nil if none found. func (m *CommentLookupRsp) ValidateAll() error { return m.validate(true) } func (m *CommentLookupRsp) validate(all bool) error { if m == nil { return nil } var errors []error if all { switch v := interface{}(m.GetComment()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CommentLookupRspValidationError{ field: "Comment", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CommentLookupRspValidationError{ field: "Comment", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetComment()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CommentLookupRspValidationError{ field: "Comment", reason: "embedded message failed validation", cause: err, } } } if len(errors) > 0 { return CommentLookupRspMultiError(errors) } return nil } // CommentLookupRspMultiError is an error wrapping multiple validation errors // returned by CommentLookupRsp.ValidateAll() if the designated constraints // aren't met. type CommentLookupRspMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m CommentLookupRspMultiError) 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 CommentLookupRspMultiError) AllErrors() []error { return m } // CommentLookupRspValidationError is the validation error returned by // CommentLookupRsp.Validate if the designated constraints aren't met. type CommentLookupRspValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e CommentLookupRspValidationError) Field() string { return e.field } // Reason function returns reason value. func (e CommentLookupRspValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e CommentLookupRspValidationError) Cause() error { return e.cause } // Key function returns key value. func (e CommentLookupRspValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e CommentLookupRspValidationError) ErrorName() string { return "CommentLookupRspValidationError" } // Error satisfies the builtin error interface func (e CommentLookupRspValidationError) 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 %sCommentLookupRsp.%s: %s%s", key, e.field, e.reason, cause) } var _ error = CommentLookupRspValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = CommentLookupRspValidationError{}