github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/alert/alert.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/monitoring/proto/v4/alert.proto 3 // DO NOT EDIT!!! 4 5 package alert 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 alerting_condition "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/alerting_condition" 24 common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common" 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 _ = &alerting_condition.AlertingCondition{} 44 _ = &common.LabelDescriptor{} 45 _ = &meta.Meta{} 46 ) 47 48 func (obj *Alert) 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("Alert", "metadata", obj.Metadata, "nested object validation failed", err) 55 } 56 } 57 if subobj, ok := interface{}(obj.Info).(gotenvalidate.Validator); ok { 58 if err := subobj.GotenValidate(); err != nil { 59 return gotenvalidate.NewValidationError("Alert", "info", obj.Info, "nested object validation failed", err) 60 } 61 } 62 if subobj, ok := interface{}(obj.State).(gotenvalidate.Validator); ok { 63 if err := subobj.GotenValidate(); err != nil { 64 return gotenvalidate.NewValidationError("Alert", "state", obj.State, "nested object validation failed", err) 65 } 66 } 67 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 68 return cvobj.GotenCustomValidate() 69 } 70 return nil 71 } 72 func (obj *Alert_Info) GotenValidate() error { 73 if obj == nil { 74 return nil 75 } 76 if subobj, ok := interface{}(obj.TimeSerie).(gotenvalidate.Validator); ok { 77 if err := subobj.GotenValidate(); err != nil { 78 return gotenvalidate.NewValidationError("Info", "timeSerie", obj.TimeSerie, "nested object validation failed", err) 79 } 80 } 81 if subobj, ok := interface{}(obj.ObservedValues).(gotenvalidate.Validator); ok { 82 if err := subobj.GotenValidate(); err != nil { 83 return gotenvalidate.NewValidationError("Info", "observedValues", obj.ObservedValues, "nested object validation failed", err) 84 } 85 } 86 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 87 return cvobj.GotenCustomValidate() 88 } 89 return nil 90 } 91 func (obj *Alert_State) GotenValidate() error { 92 if obj == nil { 93 return nil 94 } 95 if subobj, ok := interface{}(obj.Lifetime).(gotenvalidate.Validator); ok { 96 if err := subobj.GotenValidate(); err != nil { 97 return gotenvalidate.NewValidationError("State", "lifetime", obj.Lifetime, "nested object validation failed", err) 98 } 99 } 100 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 101 return cvobj.GotenCustomValidate() 102 } 103 return nil 104 } 105 func (obj *Alert_Info_TimeSerie) GotenValidate() error { 106 if obj == nil { 107 return nil 108 } 109 if subobj, ok := interface{}(obj.Metric).(gotenvalidate.Validator); ok { 110 if err := subobj.GotenValidate(); err != nil { 111 return gotenvalidate.NewValidationError("TimeSerie", "metric", obj.Metric, "nested object validation failed", err) 112 } 113 } 114 if subobj, ok := interface{}(obj.MonitoredResource).(gotenvalidate.Validator); ok { 115 if err := subobj.GotenValidate(); err != nil { 116 return gotenvalidate.NewValidationError("TimeSerie", "monitoredResource", obj.MonitoredResource, "nested object validation failed", err) 117 } 118 } 119 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 120 return cvobj.GotenCustomValidate() 121 } 122 return nil 123 } 124 func (obj *Alert_Info_ObservedValues) GotenValidate() error { 125 if obj == nil { 126 return nil 127 } 128 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 129 return cvobj.GotenCustomValidate() 130 } 131 return nil 132 }