versioning.pb.validate.go 2.2 KB

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