1359 lines
35 KiB
Go
1359 lines
35 KiB
Go
|
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||
|
// source: proto/plugin.proto
|
||
|
|
||
|
package proto
|
||
|
|
||
|
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 Empty 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 *Empty) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on Empty 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 EmptyMultiError, or nil if none found.
|
||
|
func (m *Empty) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *Empty) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return EmptyMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// EmptyMultiError is an error wrapping multiple validation errors returned by
|
||
|
// Empty.ValidateAll() if the designated constraints aren't met.
|
||
|
type EmptyMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m EmptyMultiError) 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 EmptyMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// EmptyValidationError is the validation error returned by Empty.Validate if
|
||
|
// the designated constraints aren't met.
|
||
|
type EmptyValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e EmptyValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e EmptyValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e EmptyValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e EmptyValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e EmptyValidationError) ErrorName() string { return "EmptyValidationError" }
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e EmptyValidationError) 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 %sEmpty.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = EmptyValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = EmptyValidationError{}
|
||
|
|
||
|
// Validate checks the field values on Result 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 *Result) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on Result 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 ResultMultiError, or nil if none found.
|
||
|
func (m *Result) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *Result) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
// no validation rules for Status
|
||
|
|
||
|
// no validation rules for OrderNo
|
||
|
|
||
|
// no validation rules for TradeNo
|
||
|
|
||
|
// no validation rules for Message
|
||
|
|
||
|
// no validation rules for Data
|
||
|
|
||
|
// no validation rules for Extra
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return ResultMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// ResultMultiError is an error wrapping multiple validation errors returned by
|
||
|
// Result.ValidateAll() if the designated constraints aren't met.
|
||
|
type ResultMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m ResultMultiError) 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 ResultMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// ResultValidationError is the validation error returned by Result.Validate if
|
||
|
// the designated constraints aren't met.
|
||
|
type ResultValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e ResultValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e ResultValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e ResultValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e ResultValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e ResultValidationError) ErrorName() string { return "ResultValidationError" }
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e ResultValidationError) 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 %sResult.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = ResultValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = ResultValidationError{}
|
||
|
|
||
|
// Validate checks the field values on OrderRequest 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 *OrderRequest) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on OrderRequest 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 OrderRequestMultiError, or
|
||
|
// nil if none found.
|
||
|
func (m *OrderRequest) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *OrderRequest) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
// no validation rules for Config
|
||
|
|
||
|
if all {
|
||
|
switch v := interface{}(m.GetOrder()).(type) {
|
||
|
case interface{ ValidateAll() error }:
|
||
|
if err := v.ValidateAll(); err != nil {
|
||
|
errors = append(errors, OrderRequestValidationError{
|
||
|
field: "Order",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
case interface{ Validate() error }:
|
||
|
if err := v.Validate(); err != nil {
|
||
|
errors = append(errors, OrderRequestValidationError{
|
||
|
field: "Order",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
} else if v, ok := interface{}(m.GetOrder()).(interface{ Validate() error }); ok {
|
||
|
if err := v.Validate(); err != nil {
|
||
|
return OrderRequestValidationError{
|
||
|
field: "Order",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if all {
|
||
|
switch v := interface{}(m.GetProduct()).(type) {
|
||
|
case interface{ ValidateAll() error }:
|
||
|
if err := v.ValidateAll(); err != nil {
|
||
|
errors = append(errors, OrderRequestValidationError{
|
||
|
field: "Product",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
case interface{ Validate() error }:
|
||
|
if err := v.Validate(); err != nil {
|
||
|
errors = append(errors, OrderRequestValidationError{
|
||
|
field: "Product",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
} else if v, ok := interface{}(m.GetProduct()).(interface{ Validate() error }); ok {
|
||
|
if err := v.Validate(); err != nil {
|
||
|
return OrderRequestValidationError{
|
||
|
field: "Product",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return OrderRequestMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// OrderRequestMultiError is an error wrapping multiple validation errors
|
||
|
// returned by OrderRequest.ValidateAll() if the designated constraints aren't met.
|
||
|
type OrderRequestMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m OrderRequestMultiError) 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 OrderRequestMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// OrderRequestValidationError is the validation error returned by
|
||
|
// OrderRequest.Validate if the designated constraints aren't met.
|
||
|
type OrderRequestValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e OrderRequestValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e OrderRequestValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e OrderRequestValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e OrderRequestValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e OrderRequestValidationError) ErrorName() string { return "OrderRequestValidationError" }
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e OrderRequestValidationError) 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 %sOrderRequest.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = OrderRequestValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = OrderRequestValidationError{}
|
||
|
|
||
|
// Validate checks the field values on OrderResponse 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 *OrderResponse) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on OrderResponse 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 OrderResponseMultiError, or
|
||
|
// nil if none found.
|
||
|
func (m *OrderResponse) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *OrderResponse) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
if all {
|
||
|
switch v := interface{}(m.GetResult()).(type) {
|
||
|
case interface{ ValidateAll() error }:
|
||
|
if err := v.ValidateAll(); err != nil {
|
||
|
errors = append(errors, OrderResponseValidationError{
|
||
|
field: "Result",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
case interface{ Validate() error }:
|
||
|
if err := v.Validate(); err != nil {
|
||
|
errors = append(errors, OrderResponseValidationError{
|
||
|
field: "Result",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
} else if v, ok := interface{}(m.GetResult()).(interface{ Validate() error }); ok {
|
||
|
if err := v.Validate(); err != nil {
|
||
|
return OrderResponseValidationError{
|
||
|
field: "Result",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return OrderResponseMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// OrderResponseMultiError is an error wrapping multiple validation errors
|
||
|
// returned by OrderResponse.ValidateAll() if the designated constraints
|
||
|
// aren't met.
|
||
|
type OrderResponseMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m OrderResponseMultiError) 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 OrderResponseMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// OrderResponseValidationError is the validation error returned by
|
||
|
// OrderResponse.Validate if the designated constraints aren't met.
|
||
|
type OrderResponseValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e OrderResponseValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e OrderResponseValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e OrderResponseValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e OrderResponseValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e OrderResponseValidationError) ErrorName() string { return "OrderResponseValidationError" }
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e OrderResponseValidationError) 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 %sOrderResponse.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = OrderResponseValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = OrderResponseValidationError{}
|
||
|
|
||
|
// Validate checks the field values on QueryRequest 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 *QueryRequest) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on QueryRequest 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 QueryRequestMultiError, or
|
||
|
// nil if none found.
|
||
|
func (m *QueryRequest) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *QueryRequest) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
// no validation rules for Config
|
||
|
|
||
|
if all {
|
||
|
switch v := interface{}(m.GetOrder()).(type) {
|
||
|
case interface{ ValidateAll() error }:
|
||
|
if err := v.ValidateAll(); err != nil {
|
||
|
errors = append(errors, QueryRequestValidationError{
|
||
|
field: "Order",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
case interface{ Validate() error }:
|
||
|
if err := v.Validate(); err != nil {
|
||
|
errors = append(errors, QueryRequestValidationError{
|
||
|
field: "Order",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
} else if v, ok := interface{}(m.GetOrder()).(interface{ Validate() error }); ok {
|
||
|
if err := v.Validate(); err != nil {
|
||
|
return QueryRequestValidationError{
|
||
|
field: "Order",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return QueryRequestMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// QueryRequestMultiError is an error wrapping multiple validation errors
|
||
|
// returned by QueryRequest.ValidateAll() if the designated constraints aren't met.
|
||
|
type QueryRequestMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m QueryRequestMultiError) 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 QueryRequestMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// QueryRequestValidationError is the validation error returned by
|
||
|
// QueryRequest.Validate if the designated constraints aren't met.
|
||
|
type QueryRequestValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e QueryRequestValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e QueryRequestValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e QueryRequestValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e QueryRequestValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e QueryRequestValidationError) ErrorName() string { return "QueryRequestValidationError" }
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e QueryRequestValidationError) 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 %sQueryRequest.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = QueryRequestValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = QueryRequestValidationError{}
|
||
|
|
||
|
// Validate checks the field values on QueryResponse 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 *QueryResponse) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on QueryResponse 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 QueryResponseMultiError, or
|
||
|
// nil if none found.
|
||
|
func (m *QueryResponse) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *QueryResponse) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
if all {
|
||
|
switch v := interface{}(m.GetResult()).(type) {
|
||
|
case interface{ ValidateAll() error }:
|
||
|
if err := v.ValidateAll(); err != nil {
|
||
|
errors = append(errors, QueryResponseValidationError{
|
||
|
field: "Result",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
case interface{ Validate() error }:
|
||
|
if err := v.Validate(); err != nil {
|
||
|
errors = append(errors, QueryResponseValidationError{
|
||
|
field: "Result",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
} else if v, ok := interface{}(m.GetResult()).(interface{ Validate() error }); ok {
|
||
|
if err := v.Validate(); err != nil {
|
||
|
return QueryResponseValidationError{
|
||
|
field: "Result",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return QueryResponseMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// QueryResponseMultiError is an error wrapping multiple validation errors
|
||
|
// returned by QueryResponse.ValidateAll() if the designated constraints
|
||
|
// aren't met.
|
||
|
type QueryResponseMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m QueryResponseMultiError) 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 QueryResponseMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// QueryResponseValidationError is the validation error returned by
|
||
|
// QueryResponse.Validate if the designated constraints aren't met.
|
||
|
type QueryResponseValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e QueryResponseValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e QueryResponseValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e QueryResponseValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e QueryResponseValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e QueryResponseValidationError) ErrorName() string { return "QueryResponseValidationError" }
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e QueryResponseValidationError) 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 %sQueryResponse.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = QueryResponseValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = QueryResponseValidationError{}
|
||
|
|
||
|
// Validate checks the field values on NotifyRequest 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 *NotifyRequest) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on NotifyRequest 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 NotifyRequestMultiError, or
|
||
|
// nil if none found.
|
||
|
func (m *NotifyRequest) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *NotifyRequest) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
// no validation rules for Config
|
||
|
|
||
|
// no validation rules for Queries
|
||
|
|
||
|
// no validation rules for Headers
|
||
|
|
||
|
// no validation rules for Body
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return NotifyRequestMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NotifyRequestMultiError is an error wrapping multiple validation errors
|
||
|
// returned by NotifyRequest.ValidateAll() if the designated constraints
|
||
|
// aren't met.
|
||
|
type NotifyRequestMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m NotifyRequestMultiError) 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 NotifyRequestMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// NotifyRequestValidationError is the validation error returned by
|
||
|
// NotifyRequest.Validate if the designated constraints aren't met.
|
||
|
type NotifyRequestValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e NotifyRequestValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e NotifyRequestValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e NotifyRequestValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e NotifyRequestValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e NotifyRequestValidationError) ErrorName() string { return "NotifyRequestValidationError" }
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e NotifyRequestValidationError) 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 %sNotifyRequest.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = NotifyRequestValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = NotifyRequestValidationError{}
|
||
|
|
||
|
// Validate checks the field values on NotifyResponse 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 *NotifyResponse) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on NotifyResponse 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 NotifyResponseMultiError,
|
||
|
// or nil if none found.
|
||
|
func (m *NotifyResponse) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *NotifyResponse) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
if all {
|
||
|
switch v := interface{}(m.GetResult()).(type) {
|
||
|
case interface{ ValidateAll() error }:
|
||
|
if err := v.ValidateAll(); err != nil {
|
||
|
errors = append(errors, NotifyResponseValidationError{
|
||
|
field: "Result",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
case interface{ Validate() error }:
|
||
|
if err := v.Validate(); err != nil {
|
||
|
errors = append(errors, NotifyResponseValidationError{
|
||
|
field: "Result",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
} else if v, ok := interface{}(m.GetResult()).(interface{ Validate() error }); ok {
|
||
|
if err := v.Validate(); err != nil {
|
||
|
return NotifyResponseValidationError{
|
||
|
field: "Result",
|
||
|
reason: "embedded message failed validation",
|
||
|
cause: err,
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return NotifyResponseMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NotifyResponseMultiError is an error wrapping multiple validation errors
|
||
|
// returned by NotifyResponse.ValidateAll() if the designated constraints
|
||
|
// aren't met.
|
||
|
type NotifyResponseMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m NotifyResponseMultiError) 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 NotifyResponseMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// NotifyResponseValidationError is the validation error returned by
|
||
|
// NotifyResponse.Validate if the designated constraints aren't met.
|
||
|
type NotifyResponseValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e NotifyResponseValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e NotifyResponseValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e NotifyResponseValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e NotifyResponseValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e NotifyResponseValidationError) ErrorName() string { return "NotifyResponseValidationError" }
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e NotifyResponseValidationError) 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 %sNotifyResponse.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = NotifyResponseValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = NotifyResponseValidationError{}
|
||
|
|
||
|
// Validate checks the field values on OrderRequest_Order 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 *OrderRequest_Order) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on OrderRequest_Order 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
|
||
|
// OrderRequest_OrderMultiError, or nil if none found.
|
||
|
func (m *OrderRequest_Order) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *OrderRequest_Order) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
// no validation rules for OrderNo
|
||
|
|
||
|
// no validation rules for Account
|
||
|
|
||
|
// no validation rules for Quantity
|
||
|
|
||
|
// no validation rules for Amount
|
||
|
|
||
|
// no validation rules for Extra
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return OrderRequest_OrderMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// OrderRequest_OrderMultiError is an error wrapping multiple validation errors
|
||
|
// returned by OrderRequest_Order.ValidateAll() if the designated constraints
|
||
|
// aren't met.
|
||
|
type OrderRequest_OrderMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m OrderRequest_OrderMultiError) 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 OrderRequest_OrderMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// OrderRequest_OrderValidationError is the validation error returned by
|
||
|
// OrderRequest_Order.Validate if the designated constraints aren't met.
|
||
|
type OrderRequest_OrderValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e OrderRequest_OrderValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e OrderRequest_OrderValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e OrderRequest_OrderValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e OrderRequest_OrderValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e OrderRequest_OrderValidationError) ErrorName() string {
|
||
|
return "OrderRequest_OrderValidationError"
|
||
|
}
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e OrderRequest_OrderValidationError) 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 %sOrderRequest_Order.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = OrderRequest_OrderValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = OrderRequest_OrderValidationError{}
|
||
|
|
||
|
// Validate checks the field values on OrderRequest_Product 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 *OrderRequest_Product) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on OrderRequest_Product 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
|
||
|
// OrderRequest_ProductMultiError, or nil if none found.
|
||
|
func (m *OrderRequest_Product) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *OrderRequest_Product) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
// no validation rules for ProductNo
|
||
|
|
||
|
// no validation rules for Price
|
||
|
|
||
|
// no validation rules for Extra
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return OrderRequest_ProductMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// OrderRequest_ProductMultiError is an error wrapping multiple validation
|
||
|
// errors returned by OrderRequest_Product.ValidateAll() if the designated
|
||
|
// constraints aren't met.
|
||
|
type OrderRequest_ProductMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m OrderRequest_ProductMultiError) 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 OrderRequest_ProductMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// OrderRequest_ProductValidationError is the validation error returned by
|
||
|
// OrderRequest_Product.Validate if the designated constraints aren't met.
|
||
|
type OrderRequest_ProductValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e OrderRequest_ProductValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e OrderRequest_ProductValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e OrderRequest_ProductValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e OrderRequest_ProductValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e OrderRequest_ProductValidationError) ErrorName() string {
|
||
|
return "OrderRequest_ProductValidationError"
|
||
|
}
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e OrderRequest_ProductValidationError) 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 %sOrderRequest_Product.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = OrderRequest_ProductValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = OrderRequest_ProductValidationError{}
|
||
|
|
||
|
// Validate checks the field values on QueryRequest_Order 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 *QueryRequest_Order) Validate() error {
|
||
|
return m.validate(false)
|
||
|
}
|
||
|
|
||
|
// ValidateAll checks the field values on QueryRequest_Order 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
|
||
|
// QueryRequest_OrderMultiError, or nil if none found.
|
||
|
func (m *QueryRequest_Order) ValidateAll() error {
|
||
|
return m.validate(true)
|
||
|
}
|
||
|
|
||
|
func (m *QueryRequest_Order) validate(all bool) error {
|
||
|
if m == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var errors []error
|
||
|
|
||
|
// no validation rules for OrderNo
|
||
|
|
||
|
// no validation rules for TradeNo
|
||
|
|
||
|
// no validation rules for Account
|
||
|
|
||
|
// no validation rules for Extra
|
||
|
|
||
|
if len(errors) > 0 {
|
||
|
return QueryRequest_OrderMultiError(errors)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// QueryRequest_OrderMultiError is an error wrapping multiple validation errors
|
||
|
// returned by QueryRequest_Order.ValidateAll() if the designated constraints
|
||
|
// aren't met.
|
||
|
type QueryRequest_OrderMultiError []error
|
||
|
|
||
|
// Error returns a concatenation of all the error messages it wraps.
|
||
|
func (m QueryRequest_OrderMultiError) 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 QueryRequest_OrderMultiError) AllErrors() []error { return m }
|
||
|
|
||
|
// QueryRequest_OrderValidationError is the validation error returned by
|
||
|
// QueryRequest_Order.Validate if the designated constraints aren't met.
|
||
|
type QueryRequest_OrderValidationError struct {
|
||
|
field string
|
||
|
reason string
|
||
|
cause error
|
||
|
key bool
|
||
|
}
|
||
|
|
||
|
// Field function returns field value.
|
||
|
func (e QueryRequest_OrderValidationError) Field() string { return e.field }
|
||
|
|
||
|
// Reason function returns reason value.
|
||
|
func (e QueryRequest_OrderValidationError) Reason() string { return e.reason }
|
||
|
|
||
|
// Cause function returns cause value.
|
||
|
func (e QueryRequest_OrderValidationError) Cause() error { return e.cause }
|
||
|
|
||
|
// Key function returns key value.
|
||
|
func (e QueryRequest_OrderValidationError) Key() bool { return e.key }
|
||
|
|
||
|
// ErrorName returns error name.
|
||
|
func (e QueryRequest_OrderValidationError) ErrorName() string {
|
||
|
return "QueryRequest_OrderValidationError"
|
||
|
}
|
||
|
|
||
|
// Error satisfies the builtin error interface
|
||
|
func (e QueryRequest_OrderValidationError) 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 %sQueryRequest_Order.%s: %s%s",
|
||
|
key,
|
||
|
e.field,
|
||
|
e.reason,
|
||
|
cause)
|
||
|
}
|
||
|
|
||
|
var _ error = QueryRequest_OrderValidationError{}
|
||
|
|
||
|
var _ interface {
|
||
|
Field() string
|
||
|
Reason() string
|
||
|
Key() bool
|
||
|
Cause() error
|
||
|
ErrorName() string
|
||
|
} = QueryRequest_OrderValidationError{}
|