// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: interface/dex/assets.proto

package dex

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

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

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

	var errors []error

	// no validation rules for JwtToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetUserAccountsAssetsRequestValidationError{}

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

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

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

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

	var errors []error

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

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetUserAccountsAssetsReplyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for UserId

	// no validation rules for NickName

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetUserAccountsAssetsReply_UserValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Rank

	// no validation rules for UserId

	// no validation rules for CoinId

	// no validation rules for Type

	// no validation rules for Status

	// no validation rules for BalanceAmount

	// no validation rules for FreezeAmount

	// no validation rules for RechargeAddress

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetUserAccountsAssetsReply_AccountValidationError{}

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