github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v3/alerting_policy/alerting_policy.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/monitoring/proto/v3/alerting_policy.proto 3 // DO NOT EDIT!!! 4 5 package alerting_policy 6 7 import ( 8 "bytes" 9 "errors" 10 "fmt" 11 "net" 12 "net/url" 13 "regexp" 14 "strings" 15 "time" 16 "unicode/utf8" 17 18 gotenvalidate "github.com/cloudwan/goten-sdk/runtime/validate" 19 ) 20 21 // proto imports 22 import ( 23 notification_channel "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/notification_channel" 24 project "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/project" 25 meta "github.com/cloudwan/goten-sdk/types/meta" 26 ) 27 28 var ( 29 _ = bytes.Equal 30 _ = errors.New 31 _ = fmt.Errorf 32 _ = net.ParseIP 33 _ = regexp.Match 34 _ = strings.Split 35 _ = time.Now 36 _ = utf8.RuneCountInString 37 _ = url.Parse 38 _ = gotenvalidate.NewValidationError 39 ) 40 41 // make sure we're using proto imports 42 var ( 43 _ = ¬ification_channel.NotificationChannel{} 44 _ = &project.Project{} 45 _ = &meta.Meta{} 46 ) 47 48 func (obj *AlertingPolicy) GotenValidate() error { 49 if obj == nil { 50 return nil 51 } 52 if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok { 53 if err := subobj.GotenValidate(); err != nil { 54 return gotenvalidate.NewValidationError("AlertingPolicy", "metadata", obj.Metadata, "nested object validation failed", err) 55 } 56 } 57 if subobj, ok := interface{}(obj.Documentation).(gotenvalidate.Validator); ok { 58 if err := subobj.GotenValidate(); err != nil { 59 return gotenvalidate.NewValidationError("AlertingPolicy", "documentation", obj.Documentation, "nested object validation failed", err) 60 } 61 } 62 if subobj, ok := interface{}(obj.Spec).(gotenvalidate.Validator); ok { 63 if err := subobj.GotenValidate(); err != nil { 64 return gotenvalidate.NewValidationError("AlertingPolicy", "spec", obj.Spec, "nested object validation failed", err) 65 } 66 } 67 if subobj, ok := interface{}(obj.State).(gotenvalidate.Validator); ok { 68 if err := subobj.GotenValidate(); err != nil { 69 return gotenvalidate.NewValidationError("AlertingPolicy", "state", obj.State, "nested object validation failed", err) 70 } 71 } 72 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 73 return cvobj.GotenCustomValidate() 74 } 75 return nil 76 } 77 func (obj *AlertingPolicy_Documentation) GotenValidate() error { 78 if obj == nil { 79 return nil 80 } 81 if obj.MimeType != "text/markdown" { 82 return gotenvalidate.NewValidationError("Documentation", "mimeType", obj.MimeType, "field must be equal to exactly one of the following values: text/markdown", nil) 83 } 84 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 85 return cvobj.GotenCustomValidate() 86 } 87 return nil 88 } 89 func (obj *AlertingPolicy_Spec) GotenValidate() error { 90 if obj == nil { 91 return nil 92 } 93 if obj.ConditionCombiner != 0 { 94 return gotenvalidate.NewValidationError("Spec", "conditionCombiner", obj.ConditionCombiner, "field must be equal to exactly one of the following values: 0", nil) 95 } 96 if subobj, ok := interface{}(obj.Notification).(gotenvalidate.Validator); ok { 97 if err := subobj.GotenValidate(); err != nil { 98 return gotenvalidate.NewValidationError("Spec", "notification", obj.Notification, "nested object validation failed", err) 99 } 100 } 101 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 102 return cvobj.GotenCustomValidate() 103 } 104 return nil 105 } 106 func (obj *AlertingPolicy_State) GotenValidate() error { 107 if obj == nil { 108 return nil 109 } 110 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 111 return cvobj.GotenCustomValidate() 112 } 113 return nil 114 } 115 func (obj *AlertingPolicy_Spec_Notification) GotenValidate() error { 116 if obj == nil { 117 return nil 118 } 119 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 120 return cvobj.GotenCustomValidate() 121 } 122 return nil 123 }