github.com/cloudwan/edgelq-sdk@v1.15.4/alerting/client/v1/edge_watch_service/edge_watch_service_custom.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/alerting/proto/v1/edge_watch_service_custom.proto 3 // DO NOT EDIT!!! 4 5 package edge_watch_service_client 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 alert "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/alert" 24 log_condition "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/log_condition" 25 policy "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/policy" 26 ts_condition "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/ts_condition" 27 ts_entry "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/ts_entry" 28 iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1/project" 29 ) 30 31 var ( 32 _ = bytes.Equal 33 _ = errors.New 34 _ = fmt.Errorf 35 _ = net.ParseIP 36 _ = regexp.Match 37 _ = strings.Split 38 _ = time.Now 39 _ = utf8.RuneCountInString 40 _ = url.Parse 41 _ = gotenvalidate.NewValidationError 42 ) 43 44 // make sure we're using proto imports 45 var ( 46 _ = &alert.Alert{} 47 _ = &log_condition.LogCondition{} 48 _ = &policy.Policy{} 49 _ = &ts_condition.TsCondition{} 50 _ = &ts_entry.TsEntry{} 51 _ = &iam_project.Project{} 52 ) 53 54 func (obj *WatchAlertDataRequest) GotenValidate() error { 55 if obj == nil { 56 return nil 57 } 58 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 59 return cvobj.GotenCustomValidate() 60 } 61 return nil 62 } 63 func (obj *WatchAlertDataResponse) GotenValidate() error { 64 if obj == nil { 65 return nil 66 } 67 for idx, elem := range obj.AlertsToAdd { 68 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 69 if err := subobj.GotenValidate(); err != nil { 70 return gotenvalidate.NewValidationError("WatchAlertDataResponse", "alertsToAdd", obj.AlertsToAdd[idx], "nested object validation failed", err) 71 } 72 } 73 } 74 for idx, elem := range obj.TsEntriesToAdd { 75 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 76 if err := subobj.GotenValidate(); err != nil { 77 return gotenvalidate.NewValidationError("WatchAlertDataResponse", "tsEntriesToAdd", obj.TsEntriesToAdd[idx], "nested object validation failed", err) 78 } 79 } 80 } 81 for idx, elem := range obj.PoliciesToAdd { 82 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 83 if err := subobj.GotenValidate(); err != nil { 84 return gotenvalidate.NewValidationError("WatchAlertDataResponse", "policiesToAdd", obj.PoliciesToAdd[idx], "nested object validation failed", err) 85 } 86 } 87 } 88 for idx, elem := range obj.TsCndsToAdd { 89 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 90 if err := subobj.GotenValidate(); err != nil { 91 return gotenvalidate.NewValidationError("WatchAlertDataResponse", "tsCndsToAdd", obj.TsCndsToAdd[idx], "nested object validation failed", err) 92 } 93 } 94 } 95 for idx, elem := range obj.LogCndsToAdd { 96 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 97 if err := subobj.GotenValidate(); err != nil { 98 return gotenvalidate.NewValidationError("WatchAlertDataResponse", "logCndsToAdd", obj.LogCndsToAdd[idx], "nested object validation failed", err) 99 } 100 } 101 } 102 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 103 return cvobj.GotenCustomValidate() 104 } 105 return nil 106 }