// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: service/dex-member/auth.proto

package dex_member

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

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

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

	var errors []error

	// no validation rules for Email

	// no validation rules for Password

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = AuthSignInRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for JwtToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = AuthSignInReplyValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = AuthSignUpRequestValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = AuthSignUpReplyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for JwtToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = AuthVerifyRequestValidationError{}

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

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

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

func (m *AuthVerifyReply) 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, AuthVerifyReplyValidationError{
					field:  "User",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, AuthVerifyReplyValidationError{
					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 AuthVerifyReplyValidationError{
				field:  "User",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = AuthVerifyReplyValidationError{}

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