github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/client/v4/alert/alert_service.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/monitoring/proto/v4/alert_service.proto 3 // DO NOT EDIT!!! 4 5 package alert_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/monitoring/resources/v4/alert" 24 alerting_condition "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/alerting_condition" 25 view "github.com/cloudwan/goten-sdk/types/view" 26 watch_type "github.com/cloudwan/goten-sdk/types/watch_type" 27 emptypb "google.golang.org/protobuf/types/known/emptypb" 28 fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 29 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 30 ) 31 32 var ( 33 _ = bytes.Equal 34 _ = errors.New 35 _ = fmt.Errorf 36 _ = net.ParseIP 37 _ = regexp.Match 38 _ = strings.Split 39 _ = time.Now 40 _ = utf8.RuneCountInString 41 _ = url.Parse 42 _ = gotenvalidate.NewValidationError 43 ) 44 45 // make sure we're using proto imports 46 var ( 47 _ = &alert.Alert{} 48 _ = &alerting_condition.AlertingCondition{} 49 _ = &emptypb.Empty{} 50 _ = &fieldmaskpb.FieldMask{} 51 _ = ×tamppb.Timestamp{} 52 _ = view.View(0) 53 _ = watch_type.WatchType(0) 54 ) 55 56 func (obj *GetAlertRequest) GotenValidate() error { 57 if obj == nil { 58 return nil 59 } 60 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 61 return cvobj.GotenCustomValidate() 62 } 63 return nil 64 } 65 func (obj *BatchGetAlertsRequest) GotenValidate() error { 66 if obj == nil { 67 return nil 68 } 69 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 70 return cvobj.GotenCustomValidate() 71 } 72 return nil 73 } 74 func (obj *BatchGetAlertsResponse) GotenValidate() error { 75 if obj == nil { 76 return nil 77 } 78 for idx, elem := range obj.Alerts { 79 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 80 if err := subobj.GotenValidate(); err != nil { 81 return gotenvalidate.NewValidationError("BatchGetAlertsResponse", "alerts", obj.Alerts[idx], "nested object validation failed", err) 82 } 83 } 84 } 85 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 86 return cvobj.GotenCustomValidate() 87 } 88 return nil 89 } 90 func (obj *ListAlertsRequest) GotenValidate() error { 91 if obj == nil { 92 return nil 93 } 94 if !(obj.PageSize >= 0) { 95 return gotenvalidate.NewValidationError("ListAlertsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil) 96 } 97 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 98 return cvobj.GotenCustomValidate() 99 } 100 return nil 101 } 102 func (obj *ListAlertsResponse) GotenValidate() error { 103 if obj == nil { 104 return nil 105 } 106 for idx, elem := range obj.Alerts { 107 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 108 if err := subobj.GotenValidate(); err != nil { 109 return gotenvalidate.NewValidationError("ListAlertsResponse", "alerts", obj.Alerts[idx], "nested object validation failed", err) 110 } 111 } 112 } 113 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 114 return cvobj.GotenCustomValidate() 115 } 116 return nil 117 } 118 func (obj *WatchAlertRequest) GotenValidate() error { 119 if obj == nil { 120 return nil 121 } 122 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 123 return cvobj.GotenCustomValidate() 124 } 125 return nil 126 } 127 func (obj *WatchAlertResponse) GotenValidate() error { 128 if obj == nil { 129 return nil 130 } 131 if subobj, ok := interface{}(obj.Change).(gotenvalidate.Validator); ok { 132 if err := subobj.GotenValidate(); err != nil { 133 return gotenvalidate.NewValidationError("WatchAlertResponse", "change", obj.Change, "nested object validation failed", err) 134 } 135 } 136 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 137 return cvobj.GotenCustomValidate() 138 } 139 return nil 140 } 141 func (obj *WatchAlertsRequest) GotenValidate() error { 142 if obj == nil { 143 return nil 144 } 145 if !(obj.PageSize >= 0) { 146 return gotenvalidate.NewValidationError("WatchAlertsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil) 147 } 148 if !(obj.MaxChunkSize >= 0 && obj.MaxChunkSize <= 100) { 149 return gotenvalidate.NewValidationError("WatchAlertsRequest", "maxChunkSize", obj.MaxChunkSize, "field must be in range [0, 100]", nil) 150 } 151 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 152 return cvobj.GotenCustomValidate() 153 } 154 return nil 155 } 156 func (obj *WatchAlertsResponse) GotenValidate() error { 157 if obj == nil { 158 return nil 159 } 160 for idx, elem := range obj.AlertChanges { 161 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 162 if err := subobj.GotenValidate(); err != nil { 163 return gotenvalidate.NewValidationError("WatchAlertsResponse", "alertChanges", obj.AlertChanges[idx], "nested object validation failed", err) 164 } 165 } 166 } 167 if subobj, ok := interface{}(obj.PageTokenChange).(gotenvalidate.Validator); ok { 168 if err := subobj.GotenValidate(); err != nil { 169 return gotenvalidate.NewValidationError("WatchAlertsResponse", "pageTokenChange", obj.PageTokenChange, "nested object validation failed", err) 170 } 171 } 172 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 173 return cvobj.GotenCustomValidate() 174 } 175 return nil 176 } 177 func (obj *WatchAlertsResponse_PageTokenChange) GotenValidate() error { 178 if obj == nil { 179 return nil 180 } 181 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 182 return cvobj.GotenCustomValidate() 183 } 184 return nil 185 } 186 func (obj *UpdateAlertRequest) GotenValidate() error { 187 if obj == nil { 188 return nil 189 } 190 if obj.Alert == nil { 191 return gotenvalidate.NewValidationError("UpdateAlertRequest", "alert", obj.Alert, "field is required", nil) 192 } 193 if subobj, ok := interface{}(obj.Alert).(gotenvalidate.Validator); ok { 194 if err := subobj.GotenValidate(); err != nil { 195 return gotenvalidate.NewValidationError("UpdateAlertRequest", "alert", obj.Alert, "nested object validation failed", err) 196 } 197 } 198 if subobj, ok := interface{}(obj.Cas).(gotenvalidate.Validator); ok { 199 if err := subobj.GotenValidate(); err != nil { 200 return gotenvalidate.NewValidationError("UpdateAlertRequest", "cas", obj.Cas, "nested object validation failed", err) 201 } 202 } 203 if subobj, ok := interface{}(obj.ResponseMask).(gotenvalidate.Validator); ok { 204 if err := subobj.GotenValidate(); err != nil { 205 return gotenvalidate.NewValidationError("UpdateAlertRequest", "responseMask", obj.ResponseMask, "nested object validation failed", err) 206 } 207 } 208 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 209 return cvobj.GotenCustomValidate() 210 } 211 return nil 212 } 213 func (obj *UpdateAlertRequest_CAS) GotenValidate() error { 214 if obj == nil { 215 return nil 216 } 217 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 218 return cvobj.GotenCustomValidate() 219 } 220 return nil 221 } 222 func (obj *UpdateAlertRequest_ResponseMask) GotenValidate() error { 223 if obj == nil { 224 return nil 225 } 226 switch opt := obj.Masking.(type) { 227 case *UpdateAlertRequest_ResponseMask_SkipEntireResponseBody: 228 case *UpdateAlertRequest_ResponseMask_UpdatedFieldsOnly: 229 case *UpdateAlertRequest_ResponseMask_BodyMask: 230 default: 231 _ = opt 232 } 233 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 234 return cvobj.GotenCustomValidate() 235 } 236 return nil 237 } 238 func (obj *DeleteAlertRequest) GotenValidate() error { 239 if obj == nil { 240 return nil 241 } 242 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 243 return cvobj.GotenCustomValidate() 244 } 245 return nil 246 }