// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: goods/v1/goods.proto

package v1

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 AttrValueRequest 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 *AttrValueRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AttrValueRequest 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
// AttrValueRequestMultiError, or nil if none found.
func (m *AttrValueRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *AttrValueRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for AttrId

	if m.GetGroupId() < 1 {
		err := AttrValueRequestValidationError{
			field:  "GroupId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetValue()) < 3 {
		err := AttrValueRequestValidationError{
			field:  "Value",
			reason: "value length must be at least 3 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if len(errors) > 0 {
		return AttrValueRequestMultiError(errors)
	}

	return nil
}

// AttrValueRequestMultiError is an error wrapping multiple validation errors
// returned by AttrValueRequest.ValidateAll() if the designated constraints
// aren't met.
type AttrValueRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AttrValueRequestMultiError) 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 AttrValueRequestMultiError) AllErrors() []error { return m }

// AttrValueRequestValidationError is the validation error returned by
// AttrValueRequest.Validate if the designated constraints aren't met.
type AttrValueRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AttrValueRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AttrValueRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AttrValueRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AttrValueRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AttrValueRequestValidationError) ErrorName() string { return "AttrValueRequestValidationError" }

// Error satisfies the builtin error interface
func (e AttrValueRequestValidationError) 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 %sAttrValueRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AttrValueRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AttrValueRequestValidationError{}

// Validate checks the field values on AttrRequest 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 *AttrRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AttrRequest 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 AttrRequestMultiError, or
// nil if none found.
func (m *AttrRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *AttrRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	if m.GetTypeId() < 1 {
		err := AttrRequestValidationError{
			field:  "TypeId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetGroupId() < 1 {
		err := AttrRequestValidationError{
			field:  "GroupId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetTitle()) < 1 {
		err := AttrRequestValidationError{
			field:  "Title",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Desc

	// no validation rules for Status

	if m.GetSort() < 1 {
		err := AttrRequestValidationError{
			field:  "Sort",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	for idx, item := range m.GetAttrValue() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, AttrRequestValidationError{
						field:  fmt.Sprintf("AttrValue[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, AttrRequestValidationError{
						field:  fmt.Sprintf("AttrValue[%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 AttrRequestValidationError{
					field:  fmt.Sprintf("AttrValue[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return AttrRequestMultiError(errors)
	}

	return nil
}

// AttrRequestMultiError is an error wrapping multiple validation errors
// returned by AttrRequest.ValidateAll() if the designated constraints aren't met.
type AttrRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AttrRequestMultiError) 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 AttrRequestMultiError) AllErrors() []error { return m }

// AttrRequestValidationError is the validation error returned by
// AttrRequest.Validate if the designated constraints aren't met.
type AttrRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AttrRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AttrRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AttrRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AttrRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AttrRequestValidationError) ErrorName() string { return "AttrRequestValidationError" }

// Error satisfies the builtin error interface
func (e AttrRequestValidationError) 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 %sAttrRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AttrRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AttrRequestValidationError{}

// Validate checks the field values on AttrValueResponse 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 *AttrValueResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AttrValueResponse 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
// AttrValueResponseMultiError, or nil if none found.
func (m *AttrValueResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *AttrValueResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for AttrId

	// no validation rules for GroupId

	// no validation rules for Value

	if len(errors) > 0 {
		return AttrValueResponseMultiError(errors)
	}

	return nil
}

// AttrValueResponseMultiError is an error wrapping multiple validation errors
// returned by AttrValueResponse.ValidateAll() if the designated constraints
// aren't met.
type AttrValueResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AttrValueResponseMultiError) 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 AttrValueResponseMultiError) AllErrors() []error { return m }

// AttrValueResponseValidationError is the validation error returned by
// AttrValueResponse.Validate if the designated constraints aren't met.
type AttrValueResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AttrValueResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AttrValueResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AttrValueResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AttrValueResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AttrValueResponseValidationError) ErrorName() string {
	return "AttrValueResponseValidationError"
}

// Error satisfies the builtin error interface
func (e AttrValueResponseValidationError) 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 %sAttrValueResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AttrValueResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AttrValueResponseValidationError{}

// Validate checks the field values on AttrResponse 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 *AttrResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AttrResponse 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 AttrResponseMultiError, or
// nil if none found.
func (m *AttrResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *AttrResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for TypeId

	// no validation rules for GroupId

	// no validation rules for Title

	// no validation rules for Desc

	// no validation rules for Status

	// no validation rules for Sort

	for idx, item := range m.GetAttrValue() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, AttrResponseValidationError{
						field:  fmt.Sprintf("AttrValue[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, AttrResponseValidationError{
						field:  fmt.Sprintf("AttrValue[%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 AttrResponseValidationError{
					field:  fmt.Sprintf("AttrValue[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return AttrResponseMultiError(errors)
	}

	return nil
}

// AttrResponseMultiError is an error wrapping multiple validation errors
// returned by AttrResponse.ValidateAll() if the designated constraints aren't met.
type AttrResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AttrResponseMultiError) 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 AttrResponseMultiError) AllErrors() []error { return m }

// AttrResponseValidationError is the validation error returned by
// AttrResponse.Validate if the designated constraints aren't met.
type AttrResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AttrResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AttrResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AttrResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AttrResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AttrResponseValidationError) ErrorName() string { return "AttrResponseValidationError" }

// Error satisfies the builtin error interface
func (e AttrResponseValidationError) 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 %sAttrResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AttrResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AttrResponseValidationError{}

// Validate checks the field values on AttrGroupRequest 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 *AttrGroupRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AttrGroupRequest 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
// AttrGroupRequestMultiError, or nil if none found.
func (m *AttrGroupRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *AttrGroupRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	if m.GetTypeId() < 1 {
		err := AttrGroupRequestValidationError{
			field:  "TypeId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetTitle()) < 3 {
		err := AttrGroupRequestValidationError{
			field:  "Title",
			reason: "value length must be at least 3 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Desc

	// no validation rules for Status

	if m.GetSort() < 1 {
		err := AttrGroupRequestValidationError{
			field:  "Sort",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if len(errors) > 0 {
		return AttrGroupRequestMultiError(errors)
	}

	return nil
}

// AttrGroupRequestMultiError is an error wrapping multiple validation errors
// returned by AttrGroupRequest.ValidateAll() if the designated constraints
// aren't met.
type AttrGroupRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AttrGroupRequestMultiError) 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 AttrGroupRequestMultiError) AllErrors() []error { return m }

// AttrGroupRequestValidationError is the validation error returned by
// AttrGroupRequest.Validate if the designated constraints aren't met.
type AttrGroupRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AttrGroupRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AttrGroupRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AttrGroupRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AttrGroupRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AttrGroupRequestValidationError) ErrorName() string { return "AttrGroupRequestValidationError" }

// Error satisfies the builtin error interface
func (e AttrGroupRequestValidationError) 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 %sAttrGroupRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AttrGroupRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AttrGroupRequestValidationError{}

// Validate checks the field values on AttrGroupResponse 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 *AttrGroupResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AttrGroupResponse 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
// AttrGroupResponseMultiError, or nil if none found.
func (m *AttrGroupResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *AttrGroupResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for TypeId

	// no validation rules for Title

	// no validation rules for Desc

	// no validation rules for Status

	// no validation rules for Sort

	if len(errors) > 0 {
		return AttrGroupResponseMultiError(errors)
	}

	return nil
}

// AttrGroupResponseMultiError is an error wrapping multiple validation errors
// returned by AttrGroupResponse.ValidateAll() if the designated constraints
// aren't met.
type AttrGroupResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AttrGroupResponseMultiError) 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 AttrGroupResponseMultiError) AllErrors() []error { return m }

// AttrGroupResponseValidationError is the validation error returned by
// AttrGroupResponse.Validate if the designated constraints aren't met.
type AttrGroupResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AttrGroupResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AttrGroupResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AttrGroupResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AttrGroupResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AttrGroupResponseValidationError) ErrorName() string {
	return "AttrGroupResponseValidationError"
}

// Error satisfies the builtin error interface
func (e AttrGroupResponseValidationError) 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 %sAttrGroupResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AttrGroupResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AttrGroupResponseValidationError{}

// Validate checks the field values on SpecificationValue 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 *SpecificationValue) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on SpecificationValue 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
// SpecificationValueMultiError, or nil if none found.
func (m *SpecificationValue) ValidateAll() error {
	return m.validate(true)
}

func (m *SpecificationValue) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for AttrId

	if utf8.RuneCountInString(m.GetValue()) < 3 {
		err := SpecificationValueValidationError{
			field:  "Value",
			reason: "value length must be at least 3 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetSort() < 1 {
		err := SpecificationValueValidationError{
			field:  "Sort",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if len(errors) > 0 {
		return SpecificationValueMultiError(errors)
	}

	return nil
}

// SpecificationValueMultiError is an error wrapping multiple validation errors
// returned by SpecificationValue.ValidateAll() if the designated constraints
// aren't met.
type SpecificationValueMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m SpecificationValueMultiError) 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 SpecificationValueMultiError) AllErrors() []error { return m }

// SpecificationValueValidationError is the validation error returned by
// SpecificationValue.Validate if the designated constraints aren't met.
type SpecificationValueValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e SpecificationValueValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e SpecificationValueValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e SpecificationValueValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e SpecificationValueValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e SpecificationValueValidationError) ErrorName() string {
	return "SpecificationValueValidationError"
}

// Error satisfies the builtin error interface
func (e SpecificationValueValidationError) 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 %sSpecificationValue.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = SpecificationValueValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = SpecificationValueValidationError{}

// Validate checks the field values on SpecificationValueResponse 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 *SpecificationValueResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on SpecificationValueResponse 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
// SpecificationValueResponseMultiError, or nil if none found.
func (m *SpecificationValueResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *SpecificationValueResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for AttrId

	// no validation rules for Value

	// no validation rules for Sort

	if len(errors) > 0 {
		return SpecificationValueResponseMultiError(errors)
	}

	return nil
}

// SpecificationValueResponseMultiError is an error wrapping multiple
// validation errors returned by SpecificationValueResponse.ValidateAll() if
// the designated constraints aren't met.
type SpecificationValueResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m SpecificationValueResponseMultiError) 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 SpecificationValueResponseMultiError) AllErrors() []error { return m }

// SpecificationValueResponseValidationError is the validation error returned
// by SpecificationValueResponse.Validate if the designated constraints aren't met.
type SpecificationValueResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e SpecificationValueResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e SpecificationValueResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e SpecificationValueResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e SpecificationValueResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e SpecificationValueResponseValidationError) ErrorName() string {
	return "SpecificationValueResponseValidationError"
}

// Error satisfies the builtin error interface
func (e SpecificationValueResponseValidationError) 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 %sSpecificationValueResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = SpecificationValueResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = SpecificationValueResponseValidationError{}

// Validate checks the field values on SpecificationRequest 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 *SpecificationRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on SpecificationRequest 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
// SpecificationRequestMultiError, or nil if none found.
func (m *SpecificationRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *SpecificationRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	if m.GetTypeId() < 1 {
		err := SpecificationRequestValidationError{
			field:  "TypeId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetName()) < 2 {
		err := SpecificationRequestValidationError{
			field:  "Name",
			reason: "value length must be at least 2 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetSort() < 1 {
		err := SpecificationRequestValidationError{
			field:  "Sort",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Status

	// no validation rules for IsSku

	// no validation rules for IsSelect

	for idx, item := range m.GetSpecificationValue() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, SpecificationRequestValidationError{
						field:  fmt.Sprintf("SpecificationValue[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, SpecificationRequestValidationError{
						field:  fmt.Sprintf("SpecificationValue[%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 SpecificationRequestValidationError{
					field:  fmt.Sprintf("SpecificationValue[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return SpecificationRequestMultiError(errors)
	}

	return nil
}

// SpecificationRequestMultiError is an error wrapping multiple validation
// errors returned by SpecificationRequest.ValidateAll() if the designated
// constraints aren't met.
type SpecificationRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m SpecificationRequestMultiError) 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 SpecificationRequestMultiError) AllErrors() []error { return m }

// SpecificationRequestValidationError is the validation error returned by
// SpecificationRequest.Validate if the designated constraints aren't met.
type SpecificationRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e SpecificationRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e SpecificationRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e SpecificationRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e SpecificationRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e SpecificationRequestValidationError) ErrorName() string {
	return "SpecificationRequestValidationError"
}

// Error satisfies the builtin error interface
func (e SpecificationRequestValidationError) 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 %sSpecificationRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = SpecificationRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = SpecificationRequestValidationError{}

// Validate checks the field values on SpecificationResponse 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 *SpecificationResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on SpecificationResponse 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
// SpecificationResponseMultiError, or nil if none found.
func (m *SpecificationResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *SpecificationResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	if len(errors) > 0 {
		return SpecificationResponseMultiError(errors)
	}

	return nil
}

// SpecificationResponseMultiError is an error wrapping multiple validation
// errors returned by SpecificationResponse.ValidateAll() if the designated
// constraints aren't met.
type SpecificationResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m SpecificationResponseMultiError) 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 SpecificationResponseMultiError) AllErrors() []error { return m }

// SpecificationResponseValidationError is the validation error returned by
// SpecificationResponse.Validate if the designated constraints aren't met.
type SpecificationResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e SpecificationResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e SpecificationResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e SpecificationResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e SpecificationResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e SpecificationResponseValidationError) ErrorName() string {
	return "SpecificationResponseValidationError"
}

// Error satisfies the builtin error interface
func (e SpecificationResponseValidationError) 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 %sSpecificationResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = SpecificationResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = SpecificationResponseValidationError{}

// Validate checks the field values on GoodsTypeRequest 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 *GoodsTypeRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on GoodsTypeRequest 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
// GoodsTypeRequestMultiError, or nil if none found.
func (m *GoodsTypeRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *GoodsTypeRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	if utf8.RuneCountInString(m.GetName()) < 3 {
		err := GoodsTypeRequestValidationError{
			field:  "Name",
			reason: "value length must be at least 3 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetTypeCode()) < 3 {
		err := GoodsTypeRequestValidationError{
			field:  "TypeCode",
			reason: "value length must be at least 3 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for NameAlias

	// no validation rules for IsVirtual

	// no validation rules for Desc

	// no validation rules for Sort

	if utf8.RuneCountInString(m.GetBrandIds()) < 1 {
		err := GoodsTypeRequestValidationError{
			field:  "BrandIds",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if len(errors) > 0 {
		return GoodsTypeRequestMultiError(errors)
	}

	return nil
}

// GoodsTypeRequestMultiError is an error wrapping multiple validation errors
// returned by GoodsTypeRequest.ValidateAll() if the designated constraints
// aren't met.
type GoodsTypeRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m GoodsTypeRequestMultiError) 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 GoodsTypeRequestMultiError) AllErrors() []error { return m }

// GoodsTypeRequestValidationError is the validation error returned by
// GoodsTypeRequest.Validate if the designated constraints aren't met.
type GoodsTypeRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e GoodsTypeRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e GoodsTypeRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e GoodsTypeRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e GoodsTypeRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e GoodsTypeRequestValidationError) ErrorName() string { return "GoodsTypeRequestValidationError" }

// Error satisfies the builtin error interface
func (e GoodsTypeRequestValidationError) 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 %sGoodsTypeRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = GoodsTypeRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GoodsTypeRequestValidationError{}

// Validate checks the field values on GoodsTypeResponse 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 *GoodsTypeResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on GoodsTypeResponse 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
// GoodsTypeResponseMultiError, or nil if none found.
func (m *GoodsTypeResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *GoodsTypeResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	if len(errors) > 0 {
		return GoodsTypeResponseMultiError(errors)
	}

	return nil
}

// GoodsTypeResponseMultiError is an error wrapping multiple validation errors
// returned by GoodsTypeResponse.ValidateAll() if the designated constraints
// aren't met.
type GoodsTypeResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m GoodsTypeResponseMultiError) 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 GoodsTypeResponseMultiError) AllErrors() []error { return m }

// GoodsTypeResponseValidationError is the validation error returned by
// GoodsTypeResponse.Validate if the designated constraints aren't met.
type GoodsTypeResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e GoodsTypeResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e GoodsTypeResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e GoodsTypeResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e GoodsTypeResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e GoodsTypeResponseValidationError) ErrorName() string {
	return "GoodsTypeResponseValidationError"
}

// Error satisfies the builtin error interface
func (e GoodsTypeResponseValidationError) 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 %sGoodsTypeResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = GoodsTypeResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GoodsTypeResponseValidationError{}

// Validate checks the field values on CreateGoodsRequest 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 *CreateGoodsRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CreateGoodsRequest 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
// CreateGoodsRequestMultiError, or nil if none found.
func (m *CreateGoodsRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *CreateGoodsRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	if m.GetCategoryId() < 1 {
		err := CreateGoodsRequestValidationError{
			field:  "CategoryId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetBrandId() < 1 {
		err := CreateGoodsRequestValidationError{
			field:  "BrandId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetTypeId() < 1 {
		err := CreateGoodsRequestValidationError{
			field:  "TypeId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Name

	// no validation rules for NameAlias

	// no validation rules for GoodsTags

	// no validation rules for GoodsSn

	// no validation rules for ShopPrice

	// no validation rules for MarketPrice

	// no validation rules for Inventory

	// no validation rules for GoodsBrief

	// no validation rules for GoodsFrontImage

	// no validation rules for ShipFree

	// no validation rules for ShipId

	// no validation rules for IsNew

	// no validation rules for IsHot

	// no validation rules for OnSale

	for idx, item := range m.GetSku() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, CreateGoodsRequestValidationError{
						field:  fmt.Sprintf("Sku[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, CreateGoodsRequestValidationError{
						field:  fmt.Sprintf("Sku[%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 CreateGoodsRequestValidationError{
					field:  fmt.Sprintf("Sku[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return CreateGoodsRequestMultiError(errors)
	}

	return nil
}

// CreateGoodsRequestMultiError is an error wrapping multiple validation errors
// returned by CreateGoodsRequest.ValidateAll() if the designated constraints
// aren't met.
type CreateGoodsRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CreateGoodsRequestMultiError) 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 CreateGoodsRequestMultiError) AllErrors() []error { return m }

// CreateGoodsRequestValidationError is the validation error returned by
// CreateGoodsRequest.Validate if the designated constraints aren't met.
type CreateGoodsRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CreateGoodsRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CreateGoodsRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CreateGoodsRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CreateGoodsRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CreateGoodsRequestValidationError) ErrorName() string {
	return "CreateGoodsRequestValidationError"
}

// Error satisfies the builtin error interface
func (e CreateGoodsRequestValidationError) 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 %sCreateGoodsRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CreateGoodsRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CreateGoodsRequestValidationError{}

// Validate checks the field values on CreateGoodsResponse 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 *CreateGoodsResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CreateGoodsResponse 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
// CreateGoodsResponseMultiError, or nil if none found.
func (m *CreateGoodsResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *CreateGoodsResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for ID

	if len(errors) > 0 {
		return CreateGoodsResponseMultiError(errors)
	}

	return nil
}

// CreateGoodsResponseMultiError is an error wrapping multiple validation
// errors returned by CreateGoodsResponse.ValidateAll() if the designated
// constraints aren't met.
type CreateGoodsResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CreateGoodsResponseMultiError) 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 CreateGoodsResponseMultiError) AllErrors() []error { return m }

// CreateGoodsResponseValidationError is the validation error returned by
// CreateGoodsResponse.Validate if the designated constraints aren't met.
type CreateGoodsResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CreateGoodsResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CreateGoodsResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CreateGoodsResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CreateGoodsResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CreateGoodsResponseValidationError) ErrorName() string {
	return "CreateGoodsResponseValidationError"
}

// Error satisfies the builtin error interface
func (e CreateGoodsResponseValidationError) 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 %sCreateGoodsResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CreateGoodsResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CreateGoodsResponseValidationError{}

// Validate checks the field values on GoodsInfoResponse 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 *GoodsInfoResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on GoodsInfoResponse 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
// GoodsInfoResponseMultiError, or nil if none found.
func (m *GoodsInfoResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *GoodsInfoResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for CategoryId

	// no validation rules for BrandId

	// no validation rules for Name

	// no validation rules for GoodsSn

	// no validation rules for ClickNum

	// no validation rules for SoldNum

	// no validation rules for FavNum

	// no validation rules for MarketPrice

	// no validation rules for GoodsBrief

	// no validation rules for GoodsDesc

	// no validation rules for ShipFree

	// no validation rules for Images

	// no validation rules for IsNew

	// no validation rules for IsHot

	// no validation rules for OnSale

	if len(errors) > 0 {
		return GoodsInfoResponseMultiError(errors)
	}

	return nil
}

// GoodsInfoResponseMultiError is an error wrapping multiple validation errors
// returned by GoodsInfoResponse.ValidateAll() if the designated constraints
// aren't met.
type GoodsInfoResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m GoodsInfoResponseMultiError) 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 GoodsInfoResponseMultiError) AllErrors() []error { return m }

// GoodsInfoResponseValidationError is the validation error returned by
// GoodsInfoResponse.Validate if the designated constraints aren't met.
type GoodsInfoResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e GoodsInfoResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e GoodsInfoResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e GoodsInfoResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e GoodsInfoResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e GoodsInfoResponseValidationError) ErrorName() string {
	return "GoodsInfoResponseValidationError"
}

// Error satisfies the builtin error interface
func (e GoodsInfoResponseValidationError) 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 %sGoodsInfoResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = GoodsInfoResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GoodsInfoResponseValidationError{}

// Validate checks the field values on GoodsListResponse 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 *GoodsListResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on GoodsListResponse 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
// GoodsListResponseMultiError, or nil if none found.
func (m *GoodsListResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *GoodsListResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Total

	for idx, item := range m.GetList() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, GoodsListResponseValidationError{
						field:  fmt.Sprintf("List[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, GoodsListResponseValidationError{
						field:  fmt.Sprintf("List[%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 GoodsListResponseValidationError{
					field:  fmt.Sprintf("List[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return GoodsListResponseMultiError(errors)
	}

	return nil
}

// GoodsListResponseMultiError is an error wrapping multiple validation errors
// returned by GoodsListResponse.ValidateAll() if the designated constraints
// aren't met.
type GoodsListResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m GoodsListResponseMultiError) 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 GoodsListResponseMultiError) AllErrors() []error { return m }

// GoodsListResponseValidationError is the validation error returned by
// GoodsListResponse.Validate if the designated constraints aren't met.
type GoodsListResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e GoodsListResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e GoodsListResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e GoodsListResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e GoodsListResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e GoodsListResponseValidationError) ErrorName() string {
	return "GoodsListResponseValidationError"
}

// Error satisfies the builtin error interface
func (e GoodsListResponseValidationError) 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 %sGoodsListResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = GoodsListResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GoodsListResponseValidationError{}

// Validate checks the field values on GoodsFilterRequest 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 *GoodsFilterRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on GoodsFilterRequest 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
// GoodsFilterRequestMultiError, or nil if none found.
func (m *GoodsFilterRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *GoodsFilterRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Keywords

	// no validation rules for CategoryId

	// no validation rules for BrandId

	// no validation rules for MinPrice

	// no validation rules for MaxPrice

	// no validation rules for IsHot

	// no validation rules for IsNew

	// no validation rules for IsTab

	// no validation rules for ClickNum

	// no validation rules for SoldNum

	// no validation rules for FavNum

	// no validation rules for Pages

	// no validation rules for PagePerNums

	// no validation rules for Id

	if len(errors) > 0 {
		return GoodsFilterRequestMultiError(errors)
	}

	return nil
}

// GoodsFilterRequestMultiError is an error wrapping multiple validation errors
// returned by GoodsFilterRequest.ValidateAll() if the designated constraints
// aren't met.
type GoodsFilterRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m GoodsFilterRequestMultiError) 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 GoodsFilterRequestMultiError) AllErrors() []error { return m }

// GoodsFilterRequestValidationError is the validation error returned by
// GoodsFilterRequest.Validate if the designated constraints aren't met.
type GoodsFilterRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e GoodsFilterRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e GoodsFilterRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e GoodsFilterRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e GoodsFilterRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e GoodsFilterRequestValidationError) ErrorName() string {
	return "GoodsFilterRequestValidationError"
}

// Error satisfies the builtin error interface
func (e GoodsFilterRequestValidationError) 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 %sGoodsFilterRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = GoodsFilterRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GoodsFilterRequestValidationError{}

// Validate checks the field values on CategoryInfoResponse 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 *CategoryInfoResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CategoryInfoResponse 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
// CategoryInfoResponseMultiError, or nil if none found.
func (m *CategoryInfoResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *CategoryInfoResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for Name

	// no validation rules for ParentCategory

	// no validation rules for Level

	// no validation rules for IsTab

	// no validation rules for Sort

	if len(errors) > 0 {
		return CategoryInfoResponseMultiError(errors)
	}

	return nil
}

// CategoryInfoResponseMultiError is an error wrapping multiple validation
// errors returned by CategoryInfoResponse.ValidateAll() if the designated
// constraints aren't met.
type CategoryInfoResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CategoryInfoResponseMultiError) 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 CategoryInfoResponseMultiError) AllErrors() []error { return m }

// CategoryInfoResponseValidationError is the validation error returned by
// CategoryInfoResponse.Validate if the designated constraints aren't met.
type CategoryInfoResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CategoryInfoResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CategoryInfoResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CategoryInfoResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CategoryInfoResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CategoryInfoResponseValidationError) ErrorName() string {
	return "CategoryInfoResponseValidationError"
}

// Error satisfies the builtin error interface
func (e CategoryInfoResponseValidationError) 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 %sCategoryInfoResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CategoryInfoResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CategoryInfoResponseValidationError{}

// Validate checks the field values on CategoryListResponse 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 *CategoryListResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CategoryListResponse 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
// CategoryListResponseMultiError, or nil if none found.
func (m *CategoryListResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *CategoryListResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for JsonData

	if len(errors) > 0 {
		return CategoryListResponseMultiError(errors)
	}

	return nil
}

// CategoryListResponseMultiError is an error wrapping multiple validation
// errors returned by CategoryListResponse.ValidateAll() if the designated
// constraints aren't met.
type CategoryListResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CategoryListResponseMultiError) 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 CategoryListResponseMultiError) AllErrors() []error { return m }

// CategoryListResponseValidationError is the validation error returned by
// CategoryListResponse.Validate if the designated constraints aren't met.
type CategoryListResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CategoryListResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CategoryListResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CategoryListResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CategoryListResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CategoryListResponseValidationError) ErrorName() string {
	return "CategoryListResponseValidationError"
}

// Error satisfies the builtin error interface
func (e CategoryListResponseValidationError) 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 %sCategoryListResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CategoryListResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CategoryListResponseValidationError{}

// Validate checks the field values on CategoryListRequest 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 *CategoryListRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CategoryListRequest 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
// CategoryListRequestMultiError, or nil if none found.
func (m *CategoryListRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *CategoryListRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for Level

	if len(errors) > 0 {
		return CategoryListRequestMultiError(errors)
	}

	return nil
}

// CategoryListRequestMultiError is an error wrapping multiple validation
// errors returned by CategoryListRequest.ValidateAll() if the designated
// constraints aren't met.
type CategoryListRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CategoryListRequestMultiError) 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 CategoryListRequestMultiError) AllErrors() []error { return m }

// CategoryListRequestValidationError is the validation error returned by
// CategoryListRequest.Validate if the designated constraints aren't met.
type CategoryListRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CategoryListRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CategoryListRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CategoryListRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CategoryListRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CategoryListRequestValidationError) ErrorName() string {
	return "CategoryListRequestValidationError"
}

// Error satisfies the builtin error interface
func (e CategoryListRequestValidationError) 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 %sCategoryListRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CategoryListRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CategoryListRequestValidationError{}

// Validate checks the field values on SubCategoryListResponse 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 *SubCategoryListResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on SubCategoryListResponse 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
// SubCategoryListResponseMultiError, or nil if none found.
func (m *SubCategoryListResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *SubCategoryListResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if all {
		switch v := interface{}(m.GetInfo()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, SubCategoryListResponseValidationError{
					field:  "Info",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, SubCategoryListResponseValidationError{
					field:  "Info",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetInfo()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return SubCategoryListResponseValidationError{
				field:  "Info",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	for idx, item := range m.GetSubCategory() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, SubCategoryListResponseValidationError{
						field:  fmt.Sprintf("SubCategory[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, SubCategoryListResponseValidationError{
						field:  fmt.Sprintf("SubCategory[%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 SubCategoryListResponseValidationError{
					field:  fmt.Sprintf("SubCategory[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return SubCategoryListResponseMultiError(errors)
	}

	return nil
}

// SubCategoryListResponseMultiError is an error wrapping multiple validation
// errors returned by SubCategoryListResponse.ValidateAll() if the designated
// constraints aren't met.
type SubCategoryListResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m SubCategoryListResponseMultiError) 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 SubCategoryListResponseMultiError) AllErrors() []error { return m }

// SubCategoryListResponseValidationError is the validation error returned by
// SubCategoryListResponse.Validate if the designated constraints aren't met.
type SubCategoryListResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e SubCategoryListResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e SubCategoryListResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e SubCategoryListResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e SubCategoryListResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e SubCategoryListResponseValidationError) ErrorName() string {
	return "SubCategoryListResponseValidationError"
}

// Error satisfies the builtin error interface
func (e SubCategoryListResponseValidationError) 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 %sSubCategoryListResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = SubCategoryListResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = SubCategoryListResponseValidationError{}

// Validate checks the field values on CategoryInfoRequest 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 *CategoryInfoRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CategoryInfoRequest 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
// CategoryInfoRequestMultiError, or nil if none found.
func (m *CategoryInfoRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *CategoryInfoRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for Name

	// no validation rules for ParentCategory

	// no validation rules for Level

	// no validation rules for IsTab

	// no validation rules for Sort

	if len(errors) > 0 {
		return CategoryInfoRequestMultiError(errors)
	}

	return nil
}

// CategoryInfoRequestMultiError is an error wrapping multiple validation
// errors returned by CategoryInfoRequest.ValidateAll() if the designated
// constraints aren't met.
type CategoryInfoRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CategoryInfoRequestMultiError) 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 CategoryInfoRequestMultiError) AllErrors() []error { return m }

// CategoryInfoRequestValidationError is the validation error returned by
// CategoryInfoRequest.Validate if the designated constraints aren't met.
type CategoryInfoRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CategoryInfoRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CategoryInfoRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CategoryInfoRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CategoryInfoRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CategoryInfoRequestValidationError) ErrorName() string {
	return "CategoryInfoRequestValidationError"
}

// Error satisfies the builtin error interface
func (e CategoryInfoRequestValidationError) 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 %sCategoryInfoRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CategoryInfoRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CategoryInfoRequestValidationError{}

// Validate checks the field values on BatchCategoryInfoRequest 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 *BatchCategoryInfoRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on BatchCategoryInfoRequest 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
// BatchCategoryInfoRequestMultiError, or nil if none found.
func (m *BatchCategoryInfoRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *BatchCategoryInfoRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for GoodsNums

	// no validation rules for BrandNums

	if len(errors) > 0 {
		return BatchCategoryInfoRequestMultiError(errors)
	}

	return nil
}

// BatchCategoryInfoRequestMultiError is an error wrapping multiple validation
// errors returned by BatchCategoryInfoRequest.ValidateAll() if the designated
// constraints aren't met.
type BatchCategoryInfoRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m BatchCategoryInfoRequestMultiError) 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 BatchCategoryInfoRequestMultiError) AllErrors() []error { return m }

// BatchCategoryInfoRequestValidationError is the validation error returned by
// BatchCategoryInfoRequest.Validate if the designated constraints aren't met.
type BatchCategoryInfoRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e BatchCategoryInfoRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e BatchCategoryInfoRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e BatchCategoryInfoRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e BatchCategoryInfoRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e BatchCategoryInfoRequestValidationError) ErrorName() string {
	return "BatchCategoryInfoRequestValidationError"
}

// Error satisfies the builtin error interface
func (e BatchCategoryInfoRequestValidationError) 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 %sBatchCategoryInfoRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = BatchCategoryInfoRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = BatchCategoryInfoRequestValidationError{}

// Validate checks the field values on DeleteCategoryRequest 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 *DeleteCategoryRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DeleteCategoryRequest 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
// DeleteCategoryRequestMultiError, or nil if none found.
func (m *DeleteCategoryRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *DeleteCategoryRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	if len(errors) > 0 {
		return DeleteCategoryRequestMultiError(errors)
	}

	return nil
}

// DeleteCategoryRequestMultiError is an error wrapping multiple validation
// errors returned by DeleteCategoryRequest.ValidateAll() if the designated
// constraints aren't met.
type DeleteCategoryRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m DeleteCategoryRequestMultiError) 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 DeleteCategoryRequestMultiError) AllErrors() []error { return m }

// DeleteCategoryRequestValidationError is the validation error returned by
// DeleteCategoryRequest.Validate if the designated constraints aren't met.
type DeleteCategoryRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e DeleteCategoryRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e DeleteCategoryRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e DeleteCategoryRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e DeleteCategoryRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e DeleteCategoryRequestValidationError) ErrorName() string {
	return "DeleteCategoryRequestValidationError"
}

// Error satisfies the builtin error interface
func (e DeleteCategoryRequestValidationError) 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 %sDeleteCategoryRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DeleteCategoryRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = DeleteCategoryRequestValidationError{}

// Validate checks the field values on BrandListRequest 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 *BrandListRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on BrandListRequest 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
// BrandListRequestMultiError, or nil if none found.
func (m *BrandListRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *BrandListRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Pages

	// no validation rules for PagePerNums

	if len(errors) > 0 {
		return BrandListRequestMultiError(errors)
	}

	return nil
}

// BrandListRequestMultiError is an error wrapping multiple validation errors
// returned by BrandListRequest.ValidateAll() if the designated constraints
// aren't met.
type BrandListRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m BrandListRequestMultiError) 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 BrandListRequestMultiError) AllErrors() []error { return m }

// BrandListRequestValidationError is the validation error returned by
// BrandListRequest.Validate if the designated constraints aren't met.
type BrandListRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e BrandListRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e BrandListRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e BrandListRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e BrandListRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e BrandListRequestValidationError) ErrorName() string { return "BrandListRequestValidationError" }

// Error satisfies the builtin error interface
func (e BrandListRequestValidationError) 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 %sBrandListRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = BrandListRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = BrandListRequestValidationError{}

// Validate checks the field values on BrandRequest 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 *BrandRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on BrandRequest 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 BrandRequestMultiError, or
// nil if none found.
func (m *BrandRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *BrandRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for Name

	// no validation rules for Logo

	// no validation rules for Desc

	// no validation rules for IsTab

	// no validation rules for Sort

	if len(errors) > 0 {
		return BrandRequestMultiError(errors)
	}

	return nil
}

// BrandRequestMultiError is an error wrapping multiple validation errors
// returned by BrandRequest.ValidateAll() if the designated constraints aren't met.
type BrandRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m BrandRequestMultiError) 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 BrandRequestMultiError) AllErrors() []error { return m }

// BrandRequestValidationError is the validation error returned by
// BrandRequest.Validate if the designated constraints aren't met.
type BrandRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e BrandRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e BrandRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e BrandRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e BrandRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e BrandRequestValidationError) ErrorName() string { return "BrandRequestValidationError" }

// Error satisfies the builtin error interface
func (e BrandRequestValidationError) 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 %sBrandRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = BrandRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = BrandRequestValidationError{}

// Validate checks the field values on BrandInfoResponse 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 *BrandInfoResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on BrandInfoResponse 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
// BrandInfoResponseMultiError, or nil if none found.
func (m *BrandInfoResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *BrandInfoResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for Name

	// no validation rules for Logo

	// no validation rules for Desc

	// no validation rules for IsTab

	// no validation rules for Sort

	if len(errors) > 0 {
		return BrandInfoResponseMultiError(errors)
	}

	return nil
}

// BrandInfoResponseMultiError is an error wrapping multiple validation errors
// returned by BrandInfoResponse.ValidateAll() if the designated constraints
// aren't met.
type BrandInfoResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m BrandInfoResponseMultiError) 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 BrandInfoResponseMultiError) AllErrors() []error { return m }

// BrandInfoResponseValidationError is the validation error returned by
// BrandInfoResponse.Validate if the designated constraints aren't met.
type BrandInfoResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e BrandInfoResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e BrandInfoResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e BrandInfoResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e BrandInfoResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e BrandInfoResponseValidationError) ErrorName() string {
	return "BrandInfoResponseValidationError"
}

// Error satisfies the builtin error interface
func (e BrandInfoResponseValidationError) 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 %sBrandInfoResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = BrandInfoResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = BrandInfoResponseValidationError{}

// Validate checks the field values on BrandListResponse 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 *BrandListResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on BrandListResponse 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
// BrandListResponseMultiError, or nil if none found.
func (m *BrandListResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *BrandListResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Total

	for idx, item := range m.GetData() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, BrandListResponseValidationError{
						field:  fmt.Sprintf("Data[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, BrandListResponseValidationError{
						field:  fmt.Sprintf("Data[%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 BrandListResponseValidationError{
					field:  fmt.Sprintf("Data[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return BrandListResponseMultiError(errors)
	}

	return nil
}

// BrandListResponseMultiError is an error wrapping multiple validation errors
// returned by BrandListResponse.ValidateAll() if the designated constraints
// aren't met.
type BrandListResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m BrandListResponseMultiError) 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 BrandListResponseMultiError) AllErrors() []error { return m }

// BrandListResponseValidationError is the validation error returned by
// BrandListResponse.Validate if the designated constraints aren't met.
type BrandListResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e BrandListResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e BrandListResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e BrandListResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e BrandListResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e BrandListResponseValidationError) ErrorName() string {
	return "BrandListResponseValidationError"
}

// Error satisfies the builtin error interface
func (e BrandListResponseValidationError) 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 %sBrandListResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = BrandListResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = BrandListResponseValidationError{}

// Validate checks the field values on CreateGoodsRequestGoodsSku 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 *CreateGoodsRequestGoodsSku) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CreateGoodsRequestGoodsSku 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
// CreateGoodsRequestGoodsSkuMultiError, or nil if none found.
func (m *CreateGoodsRequestGoodsSku) ValidateAll() error {
	return m.validate(true)
}

func (m *CreateGoodsRequestGoodsSku) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Id

	// no validation rules for GoodsId

	if utf8.RuneCountInString(m.GetSkuName()) < 1 {
		err := CreateGoodsRequestGoodsSkuValidationError{
			field:  "SkuName",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetCode()) < 1 {
		err := CreateGoodsRequestGoodsSkuValidationError{
			field:  "Code",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetBarCode()) < 1 {
		err := CreateGoodsRequestGoodsSkuValidationError{
			field:  "BarCode",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Price

	// no validation rules for PromotionPrice

	// no validation rules for Points

	// no validation rules for Image

	// no validation rules for Sort

	// no validation rules for Inventory

	for idx, item := range m.GetSpecificationInfo() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{
						field:  fmt.Sprintf("SpecificationInfo[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{
						field:  fmt.Sprintf("SpecificationInfo[%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 CreateGoodsRequestGoodsSkuValidationError{
					field:  fmt.Sprintf("SpecificationInfo[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	for idx, item := range m.GetGroupAttrInfo() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{
						field:  fmt.Sprintf("GroupAttrInfo[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, CreateGoodsRequestGoodsSkuValidationError{
						field:  fmt.Sprintf("GroupAttrInfo[%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 CreateGoodsRequestGoodsSkuValidationError{
					field:  fmt.Sprintf("GroupAttrInfo[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return CreateGoodsRequestGoodsSkuMultiError(errors)
	}

	return nil
}

// CreateGoodsRequestGoodsSkuMultiError is an error wrapping multiple
// validation errors returned by CreateGoodsRequestGoodsSku.ValidateAll() if
// the designated constraints aren't met.
type CreateGoodsRequestGoodsSkuMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CreateGoodsRequestGoodsSkuMultiError) 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 CreateGoodsRequestGoodsSkuMultiError) AllErrors() []error { return m }

// CreateGoodsRequestGoodsSkuValidationError is the validation error returned
// by CreateGoodsRequestGoodsSku.Validate if the designated constraints aren't met.
type CreateGoodsRequestGoodsSkuValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CreateGoodsRequestGoodsSkuValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CreateGoodsRequestGoodsSkuValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CreateGoodsRequestGoodsSkuValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CreateGoodsRequestGoodsSkuValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CreateGoodsRequestGoodsSkuValidationError) ErrorName() string {
	return "CreateGoodsRequestGoodsSkuValidationError"
}

// Error satisfies the builtin error interface
func (e CreateGoodsRequestGoodsSkuValidationError) 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 %sCreateGoodsRequestGoodsSku.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CreateGoodsRequestGoodsSkuValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CreateGoodsRequestGoodsSkuValidationError{}

// Validate checks the field values on CreateGoodsRequestGoodsSkuSpecification
// 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 *CreateGoodsRequestGoodsSkuSpecification) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on
// CreateGoodsRequestGoodsSkuSpecification 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
// CreateGoodsRequestGoodsSkuSpecificationMultiError, or nil if none found.
func (m *CreateGoodsRequestGoodsSkuSpecification) ValidateAll() error {
	return m.validate(true)
}

func (m *CreateGoodsRequestGoodsSkuSpecification) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if m.GetSId() < 1 {
		err := CreateGoodsRequestGoodsSkuSpecificationValidationError{
			field:  "SId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetVId() < 1 {
		err := CreateGoodsRequestGoodsSkuSpecificationValidationError{
			field:  "VId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if len(errors) > 0 {
		return CreateGoodsRequestGoodsSkuSpecificationMultiError(errors)
	}

	return nil
}

// CreateGoodsRequestGoodsSkuSpecificationMultiError is an error wrapping
// multiple validation errors returned by
// CreateGoodsRequestGoodsSkuSpecification.ValidateAll() if the designated
// constraints aren't met.
type CreateGoodsRequestGoodsSkuSpecificationMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CreateGoodsRequestGoodsSkuSpecificationMultiError) 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 CreateGoodsRequestGoodsSkuSpecificationMultiError) AllErrors() []error { return m }

// CreateGoodsRequestGoodsSkuSpecificationValidationError is the validation
// error returned by CreateGoodsRequestGoodsSkuSpecification.Validate if the
// designated constraints aren't met.
type CreateGoodsRequestGoodsSkuSpecificationValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) ErrorName() string {
	return "CreateGoodsRequestGoodsSkuSpecificationValidationError"
}

// Error satisfies the builtin error interface
func (e CreateGoodsRequestGoodsSkuSpecificationValidationError) 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 %sCreateGoodsRequestGoodsSkuSpecification.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CreateGoodsRequestGoodsSkuSpecificationValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CreateGoodsRequestGoodsSkuSpecificationValidationError{}

// Validate checks the field values on CreateGoodsRequestGoodsSkuGroupAttr 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 *CreateGoodsRequestGoodsSkuGroupAttr) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CreateGoodsRequestGoodsSkuGroupAttr
// 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
// CreateGoodsRequestGoodsSkuGroupAttrMultiError, or nil if none found.
func (m *CreateGoodsRequestGoodsSkuGroupAttr) ValidateAll() error {
	return m.validate(true)
}

func (m *CreateGoodsRequestGoodsSkuGroupAttr) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for GroupId

	// no validation rules for GroupName

	for idx, item := range m.GetAttrInfo() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, CreateGoodsRequestGoodsSkuGroupAttrValidationError{
						field:  fmt.Sprintf("AttrInfo[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, CreateGoodsRequestGoodsSkuGroupAttrValidationError{
						field:  fmt.Sprintf("AttrInfo[%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 CreateGoodsRequestGoodsSkuGroupAttrValidationError{
					field:  fmt.Sprintf("AttrInfo[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return CreateGoodsRequestGoodsSkuGroupAttrMultiError(errors)
	}

	return nil
}

// CreateGoodsRequestGoodsSkuGroupAttrMultiError is an error wrapping multiple
// validation errors returned by
// CreateGoodsRequestGoodsSkuGroupAttr.ValidateAll() if the designated
// constraints aren't met.
type CreateGoodsRequestGoodsSkuGroupAttrMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CreateGoodsRequestGoodsSkuGroupAttrMultiError) 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 CreateGoodsRequestGoodsSkuGroupAttrMultiError) AllErrors() []error { return m }

// CreateGoodsRequestGoodsSkuGroupAttrValidationError is the validation error
// returned by CreateGoodsRequestGoodsSkuGroupAttr.Validate if the designated
// constraints aren't met.
type CreateGoodsRequestGoodsSkuGroupAttrValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) ErrorName() string {
	return "CreateGoodsRequestGoodsSkuGroupAttrValidationError"
}

// Error satisfies the builtin error interface
func (e CreateGoodsRequestGoodsSkuGroupAttrValidationError) 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 %sCreateGoodsRequestGoodsSkuGroupAttr.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CreateGoodsRequestGoodsSkuGroupAttrValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CreateGoodsRequestGoodsSkuGroupAttrValidationError{}

// Validate checks the field values on CreateGoodsRequestGoodsSkuGroupAttrAttr
// 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 *CreateGoodsRequestGoodsSkuGroupAttrAttr) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on
// CreateGoodsRequestGoodsSkuGroupAttrAttr 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
// CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError, or nil if none found.
func (m *CreateGoodsRequestGoodsSkuGroupAttrAttr) ValidateAll() error {
	return m.validate(true)
}

func (m *CreateGoodsRequestGoodsSkuGroupAttrAttr) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if m.GetAttrId() < 1 {
		err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{
			field:  "AttrId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetAttrName()) < 1 {
		err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{
			field:  "AttrName",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetAttrValueId() < 1 {
		err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{
			field:  "AttrValueId",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetAttrValueName()) < 1 {
		err := CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{
			field:  "AttrValueName",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if len(errors) > 0 {
		return CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError(errors)
	}

	return nil
}

// CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError is an error wrapping
// multiple validation errors returned by
// CreateGoodsRequestGoodsSkuGroupAttrAttr.ValidateAll() if the designated
// constraints aren't met.
type CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError) 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 CreateGoodsRequestGoodsSkuGroupAttrAttrMultiError) AllErrors() []error { return m }

// CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError is the validation
// error returned by CreateGoodsRequestGoodsSkuGroupAttrAttr.Validate if the
// designated constraints aren't met.
type CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) ErrorName() string {
	return "CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError"
}

// Error satisfies the builtin error interface
func (e CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError) 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 %sCreateGoodsRequestGoodsSkuGroupAttrAttr.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CreateGoodsRequestGoodsSkuGroupAttrAttrValidationError{}
