1// Code generated by protoc-gen-validate. DO NOT EDIT.
2// source: udpa/annotations/versioning.proto
3
4package annotations
5
6import (
7	"bytes"
8	"errors"
9	"fmt"
10	"net"
11	"net/mail"
12	"net/url"
13	"regexp"
14	"strings"
15	"time"
16	"unicode/utf8"
17
18	"google.golang.org/protobuf/types/known/anypb"
19)
20
21// ensure the imports are used
22var (
23	_ = bytes.MinRead
24	_ = errors.New("")
25	_ = fmt.Print
26	_ = utf8.UTFMax
27	_ = (*regexp.Regexp)(nil)
28	_ = (*strings.Reader)(nil)
29	_ = net.IPv4len
30	_ = time.Duration(0)
31	_ = (*url.URL)(nil)
32	_ = (*mail.Address)(nil)
33	_ = anypb.Any{}
34)
35
36// Validate checks the field values on VersioningAnnotation with the rules
37// defined in the proto definition for this message. If any rules are
38// violated, an error is returned.
39func (m *VersioningAnnotation) Validate() error {
40	if m == nil {
41		return nil
42	}
43
44	// no validation rules for PreviousMessageType
45
46	return nil
47}
48
49// VersioningAnnotationValidationError is the validation error returned by
50// VersioningAnnotation.Validate if the designated constraints aren't met.
51type VersioningAnnotationValidationError struct {
52	field  string
53	reason string
54	cause  error
55	key    bool
56}
57
58// Field function returns field value.
59func (e VersioningAnnotationValidationError) Field() string { return e.field }
60
61// Reason function returns reason value.
62func (e VersioningAnnotationValidationError) Reason() string { return e.reason }
63
64// Cause function returns cause value.
65func (e VersioningAnnotationValidationError) Cause() error { return e.cause }
66
67// Key function returns key value.
68func (e VersioningAnnotationValidationError) Key() bool { return e.key }
69
70// ErrorName returns error name.
71func (e VersioningAnnotationValidationError) ErrorName() string {
72	return "VersioningAnnotationValidationError"
73}
74
75// Error satisfies the builtin error interface
76func (e VersioningAnnotationValidationError) Error() string {
77	cause := ""
78	if e.cause != nil {
79		cause = fmt.Sprintf(" | caused by: %v", e.cause)
80	}
81
82	key := ""
83	if e.key {
84		key = "key for "
85	}
86
87	return fmt.Sprintf(
88		"invalid %sVersioningAnnotation.%s: %s%s",
89		key,
90		e.field,
91		e.reason,
92		cause)
93}
94
95var _ error = VersioningAnnotationValidationError{}
96
97var _ interface {
98	Field() string
99	Reason() string
100	Key() bool
101	Cause() error
102	ErrorName() string
103} = VersioningAnnotationValidationError{}
104