1// Code generated by protoc-gen-validate. DO NOT EDIT.
2// source: udpa/annotations/security.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 FieldSecurityAnnotation with the rules
37// defined in the proto definition for this message. If any rules are
38// violated, an error is returned.
39func (m *FieldSecurityAnnotation) Validate() error {
40	if m == nil {
41		return nil
42	}
43
44	// no validation rules for ConfigureForUntrustedDownstream
45
46	// no validation rules for ConfigureForUntrustedUpstream
47
48	return nil
49}
50
51// FieldSecurityAnnotationValidationError is the validation error returned by
52// FieldSecurityAnnotation.Validate if the designated constraints aren't met.
53type FieldSecurityAnnotationValidationError struct {
54	field  string
55	reason string
56	cause  error
57	key    bool
58}
59
60// Field function returns field value.
61func (e FieldSecurityAnnotationValidationError) Field() string { return e.field }
62
63// Reason function returns reason value.
64func (e FieldSecurityAnnotationValidationError) Reason() string { return e.reason }
65
66// Cause function returns cause value.
67func (e FieldSecurityAnnotationValidationError) Cause() error { return e.cause }
68
69// Key function returns key value.
70func (e FieldSecurityAnnotationValidationError) Key() bool { return e.key }
71
72// ErrorName returns error name.
73func (e FieldSecurityAnnotationValidationError) ErrorName() string {
74	return "FieldSecurityAnnotationValidationError"
75}
76
77// Error satisfies the builtin error interface
78func (e FieldSecurityAnnotationValidationError) Error() string {
79	cause := ""
80	if e.cause != nil {
81		cause = fmt.Sprintf(" | caused by: %v", e.cause)
82	}
83
84	key := ""
85	if e.key {
86		key = "key for "
87	}
88
89	return fmt.Sprintf(
90		"invalid %sFieldSecurityAnnotation.%s: %s%s",
91		key,
92		e.field,
93		e.reason,
94		cause)
95}
96
97var _ error = FieldSecurityAnnotationValidationError{}
98
99var _ interface {
100	Field() string
101	Reason() string
102	Key() bool
103	Cause() error
104	ErrorName() string
105} = FieldSecurityAnnotationValidationError{}
106