// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: payment/api/gateway/v1/gateway.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 GetPaymentMethodRequest 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 *GetPaymentMethodRequest) Validate() error {
	return m.validate(false)
}

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

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

	var errors []error

	// no validation rules for OrderId

	// no validation rules for IsTest

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetPaymentMethodRequestValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetPaymentMethodReplyValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = StripeWebhookRequestValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = StripeWebhookReplyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Name

	// no validation rules for Logo

	// no validation rules for Desc

	// no validation rules for Notice

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PaymentMethodValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetStripeConfigRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for IsTest

	// no validation rules for PublishKey

	// no validation rules for PriceTables

	// no validation rules for CustomerId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetStripeConfigReplyValidationError{}

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