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

package openfgav1

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

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

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

	var errors []error

	// no validation rules for Code

	// no validation rules for Message

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ValidationErrorMessageResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Code

	// no validation rules for Message

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UnauthenticatedResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Code

	// no validation rules for Message

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UnprocessableContentMessageResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Code

	// no validation rules for Message

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = InternalErrorMessageResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Code

	// no validation rules for Message

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PathUnknownErrorMessageResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Code

	// no validation rules for Message

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = AbortedMessageResponseValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ErrorMessageRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Code

	// no validation rules for Message

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ForbiddenResponseValidationError{}

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