status.pb.validate.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // Code generated by protoc-gen-validate. DO NOT EDIT.
  2. // source: udpa/annotations/status.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 StatusAnnotation with the rules defined
  32. // in the proto definition for this message. If any rules are violated, an
  33. // error is returned.
  34. func (m *StatusAnnotation) Validate() error {
  35. if m == nil {
  36. return nil
  37. }
  38. // no validation rules for WorkInProgress
  39. // no validation rules for PackageVersionStatus
  40. return nil
  41. }
  42. // StatusAnnotationValidationError is the validation error returned by
  43. // StatusAnnotation.Validate if the designated constraints aren't met.
  44. type StatusAnnotationValidationError struct {
  45. field string
  46. reason string
  47. cause error
  48. key bool
  49. }
  50. // Field function returns field value.
  51. func (e StatusAnnotationValidationError) Field() string { return e.field }
  52. // Reason function returns reason value.
  53. func (e StatusAnnotationValidationError) Reason() string { return e.reason }
  54. // Cause function returns cause value.
  55. func (e StatusAnnotationValidationError) Cause() error { return e.cause }
  56. // Key function returns key value.
  57. func (e StatusAnnotationValidationError) Key() bool { return e.key }
  58. // ErrorName returns error name.
  59. func (e StatusAnnotationValidationError) ErrorName() string { return "StatusAnnotationValidationError" }
  60. // Error satisfies the builtin error interface
  61. func (e StatusAnnotationValidationError) Error() string {
  62. cause := ""
  63. if e.cause != nil {
  64. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  65. }
  66. key := ""
  67. if e.key {
  68. key = "key for "
  69. }
  70. return fmt.Sprintf(
  71. "invalid %sStatusAnnotation.%s: %s%s",
  72. key,
  73. e.field,
  74. e.reason,
  75. cause)
  76. }
  77. var _ error = StatusAnnotationValidationError{}
  78. var _ interface {
  79. Field() string
  80. Reason() string
  81. Key() bool
  82. Cause() error
  83. ErrorName() string
  84. } = StatusAnnotationValidationError{}