github.com/cloudwan/edgelq-sdk@v1.15.4/alerting/resources/v1/common/specs.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/alerting/proto/v1/specs.proto 3 // DO NOT EDIT!!! 4 5 package rcommon 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 logging_log "github.com/cloudwan/edgelq-sdk/logging/resources/v1/log" 24 monitoring_common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common" 25 monitoring_time_serie "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/time_serie" 26 meta_resource "github.com/cloudwan/goten-sdk/meta-service/resources/v1/resource" 27 durationpb "google.golang.org/protobuf/types/known/durationpb" 28 fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 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 _ = &logging_log.Log{} 47 _ = &monitoring_common.LabelDescriptor{} 48 _ = &monitoring_time_serie.Point{} 49 _ = &durationpb.Duration{} 50 _ = &fieldmaskpb.FieldMask{} 51 _ = &meta_resource.Resource{} 52 ) 53 54 func (obj *LogCndSpec) GotenValidate() error { 55 if obj == nil { 56 return nil 57 } 58 if obj.Query == nil { 59 return gotenvalidate.NewValidationError("LogCndSpec", "query", obj.Query, "field is required", nil) 60 } 61 if subobj, ok := interface{}(obj.Query).(gotenvalidate.Validator); ok { 62 if err := subobj.GotenValidate(); err != nil { 63 return gotenvalidate.NewValidationError("LogCndSpec", "query", obj.Query, "nested object validation failed", err) 64 } 65 } 66 if len(obj.GroupByLabels) < 1 { 67 return gotenvalidate.NewValidationError("LogCndSpec", "groupByLabels", obj.GroupByLabels, "field must have at least 1 items", nil) 68 } 69 if len(obj.GroupByLabels) > 8 { 70 return gotenvalidate.NewValidationError("LogCndSpec", "groupByLabels", obj.GroupByLabels, "field must have at most 8 items", nil) 71 } 72 if len(obj.GroupByLabels) > 1 { 73 values := make(map[string]struct{}) 74 for _, v := range obj.GroupByLabels { 75 if _, ok := values[v]; ok { 76 return gotenvalidate.NewValidationError("LogCndSpec", "groupByLabels", obj.GroupByLabels, "field must contain unique items", nil) 77 } 78 values[v] = struct{}{} 79 } 80 } 81 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 82 return cvobj.GotenCustomValidate() 83 } 84 return nil 85 } 86 func (obj *LogCndSpec_Query) GotenValidate() error { 87 if obj == nil { 88 return nil 89 } 90 if obj.Trigger == nil { 91 return gotenvalidate.NewValidationError("Query", "trigger", obj.Trigger, "field is required", nil) 92 } 93 if subobj, ok := interface{}(obj.Trigger).(gotenvalidate.Validator); ok { 94 if err := subobj.GotenValidate(); err != nil { 95 return gotenvalidate.NewValidationError("Query", "trigger", obj.Trigger, "nested object validation failed", err) 96 } 97 } 98 if obj.MinDuration != nil && obj.MinDuration.CheckValid() != nil { 99 err := obj.MinDuration.CheckValid() 100 return gotenvalidate.NewValidationError("Query", "minDuration", obj.MinDuration, "could not validate duration", err) 101 } else { 102 d := obj.MinDuration.AsDuration() 103 104 if obj.MinDuration != nil { 105 if !(d >= time.Duration(60000000000)) { 106 return gotenvalidate.NewValidationError("Query", "minDuration", d, "field must be greater or equal to 1m0s", nil) 107 } 108 } 109 } 110 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 111 return cvobj.GotenCustomValidate() 112 } 113 return nil 114 } 115 func (obj *LogCndSpec_Query_LabelTrigger) GotenValidate() error { 116 if obj == nil { 117 return nil 118 } 119 if len(obj.Key) > 64 { 120 return gotenvalidate.NewValidationError("LabelTrigger", "key", obj.Key, "field must contain at most 64 characters", nil) 121 } 122 if obj.Key == "" { 123 return gotenvalidate.NewValidationError("LabelTrigger", "key", obj.Key, "field is required", nil) 124 } 125 if len(obj.Values) < 1 { 126 return gotenvalidate.NewValidationError("LabelTrigger", "values", obj.Values, "field must have at least 1 items", nil) 127 } 128 if len(obj.Values) > 25 { 129 return gotenvalidate.NewValidationError("LabelTrigger", "values", obj.Values, "field must have at most 25 items", nil) 130 } 131 if len(obj.Values) > 1 { 132 values := make(map[string]struct{}) 133 for _, v := range obj.Values { 134 if _, ok := values[v]; ok { 135 return gotenvalidate.NewValidationError("LabelTrigger", "values", obj.Values, "field must contain unique items", nil) 136 } 137 values[v] = struct{}{} 138 } 139 } 140 for _, el := range obj.Values { 141 142 if len(el) > 128 { 143 return gotenvalidate.NewValidationError("LabelTrigger", "values", el, "field must contain at most 128 characters", nil) 144 } 145 if el == "" { 146 return gotenvalidate.NewValidationError("LabelTrigger", "values", el, "field is required", nil) 147 } 148 } 149 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 150 return cvobj.GotenCustomValidate() 151 } 152 return nil 153 } 154 func (obj *LogCndSpec_Query_StringPayloadTrigger) GotenValidate() error { 155 if obj == nil { 156 return nil 157 } 158 if len(obj.ObjectSelector) < 0 { 159 return gotenvalidate.NewValidationError("StringPayloadTrigger", "objectSelector", obj.ObjectSelector, "field must contain at least 0 characters", nil) 160 } 161 if len(obj.ObjectSelector) > 64 { 162 return gotenvalidate.NewValidationError("StringPayloadTrigger", "objectSelector", obj.ObjectSelector, "field must contain at most 64 characters", nil) 163 } 164 if len(obj.Regex) > 64 { 165 return gotenvalidate.NewValidationError("StringPayloadTrigger", "regex", obj.Regex, "field must contain at most 64 characters", nil) 166 } 167 if obj.Regex == "" { 168 return gotenvalidate.NewValidationError("StringPayloadTrigger", "regex", obj.Regex, "field is required", nil) 169 } 170 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 171 return cvobj.GotenCustomValidate() 172 } 173 return nil 174 } 175 func (obj *LogCndSpec_Query_CompositeTrigger) GotenValidate() error { 176 if obj == nil { 177 return nil 178 } 179 for idx, elem := range obj.Triggers { 180 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 181 if err := subobj.GotenValidate(); err != nil { 182 return gotenvalidate.NewValidationError("CompositeTrigger", "triggers", obj.Triggers[idx], "nested object validation failed", err) 183 } 184 } 185 } 186 if _, ok := LogCndSpec_Query_CompositeTrigger_Operator_name[int32(obj.Operator)]; !ok { 187 return gotenvalidate.NewValidationError("CompositeTrigger", "operator", obj.Operator, "field must be a defined enum value", nil) 188 } 189 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 190 return cvobj.GotenCustomValidate() 191 } 192 return nil 193 } 194 func (obj *LogCndSpec_Query_TriggerCnd) GotenValidate() error { 195 if obj == nil { 196 return nil 197 } 198 switch opt := obj.Type.(type) { 199 case *LogCndSpec_Query_TriggerCnd_Label: 200 if subobj, ok := interface{}(opt.Label).(gotenvalidate.Validator); ok { 201 if err := subobj.GotenValidate(); err != nil { 202 return gotenvalidate.NewValidationError("TriggerCnd", "label", opt.Label, "nested object validation failed", err) 203 } 204 } 205 case *LogCndSpec_Query_TriggerCnd_StringContent: 206 if subobj, ok := interface{}(opt.StringContent).(gotenvalidate.Validator); ok { 207 if err := subobj.GotenValidate(); err != nil { 208 return gotenvalidate.NewValidationError("TriggerCnd", "stringContent", opt.StringContent, "nested object validation failed", err) 209 } 210 } 211 case *LogCndSpec_Query_TriggerCnd_Composite: 212 if subobj, ok := interface{}(opt.Composite).(gotenvalidate.Validator); ok { 213 if err := subobj.GotenValidate(); err != nil { 214 return gotenvalidate.NewValidationError("TriggerCnd", "composite", opt.Composite, "nested object validation failed", err) 215 } 216 } 217 default: 218 _ = opt 219 } 220 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 221 return cvobj.GotenCustomValidate() 222 } 223 return nil 224 } 225 func (obj *TsCndSpec) GotenValidate() error { 226 if obj == nil { 227 return nil 228 } 229 for idx, elem := range obj.Queries { 230 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 231 if err := subobj.GotenValidate(); err != nil { 232 return gotenvalidate.NewValidationError("TsCndSpec", "queries", obj.Queries[idx], "nested object validation failed", err) 233 } 234 } 235 } 236 if len(obj.QueryGroupBy) < 0 { 237 return gotenvalidate.NewValidationError("TsCndSpec", "queryGroupBy", obj.QueryGroupBy, "field must have at least 0 items", nil) 238 } 239 if len(obj.QueryGroupBy) > 8 { 240 return gotenvalidate.NewValidationError("TsCndSpec", "queryGroupBy", obj.QueryGroupBy, "field must have at most 8 items", nil) 241 } 242 if len(obj.QueryGroupBy) > 1 { 243 values := make(map[string]struct{}) 244 for _, v := range obj.QueryGroupBy { 245 if _, ok := values[v]; ok { 246 return gotenvalidate.NewValidationError("TsCndSpec", "queryGroupBy", obj.QueryGroupBy, "field must contain unique items", nil) 247 } 248 values[v] = struct{}{} 249 } 250 } 251 if obj.ThresholdAlerting == nil { 252 return gotenvalidate.NewValidationError("TsCndSpec", "thresholdAlerting", obj.ThresholdAlerting, "field is required", nil) 253 } 254 if subobj, ok := interface{}(obj.ThresholdAlerting).(gotenvalidate.Validator); ok { 255 if err := subobj.GotenValidate(); err != nil { 256 return gotenvalidate.NewValidationError("TsCndSpec", "thresholdAlerting", obj.ThresholdAlerting, "nested object validation failed", err) 257 } 258 } 259 for idx, elem := range obj.AnomalyAlerting { 260 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 261 if err := subobj.GotenValidate(); err != nil { 262 return gotenvalidate.NewValidationError("TsCndSpec", "anomalyAlerting", obj.AnomalyAlerting[idx], "nested object validation failed", err) 263 } 264 } 265 } 266 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 267 return cvobj.GotenCustomValidate() 268 } 269 return nil 270 } 271 func (obj *TsCndSpec_Query) GotenValidate() error { 272 if obj == nil { 273 return nil 274 } 275 if len(obj.Name) > 256 { 276 return gotenvalidate.NewValidationError("Query", "name", obj.Name, "field must contain at most 256 characters", nil) 277 } 278 if obj.Name == "" { 279 return gotenvalidate.NewValidationError("Query", "name", obj.Name, "field is required", nil) 280 } 281 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 282 return cvobj.GotenCustomValidate() 283 } 284 return nil 285 } 286 func (obj *TsCndSpec_ThresholdAlertingCfg) GotenValidate() error { 287 if obj == nil { 288 return nil 289 } 290 if _, ok := TsCndSpec_ThresholdAlertingCfg_Operator_name[int32(obj.Operator)]; !ok { 291 return gotenvalidate.NewValidationError("ThresholdAlertingCfg", "operator", obj.Operator, "field must be a defined enum value", nil) 292 } 293 if obj.AlignmentPeriod != nil && obj.AlignmentPeriod.CheckValid() != nil { 294 err := obj.AlignmentPeriod.CheckValid() 295 return gotenvalidate.NewValidationError("ThresholdAlertingCfg", "alignmentPeriod", obj.AlignmentPeriod, "could not validate duration", err) 296 } else { 297 d := obj.AlignmentPeriod.AsDuration() 298 299 if obj.AlignmentPeriod != nil { 300 if d != time.Duration(60000000000) && d != time.Duration(180000000000) && d != time.Duration(300000000000) && d != time.Duration(900000000000) && d != time.Duration(1800000000000) && d != time.Duration(3600000000000) && d != time.Duration(10800000000000) && d != time.Duration(21600000000000) && d != time.Duration(43200000000000) && d != time.Duration(86400000000000) { 301 return gotenvalidate.NewValidationError("ThresholdAlertingCfg", "alignmentPeriod", d, "field must be equal to exactly one of the following values: 1m0s, 3m0s, 5m0s, 15m0s, 30m0s, 1h0m0s, 3h0m0s, 6h0m0s, 12h0m0s, 24h0m0s", nil) 302 } 303 } 304 } 305 if obj.RaiseAfter != nil && obj.RaiseAfter.CheckValid() != nil { 306 err := obj.RaiseAfter.CheckValid() 307 return gotenvalidate.NewValidationError("ThresholdAlertingCfg", "raiseAfter", obj.RaiseAfter, "could not validate duration", err) 308 } else { 309 d := obj.RaiseAfter.AsDuration() 310 311 if obj.RaiseAfter != nil { 312 if !(d > time.Duration(0)) { 313 return gotenvalidate.NewValidationError("ThresholdAlertingCfg", "raiseAfter", d, "field must be greater than 0s", nil) 314 } 315 } 316 } 317 for idx, elem := range obj.PerQueryThresholds { 318 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 319 if err := subobj.GotenValidate(); err != nil { 320 return gotenvalidate.NewValidationError("ThresholdAlertingCfg", "perQueryThresholds", obj.PerQueryThresholds[idx], "nested object validation failed", err) 321 } 322 } 323 } 324 if obj.AdaptiveThresholdsDetectionPeriod != nil && obj.AdaptiveThresholdsDetectionPeriod.CheckValid() != nil { 325 err := obj.AdaptiveThresholdsDetectionPeriod.CheckValid() 326 return gotenvalidate.NewValidationError("ThresholdAlertingCfg", "adaptiveThresholdsDetectionPeriod", obj.AdaptiveThresholdsDetectionPeriod, "could not validate duration", err) 327 } else { 328 d := obj.AdaptiveThresholdsDetectionPeriod.AsDuration() 329 330 if obj.AdaptiveThresholdsDetectionPeriod != nil { 331 if !(d >= time.Duration(0)) { 332 return gotenvalidate.NewValidationError("ThresholdAlertingCfg", "adaptiveThresholdsDetectionPeriod", d, "field must be greater or equal to 0s", nil) 333 } 334 } 335 } 336 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 337 return cvobj.GotenCustomValidate() 338 } 339 return nil 340 } 341 func (obj *TsCndSpec_AnomalyAlertingCfg) GotenValidate() error { 342 if obj == nil { 343 return nil 344 } 345 if obj.AnalysisWindow != nil && obj.AnalysisWindow.CheckValid() != nil { 346 err := obj.AnalysisWindow.CheckValid() 347 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "analysisWindow", obj.AnalysisWindow, "could not validate duration", err) 348 } else { 349 d := obj.AnalysisWindow.AsDuration() 350 351 if obj.AnalysisWindow != nil { 352 if !(d >= time.Duration(1800000000000)) { 353 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "analysisWindow", d, "field must be greater or equal to 30m0s", nil) 354 } 355 } 356 } 357 if obj.StepInterval != nil && obj.StepInterval.CheckValid() != nil { 358 err := obj.StepInterval.CheckValid() 359 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "stepInterval", obj.StepInterval, "could not validate duration", err) 360 } else { 361 d := obj.StepInterval.AsDuration() 362 363 if obj.StepInterval != nil { 364 if !(d >= time.Duration(300000000000)) { 365 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "stepInterval", d, "field must be greater or equal to 5m0s", nil) 366 } 367 } 368 } 369 if obj.TrainStepInterval != nil && obj.TrainStepInterval.CheckValid() != nil { 370 err := obj.TrainStepInterval.CheckValid() 371 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "trainStepInterval", obj.TrainStepInterval, "could not validate duration", err) 372 } else { 373 d := obj.TrainStepInterval.AsDuration() 374 375 if obj.TrainStepInterval != nil { 376 if !(d >= time.Duration(300000000000)) { 377 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "trainStepInterval", d, "field must be greater or equal to 5m0s", nil) 378 } 379 } 380 } 381 if obj.AlignmentPeriod != nil && obj.AlignmentPeriod.CheckValid() != nil { 382 err := obj.AlignmentPeriod.CheckValid() 383 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "alignmentPeriod", obj.AlignmentPeriod, "could not validate duration", err) 384 } else { 385 d := obj.AlignmentPeriod.AsDuration() 386 387 if obj.AlignmentPeriod != nil { 388 if d != time.Duration(60000000000) && d != time.Duration(180000000000) && d != time.Duration(300000000000) && d != time.Duration(900000000000) && d != time.Duration(1800000000000) && d != time.Duration(3600000000000) && d != time.Duration(10800000000000) && d != time.Duration(21600000000000) && d != time.Duration(43200000000000) && d != time.Duration(86400000000000) { 389 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "alignmentPeriod", d, "field must be equal to exactly one of the following values: 1m0s, 3m0s, 5m0s, 15m0s, 30m0s, 1h0m0s, 3h0m0s, 6h0m0s, 12h0m0s, 24h0m0s", nil) 390 } 391 } 392 } 393 if obj.RaiseAfter != nil && obj.RaiseAfter.CheckValid() != nil { 394 err := obj.RaiseAfter.CheckValid() 395 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "raiseAfter", obj.RaiseAfter, "could not validate duration", err) 396 } else { 397 d := obj.RaiseAfter.AsDuration() 398 399 if obj.RaiseAfter != nil { 400 if !(d > time.Duration(0)) { 401 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "raiseAfter", d, "field must be greater than 0s", nil) 402 } 403 } 404 } 405 switch opt := obj.Model.(type) { 406 case *TsCndSpec_AnomalyAlertingCfg_LstmAutoencoder: 407 if subobj, ok := interface{}(opt.LstmAutoencoder).(gotenvalidate.Validator); ok { 408 if err := subobj.GotenValidate(); err != nil { 409 return gotenvalidate.NewValidationError("AnomalyAlertingCfg", "lstmAutoencoder", opt.LstmAutoencoder, "nested object validation failed", err) 410 } 411 } 412 default: 413 _ = opt 414 } 415 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 416 return cvobj.GotenCustomValidate() 417 } 418 return nil 419 } 420 func (obj *TsCndSpec_ThresholdAlertingCfg_AlertingThresholds) GotenValidate() error { 421 if obj == nil { 422 return nil 423 } 424 if subobj, ok := interface{}(obj.MaxUpper).(gotenvalidate.Validator); ok { 425 if err := subobj.GotenValidate(); err != nil { 426 return gotenvalidate.NewValidationError("AlertingThresholds", "maxUpper", obj.MaxUpper, "nested object validation failed", err) 427 } 428 } 429 if subobj, ok := interface{}(obj.MaxLower).(gotenvalidate.Validator); ok { 430 if err := subobj.GotenValidate(); err != nil { 431 return gotenvalidate.NewValidationError("AlertingThresholds", "maxLower", obj.MaxLower, "nested object validation failed", err) 432 } 433 } 434 if subobj, ok := interface{}(obj.MinUpper).(gotenvalidate.Validator); ok { 435 if err := subobj.GotenValidate(); err != nil { 436 return gotenvalidate.NewValidationError("AlertingThresholds", "minUpper", obj.MinUpper, "nested object validation failed", err) 437 } 438 } 439 if subobj, ok := interface{}(obj.MinLower).(gotenvalidate.Validator); ok { 440 if err := subobj.GotenValidate(); err != nil { 441 return gotenvalidate.NewValidationError("AlertingThresholds", "minLower", obj.MinLower, "nested object validation failed", err) 442 } 443 } 444 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 445 return cvobj.GotenCustomValidate() 446 } 447 return nil 448 } 449 func (obj *TsCndSpec_AnomalyAlertingCfg_LstmAutoEncoder) GotenValidate() error { 450 if obj == nil { 451 return nil 452 } 453 if !(obj.HiddenSize >= 8 && obj.HiddenSize <= 64) { 454 return gotenvalidate.NewValidationError("LstmAutoEncoder", "hiddenSize", obj.HiddenSize, "field must be in range [8, 64]", nil) 455 } 456 if !(obj.MaxTrainingEpochs >= 32 && obj.MaxTrainingEpochs <= 1024) { 457 return gotenvalidate.NewValidationError("LstmAutoEncoder", "maxTrainingEpochs", obj.MaxTrainingEpochs, "field must be in range [32, 1024]", nil) 458 } 459 if !(obj.MinTrainingEpochs >= 32 && obj.MinTrainingEpochs <= 1024) { 460 return gotenvalidate.NewValidationError("LstmAutoEncoder", "minTrainingEpochs", obj.MinTrainingEpochs, "field must be in range [32, 1024]", nil) 461 } 462 if obj.TrainingPeriod != nil && obj.TrainingPeriod.CheckValid() != nil { 463 err := obj.TrainingPeriod.CheckValid() 464 return gotenvalidate.NewValidationError("LstmAutoEncoder", "trainingPeriod", obj.TrainingPeriod, "could not validate duration", err) 465 } else { 466 d := obj.TrainingPeriod.AsDuration() 467 468 if obj.TrainingPeriod == nil { 469 return gotenvalidate.NewValidationError("LstmAutoEncoder", "trainingPeriod", d, "field is required", nil) 470 } 471 472 if obj.TrainingPeriod != nil { 473 if !(d >= time.Duration(86400000000000)) { 474 return gotenvalidate.NewValidationError("LstmAutoEncoder", "trainingPeriod", d, "field must be greater or equal to 24h0m0s", nil) 475 } 476 } 477 } 478 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 479 return cvobj.GotenCustomValidate() 480 } 481 return nil 482 } 483 func (obj *PolicySpec) GotenValidate() error { 484 if obj == nil { 485 return nil 486 } 487 if _, ok := PolicySpec_ProcessingLocation_name[int32(obj.ProcessingLocation)]; !ok { 488 return gotenvalidate.NewValidationError("PolicySpec", "processingLocation", obj.ProcessingLocation, "field must be a defined enum value", nil) 489 } 490 if obj.ResourceIdentity == nil { 491 return gotenvalidate.NewValidationError("PolicySpec", "resourceIdentity", obj.ResourceIdentity, "field is required", nil) 492 } 493 if subobj, ok := interface{}(obj.ResourceIdentity).(gotenvalidate.Validator); ok { 494 if err := subobj.GotenValidate(); err != nil { 495 return gotenvalidate.NewValidationError("PolicySpec", "resourceIdentity", obj.ResourceIdentity, "nested object validation failed", err) 496 } 497 } 498 for idx, elem := range obj.SupportingQueries { 499 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 500 if err := subobj.GotenValidate(); err != nil { 501 return gotenvalidate.NewValidationError("PolicySpec", "supportingQueries", obj.SupportingQueries[idx], "nested object validation failed", err) 502 } 503 } 504 } 505 if subobj, ok := interface{}(obj.AiAgent).(gotenvalidate.Validator); ok { 506 if err := subobj.GotenValidate(); err != nil { 507 return gotenvalidate.NewValidationError("PolicySpec", "aiAgent", obj.AiAgent, "nested object validation failed", err) 508 } 509 } 510 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 511 return cvobj.GotenCustomValidate() 512 } 513 return nil 514 } 515 func (obj *PolicySpec_ResourceIdentity) GotenValidate() error { 516 if obj == nil { 517 return nil 518 } 519 for idx, elem := range obj.Labels { 520 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 521 if err := subobj.GotenValidate(); err != nil { 522 return gotenvalidate.NewValidationError("ResourceIdentity", "labels", obj.Labels[idx], "nested object validation failed", err) 523 } 524 } 525 } 526 if len(obj.NamePatterns) < 1 { 527 return gotenvalidate.NewValidationError("ResourceIdentity", "namePatterns", obj.NamePatterns, "field must have at least 1 items", nil) 528 } 529 if len(obj.NamePatterns) > 1 { 530 return gotenvalidate.NewValidationError("ResourceIdentity", "namePatterns", obj.NamePatterns, "field must have at most 1 items", nil) 531 } 532 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 533 return cvobj.GotenCustomValidate() 534 } 535 return nil 536 } 537 func (obj *PolicySpec_SupportingAlertQuery) GotenValidate() error { 538 if obj == nil { 539 return nil 540 } 541 switch opt := obj.Query.(type) { 542 case *PolicySpec_SupportingAlertQuery_TsQuery_: 543 if subobj, ok := interface{}(opt.TsQuery).(gotenvalidate.Validator); ok { 544 if err := subobj.GotenValidate(); err != nil { 545 return gotenvalidate.NewValidationError("SupportingAlertQuery", "tsQuery", opt.TsQuery, "nested object validation failed", err) 546 } 547 } 548 case *PolicySpec_SupportingAlertQuery_LogQuery_: 549 if subobj, ok := interface{}(opt.LogQuery).(gotenvalidate.Validator); ok { 550 if err := subobj.GotenValidate(); err != nil { 551 return gotenvalidate.NewValidationError("SupportingAlertQuery", "logQuery", opt.LogQuery, "nested object validation failed", err) 552 } 553 } 554 case *PolicySpec_SupportingAlertQuery_RestGetQuery_: 555 if subobj, ok := interface{}(opt.RestGetQuery).(gotenvalidate.Validator); ok { 556 if err := subobj.GotenValidate(); err != nil { 557 return gotenvalidate.NewValidationError("SupportingAlertQuery", "restGetQuery", opt.RestGetQuery, "nested object validation failed", err) 558 } 559 } 560 case *PolicySpec_SupportingAlertQuery_RestListQuery_: 561 if subobj, ok := interface{}(opt.RestListQuery).(gotenvalidate.Validator); ok { 562 if err := subobj.GotenValidate(); err != nil { 563 return gotenvalidate.NewValidationError("SupportingAlertQuery", "restListQuery", opt.RestListQuery, "nested object validation failed", err) 564 } 565 } 566 default: 567 _ = opt 568 } 569 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 570 return cvobj.GotenCustomValidate() 571 } 572 return nil 573 } 574 func (obj *PolicySpec_AIAgentHandling) GotenValidate() error { 575 if obj == nil { 576 return nil 577 } 578 if subobj, ok := interface{}(obj.EdgeConnectivity).(gotenvalidate.Validator); ok { 579 if err := subobj.GotenValidate(); err != nil { 580 return gotenvalidate.NewValidationError("AIAgentHandling", "edgeConnectivity", obj.EdgeConnectivity, "nested object validation failed", err) 581 } 582 } 583 for idx, elem := range obj.RemediationOptions { 584 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 585 if err := subobj.GotenValidate(); err != nil { 586 return gotenvalidate.NewValidationError("AIAgentHandling", "remediationOptions", obj.RemediationOptions[idx], "nested object validation failed", err) 587 } 588 } 589 } 590 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 591 return cvobj.GotenCustomValidate() 592 } 593 return nil 594 } 595 func (obj *PolicySpec_ResourceIdentity_LabelInfo) GotenValidate() error { 596 if obj == nil { 597 return nil 598 } 599 if len(obj.Key) > 64 { 600 return gotenvalidate.NewValidationError("LabelInfo", "key", obj.Key, "field must contain at most 64 characters", nil) 601 } 602 if obj.Key == "" { 603 return gotenvalidate.NewValidationError("LabelInfo", "key", obj.Key, "field is required", nil) 604 } 605 if len(obj.Contexts) < 1 { 606 return gotenvalidate.NewValidationError("LabelInfo", "contexts", obj.Contexts, "field must have at least 1 items", nil) 607 } 608 if len(obj.Contexts) > 1 { 609 values := make(map[PolicySpec_ResourceIdentity_LabelInfo_UsageContext]struct{}) 610 for _, v := range obj.Contexts { 611 if _, ok := values[v]; ok { 612 return gotenvalidate.NewValidationError("LabelInfo", "contexts", obj.Contexts, "field must contain unique items", nil) 613 } 614 values[v] = struct{}{} 615 } 616 } 617 for _, el := range obj.Contexts { 618 619 if _, ok := PolicySpec_ResourceIdentity_LabelInfo_UsageContext_name[int32(el)]; !ok { 620 return gotenvalidate.NewValidationError("LabelInfo", "contexts", el, "field must be a defined enum value", nil) 621 } 622 } 623 if len(obj.MappedNameSegment) > 128 { 624 return gotenvalidate.NewValidationError("LabelInfo", "mappedNameSegment", obj.MappedNameSegment, "field must contain at most 128 characters", nil) 625 } 626 if obj.MappedNameSegment == "" { 627 return gotenvalidate.NewValidationError("LabelInfo", "mappedNameSegment", obj.MappedNameSegment, "field is required", nil) 628 } 629 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 630 return cvobj.GotenCustomValidate() 631 } 632 return nil 633 } 634 func (obj *PolicySpec_SupportingAlertQuery_TsQuery) GotenValidate() error { 635 if obj == nil { 636 return nil 637 } 638 if len(obj.Description) > 256 { 639 return gotenvalidate.NewValidationError("TsQuery", "description", obj.Description, "field must contain at most 256 characters", nil) 640 } 641 if obj.Description == "" { 642 return gotenvalidate.NewValidationError("TsQuery", "description", obj.Description, "field is required", nil) 643 } 644 if len(obj.FilterTemplate) > 256 { 645 return gotenvalidate.NewValidationError("TsQuery", "filterTemplate", obj.FilterTemplate, "field must contain at most 256 characters", nil) 646 } 647 if obj.FilterTemplate == "" { 648 return gotenvalidate.NewValidationError("TsQuery", "filterTemplate", obj.FilterTemplate, "field is required", nil) 649 } 650 if obj.Aggregation == nil { 651 return gotenvalidate.NewValidationError("TsQuery", "aggregation", obj.Aggregation, "field is required", nil) 652 } 653 if subobj, ok := interface{}(obj.Aggregation).(gotenvalidate.Validator); ok { 654 if err := subobj.GotenValidate(); err != nil { 655 return gotenvalidate.NewValidationError("TsQuery", "aggregation", obj.Aggregation, "nested object validation failed", err) 656 } 657 } 658 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 659 return cvobj.GotenCustomValidate() 660 } 661 return nil 662 } 663 func (obj *PolicySpec_SupportingAlertQuery_LogQuery) GotenValidate() error { 664 if obj == nil { 665 return nil 666 } 667 if len(obj.Description) > 256 { 668 return gotenvalidate.NewValidationError("LogQuery", "description", obj.Description, "field must contain at most 256 characters", nil) 669 } 670 if obj.Description == "" { 671 return gotenvalidate.NewValidationError("LogQuery", "description", obj.Description, "field is required", nil) 672 } 673 if len(obj.FilterTemplate) > 256 { 674 return gotenvalidate.NewValidationError("LogQuery", "filterTemplate", obj.FilterTemplate, "field must contain at most 256 characters", nil) 675 } 676 if obj.FilterTemplate == "" { 677 return gotenvalidate.NewValidationError("LogQuery", "filterTemplate", obj.FilterTemplate, "field is required", nil) 678 } 679 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 680 return cvobj.GotenCustomValidate() 681 } 682 return nil 683 } 684 func (obj *PolicySpec_SupportingAlertQuery_RestGetQuery) GotenValidate() error { 685 if obj == nil { 686 return nil 687 } 688 if len(obj.Description) > 256 { 689 return gotenvalidate.NewValidationError("RestGetQuery", "description", obj.Description, "field must contain at most 256 characters", nil) 690 } 691 if obj.Description == "" { 692 return gotenvalidate.NewValidationError("RestGetQuery", "description", obj.Description, "field is required", nil) 693 } 694 if uri, err := url.Parse(string(obj.Endpoint)); err != nil { 695 return gotenvalidate.NewValidationError("RestGetQuery", "endpoint", obj.Endpoint, "field must contain a valid URI", nil) 696 } else if !uri.IsAbs() { 697 return gotenvalidate.NewValidationError("RestGetQuery", "endpoint", obj.Endpoint, "field must contain an absolute URI", nil) 698 } 699 if obj.Endpoint == "" { 700 return gotenvalidate.NewValidationError("RestGetQuery", "endpoint", obj.Endpoint, "field is required", nil) 701 } 702 if len(obj.PathTemplate) > 256 { 703 return gotenvalidate.NewValidationError("RestGetQuery", "pathTemplate", obj.PathTemplate, "field must contain at most 256 characters", nil) 704 } 705 if obj.PathTemplate == "" { 706 return gotenvalidate.NewValidationError("RestGetQuery", "pathTemplate", obj.PathTemplate, "field is required", nil) 707 } 708 if len(obj.View) > 32 { 709 return gotenvalidate.NewValidationError("RestGetQuery", "view", obj.View, "field must contain at most 32 characters", nil) 710 } 711 if len(obj.FieldMask) > 512 { 712 return gotenvalidate.NewValidationError("RestGetQuery", "fieldMask", obj.FieldMask, "field must contain at most 512 characters", nil) 713 } 714 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 715 return cvobj.GotenCustomValidate() 716 } 717 return nil 718 } 719 func (obj *PolicySpec_SupportingAlertQuery_RestListQuery) GotenValidate() error { 720 if obj == nil { 721 return nil 722 } 723 if len(obj.Description) > 256 { 724 return gotenvalidate.NewValidationError("RestListQuery", "description", obj.Description, "field must contain at most 256 characters", nil) 725 } 726 if obj.Description == "" { 727 return gotenvalidate.NewValidationError("RestListQuery", "description", obj.Description, "field is required", nil) 728 } 729 if uri, err := url.Parse(string(obj.Endpoint)); err != nil { 730 return gotenvalidate.NewValidationError("RestListQuery", "endpoint", obj.Endpoint, "field must contain a valid URI", nil) 731 } else if !uri.IsAbs() { 732 return gotenvalidate.NewValidationError("RestListQuery", "endpoint", obj.Endpoint, "field must contain an absolute URI", nil) 733 } 734 if obj.Endpoint == "" { 735 return gotenvalidate.NewValidationError("RestListQuery", "endpoint", obj.Endpoint, "field is required", nil) 736 } 737 if len(obj.PathTemplate) > 256 { 738 return gotenvalidate.NewValidationError("RestListQuery", "pathTemplate", obj.PathTemplate, "field must contain at most 256 characters", nil) 739 } 740 if obj.PathTemplate == "" { 741 return gotenvalidate.NewValidationError("RestListQuery", "pathTemplate", obj.PathTemplate, "field is required", nil) 742 } 743 if len(obj.View) > 32 { 744 return gotenvalidate.NewValidationError("RestListQuery", "view", obj.View, "field must contain at most 32 characters", nil) 745 } 746 if len(obj.FieldMask) > 512 { 747 return gotenvalidate.NewValidationError("RestListQuery", "fieldMask", obj.FieldMask, "field must contain at most 512 characters", nil) 748 } 749 if len(obj.FilterTemplate) > 256 { 750 return gotenvalidate.NewValidationError("RestListQuery", "filterTemplate", obj.FilterTemplate, "field must contain at most 256 characters", nil) 751 } 752 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 753 return cvobj.GotenCustomValidate() 754 } 755 return nil 756 } 757 func (obj *PolicySpec_AIAgentHandling_EdgeConnectivity) GotenValidate() error { 758 if obj == nil { 759 return nil 760 } 761 switch opt := obj.Type.(type) { 762 case *PolicySpec_AIAgentHandling_EdgeConnectivity_DeviceSsh: 763 if subobj, ok := interface{}(opt.DeviceSsh).(gotenvalidate.Validator); ok { 764 if err := subobj.GotenValidate(); err != nil { 765 return gotenvalidate.NewValidationError("EdgeConnectivity", "deviceSsh", opt.DeviceSsh, "nested object validation failed", err) 766 } 767 } 768 case *PolicySpec_AIAgentHandling_EdgeConnectivity_ProxiesSsh: 769 if subobj, ok := interface{}(opt.ProxiesSsh).(gotenvalidate.Validator); ok { 770 if err := subobj.GotenValidate(); err != nil { 771 return gotenvalidate.NewValidationError("EdgeConnectivity", "proxiesSsh", opt.ProxiesSsh, "nested object validation failed", err) 772 } 773 } 774 case *PolicySpec_AIAgentHandling_EdgeConnectivity_PodSsh: 775 if subobj, ok := interface{}(opt.PodSsh).(gotenvalidate.Validator); ok { 776 if err := subobj.GotenValidate(); err != nil { 777 return gotenvalidate.NewValidationError("EdgeConnectivity", "podSsh", opt.PodSsh, "nested object validation failed", err) 778 } 779 } 780 default: 781 _ = opt 782 } 783 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 784 return cvobj.GotenCustomValidate() 785 } 786 return nil 787 } 788 func (obj *PolicySpec_AIAgentHandling_Remediation) GotenValidate() error { 789 if obj == nil { 790 return nil 791 } 792 switch opt := obj.Type.(type) { 793 case *PolicySpec_AIAgentHandling_Remediation_FixInSsh: 794 if subobj, ok := interface{}(opt.FixInSsh).(gotenvalidate.Validator); ok { 795 if err := subobj.GotenValidate(); err != nil { 796 return gotenvalidate.NewValidationError("Remediation", "fixInSsh", opt.FixInSsh, "nested object validation failed", err) 797 } 798 } 799 case *PolicySpec_AIAgentHandling_Remediation_Reboot_: 800 if subobj, ok := interface{}(opt.Reboot).(gotenvalidate.Validator); ok { 801 if err := subobj.GotenValidate(); err != nil { 802 return gotenvalidate.NewValidationError("Remediation", "reboot", opt.Reboot, "nested object validation failed", err) 803 } 804 } 805 default: 806 _ = opt 807 } 808 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 809 return cvobj.GotenCustomValidate() 810 } 811 return nil 812 } 813 func (obj *PolicySpec_AIAgentHandling_EdgeConnectivity_DeviceSSH) GotenValidate() error { 814 if obj == nil { 815 return nil 816 } 817 if len(obj.ClientName) > 64 { 818 return gotenvalidate.NewValidationError("DeviceSSH", "clientName", obj.ClientName, "field must contain at most 64 characters", nil) 819 } 820 if obj.ClientName == "" { 821 return gotenvalidate.NewValidationError("DeviceSSH", "clientName", obj.ClientName, "field is required", nil) 822 } 823 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 824 return cvobj.GotenCustomValidate() 825 } 826 return nil 827 } 828 func (obj *PolicySpec_AIAgentHandling_EdgeConnectivity_ProxiesSSH) GotenValidate() error { 829 if obj == nil { 830 return nil 831 } 832 if len(obj.ServiceDomain) > 64 { 833 return gotenvalidate.NewValidationError("ProxiesSSH", "serviceDomain", obj.ServiceDomain, "field must contain at most 64 characters", nil) 834 } 835 if obj.ServiceDomain == "" { 836 return gotenvalidate.NewValidationError("ProxiesSSH", "serviceDomain", obj.ServiceDomain, "field is required", nil) 837 } 838 if len(obj.ProviderNameTmpl) > 256 { 839 return gotenvalidate.NewValidationError("ProxiesSSH", "providerNameTmpl", obj.ProviderNameTmpl, "field must contain at most 256 characters", nil) 840 } 841 if obj.ProviderNameTmpl == "" { 842 return gotenvalidate.NewValidationError("ProxiesSSH", "providerNameTmpl", obj.ProviderNameTmpl, "field is required", nil) 843 } 844 if len(obj.ClientName) > 64 { 845 return gotenvalidate.NewValidationError("ProxiesSSH", "clientName", obj.ClientName, "field must contain at most 64 characters", nil) 846 } 847 if obj.ClientName == "" { 848 return gotenvalidate.NewValidationError("ProxiesSSH", "clientName", obj.ClientName, "field is required", nil) 849 } 850 if len(obj.ServiceName) > 128 { 851 return gotenvalidate.NewValidationError("ProxiesSSH", "serviceName", obj.ServiceName, "field must contain at most 128 characters", nil) 852 } 853 if obj.ServiceName == "" { 854 return gotenvalidate.NewValidationError("ProxiesSSH", "serviceName", obj.ServiceName, "field is required", nil) 855 } 856 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 857 return cvobj.GotenCustomValidate() 858 } 859 return nil 860 } 861 func (obj *PolicySpec_AIAgentHandling_EdgeConnectivity_PodSSH) GotenValidate() error { 862 if obj == nil { 863 return nil 864 } 865 if len(obj.ClientName) > 64 { 866 return gotenvalidate.NewValidationError("PodSSH", "clientName", obj.ClientName, "field must contain at most 64 characters", nil) 867 } 868 if obj.ClientName == "" { 869 return gotenvalidate.NewValidationError("PodSSH", "clientName", obj.ClientName, "field is required", nil) 870 } 871 if len(obj.Username) > 32 { 872 return gotenvalidate.NewValidationError("PodSSH", "username", obj.Username, "field must contain at most 32 characters", nil) 873 } 874 if obj.Username == "" { 875 return gotenvalidate.NewValidationError("PodSSH", "username", obj.Username, "field is required", nil) 876 } 877 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 878 return cvobj.GotenCustomValidate() 879 } 880 return nil 881 } 882 func (obj *PolicySpec_AIAgentHandling_Remediation_FixInSSH) GotenValidate() error { 883 if obj == nil { 884 return nil 885 } 886 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 887 return cvobj.GotenCustomValidate() 888 } 889 return nil 890 } 891 func (obj *PolicySpec_AIAgentHandling_Remediation_Reboot) GotenValidate() error { 892 if obj == nil { 893 return nil 894 } 895 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 896 return cvobj.GotenCustomValidate() 897 } 898 return nil 899 } 900 func (obj *NotificationChannelSpec) GotenValidate() error { 901 if obj == nil { 902 return nil 903 } 904 if _, ok := NotificationChannelSpec_Type_name[int32(obj.Type)]; !ok { 905 return gotenvalidate.NewValidationError("NotificationChannelSpec", "type", obj.Type, "field must be a defined enum value", nil) 906 } 907 for _, el := range obj.EnabledKinds { 908 909 if _, ok := NotificationChannelSpec_EventKind_name[int32(el)]; !ok { 910 return gotenvalidate.NewValidationError("NotificationChannelSpec", "enabledKinds", el, "field must be a defined enum value", nil) 911 } 912 } 913 if subobj, ok := interface{}(obj.Email).(gotenvalidate.Validator); ok { 914 if err := subobj.GotenValidate(); err != nil { 915 return gotenvalidate.NewValidationError("NotificationChannelSpec", "email", obj.Email, "nested object validation failed", err) 916 } 917 } 918 if subobj, ok := interface{}(obj.Slack).(gotenvalidate.Validator); ok { 919 if err := subobj.GotenValidate(); err != nil { 920 return gotenvalidate.NewValidationError("NotificationChannelSpec", "slack", obj.Slack, "nested object validation failed", err) 921 } 922 } 923 if subobj, ok := interface{}(obj.Webhook).(gotenvalidate.Validator); ok { 924 if err := subobj.GotenValidate(); err != nil { 925 return gotenvalidate.NewValidationError("NotificationChannelSpec", "webhook", obj.Webhook, "nested object validation failed", err) 926 } 927 } 928 if !(obj.MaxAlertBodiesInMsg >= 0) { 929 return gotenvalidate.NewValidationError("NotificationChannelSpec", "maxAlertBodiesInMsg", obj.MaxAlertBodiesInMsg, "field must be greater or equal to 0", nil) 930 } 931 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 932 return cvobj.GotenCustomValidate() 933 } 934 return nil 935 } 936 func (obj *NotificationChannelSpec_Email) GotenValidate() error { 937 if obj == nil { 938 return nil 939 } 940 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 941 return cvobj.GotenCustomValidate() 942 } 943 return nil 944 } 945 func (obj *NotificationChannelSpec_Slack) GotenValidate() error { 946 if obj == nil { 947 return nil 948 } 949 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 950 return cvobj.GotenCustomValidate() 951 } 952 return nil 953 } 954 func (obj *NotificationChannelSpec_PagerDuty) GotenValidate() error { 955 if obj == nil { 956 return nil 957 } 958 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 959 return cvobj.GotenCustomValidate() 960 } 961 return nil 962 } 963 func (obj *NotificationChannelSpec_Webhook) GotenValidate() error { 964 if obj == nil { 965 return nil 966 } 967 for idx, elem := range obj.Headers { 968 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 969 if err := subobj.GotenValidate(); err != nil { 970 return gotenvalidate.NewValidationError("Webhook", "headers", obj.Headers[idx], "nested object validation failed", err) 971 } 972 } 973 } 974 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 975 return cvobj.GotenCustomValidate() 976 } 977 return nil 978 } 979 func (obj *NotificationChannelSpec_Webhook_Header) GotenValidate() error { 980 if obj == nil { 981 return nil 982 } 983 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 984 return cvobj.GotenCustomValidate() 985 } 986 return nil 987 } 988 func (obj *AlertingThreshold) GotenValidate() error { 989 if obj == nil { 990 return nil 991 } 992 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 993 return cvobj.GotenCustomValidate() 994 } 995 return nil 996 }