plugin/proto/plugin.pb.validate.go

865 lines
20 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"
"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{}
)
// Validate checks the field values on Empty with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Empty) Validate() error {
if m == nil {
return nil
}
return nil
}
// 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, an error is returned.
func (m *Result) Validate() error {
if m == nil {
return nil
}
// 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
return nil
}
// 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, an error
// is returned.
func (m *OrderRequest) Validate() error {
if m == nil {
return nil
}
if len(m.GetConfig()) < 1 {
return OrderRequestValidationError{
field: "Config",
reason: "value length must be at least 1 bytes",
}
}
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 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,
}
}
}
return nil
}
// 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, an error
// is returned.
func (m *OrderResponse) Validate() error {
if m == nil {
return nil
}
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,
}
}
}
return nil
}
// 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, an error
// is returned.
func (m *QueryRequest) Validate() error {
if m == nil {
return nil
}
// no validation rules for Config
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,
}
}
}
return nil
}
// 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, an error
// is returned.
func (m *QueryResponse) Validate() error {
if m == nil {
return nil
}
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,
}
}
}
return nil
}
// 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, an error
// is returned.
func (m *NotifyRequest) Validate() error {
if m == nil {
return nil
}
// no validation rules for Config
// no validation rules for Queries
// no validation rules for Headers
// no validation rules for Body
return nil
}
// 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, an error
// is returned.
func (m *NotifyResponse) Validate() error {
if m == nil {
return nil
}
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,
}
}
}
return nil
}
// 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, an error is returned.
func (m *OrderRequest_Order) Validate() error {
if m == nil {
return nil
}
// no validation rules for OrderNo
// no validation rules for Account
// no validation rules for Quantity
// no validation rules for Extra
return nil
}
// 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, an error is returned.
func (m *OrderRequest_Product) Validate() error {
if m == nil {
return nil
}
// no validation rules for ProductNo
// no validation rules for Price
// no validation rules for Extra
return nil
}
// 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, an error is returned.
func (m *QueryRequest_Order) Validate() error {
if m == nil {
return nil
}
// no validation rules for OrderNo
// no validation rules for TradeNo
// no validation rules for Account
// no validation rules for Extra
return nil
}
// 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{}