go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/cv/api/config/v2/config.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: go.chromium.org/luci/cv/api/config/v2/config.proto 3 4 package cfgpb 5 6 import ( 7 "bytes" 8 "errors" 9 "fmt" 10 "net" 11 "net/mail" 12 "net/url" 13 "regexp" 14 "sort" 15 "strings" 16 "time" 17 "unicode/utf8" 18 19 "google.golang.org/protobuf/types/known/anypb" 20 21 cvpb "go.chromium.org/luci/cv/api/v1" 22 ) 23 24 // ensure the imports are used 25 var ( 26 _ = bytes.MinRead 27 _ = errors.New("") 28 _ = fmt.Print 29 _ = utf8.UTFMax 30 _ = (*regexp.Regexp)(nil) 31 _ = (*strings.Reader)(nil) 32 _ = net.IPv4len 33 _ = time.Duration(0) 34 _ = (*url.URL)(nil) 35 _ = (*mail.Address)(nil) 36 _ = anypb.Any{} 37 _ = sort.Sort 38 39 _ = cvpb.Run_Status(0) 40 ) 41 42 // Validate checks the field values on Config with the rules defined in the 43 // proto definition for this message. If any rules are violated, the first 44 // error encountered is returned, or nil if there are no violations. 45 func (m *Config) Validate() error { 46 return m.validate(false) 47 } 48 49 // ValidateAll checks the field values on Config with the rules defined in the 50 // proto definition for this message. If any rules are violated, the result is 51 // a list of violation errors wrapped in ConfigMultiError, or nil if none found. 52 func (m *Config) ValidateAll() error { 53 return m.validate(true) 54 } 55 56 func (m *Config) validate(all bool) error { 57 if m == nil { 58 return nil 59 } 60 61 var errors []error 62 63 // no validation rules for DrainingStartTime 64 65 // no validation rules for CqStatusHost 66 67 if all { 68 switch v := interface{}(m.GetSubmitOptions()).(type) { 69 case interface{ ValidateAll() error }: 70 if err := v.ValidateAll(); err != nil { 71 errors = append(errors, ConfigValidationError{ 72 field: "SubmitOptions", 73 reason: "embedded message failed validation", 74 cause: err, 75 }) 76 } 77 case interface{ Validate() error }: 78 if err := v.Validate(); err != nil { 79 errors = append(errors, ConfigValidationError{ 80 field: "SubmitOptions", 81 reason: "embedded message failed validation", 82 cause: err, 83 }) 84 } 85 } 86 } else if v, ok := interface{}(m.GetSubmitOptions()).(interface{ Validate() error }); ok { 87 if err := v.Validate(); err != nil { 88 return ConfigValidationError{ 89 field: "SubmitOptions", 90 reason: "embedded message failed validation", 91 cause: err, 92 } 93 } 94 } 95 96 for idx, item := range m.GetConfigGroups() { 97 _, _ = idx, item 98 99 if all { 100 switch v := interface{}(item).(type) { 101 case interface{ ValidateAll() error }: 102 if err := v.ValidateAll(); err != nil { 103 errors = append(errors, ConfigValidationError{ 104 field: fmt.Sprintf("ConfigGroups[%v]", idx), 105 reason: "embedded message failed validation", 106 cause: err, 107 }) 108 } 109 case interface{ Validate() error }: 110 if err := v.Validate(); err != nil { 111 errors = append(errors, ConfigValidationError{ 112 field: fmt.Sprintf("ConfigGroups[%v]", idx), 113 reason: "embedded message failed validation", 114 cause: err, 115 }) 116 } 117 } 118 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 119 if err := v.Validate(); err != nil { 120 return ConfigValidationError{ 121 field: fmt.Sprintf("ConfigGroups[%v]", idx), 122 reason: "embedded message failed validation", 123 cause: err, 124 } 125 } 126 } 127 128 } 129 130 // no validation rules for ProjectScopedAccount 131 132 if len(errors) > 0 { 133 return ConfigMultiError(errors) 134 } 135 136 return nil 137 } 138 139 // ConfigMultiError is an error wrapping multiple validation errors returned by 140 // Config.ValidateAll() if the designated constraints aren't met. 141 type ConfigMultiError []error 142 143 // Error returns a concatenation of all the error messages it wraps. 144 func (m ConfigMultiError) Error() string { 145 var msgs []string 146 for _, err := range m { 147 msgs = append(msgs, err.Error()) 148 } 149 return strings.Join(msgs, "; ") 150 } 151 152 // AllErrors returns a list of validation violation errors. 153 func (m ConfigMultiError) AllErrors() []error { return m } 154 155 // ConfigValidationError is the validation error returned by Config.Validate if 156 // the designated constraints aren't met. 157 type ConfigValidationError struct { 158 field string 159 reason string 160 cause error 161 key bool 162 } 163 164 // Field function returns field value. 165 func (e ConfigValidationError) Field() string { return e.field } 166 167 // Reason function returns reason value. 168 func (e ConfigValidationError) Reason() string { return e.reason } 169 170 // Cause function returns cause value. 171 func (e ConfigValidationError) Cause() error { return e.cause } 172 173 // Key function returns key value. 174 func (e ConfigValidationError) Key() bool { return e.key } 175 176 // ErrorName returns error name. 177 func (e ConfigValidationError) ErrorName() string { return "ConfigValidationError" } 178 179 // Error satisfies the builtin error interface 180 func (e ConfigValidationError) Error() string { 181 cause := "" 182 if e.cause != nil { 183 cause = fmt.Sprintf(" | caused by: %v", e.cause) 184 } 185 186 key := "" 187 if e.key { 188 key = "key for " 189 } 190 191 return fmt.Sprintf( 192 "invalid %sConfig.%s: %s%s", 193 key, 194 e.field, 195 e.reason, 196 cause) 197 } 198 199 var _ error = ConfigValidationError{} 200 201 var _ interface { 202 Field() string 203 Reason() string 204 Key() bool 205 Cause() error 206 ErrorName() string 207 } = ConfigValidationError{} 208 209 // Validate checks the field values on ConfigGroup with the rules defined in 210 // the proto definition for this message. If any rules are violated, the first 211 // error encountered is returned, or nil if there are no violations. 212 func (m *ConfigGroup) Validate() error { 213 return m.validate(false) 214 } 215 216 // ValidateAll checks the field values on ConfigGroup with the rules defined in 217 // the proto definition for this message. If any rules are violated, the 218 // result is a list of violation errors wrapped in ConfigGroupMultiError, or 219 // nil if none found. 220 func (m *ConfigGroup) ValidateAll() error { 221 return m.validate(true) 222 } 223 224 func (m *ConfigGroup) validate(all bool) error { 225 if m == nil { 226 return nil 227 } 228 229 var errors []error 230 231 // no validation rules for Name 232 233 for idx, item := range m.GetGerrit() { 234 _, _ = idx, item 235 236 if all { 237 switch v := interface{}(item).(type) { 238 case interface{ ValidateAll() error }: 239 if err := v.ValidateAll(); err != nil { 240 errors = append(errors, ConfigGroupValidationError{ 241 field: fmt.Sprintf("Gerrit[%v]", idx), 242 reason: "embedded message failed validation", 243 cause: err, 244 }) 245 } 246 case interface{ Validate() error }: 247 if err := v.Validate(); err != nil { 248 errors = append(errors, ConfigGroupValidationError{ 249 field: fmt.Sprintf("Gerrit[%v]", idx), 250 reason: "embedded message failed validation", 251 cause: err, 252 }) 253 } 254 } 255 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 256 if err := v.Validate(); err != nil { 257 return ConfigGroupValidationError{ 258 field: fmt.Sprintf("Gerrit[%v]", idx), 259 reason: "embedded message failed validation", 260 cause: err, 261 } 262 } 263 } 264 265 } 266 267 if all { 268 switch v := interface{}(m.GetCombineCls()).(type) { 269 case interface{ ValidateAll() error }: 270 if err := v.ValidateAll(); err != nil { 271 errors = append(errors, ConfigGroupValidationError{ 272 field: "CombineCls", 273 reason: "embedded message failed validation", 274 cause: err, 275 }) 276 } 277 case interface{ Validate() error }: 278 if err := v.Validate(); err != nil { 279 errors = append(errors, ConfigGroupValidationError{ 280 field: "CombineCls", 281 reason: "embedded message failed validation", 282 cause: err, 283 }) 284 } 285 } 286 } else if v, ok := interface{}(m.GetCombineCls()).(interface{ Validate() error }); ok { 287 if err := v.Validate(); err != nil { 288 return ConfigGroupValidationError{ 289 field: "CombineCls", 290 reason: "embedded message failed validation", 291 cause: err, 292 } 293 } 294 } 295 296 if all { 297 switch v := interface{}(m.GetVerifiers()).(type) { 298 case interface{ ValidateAll() error }: 299 if err := v.ValidateAll(); err != nil { 300 errors = append(errors, ConfigGroupValidationError{ 301 field: "Verifiers", 302 reason: "embedded message failed validation", 303 cause: err, 304 }) 305 } 306 case interface{ Validate() error }: 307 if err := v.Validate(); err != nil { 308 errors = append(errors, ConfigGroupValidationError{ 309 field: "Verifiers", 310 reason: "embedded message failed validation", 311 cause: err, 312 }) 313 } 314 } 315 } else if v, ok := interface{}(m.GetVerifiers()).(interface{ Validate() error }); ok { 316 if err := v.Validate(); err != nil { 317 return ConfigGroupValidationError{ 318 field: "Verifiers", 319 reason: "embedded message failed validation", 320 cause: err, 321 } 322 } 323 } 324 325 // no validation rules for Fallback 326 327 for idx, item := range m.GetAdditionalModes() { 328 _, _ = idx, item 329 330 if all { 331 switch v := interface{}(item).(type) { 332 case interface{ ValidateAll() error }: 333 if err := v.ValidateAll(); err != nil { 334 errors = append(errors, ConfigGroupValidationError{ 335 field: fmt.Sprintf("AdditionalModes[%v]", idx), 336 reason: "embedded message failed validation", 337 cause: err, 338 }) 339 } 340 case interface{ Validate() error }: 341 if err := v.Validate(); err != nil { 342 errors = append(errors, ConfigGroupValidationError{ 343 field: fmt.Sprintf("AdditionalModes[%v]", idx), 344 reason: "embedded message failed validation", 345 cause: err, 346 }) 347 } 348 } 349 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 350 if err := v.Validate(); err != nil { 351 return ConfigGroupValidationError{ 352 field: fmt.Sprintf("AdditionalModes[%v]", idx), 353 reason: "embedded message failed validation", 354 cause: err, 355 } 356 } 357 } 358 359 } 360 361 for idx, item := range m.GetUserLimits() { 362 _, _ = idx, item 363 364 if all { 365 switch v := interface{}(item).(type) { 366 case interface{ ValidateAll() error }: 367 if err := v.ValidateAll(); err != nil { 368 errors = append(errors, ConfigGroupValidationError{ 369 field: fmt.Sprintf("UserLimits[%v]", idx), 370 reason: "embedded message failed validation", 371 cause: err, 372 }) 373 } 374 case interface{ Validate() error }: 375 if err := v.Validate(); err != nil { 376 errors = append(errors, ConfigGroupValidationError{ 377 field: fmt.Sprintf("UserLimits[%v]", idx), 378 reason: "embedded message failed validation", 379 cause: err, 380 }) 381 } 382 } 383 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 384 if err := v.Validate(); err != nil { 385 return ConfigGroupValidationError{ 386 field: fmt.Sprintf("UserLimits[%v]", idx), 387 reason: "embedded message failed validation", 388 cause: err, 389 } 390 } 391 } 392 393 } 394 395 if all { 396 switch v := interface{}(m.GetUserLimitDefault()).(type) { 397 case interface{ ValidateAll() error }: 398 if err := v.ValidateAll(); err != nil { 399 errors = append(errors, ConfigGroupValidationError{ 400 field: "UserLimitDefault", 401 reason: "embedded message failed validation", 402 cause: err, 403 }) 404 } 405 case interface{ Validate() error }: 406 if err := v.Validate(); err != nil { 407 errors = append(errors, ConfigGroupValidationError{ 408 field: "UserLimitDefault", 409 reason: "embedded message failed validation", 410 cause: err, 411 }) 412 } 413 } 414 } else if v, ok := interface{}(m.GetUserLimitDefault()).(interface{ Validate() error }); ok { 415 if err := v.Validate(); err != nil { 416 return ConfigGroupValidationError{ 417 field: "UserLimitDefault", 418 reason: "embedded message failed validation", 419 cause: err, 420 } 421 } 422 } 423 424 for idx, item := range m.GetPostActions() { 425 _, _ = idx, item 426 427 if item == nil { 428 err := ConfigGroupValidationError{ 429 field: fmt.Sprintf("PostActions[%v]", idx), 430 reason: "value is required", 431 } 432 if !all { 433 return err 434 } 435 errors = append(errors, err) 436 } 437 438 if all { 439 switch v := interface{}(item).(type) { 440 case interface{ ValidateAll() error }: 441 if err := v.ValidateAll(); err != nil { 442 errors = append(errors, ConfigGroupValidationError{ 443 field: fmt.Sprintf("PostActions[%v]", idx), 444 reason: "embedded message failed validation", 445 cause: err, 446 }) 447 } 448 case interface{ Validate() error }: 449 if err := v.Validate(); err != nil { 450 errors = append(errors, ConfigGroupValidationError{ 451 field: fmt.Sprintf("PostActions[%v]", idx), 452 reason: "embedded message failed validation", 453 cause: err, 454 }) 455 } 456 } 457 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 458 if err := v.Validate(); err != nil { 459 return ConfigGroupValidationError{ 460 field: fmt.Sprintf("PostActions[%v]", idx), 461 reason: "embedded message failed validation", 462 cause: err, 463 } 464 } 465 } 466 467 } 468 469 for idx, item := range m.GetTryjobExperiments() { 470 _, _ = idx, item 471 472 if item == nil { 473 err := ConfigGroupValidationError{ 474 field: fmt.Sprintf("TryjobExperiments[%v]", idx), 475 reason: "value is required", 476 } 477 if !all { 478 return err 479 } 480 errors = append(errors, err) 481 } 482 483 if all { 484 switch v := interface{}(item).(type) { 485 case interface{ ValidateAll() error }: 486 if err := v.ValidateAll(); err != nil { 487 errors = append(errors, ConfigGroupValidationError{ 488 field: fmt.Sprintf("TryjobExperiments[%v]", idx), 489 reason: "embedded message failed validation", 490 cause: err, 491 }) 492 } 493 case interface{ Validate() error }: 494 if err := v.Validate(); err != nil { 495 errors = append(errors, ConfigGroupValidationError{ 496 field: fmt.Sprintf("TryjobExperiments[%v]", idx), 497 reason: "embedded message failed validation", 498 cause: err, 499 }) 500 } 501 } 502 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 503 if err := v.Validate(); err != nil { 504 return ConfigGroupValidationError{ 505 field: fmt.Sprintf("TryjobExperiments[%v]", idx), 506 reason: "embedded message failed validation", 507 cause: err, 508 } 509 } 510 } 511 512 } 513 514 if len(errors) > 0 { 515 return ConfigGroupMultiError(errors) 516 } 517 518 return nil 519 } 520 521 // ConfigGroupMultiError is an error wrapping multiple validation errors 522 // returned by ConfigGroup.ValidateAll() if the designated constraints aren't met. 523 type ConfigGroupMultiError []error 524 525 // Error returns a concatenation of all the error messages it wraps. 526 func (m ConfigGroupMultiError) Error() string { 527 var msgs []string 528 for _, err := range m { 529 msgs = append(msgs, err.Error()) 530 } 531 return strings.Join(msgs, "; ") 532 } 533 534 // AllErrors returns a list of validation violation errors. 535 func (m ConfigGroupMultiError) AllErrors() []error { return m } 536 537 // ConfigGroupValidationError is the validation error returned by 538 // ConfigGroup.Validate if the designated constraints aren't met. 539 type ConfigGroupValidationError struct { 540 field string 541 reason string 542 cause error 543 key bool 544 } 545 546 // Field function returns field value. 547 func (e ConfigGroupValidationError) Field() string { return e.field } 548 549 // Reason function returns reason value. 550 func (e ConfigGroupValidationError) Reason() string { return e.reason } 551 552 // Cause function returns cause value. 553 func (e ConfigGroupValidationError) Cause() error { return e.cause } 554 555 // Key function returns key value. 556 func (e ConfigGroupValidationError) Key() bool { return e.key } 557 558 // ErrorName returns error name. 559 func (e ConfigGroupValidationError) ErrorName() string { return "ConfigGroupValidationError" } 560 561 // Error satisfies the builtin error interface 562 func (e ConfigGroupValidationError) Error() string { 563 cause := "" 564 if e.cause != nil { 565 cause = fmt.Sprintf(" | caused by: %v", e.cause) 566 } 567 568 key := "" 569 if e.key { 570 key = "key for " 571 } 572 573 return fmt.Sprintf( 574 "invalid %sConfigGroup.%s: %s%s", 575 key, 576 e.field, 577 e.reason, 578 cause) 579 } 580 581 var _ error = ConfigGroupValidationError{} 582 583 var _ interface { 584 Field() string 585 Reason() string 586 Key() bool 587 Cause() error 588 ErrorName() string 589 } = ConfigGroupValidationError{} 590 591 // Validate checks the field values on SubmitOptions with the rules defined in 592 // the proto definition for this message. If any rules are violated, the first 593 // error encountered is returned, or nil if there are no violations. 594 func (m *SubmitOptions) Validate() error { 595 return m.validate(false) 596 } 597 598 // ValidateAll checks the field values on SubmitOptions with the rules defined 599 // in the proto definition for this message. If any rules are violated, the 600 // result is a list of violation errors wrapped in SubmitOptionsMultiError, or 601 // nil if none found. 602 func (m *SubmitOptions) ValidateAll() error { 603 return m.validate(true) 604 } 605 606 func (m *SubmitOptions) validate(all bool) error { 607 if m == nil { 608 return nil 609 } 610 611 var errors []error 612 613 // no validation rules for MaxBurst 614 615 if all { 616 switch v := interface{}(m.GetBurstDelay()).(type) { 617 case interface{ ValidateAll() error }: 618 if err := v.ValidateAll(); err != nil { 619 errors = append(errors, SubmitOptionsValidationError{ 620 field: "BurstDelay", 621 reason: "embedded message failed validation", 622 cause: err, 623 }) 624 } 625 case interface{ Validate() error }: 626 if err := v.Validate(); err != nil { 627 errors = append(errors, SubmitOptionsValidationError{ 628 field: "BurstDelay", 629 reason: "embedded message failed validation", 630 cause: err, 631 }) 632 } 633 } 634 } else if v, ok := interface{}(m.GetBurstDelay()).(interface{ Validate() error }); ok { 635 if err := v.Validate(); err != nil { 636 return SubmitOptionsValidationError{ 637 field: "BurstDelay", 638 reason: "embedded message failed validation", 639 cause: err, 640 } 641 } 642 } 643 644 if len(errors) > 0 { 645 return SubmitOptionsMultiError(errors) 646 } 647 648 return nil 649 } 650 651 // SubmitOptionsMultiError is an error wrapping multiple validation errors 652 // returned by SubmitOptions.ValidateAll() if the designated constraints 653 // aren't met. 654 type SubmitOptionsMultiError []error 655 656 // Error returns a concatenation of all the error messages it wraps. 657 func (m SubmitOptionsMultiError) Error() string { 658 var msgs []string 659 for _, err := range m { 660 msgs = append(msgs, err.Error()) 661 } 662 return strings.Join(msgs, "; ") 663 } 664 665 // AllErrors returns a list of validation violation errors. 666 func (m SubmitOptionsMultiError) AllErrors() []error { return m } 667 668 // SubmitOptionsValidationError is the validation error returned by 669 // SubmitOptions.Validate if the designated constraints aren't met. 670 type SubmitOptionsValidationError struct { 671 field string 672 reason string 673 cause error 674 key bool 675 } 676 677 // Field function returns field value. 678 func (e SubmitOptionsValidationError) Field() string { return e.field } 679 680 // Reason function returns reason value. 681 func (e SubmitOptionsValidationError) Reason() string { return e.reason } 682 683 // Cause function returns cause value. 684 func (e SubmitOptionsValidationError) Cause() error { return e.cause } 685 686 // Key function returns key value. 687 func (e SubmitOptionsValidationError) Key() bool { return e.key } 688 689 // ErrorName returns error name. 690 func (e SubmitOptionsValidationError) ErrorName() string { return "SubmitOptionsValidationError" } 691 692 // Error satisfies the builtin error interface 693 func (e SubmitOptionsValidationError) Error() string { 694 cause := "" 695 if e.cause != nil { 696 cause = fmt.Sprintf(" | caused by: %v", e.cause) 697 } 698 699 key := "" 700 if e.key { 701 key = "key for " 702 } 703 704 return fmt.Sprintf( 705 "invalid %sSubmitOptions.%s: %s%s", 706 key, 707 e.field, 708 e.reason, 709 cause) 710 } 711 712 var _ error = SubmitOptionsValidationError{} 713 714 var _ interface { 715 Field() string 716 Reason() string 717 Key() bool 718 Cause() error 719 ErrorName() string 720 } = SubmitOptionsValidationError{} 721 722 // Validate checks the field values on Mode with the rules defined in the proto 723 // definition for this message. If any rules are violated, the first error 724 // encountered is returned, or nil if there are no violations. 725 func (m *Mode) Validate() error { 726 return m.validate(false) 727 } 728 729 // ValidateAll checks the field values on Mode with the rules defined in the 730 // proto definition for this message. If any rules are violated, the result is 731 // a list of violation errors wrapped in ModeMultiError, or nil if none found. 732 func (m *Mode) ValidateAll() error { 733 return m.validate(true) 734 } 735 736 func (m *Mode) validate(all bool) error { 737 if m == nil { 738 return nil 739 } 740 741 var errors []error 742 743 if _, ok := _Mode_Name_NotInLookup[m.GetName()]; ok { 744 err := ModeValidationError{ 745 field: "Name", 746 reason: "value must not be in list [DRY_RUN FULL_RUN NEW_PATCHSET_RUN]", 747 } 748 if !all { 749 return err 750 } 751 errors = append(errors, err) 752 } 753 754 if !_Mode_Name_Pattern.MatchString(m.GetName()) { 755 err := ModeValidationError{ 756 field: "Name", 757 reason: "value does not match regex pattern \"^[A-Z][A-Z_]{0,39}$\"", 758 } 759 if !all { 760 return err 761 } 762 errors = append(errors, err) 763 } 764 765 if _, ok := _Mode_CqLabelValue_InLookup[m.GetCqLabelValue()]; !ok { 766 err := ModeValidationError{ 767 field: "CqLabelValue", 768 reason: "value must be in list [1 2]", 769 } 770 if !all { 771 return err 772 } 773 errors = append(errors, err) 774 } 775 776 if _, ok := _Mode_TriggeringLabel_NotInLookup[m.GetTriggeringLabel()]; ok { 777 err := ModeValidationError{ 778 field: "TriggeringLabel", 779 reason: "value must not be in list [Commit-Queue]", 780 } 781 if !all { 782 return err 783 } 784 errors = append(errors, err) 785 } 786 787 if utf8.RuneCountInString(m.GetTriggeringLabel()) < 1 { 788 err := ModeValidationError{ 789 field: "TriggeringLabel", 790 reason: "value length must be at least 1 runes", 791 } 792 if !all { 793 return err 794 } 795 errors = append(errors, err) 796 } 797 798 if m.GetTriggeringValue() <= 0 { 799 err := ModeValidationError{ 800 field: "TriggeringValue", 801 reason: "value must be greater than 0", 802 } 803 if !all { 804 return err 805 } 806 errors = append(errors, err) 807 } 808 809 if len(errors) > 0 { 810 return ModeMultiError(errors) 811 } 812 813 return nil 814 } 815 816 // ModeMultiError is an error wrapping multiple validation errors returned by 817 // Mode.ValidateAll() if the designated constraints aren't met. 818 type ModeMultiError []error 819 820 // Error returns a concatenation of all the error messages it wraps. 821 func (m ModeMultiError) Error() string { 822 var msgs []string 823 for _, err := range m { 824 msgs = append(msgs, err.Error()) 825 } 826 return strings.Join(msgs, "; ") 827 } 828 829 // AllErrors returns a list of validation violation errors. 830 func (m ModeMultiError) AllErrors() []error { return m } 831 832 // ModeValidationError is the validation error returned by Mode.Validate if the 833 // designated constraints aren't met. 834 type ModeValidationError struct { 835 field string 836 reason string 837 cause error 838 key bool 839 } 840 841 // Field function returns field value. 842 func (e ModeValidationError) Field() string { return e.field } 843 844 // Reason function returns reason value. 845 func (e ModeValidationError) Reason() string { return e.reason } 846 847 // Cause function returns cause value. 848 func (e ModeValidationError) Cause() error { return e.cause } 849 850 // Key function returns key value. 851 func (e ModeValidationError) Key() bool { return e.key } 852 853 // ErrorName returns error name. 854 func (e ModeValidationError) ErrorName() string { return "ModeValidationError" } 855 856 // Error satisfies the builtin error interface 857 func (e ModeValidationError) Error() string { 858 cause := "" 859 if e.cause != nil { 860 cause = fmt.Sprintf(" | caused by: %v", e.cause) 861 } 862 863 key := "" 864 if e.key { 865 key = "key for " 866 } 867 868 return fmt.Sprintf( 869 "invalid %sMode.%s: %s%s", 870 key, 871 e.field, 872 e.reason, 873 cause) 874 } 875 876 var _ error = ModeValidationError{} 877 878 var _ interface { 879 Field() string 880 Reason() string 881 Key() bool 882 Cause() error 883 ErrorName() string 884 } = ModeValidationError{} 885 886 var _Mode_Name_NotInLookup = map[string]struct{}{ 887 "DRY_RUN": {}, 888 "FULL_RUN": {}, 889 "NEW_PATCHSET_RUN": {}, 890 } 891 892 var _Mode_Name_Pattern = regexp.MustCompile("^[A-Z][A-Z_]{0,39}$") 893 894 var _Mode_CqLabelValue_InLookup = map[int32]struct{}{ 895 1: {}, 896 2: {}, 897 } 898 899 var _Mode_TriggeringLabel_NotInLookup = map[string]struct{}{ 900 "Commit-Queue": {}, 901 } 902 903 // Validate checks the field values on CombineCLs with the rules defined in the 904 // proto definition for this message. If any rules are violated, the first 905 // error encountered is returned, or nil if there are no violations. 906 func (m *CombineCLs) Validate() error { 907 return m.validate(false) 908 } 909 910 // ValidateAll checks the field values on CombineCLs with the rules defined in 911 // the proto definition for this message. If any rules are violated, the 912 // result is a list of violation errors wrapped in CombineCLsMultiError, or 913 // nil if none found. 914 func (m *CombineCLs) ValidateAll() error { 915 return m.validate(true) 916 } 917 918 func (m *CombineCLs) validate(all bool) error { 919 if m == nil { 920 return nil 921 } 922 923 var errors []error 924 925 if all { 926 switch v := interface{}(m.GetStabilizationDelay()).(type) { 927 case interface{ ValidateAll() error }: 928 if err := v.ValidateAll(); err != nil { 929 errors = append(errors, CombineCLsValidationError{ 930 field: "StabilizationDelay", 931 reason: "embedded message failed validation", 932 cause: err, 933 }) 934 } 935 case interface{ Validate() error }: 936 if err := v.Validate(); err != nil { 937 errors = append(errors, CombineCLsValidationError{ 938 field: "StabilizationDelay", 939 reason: "embedded message failed validation", 940 cause: err, 941 }) 942 } 943 } 944 } else if v, ok := interface{}(m.GetStabilizationDelay()).(interface{ Validate() error }); ok { 945 if err := v.Validate(); err != nil { 946 return CombineCLsValidationError{ 947 field: "StabilizationDelay", 948 reason: "embedded message failed validation", 949 cause: err, 950 } 951 } 952 } 953 954 if len(errors) > 0 { 955 return CombineCLsMultiError(errors) 956 } 957 958 return nil 959 } 960 961 // CombineCLsMultiError is an error wrapping multiple validation errors 962 // returned by CombineCLs.ValidateAll() if the designated constraints aren't met. 963 type CombineCLsMultiError []error 964 965 // Error returns a concatenation of all the error messages it wraps. 966 func (m CombineCLsMultiError) Error() string { 967 var msgs []string 968 for _, err := range m { 969 msgs = append(msgs, err.Error()) 970 } 971 return strings.Join(msgs, "; ") 972 } 973 974 // AllErrors returns a list of validation violation errors. 975 func (m CombineCLsMultiError) AllErrors() []error { return m } 976 977 // CombineCLsValidationError is the validation error returned by 978 // CombineCLs.Validate if the designated constraints aren't met. 979 type CombineCLsValidationError struct { 980 field string 981 reason string 982 cause error 983 key bool 984 } 985 986 // Field function returns field value. 987 func (e CombineCLsValidationError) Field() string { return e.field } 988 989 // Reason function returns reason value. 990 func (e CombineCLsValidationError) Reason() string { return e.reason } 991 992 // Cause function returns cause value. 993 func (e CombineCLsValidationError) Cause() error { return e.cause } 994 995 // Key function returns key value. 996 func (e CombineCLsValidationError) Key() bool { return e.key } 997 998 // ErrorName returns error name. 999 func (e CombineCLsValidationError) ErrorName() string { return "CombineCLsValidationError" } 1000 1001 // Error satisfies the builtin error interface 1002 func (e CombineCLsValidationError) Error() string { 1003 cause := "" 1004 if e.cause != nil { 1005 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1006 } 1007 1008 key := "" 1009 if e.key { 1010 key = "key for " 1011 } 1012 1013 return fmt.Sprintf( 1014 "invalid %sCombineCLs.%s: %s%s", 1015 key, 1016 e.field, 1017 e.reason, 1018 cause) 1019 } 1020 1021 var _ error = CombineCLsValidationError{} 1022 1023 var _ interface { 1024 Field() string 1025 Reason() string 1026 Key() bool 1027 Cause() error 1028 ErrorName() string 1029 } = CombineCLsValidationError{} 1030 1031 // Validate checks the field values on Verifiers with the rules defined in the 1032 // proto definition for this message. If any rules are violated, the first 1033 // error encountered is returned, or nil if there are no violations. 1034 func (m *Verifiers) Validate() error { 1035 return m.validate(false) 1036 } 1037 1038 // ValidateAll checks the field values on Verifiers with the rules defined in 1039 // the proto definition for this message. If any rules are violated, the 1040 // result is a list of violation errors wrapped in VerifiersMultiError, or nil 1041 // if none found. 1042 func (m *Verifiers) ValidateAll() error { 1043 return m.validate(true) 1044 } 1045 1046 func (m *Verifiers) validate(all bool) error { 1047 if m == nil { 1048 return nil 1049 } 1050 1051 var errors []error 1052 1053 if all { 1054 switch v := interface{}(m.GetGerritCqAbility()).(type) { 1055 case interface{ ValidateAll() error }: 1056 if err := v.ValidateAll(); err != nil { 1057 errors = append(errors, VerifiersValidationError{ 1058 field: "GerritCqAbility", 1059 reason: "embedded message failed validation", 1060 cause: err, 1061 }) 1062 } 1063 case interface{ Validate() error }: 1064 if err := v.Validate(); err != nil { 1065 errors = append(errors, VerifiersValidationError{ 1066 field: "GerritCqAbility", 1067 reason: "embedded message failed validation", 1068 cause: err, 1069 }) 1070 } 1071 } 1072 } else if v, ok := interface{}(m.GetGerritCqAbility()).(interface{ Validate() error }); ok { 1073 if err := v.Validate(); err != nil { 1074 return VerifiersValidationError{ 1075 field: "GerritCqAbility", 1076 reason: "embedded message failed validation", 1077 cause: err, 1078 } 1079 } 1080 } 1081 1082 if all { 1083 switch v := interface{}(m.GetTreeStatus()).(type) { 1084 case interface{ ValidateAll() error }: 1085 if err := v.ValidateAll(); err != nil { 1086 errors = append(errors, VerifiersValidationError{ 1087 field: "TreeStatus", 1088 reason: "embedded message failed validation", 1089 cause: err, 1090 }) 1091 } 1092 case interface{ Validate() error }: 1093 if err := v.Validate(); err != nil { 1094 errors = append(errors, VerifiersValidationError{ 1095 field: "TreeStatus", 1096 reason: "embedded message failed validation", 1097 cause: err, 1098 }) 1099 } 1100 } 1101 } else if v, ok := interface{}(m.GetTreeStatus()).(interface{ Validate() error }); ok { 1102 if err := v.Validate(); err != nil { 1103 return VerifiersValidationError{ 1104 field: "TreeStatus", 1105 reason: "embedded message failed validation", 1106 cause: err, 1107 } 1108 } 1109 } 1110 1111 if all { 1112 switch v := interface{}(m.GetTryjob()).(type) { 1113 case interface{ ValidateAll() error }: 1114 if err := v.ValidateAll(); err != nil { 1115 errors = append(errors, VerifiersValidationError{ 1116 field: "Tryjob", 1117 reason: "embedded message failed validation", 1118 cause: err, 1119 }) 1120 } 1121 case interface{ Validate() error }: 1122 if err := v.Validate(); err != nil { 1123 errors = append(errors, VerifiersValidationError{ 1124 field: "Tryjob", 1125 reason: "embedded message failed validation", 1126 cause: err, 1127 }) 1128 } 1129 } 1130 } else if v, ok := interface{}(m.GetTryjob()).(interface{ Validate() error }); ok { 1131 if err := v.Validate(); err != nil { 1132 return VerifiersValidationError{ 1133 field: "Tryjob", 1134 reason: "embedded message failed validation", 1135 cause: err, 1136 } 1137 } 1138 } 1139 1140 if all { 1141 switch v := interface{}(m.GetCqlinter()).(type) { 1142 case interface{ ValidateAll() error }: 1143 if err := v.ValidateAll(); err != nil { 1144 errors = append(errors, VerifiersValidationError{ 1145 field: "Cqlinter", 1146 reason: "embedded message failed validation", 1147 cause: err, 1148 }) 1149 } 1150 case interface{ Validate() error }: 1151 if err := v.Validate(); err != nil { 1152 errors = append(errors, VerifiersValidationError{ 1153 field: "Cqlinter", 1154 reason: "embedded message failed validation", 1155 cause: err, 1156 }) 1157 } 1158 } 1159 } else if v, ok := interface{}(m.GetCqlinter()).(interface{ Validate() error }); ok { 1160 if err := v.Validate(); err != nil { 1161 return VerifiersValidationError{ 1162 field: "Cqlinter", 1163 reason: "embedded message failed validation", 1164 cause: err, 1165 } 1166 } 1167 } 1168 1169 if all { 1170 switch v := interface{}(m.GetFake()).(type) { 1171 case interface{ ValidateAll() error }: 1172 if err := v.ValidateAll(); err != nil { 1173 errors = append(errors, VerifiersValidationError{ 1174 field: "Fake", 1175 reason: "embedded message failed validation", 1176 cause: err, 1177 }) 1178 } 1179 case interface{ Validate() error }: 1180 if err := v.Validate(); err != nil { 1181 errors = append(errors, VerifiersValidationError{ 1182 field: "Fake", 1183 reason: "embedded message failed validation", 1184 cause: err, 1185 }) 1186 } 1187 } 1188 } else if v, ok := interface{}(m.GetFake()).(interface{ Validate() error }); ok { 1189 if err := v.Validate(); err != nil { 1190 return VerifiersValidationError{ 1191 field: "Fake", 1192 reason: "embedded message failed validation", 1193 cause: err, 1194 } 1195 } 1196 } 1197 1198 if len(errors) > 0 { 1199 return VerifiersMultiError(errors) 1200 } 1201 1202 return nil 1203 } 1204 1205 // VerifiersMultiError is an error wrapping multiple validation errors returned 1206 // by Verifiers.ValidateAll() if the designated constraints aren't met. 1207 type VerifiersMultiError []error 1208 1209 // Error returns a concatenation of all the error messages it wraps. 1210 func (m VerifiersMultiError) Error() string { 1211 var msgs []string 1212 for _, err := range m { 1213 msgs = append(msgs, err.Error()) 1214 } 1215 return strings.Join(msgs, "; ") 1216 } 1217 1218 // AllErrors returns a list of validation violation errors. 1219 func (m VerifiersMultiError) AllErrors() []error { return m } 1220 1221 // VerifiersValidationError is the validation error returned by 1222 // Verifiers.Validate if the designated constraints aren't met. 1223 type VerifiersValidationError struct { 1224 field string 1225 reason string 1226 cause error 1227 key bool 1228 } 1229 1230 // Field function returns field value. 1231 func (e VerifiersValidationError) Field() string { return e.field } 1232 1233 // Reason function returns reason value. 1234 func (e VerifiersValidationError) Reason() string { return e.reason } 1235 1236 // Cause function returns cause value. 1237 func (e VerifiersValidationError) Cause() error { return e.cause } 1238 1239 // Key function returns key value. 1240 func (e VerifiersValidationError) Key() bool { return e.key } 1241 1242 // ErrorName returns error name. 1243 func (e VerifiersValidationError) ErrorName() string { return "VerifiersValidationError" } 1244 1245 // Error satisfies the builtin error interface 1246 func (e VerifiersValidationError) Error() string { 1247 cause := "" 1248 if e.cause != nil { 1249 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1250 } 1251 1252 key := "" 1253 if e.key { 1254 key = "key for " 1255 } 1256 1257 return fmt.Sprintf( 1258 "invalid %sVerifiers.%s: %s%s", 1259 key, 1260 e.field, 1261 e.reason, 1262 cause) 1263 } 1264 1265 var _ error = VerifiersValidationError{} 1266 1267 var _ interface { 1268 Field() string 1269 Reason() string 1270 Key() bool 1271 Cause() error 1272 ErrorName() string 1273 } = VerifiersValidationError{} 1274 1275 // Validate checks the field values on UserLimit with the rules defined in the 1276 // proto definition for this message. If any rules are violated, the first 1277 // error encountered is returned, or nil if there are no violations. 1278 func (m *UserLimit) Validate() error { 1279 return m.validate(false) 1280 } 1281 1282 // ValidateAll checks the field values on UserLimit with the rules defined in 1283 // the proto definition for this message. If any rules are violated, the 1284 // result is a list of violation errors wrapped in UserLimitMultiError, or nil 1285 // if none found. 1286 func (m *UserLimit) ValidateAll() error { 1287 return m.validate(true) 1288 } 1289 1290 func (m *UserLimit) validate(all bool) error { 1291 if m == nil { 1292 return nil 1293 } 1294 1295 var errors []error 1296 1297 // no validation rules for Name 1298 1299 if all { 1300 switch v := interface{}(m.GetRun()).(type) { 1301 case interface{ ValidateAll() error }: 1302 if err := v.ValidateAll(); err != nil { 1303 errors = append(errors, UserLimitValidationError{ 1304 field: "Run", 1305 reason: "embedded message failed validation", 1306 cause: err, 1307 }) 1308 } 1309 case interface{ Validate() error }: 1310 if err := v.Validate(); err != nil { 1311 errors = append(errors, UserLimitValidationError{ 1312 field: "Run", 1313 reason: "embedded message failed validation", 1314 cause: err, 1315 }) 1316 } 1317 } 1318 } else if v, ok := interface{}(m.GetRun()).(interface{ Validate() error }); ok { 1319 if err := v.Validate(); err != nil { 1320 return UserLimitValidationError{ 1321 field: "Run", 1322 reason: "embedded message failed validation", 1323 cause: err, 1324 } 1325 } 1326 } 1327 1328 if all { 1329 switch v := interface{}(m.GetTryjob()).(type) { 1330 case interface{ ValidateAll() error }: 1331 if err := v.ValidateAll(); err != nil { 1332 errors = append(errors, UserLimitValidationError{ 1333 field: "Tryjob", 1334 reason: "embedded message failed validation", 1335 cause: err, 1336 }) 1337 } 1338 case interface{ Validate() error }: 1339 if err := v.Validate(); err != nil { 1340 errors = append(errors, UserLimitValidationError{ 1341 field: "Tryjob", 1342 reason: "embedded message failed validation", 1343 cause: err, 1344 }) 1345 } 1346 } 1347 } else if v, ok := interface{}(m.GetTryjob()).(interface{ Validate() error }); ok { 1348 if err := v.Validate(); err != nil { 1349 return UserLimitValidationError{ 1350 field: "Tryjob", 1351 reason: "embedded message failed validation", 1352 cause: err, 1353 } 1354 } 1355 } 1356 1357 if len(errors) > 0 { 1358 return UserLimitMultiError(errors) 1359 } 1360 1361 return nil 1362 } 1363 1364 // UserLimitMultiError is an error wrapping multiple validation errors returned 1365 // by UserLimit.ValidateAll() if the designated constraints aren't met. 1366 type UserLimitMultiError []error 1367 1368 // Error returns a concatenation of all the error messages it wraps. 1369 func (m UserLimitMultiError) Error() string { 1370 var msgs []string 1371 for _, err := range m { 1372 msgs = append(msgs, err.Error()) 1373 } 1374 return strings.Join(msgs, "; ") 1375 } 1376 1377 // AllErrors returns a list of validation violation errors. 1378 func (m UserLimitMultiError) AllErrors() []error { return m } 1379 1380 // UserLimitValidationError is the validation error returned by 1381 // UserLimit.Validate if the designated constraints aren't met. 1382 type UserLimitValidationError struct { 1383 field string 1384 reason string 1385 cause error 1386 key bool 1387 } 1388 1389 // Field function returns field value. 1390 func (e UserLimitValidationError) Field() string { return e.field } 1391 1392 // Reason function returns reason value. 1393 func (e UserLimitValidationError) Reason() string { return e.reason } 1394 1395 // Cause function returns cause value. 1396 func (e UserLimitValidationError) Cause() error { return e.cause } 1397 1398 // Key function returns key value. 1399 func (e UserLimitValidationError) Key() bool { return e.key } 1400 1401 // ErrorName returns error name. 1402 func (e UserLimitValidationError) ErrorName() string { return "UserLimitValidationError" } 1403 1404 // Error satisfies the builtin error interface 1405 func (e UserLimitValidationError) Error() string { 1406 cause := "" 1407 if e.cause != nil { 1408 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1409 } 1410 1411 key := "" 1412 if e.key { 1413 key = "key for " 1414 } 1415 1416 return fmt.Sprintf( 1417 "invalid %sUserLimit.%s: %s%s", 1418 key, 1419 e.field, 1420 e.reason, 1421 cause) 1422 } 1423 1424 var _ error = UserLimitValidationError{} 1425 1426 var _ interface { 1427 Field() string 1428 Reason() string 1429 Key() bool 1430 Cause() error 1431 ErrorName() string 1432 } = UserLimitValidationError{} 1433 1434 // Validate checks the field values on ConfigGroup_Gerrit with the rules 1435 // defined in the proto definition for this message. If any rules are 1436 // violated, the first error encountered is returned, or nil if there are no violations. 1437 func (m *ConfigGroup_Gerrit) Validate() error { 1438 return m.validate(false) 1439 } 1440 1441 // ValidateAll checks the field values on ConfigGroup_Gerrit with the rules 1442 // defined in the proto definition for this message. If any rules are 1443 // violated, the result is a list of violation errors wrapped in 1444 // ConfigGroup_GerritMultiError, or nil if none found. 1445 func (m *ConfigGroup_Gerrit) ValidateAll() error { 1446 return m.validate(true) 1447 } 1448 1449 func (m *ConfigGroup_Gerrit) validate(all bool) error { 1450 if m == nil { 1451 return nil 1452 } 1453 1454 var errors []error 1455 1456 // no validation rules for Url 1457 1458 for idx, item := range m.GetProjects() { 1459 _, _ = idx, item 1460 1461 if all { 1462 switch v := interface{}(item).(type) { 1463 case interface{ ValidateAll() error }: 1464 if err := v.ValidateAll(); err != nil { 1465 errors = append(errors, ConfigGroup_GerritValidationError{ 1466 field: fmt.Sprintf("Projects[%v]", idx), 1467 reason: "embedded message failed validation", 1468 cause: err, 1469 }) 1470 } 1471 case interface{ Validate() error }: 1472 if err := v.Validate(); err != nil { 1473 errors = append(errors, ConfigGroup_GerritValidationError{ 1474 field: fmt.Sprintf("Projects[%v]", idx), 1475 reason: "embedded message failed validation", 1476 cause: err, 1477 }) 1478 } 1479 } 1480 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1481 if err := v.Validate(); err != nil { 1482 return ConfigGroup_GerritValidationError{ 1483 field: fmt.Sprintf("Projects[%v]", idx), 1484 reason: "embedded message failed validation", 1485 cause: err, 1486 } 1487 } 1488 } 1489 1490 } 1491 1492 if len(errors) > 0 { 1493 return ConfigGroup_GerritMultiError(errors) 1494 } 1495 1496 return nil 1497 } 1498 1499 // ConfigGroup_GerritMultiError is an error wrapping multiple validation errors 1500 // returned by ConfigGroup_Gerrit.ValidateAll() if the designated constraints 1501 // aren't met. 1502 type ConfigGroup_GerritMultiError []error 1503 1504 // Error returns a concatenation of all the error messages it wraps. 1505 func (m ConfigGroup_GerritMultiError) Error() string { 1506 var msgs []string 1507 for _, err := range m { 1508 msgs = append(msgs, err.Error()) 1509 } 1510 return strings.Join(msgs, "; ") 1511 } 1512 1513 // AllErrors returns a list of validation violation errors. 1514 func (m ConfigGroup_GerritMultiError) AllErrors() []error { return m } 1515 1516 // ConfigGroup_GerritValidationError is the validation error returned by 1517 // ConfigGroup_Gerrit.Validate if the designated constraints aren't met. 1518 type ConfigGroup_GerritValidationError struct { 1519 field string 1520 reason string 1521 cause error 1522 key bool 1523 } 1524 1525 // Field function returns field value. 1526 func (e ConfigGroup_GerritValidationError) Field() string { return e.field } 1527 1528 // Reason function returns reason value. 1529 func (e ConfigGroup_GerritValidationError) Reason() string { return e.reason } 1530 1531 // Cause function returns cause value. 1532 func (e ConfigGroup_GerritValidationError) Cause() error { return e.cause } 1533 1534 // Key function returns key value. 1535 func (e ConfigGroup_GerritValidationError) Key() bool { return e.key } 1536 1537 // ErrorName returns error name. 1538 func (e ConfigGroup_GerritValidationError) ErrorName() string { 1539 return "ConfigGroup_GerritValidationError" 1540 } 1541 1542 // Error satisfies the builtin error interface 1543 func (e ConfigGroup_GerritValidationError) Error() string { 1544 cause := "" 1545 if e.cause != nil { 1546 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1547 } 1548 1549 key := "" 1550 if e.key { 1551 key = "key for " 1552 } 1553 1554 return fmt.Sprintf( 1555 "invalid %sConfigGroup_Gerrit.%s: %s%s", 1556 key, 1557 e.field, 1558 e.reason, 1559 cause) 1560 } 1561 1562 var _ error = ConfigGroup_GerritValidationError{} 1563 1564 var _ interface { 1565 Field() string 1566 Reason() string 1567 Key() bool 1568 Cause() error 1569 ErrorName() string 1570 } = ConfigGroup_GerritValidationError{} 1571 1572 // Validate checks the field values on ConfigGroup_PostAction with the rules 1573 // defined in the proto definition for this message. If any rules are 1574 // violated, the first error encountered is returned, or nil if there are no violations. 1575 func (m *ConfigGroup_PostAction) Validate() error { 1576 return m.validate(false) 1577 } 1578 1579 // ValidateAll checks the field values on ConfigGroup_PostAction with the rules 1580 // defined in the proto definition for this message. If any rules are 1581 // violated, the result is a list of violation errors wrapped in 1582 // ConfigGroup_PostActionMultiError, or nil if none found. 1583 func (m *ConfigGroup_PostAction) ValidateAll() error { 1584 return m.validate(true) 1585 } 1586 1587 func (m *ConfigGroup_PostAction) validate(all bool) error { 1588 if m == nil { 1589 return nil 1590 } 1591 1592 var errors []error 1593 1594 if utf8.RuneCountInString(m.GetName()) < 1 { 1595 err := ConfigGroup_PostActionValidationError{ 1596 field: "Name", 1597 reason: "value length must be at least 1 runes", 1598 } 1599 if !all { 1600 return err 1601 } 1602 errors = append(errors, err) 1603 } 1604 1605 if len(m.GetConditions()) < 1 { 1606 err := ConfigGroup_PostActionValidationError{ 1607 field: "Conditions", 1608 reason: "value must contain at least 1 item(s)", 1609 } 1610 if !all { 1611 return err 1612 } 1613 errors = append(errors, err) 1614 } 1615 1616 for idx, item := range m.GetConditions() { 1617 _, _ = idx, item 1618 1619 if item == nil { 1620 err := ConfigGroup_PostActionValidationError{ 1621 field: fmt.Sprintf("Conditions[%v]", idx), 1622 reason: "value is required", 1623 } 1624 if !all { 1625 return err 1626 } 1627 errors = append(errors, err) 1628 } 1629 1630 if all { 1631 switch v := interface{}(item).(type) { 1632 case interface{ ValidateAll() error }: 1633 if err := v.ValidateAll(); err != nil { 1634 errors = append(errors, ConfigGroup_PostActionValidationError{ 1635 field: fmt.Sprintf("Conditions[%v]", idx), 1636 reason: "embedded message failed validation", 1637 cause: err, 1638 }) 1639 } 1640 case interface{ Validate() error }: 1641 if err := v.Validate(); err != nil { 1642 errors = append(errors, ConfigGroup_PostActionValidationError{ 1643 field: fmt.Sprintf("Conditions[%v]", idx), 1644 reason: "embedded message failed validation", 1645 cause: err, 1646 }) 1647 } 1648 } 1649 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1650 if err := v.Validate(); err != nil { 1651 return ConfigGroup_PostActionValidationError{ 1652 field: fmt.Sprintf("Conditions[%v]", idx), 1653 reason: "embedded message failed validation", 1654 cause: err, 1655 } 1656 } 1657 } 1658 1659 } 1660 1661 oneofActionPresent := false 1662 switch v := m.Action.(type) { 1663 case *ConfigGroup_PostAction_VoteGerritLabels_: 1664 if v == nil { 1665 err := ConfigGroup_PostActionValidationError{ 1666 field: "Action", 1667 reason: "oneof value cannot be a typed-nil", 1668 } 1669 if !all { 1670 return err 1671 } 1672 errors = append(errors, err) 1673 } 1674 oneofActionPresent = true 1675 1676 if all { 1677 switch v := interface{}(m.GetVoteGerritLabels()).(type) { 1678 case interface{ ValidateAll() error }: 1679 if err := v.ValidateAll(); err != nil { 1680 errors = append(errors, ConfigGroup_PostActionValidationError{ 1681 field: "VoteGerritLabels", 1682 reason: "embedded message failed validation", 1683 cause: err, 1684 }) 1685 } 1686 case interface{ Validate() error }: 1687 if err := v.Validate(); err != nil { 1688 errors = append(errors, ConfigGroup_PostActionValidationError{ 1689 field: "VoteGerritLabels", 1690 reason: "embedded message failed validation", 1691 cause: err, 1692 }) 1693 } 1694 } 1695 } else if v, ok := interface{}(m.GetVoteGerritLabels()).(interface{ Validate() error }); ok { 1696 if err := v.Validate(); err != nil { 1697 return ConfigGroup_PostActionValidationError{ 1698 field: "VoteGerritLabels", 1699 reason: "embedded message failed validation", 1700 cause: err, 1701 } 1702 } 1703 } 1704 1705 default: 1706 _ = v // ensures v is used 1707 } 1708 if !oneofActionPresent { 1709 err := ConfigGroup_PostActionValidationError{ 1710 field: "Action", 1711 reason: "value is required", 1712 } 1713 if !all { 1714 return err 1715 } 1716 errors = append(errors, err) 1717 } 1718 1719 if len(errors) > 0 { 1720 return ConfigGroup_PostActionMultiError(errors) 1721 } 1722 1723 return nil 1724 } 1725 1726 // ConfigGroup_PostActionMultiError is an error wrapping multiple validation 1727 // errors returned by ConfigGroup_PostAction.ValidateAll() if the designated 1728 // constraints aren't met. 1729 type ConfigGroup_PostActionMultiError []error 1730 1731 // Error returns a concatenation of all the error messages it wraps. 1732 func (m ConfigGroup_PostActionMultiError) Error() string { 1733 var msgs []string 1734 for _, err := range m { 1735 msgs = append(msgs, err.Error()) 1736 } 1737 return strings.Join(msgs, "; ") 1738 } 1739 1740 // AllErrors returns a list of validation violation errors. 1741 func (m ConfigGroup_PostActionMultiError) AllErrors() []error { return m } 1742 1743 // ConfigGroup_PostActionValidationError is the validation error returned by 1744 // ConfigGroup_PostAction.Validate if the designated constraints aren't met. 1745 type ConfigGroup_PostActionValidationError struct { 1746 field string 1747 reason string 1748 cause error 1749 key bool 1750 } 1751 1752 // Field function returns field value. 1753 func (e ConfigGroup_PostActionValidationError) Field() string { return e.field } 1754 1755 // Reason function returns reason value. 1756 func (e ConfigGroup_PostActionValidationError) Reason() string { return e.reason } 1757 1758 // Cause function returns cause value. 1759 func (e ConfigGroup_PostActionValidationError) Cause() error { return e.cause } 1760 1761 // Key function returns key value. 1762 func (e ConfigGroup_PostActionValidationError) Key() bool { return e.key } 1763 1764 // ErrorName returns error name. 1765 func (e ConfigGroup_PostActionValidationError) ErrorName() string { 1766 return "ConfigGroup_PostActionValidationError" 1767 } 1768 1769 // Error satisfies the builtin error interface 1770 func (e ConfigGroup_PostActionValidationError) Error() string { 1771 cause := "" 1772 if e.cause != nil { 1773 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1774 } 1775 1776 key := "" 1777 if e.key { 1778 key = "key for " 1779 } 1780 1781 return fmt.Sprintf( 1782 "invalid %sConfigGroup_PostAction.%s: %s%s", 1783 key, 1784 e.field, 1785 e.reason, 1786 cause) 1787 } 1788 1789 var _ error = ConfigGroup_PostActionValidationError{} 1790 1791 var _ interface { 1792 Field() string 1793 Reason() string 1794 Key() bool 1795 Cause() error 1796 ErrorName() string 1797 } = ConfigGroup_PostActionValidationError{} 1798 1799 // Validate checks the field values on ConfigGroup_TryjobExperiment with the 1800 // rules defined in the proto definition for this message. If any rules are 1801 // violated, the first error encountered is returned, or nil if there are no violations. 1802 func (m *ConfigGroup_TryjobExperiment) Validate() error { 1803 return m.validate(false) 1804 } 1805 1806 // ValidateAll checks the field values on ConfigGroup_TryjobExperiment with the 1807 // rules defined in the proto definition for this message. If any rules are 1808 // violated, the result is a list of violation errors wrapped in 1809 // ConfigGroup_TryjobExperimentMultiError, or nil if none found. 1810 func (m *ConfigGroup_TryjobExperiment) ValidateAll() error { 1811 return m.validate(true) 1812 } 1813 1814 func (m *ConfigGroup_TryjobExperiment) validate(all bool) error { 1815 if m == nil { 1816 return nil 1817 } 1818 1819 var errors []error 1820 1821 if utf8.RuneCountInString(m.GetName()) < 1 { 1822 err := ConfigGroup_TryjobExperimentValidationError{ 1823 field: "Name", 1824 reason: "value length must be at least 1 runes", 1825 } 1826 if !all { 1827 return err 1828 } 1829 errors = append(errors, err) 1830 } 1831 1832 if all { 1833 switch v := interface{}(m.GetCondition()).(type) { 1834 case interface{ ValidateAll() error }: 1835 if err := v.ValidateAll(); err != nil { 1836 errors = append(errors, ConfigGroup_TryjobExperimentValidationError{ 1837 field: "Condition", 1838 reason: "embedded message failed validation", 1839 cause: err, 1840 }) 1841 } 1842 case interface{ Validate() error }: 1843 if err := v.Validate(); err != nil { 1844 errors = append(errors, ConfigGroup_TryjobExperimentValidationError{ 1845 field: "Condition", 1846 reason: "embedded message failed validation", 1847 cause: err, 1848 }) 1849 } 1850 } 1851 } else if v, ok := interface{}(m.GetCondition()).(interface{ Validate() error }); ok { 1852 if err := v.Validate(); err != nil { 1853 return ConfigGroup_TryjobExperimentValidationError{ 1854 field: "Condition", 1855 reason: "embedded message failed validation", 1856 cause: err, 1857 } 1858 } 1859 } 1860 1861 if len(errors) > 0 { 1862 return ConfigGroup_TryjobExperimentMultiError(errors) 1863 } 1864 1865 return nil 1866 } 1867 1868 // ConfigGroup_TryjobExperimentMultiError is an error wrapping multiple 1869 // validation errors returned by ConfigGroup_TryjobExperiment.ValidateAll() if 1870 // the designated constraints aren't met. 1871 type ConfigGroup_TryjobExperimentMultiError []error 1872 1873 // Error returns a concatenation of all the error messages it wraps. 1874 func (m ConfigGroup_TryjobExperimentMultiError) Error() string { 1875 var msgs []string 1876 for _, err := range m { 1877 msgs = append(msgs, err.Error()) 1878 } 1879 return strings.Join(msgs, "; ") 1880 } 1881 1882 // AllErrors returns a list of validation violation errors. 1883 func (m ConfigGroup_TryjobExperimentMultiError) AllErrors() []error { return m } 1884 1885 // ConfigGroup_TryjobExperimentValidationError is the validation error returned 1886 // by ConfigGroup_TryjobExperiment.Validate if the designated constraints 1887 // aren't met. 1888 type ConfigGroup_TryjobExperimentValidationError struct { 1889 field string 1890 reason string 1891 cause error 1892 key bool 1893 } 1894 1895 // Field function returns field value. 1896 func (e ConfigGroup_TryjobExperimentValidationError) Field() string { return e.field } 1897 1898 // Reason function returns reason value. 1899 func (e ConfigGroup_TryjobExperimentValidationError) Reason() string { return e.reason } 1900 1901 // Cause function returns cause value. 1902 func (e ConfigGroup_TryjobExperimentValidationError) Cause() error { return e.cause } 1903 1904 // Key function returns key value. 1905 func (e ConfigGroup_TryjobExperimentValidationError) Key() bool { return e.key } 1906 1907 // ErrorName returns error name. 1908 func (e ConfigGroup_TryjobExperimentValidationError) ErrorName() string { 1909 return "ConfigGroup_TryjobExperimentValidationError" 1910 } 1911 1912 // Error satisfies the builtin error interface 1913 func (e ConfigGroup_TryjobExperimentValidationError) Error() string { 1914 cause := "" 1915 if e.cause != nil { 1916 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1917 } 1918 1919 key := "" 1920 if e.key { 1921 key = "key for " 1922 } 1923 1924 return fmt.Sprintf( 1925 "invalid %sConfigGroup_TryjobExperiment.%s: %s%s", 1926 key, 1927 e.field, 1928 e.reason, 1929 cause) 1930 } 1931 1932 var _ error = ConfigGroup_TryjobExperimentValidationError{} 1933 1934 var _ interface { 1935 Field() string 1936 Reason() string 1937 Key() bool 1938 Cause() error 1939 ErrorName() string 1940 } = ConfigGroup_TryjobExperimentValidationError{} 1941 1942 // Validate checks the field values on ConfigGroup_Gerrit_Project with the 1943 // rules defined in the proto definition for this message. If any rules are 1944 // violated, the first error encountered is returned, or nil if there are no violations. 1945 func (m *ConfigGroup_Gerrit_Project) Validate() error { 1946 return m.validate(false) 1947 } 1948 1949 // ValidateAll checks the field values on ConfigGroup_Gerrit_Project with the 1950 // rules defined in the proto definition for this message. If any rules are 1951 // violated, the result is a list of violation errors wrapped in 1952 // ConfigGroup_Gerrit_ProjectMultiError, or nil if none found. 1953 func (m *ConfigGroup_Gerrit_Project) ValidateAll() error { 1954 return m.validate(true) 1955 } 1956 1957 func (m *ConfigGroup_Gerrit_Project) validate(all bool) error { 1958 if m == nil { 1959 return nil 1960 } 1961 1962 var errors []error 1963 1964 // no validation rules for Name 1965 1966 if len(errors) > 0 { 1967 return ConfigGroup_Gerrit_ProjectMultiError(errors) 1968 } 1969 1970 return nil 1971 } 1972 1973 // ConfigGroup_Gerrit_ProjectMultiError is an error wrapping multiple 1974 // validation errors returned by ConfigGroup_Gerrit_Project.ValidateAll() if 1975 // the designated constraints aren't met. 1976 type ConfigGroup_Gerrit_ProjectMultiError []error 1977 1978 // Error returns a concatenation of all the error messages it wraps. 1979 func (m ConfigGroup_Gerrit_ProjectMultiError) Error() string { 1980 var msgs []string 1981 for _, err := range m { 1982 msgs = append(msgs, err.Error()) 1983 } 1984 return strings.Join(msgs, "; ") 1985 } 1986 1987 // AllErrors returns a list of validation violation errors. 1988 func (m ConfigGroup_Gerrit_ProjectMultiError) AllErrors() []error { return m } 1989 1990 // ConfigGroup_Gerrit_ProjectValidationError is the validation error returned 1991 // by ConfigGroup_Gerrit_Project.Validate if the designated constraints aren't met. 1992 type ConfigGroup_Gerrit_ProjectValidationError struct { 1993 field string 1994 reason string 1995 cause error 1996 key bool 1997 } 1998 1999 // Field function returns field value. 2000 func (e ConfigGroup_Gerrit_ProjectValidationError) Field() string { return e.field } 2001 2002 // Reason function returns reason value. 2003 func (e ConfigGroup_Gerrit_ProjectValidationError) Reason() string { return e.reason } 2004 2005 // Cause function returns cause value. 2006 func (e ConfigGroup_Gerrit_ProjectValidationError) Cause() error { return e.cause } 2007 2008 // Key function returns key value. 2009 func (e ConfigGroup_Gerrit_ProjectValidationError) Key() bool { return e.key } 2010 2011 // ErrorName returns error name. 2012 func (e ConfigGroup_Gerrit_ProjectValidationError) ErrorName() string { 2013 return "ConfigGroup_Gerrit_ProjectValidationError" 2014 } 2015 2016 // Error satisfies the builtin error interface 2017 func (e ConfigGroup_Gerrit_ProjectValidationError) Error() string { 2018 cause := "" 2019 if e.cause != nil { 2020 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2021 } 2022 2023 key := "" 2024 if e.key { 2025 key = "key for " 2026 } 2027 2028 return fmt.Sprintf( 2029 "invalid %sConfigGroup_Gerrit_Project.%s: %s%s", 2030 key, 2031 e.field, 2032 e.reason, 2033 cause) 2034 } 2035 2036 var _ error = ConfigGroup_Gerrit_ProjectValidationError{} 2037 2038 var _ interface { 2039 Field() string 2040 Reason() string 2041 Key() bool 2042 Cause() error 2043 ErrorName() string 2044 } = ConfigGroup_Gerrit_ProjectValidationError{} 2045 2046 // Validate checks the field values on 2047 // ConfigGroup_PostAction_TriggeringCondition with the rules defined in the 2048 // proto definition for this message. If any rules are violated, the first 2049 // error encountered is returned, or nil if there are no violations. 2050 func (m *ConfigGroup_PostAction_TriggeringCondition) Validate() error { 2051 return m.validate(false) 2052 } 2053 2054 // ValidateAll checks the field values on 2055 // ConfigGroup_PostAction_TriggeringCondition with the rules defined in the 2056 // proto definition for this message. If any rules are violated, the result is 2057 // a list of violation errors wrapped in 2058 // ConfigGroup_PostAction_TriggeringConditionMultiError, or nil if none found. 2059 func (m *ConfigGroup_PostAction_TriggeringCondition) ValidateAll() error { 2060 return m.validate(true) 2061 } 2062 2063 func (m *ConfigGroup_PostAction_TriggeringCondition) validate(all bool) error { 2064 if m == nil { 2065 return nil 2066 } 2067 2068 var errors []error 2069 2070 if utf8.RuneCountInString(m.GetMode()) < 1 { 2071 err := ConfigGroup_PostAction_TriggeringConditionValidationError{ 2072 field: "Mode", 2073 reason: "value length must be at least 1 runes", 2074 } 2075 if !all { 2076 return err 2077 } 2078 errors = append(errors, err) 2079 } 2080 2081 if len(m.GetStatuses()) < 1 { 2082 err := ConfigGroup_PostAction_TriggeringConditionValidationError{ 2083 field: "Statuses", 2084 reason: "value must contain at least 1 item(s)", 2085 } 2086 if !all { 2087 return err 2088 } 2089 errors = append(errors, err) 2090 } 2091 2092 for idx, item := range m.GetStatuses() { 2093 _, _ = idx, item 2094 2095 if _, ok := cvpb.Run_Status_name[int32(item)]; !ok { 2096 err := ConfigGroup_PostAction_TriggeringConditionValidationError{ 2097 field: fmt.Sprintf("Statuses[%v]", idx), 2098 reason: "value must be one of the defined enum values", 2099 } 2100 if !all { 2101 return err 2102 } 2103 errors = append(errors, err) 2104 } 2105 2106 } 2107 2108 if len(errors) > 0 { 2109 return ConfigGroup_PostAction_TriggeringConditionMultiError(errors) 2110 } 2111 2112 return nil 2113 } 2114 2115 // ConfigGroup_PostAction_TriggeringConditionMultiError is an error wrapping 2116 // multiple validation errors returned by 2117 // ConfigGroup_PostAction_TriggeringCondition.ValidateAll() if the designated 2118 // constraints aren't met. 2119 type ConfigGroup_PostAction_TriggeringConditionMultiError []error 2120 2121 // Error returns a concatenation of all the error messages it wraps. 2122 func (m ConfigGroup_PostAction_TriggeringConditionMultiError) Error() string { 2123 var msgs []string 2124 for _, err := range m { 2125 msgs = append(msgs, err.Error()) 2126 } 2127 return strings.Join(msgs, "; ") 2128 } 2129 2130 // AllErrors returns a list of validation violation errors. 2131 func (m ConfigGroup_PostAction_TriggeringConditionMultiError) AllErrors() []error { return m } 2132 2133 // ConfigGroup_PostAction_TriggeringConditionValidationError is the validation 2134 // error returned by ConfigGroup_PostAction_TriggeringCondition.Validate if 2135 // the designated constraints aren't met. 2136 type ConfigGroup_PostAction_TriggeringConditionValidationError struct { 2137 field string 2138 reason string 2139 cause error 2140 key bool 2141 } 2142 2143 // Field function returns field value. 2144 func (e ConfigGroup_PostAction_TriggeringConditionValidationError) Field() string { return e.field } 2145 2146 // Reason function returns reason value. 2147 func (e ConfigGroup_PostAction_TriggeringConditionValidationError) Reason() string { return e.reason } 2148 2149 // Cause function returns cause value. 2150 func (e ConfigGroup_PostAction_TriggeringConditionValidationError) Cause() error { return e.cause } 2151 2152 // Key function returns key value. 2153 func (e ConfigGroup_PostAction_TriggeringConditionValidationError) Key() bool { return e.key } 2154 2155 // ErrorName returns error name. 2156 func (e ConfigGroup_PostAction_TriggeringConditionValidationError) ErrorName() string { 2157 return "ConfigGroup_PostAction_TriggeringConditionValidationError" 2158 } 2159 2160 // Error satisfies the builtin error interface 2161 func (e ConfigGroup_PostAction_TriggeringConditionValidationError) Error() string { 2162 cause := "" 2163 if e.cause != nil { 2164 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2165 } 2166 2167 key := "" 2168 if e.key { 2169 key = "key for " 2170 } 2171 2172 return fmt.Sprintf( 2173 "invalid %sConfigGroup_PostAction_TriggeringCondition.%s: %s%s", 2174 key, 2175 e.field, 2176 e.reason, 2177 cause) 2178 } 2179 2180 var _ error = ConfigGroup_PostAction_TriggeringConditionValidationError{} 2181 2182 var _ interface { 2183 Field() string 2184 Reason() string 2185 Key() bool 2186 Cause() error 2187 ErrorName() string 2188 } = ConfigGroup_PostAction_TriggeringConditionValidationError{} 2189 2190 // Validate checks the field values on ConfigGroup_PostAction_VoteGerritLabels 2191 // with the rules defined in the proto definition for this message. If any 2192 // rules are violated, the first error encountered is returned, or nil if 2193 // there are no violations. 2194 func (m *ConfigGroup_PostAction_VoteGerritLabels) Validate() error { 2195 return m.validate(false) 2196 } 2197 2198 // ValidateAll checks the field values on 2199 // ConfigGroup_PostAction_VoteGerritLabels with the rules defined in the proto 2200 // definition for this message. If any rules are violated, the result is a 2201 // list of violation errors wrapped in 2202 // ConfigGroup_PostAction_VoteGerritLabelsMultiError, or nil if none found. 2203 func (m *ConfigGroup_PostAction_VoteGerritLabels) ValidateAll() error { 2204 return m.validate(true) 2205 } 2206 2207 func (m *ConfigGroup_PostAction_VoteGerritLabels) validate(all bool) error { 2208 if m == nil { 2209 return nil 2210 } 2211 2212 var errors []error 2213 2214 if len(m.GetVotes()) < 1 { 2215 err := ConfigGroup_PostAction_VoteGerritLabelsValidationError{ 2216 field: "Votes", 2217 reason: "value must contain at least 1 item(s)", 2218 } 2219 if !all { 2220 return err 2221 } 2222 errors = append(errors, err) 2223 } 2224 2225 for idx, item := range m.GetVotes() { 2226 _, _ = idx, item 2227 2228 if all { 2229 switch v := interface{}(item).(type) { 2230 case interface{ ValidateAll() error }: 2231 if err := v.ValidateAll(); err != nil { 2232 errors = append(errors, ConfigGroup_PostAction_VoteGerritLabelsValidationError{ 2233 field: fmt.Sprintf("Votes[%v]", idx), 2234 reason: "embedded message failed validation", 2235 cause: err, 2236 }) 2237 } 2238 case interface{ Validate() error }: 2239 if err := v.Validate(); err != nil { 2240 errors = append(errors, ConfigGroup_PostAction_VoteGerritLabelsValidationError{ 2241 field: fmt.Sprintf("Votes[%v]", idx), 2242 reason: "embedded message failed validation", 2243 cause: err, 2244 }) 2245 } 2246 } 2247 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2248 if err := v.Validate(); err != nil { 2249 return ConfigGroup_PostAction_VoteGerritLabelsValidationError{ 2250 field: fmt.Sprintf("Votes[%v]", idx), 2251 reason: "embedded message failed validation", 2252 cause: err, 2253 } 2254 } 2255 } 2256 2257 } 2258 2259 if len(errors) > 0 { 2260 return ConfigGroup_PostAction_VoteGerritLabelsMultiError(errors) 2261 } 2262 2263 return nil 2264 } 2265 2266 // ConfigGroup_PostAction_VoteGerritLabelsMultiError is an error wrapping 2267 // multiple validation errors returned by 2268 // ConfigGroup_PostAction_VoteGerritLabels.ValidateAll() if the designated 2269 // constraints aren't met. 2270 type ConfigGroup_PostAction_VoteGerritLabelsMultiError []error 2271 2272 // Error returns a concatenation of all the error messages it wraps. 2273 func (m ConfigGroup_PostAction_VoteGerritLabelsMultiError) Error() string { 2274 var msgs []string 2275 for _, err := range m { 2276 msgs = append(msgs, err.Error()) 2277 } 2278 return strings.Join(msgs, "; ") 2279 } 2280 2281 // AllErrors returns a list of validation violation errors. 2282 func (m ConfigGroup_PostAction_VoteGerritLabelsMultiError) AllErrors() []error { return m } 2283 2284 // ConfigGroup_PostAction_VoteGerritLabelsValidationError is the validation 2285 // error returned by ConfigGroup_PostAction_VoteGerritLabels.Validate if the 2286 // designated constraints aren't met. 2287 type ConfigGroup_PostAction_VoteGerritLabelsValidationError struct { 2288 field string 2289 reason string 2290 cause error 2291 key bool 2292 } 2293 2294 // Field function returns field value. 2295 func (e ConfigGroup_PostAction_VoteGerritLabelsValidationError) Field() string { return e.field } 2296 2297 // Reason function returns reason value. 2298 func (e ConfigGroup_PostAction_VoteGerritLabelsValidationError) Reason() string { return e.reason } 2299 2300 // Cause function returns cause value. 2301 func (e ConfigGroup_PostAction_VoteGerritLabelsValidationError) Cause() error { return e.cause } 2302 2303 // Key function returns key value. 2304 func (e ConfigGroup_PostAction_VoteGerritLabelsValidationError) Key() bool { return e.key } 2305 2306 // ErrorName returns error name. 2307 func (e ConfigGroup_PostAction_VoteGerritLabelsValidationError) ErrorName() string { 2308 return "ConfigGroup_PostAction_VoteGerritLabelsValidationError" 2309 } 2310 2311 // Error satisfies the builtin error interface 2312 func (e ConfigGroup_PostAction_VoteGerritLabelsValidationError) Error() string { 2313 cause := "" 2314 if e.cause != nil { 2315 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2316 } 2317 2318 key := "" 2319 if e.key { 2320 key = "key for " 2321 } 2322 2323 return fmt.Sprintf( 2324 "invalid %sConfigGroup_PostAction_VoteGerritLabels.%s: %s%s", 2325 key, 2326 e.field, 2327 e.reason, 2328 cause) 2329 } 2330 2331 var _ error = ConfigGroup_PostAction_VoteGerritLabelsValidationError{} 2332 2333 var _ interface { 2334 Field() string 2335 Reason() string 2336 Key() bool 2337 Cause() error 2338 ErrorName() string 2339 } = ConfigGroup_PostAction_VoteGerritLabelsValidationError{} 2340 2341 // Validate checks the field values on 2342 // ConfigGroup_PostAction_VoteGerritLabels_Vote with the rules defined in the 2343 // proto definition for this message. If any rules are violated, the first 2344 // error encountered is returned, or nil if there are no violations. 2345 func (m *ConfigGroup_PostAction_VoteGerritLabels_Vote) Validate() error { 2346 return m.validate(false) 2347 } 2348 2349 // ValidateAll checks the field values on 2350 // ConfigGroup_PostAction_VoteGerritLabels_Vote with the rules defined in the 2351 // proto definition for this message. If any rules are violated, the result is 2352 // a list of violation errors wrapped in 2353 // ConfigGroup_PostAction_VoteGerritLabels_VoteMultiError, or nil if none found. 2354 func (m *ConfigGroup_PostAction_VoteGerritLabels_Vote) ValidateAll() error { 2355 return m.validate(true) 2356 } 2357 2358 func (m *ConfigGroup_PostAction_VoteGerritLabels_Vote) validate(all bool) error { 2359 if m == nil { 2360 return nil 2361 } 2362 2363 var errors []error 2364 2365 if utf8.RuneCountInString(m.GetName()) < 1 { 2366 err := ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError{ 2367 field: "Name", 2368 reason: "value length must be at least 1 runes", 2369 } 2370 if !all { 2371 return err 2372 } 2373 errors = append(errors, err) 2374 } 2375 2376 // no validation rules for Value 2377 2378 if len(errors) > 0 { 2379 return ConfigGroup_PostAction_VoteGerritLabels_VoteMultiError(errors) 2380 } 2381 2382 return nil 2383 } 2384 2385 // ConfigGroup_PostAction_VoteGerritLabels_VoteMultiError is an error wrapping 2386 // multiple validation errors returned by 2387 // ConfigGroup_PostAction_VoteGerritLabels_Vote.ValidateAll() if the 2388 // designated constraints aren't met. 2389 type ConfigGroup_PostAction_VoteGerritLabels_VoteMultiError []error 2390 2391 // Error returns a concatenation of all the error messages it wraps. 2392 func (m ConfigGroup_PostAction_VoteGerritLabels_VoteMultiError) Error() string { 2393 var msgs []string 2394 for _, err := range m { 2395 msgs = append(msgs, err.Error()) 2396 } 2397 return strings.Join(msgs, "; ") 2398 } 2399 2400 // AllErrors returns a list of validation violation errors. 2401 func (m ConfigGroup_PostAction_VoteGerritLabels_VoteMultiError) AllErrors() []error { return m } 2402 2403 // ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError is the 2404 // validation error returned by 2405 // ConfigGroup_PostAction_VoteGerritLabels_Vote.Validate if the designated 2406 // constraints aren't met. 2407 type ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError struct { 2408 field string 2409 reason string 2410 cause error 2411 key bool 2412 } 2413 2414 // Field function returns field value. 2415 func (e ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError) Field() string { return e.field } 2416 2417 // Reason function returns reason value. 2418 func (e ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError) Reason() string { return e.reason } 2419 2420 // Cause function returns cause value. 2421 func (e ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError) Cause() error { return e.cause } 2422 2423 // Key function returns key value. 2424 func (e ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError) Key() bool { return e.key } 2425 2426 // ErrorName returns error name. 2427 func (e ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError) ErrorName() string { 2428 return "ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError" 2429 } 2430 2431 // Error satisfies the builtin error interface 2432 func (e ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError) Error() string { 2433 cause := "" 2434 if e.cause != nil { 2435 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2436 } 2437 2438 key := "" 2439 if e.key { 2440 key = "key for " 2441 } 2442 2443 return fmt.Sprintf( 2444 "invalid %sConfigGroup_PostAction_VoteGerritLabels_Vote.%s: %s%s", 2445 key, 2446 e.field, 2447 e.reason, 2448 cause) 2449 } 2450 2451 var _ error = ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError{} 2452 2453 var _ interface { 2454 Field() string 2455 Reason() string 2456 Key() bool 2457 Cause() error 2458 ErrorName() string 2459 } = ConfigGroup_PostAction_VoteGerritLabels_VoteValidationError{} 2460 2461 // Validate checks the field values on ConfigGroup_TryjobExperiment_Condition 2462 // with the rules defined in the proto definition for this message. If any 2463 // rules are violated, the first error encountered is returned, or nil if 2464 // there are no violations. 2465 func (m *ConfigGroup_TryjobExperiment_Condition) Validate() error { 2466 return m.validate(false) 2467 } 2468 2469 // ValidateAll checks the field values on 2470 // ConfigGroup_TryjobExperiment_Condition with the rules defined in the proto 2471 // definition for this message. If any rules are violated, the result is a 2472 // list of violation errors wrapped in 2473 // ConfigGroup_TryjobExperiment_ConditionMultiError, or nil if none found. 2474 func (m *ConfigGroup_TryjobExperiment_Condition) ValidateAll() error { 2475 return m.validate(true) 2476 } 2477 2478 func (m *ConfigGroup_TryjobExperiment_Condition) validate(all bool) error { 2479 if m == nil { 2480 return nil 2481 } 2482 2483 var errors []error 2484 2485 for idx, item := range m.GetOwnerGroupAllowlist() { 2486 _, _ = idx, item 2487 2488 if utf8.RuneCountInString(item) < 1 { 2489 err := ConfigGroup_TryjobExperiment_ConditionValidationError{ 2490 field: fmt.Sprintf("OwnerGroupAllowlist[%v]", idx), 2491 reason: "value length must be at least 1 runes", 2492 } 2493 if !all { 2494 return err 2495 } 2496 errors = append(errors, err) 2497 } 2498 2499 } 2500 2501 if len(errors) > 0 { 2502 return ConfigGroup_TryjobExperiment_ConditionMultiError(errors) 2503 } 2504 2505 return nil 2506 } 2507 2508 // ConfigGroup_TryjobExperiment_ConditionMultiError is an error wrapping 2509 // multiple validation errors returned by 2510 // ConfigGroup_TryjobExperiment_Condition.ValidateAll() if the designated 2511 // constraints aren't met. 2512 type ConfigGroup_TryjobExperiment_ConditionMultiError []error 2513 2514 // Error returns a concatenation of all the error messages it wraps. 2515 func (m ConfigGroup_TryjobExperiment_ConditionMultiError) Error() string { 2516 var msgs []string 2517 for _, err := range m { 2518 msgs = append(msgs, err.Error()) 2519 } 2520 return strings.Join(msgs, "; ") 2521 } 2522 2523 // AllErrors returns a list of validation violation errors. 2524 func (m ConfigGroup_TryjobExperiment_ConditionMultiError) AllErrors() []error { return m } 2525 2526 // ConfigGroup_TryjobExperiment_ConditionValidationError is the validation 2527 // error returned by ConfigGroup_TryjobExperiment_Condition.Validate if the 2528 // designated constraints aren't met. 2529 type ConfigGroup_TryjobExperiment_ConditionValidationError struct { 2530 field string 2531 reason string 2532 cause error 2533 key bool 2534 } 2535 2536 // Field function returns field value. 2537 func (e ConfigGroup_TryjobExperiment_ConditionValidationError) Field() string { return e.field } 2538 2539 // Reason function returns reason value. 2540 func (e ConfigGroup_TryjobExperiment_ConditionValidationError) Reason() string { return e.reason } 2541 2542 // Cause function returns cause value. 2543 func (e ConfigGroup_TryjobExperiment_ConditionValidationError) Cause() error { return e.cause } 2544 2545 // Key function returns key value. 2546 func (e ConfigGroup_TryjobExperiment_ConditionValidationError) Key() bool { return e.key } 2547 2548 // ErrorName returns error name. 2549 func (e ConfigGroup_TryjobExperiment_ConditionValidationError) ErrorName() string { 2550 return "ConfigGroup_TryjobExperiment_ConditionValidationError" 2551 } 2552 2553 // Error satisfies the builtin error interface 2554 func (e ConfigGroup_TryjobExperiment_ConditionValidationError) Error() string { 2555 cause := "" 2556 if e.cause != nil { 2557 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2558 } 2559 2560 key := "" 2561 if e.key { 2562 key = "key for " 2563 } 2564 2565 return fmt.Sprintf( 2566 "invalid %sConfigGroup_TryjobExperiment_Condition.%s: %s%s", 2567 key, 2568 e.field, 2569 e.reason, 2570 cause) 2571 } 2572 2573 var _ error = ConfigGroup_TryjobExperiment_ConditionValidationError{} 2574 2575 var _ interface { 2576 Field() string 2577 Reason() string 2578 Key() bool 2579 Cause() error 2580 ErrorName() string 2581 } = ConfigGroup_TryjobExperiment_ConditionValidationError{} 2582 2583 // Validate checks the field values on Verifiers_GerritCQAbility with the rules 2584 // defined in the proto definition for this message. If any rules are 2585 // violated, the first error encountered is returned, or nil if there are no violations. 2586 func (m *Verifiers_GerritCQAbility) Validate() error { 2587 return m.validate(false) 2588 } 2589 2590 // ValidateAll checks the field values on Verifiers_GerritCQAbility with the 2591 // rules defined in the proto definition for this message. If any rules are 2592 // violated, the result is a list of violation errors wrapped in 2593 // Verifiers_GerritCQAbilityMultiError, or nil if none found. 2594 func (m *Verifiers_GerritCQAbility) ValidateAll() error { 2595 return m.validate(true) 2596 } 2597 2598 func (m *Verifiers_GerritCQAbility) validate(all bool) error { 2599 if m == nil { 2600 return nil 2601 } 2602 2603 var errors []error 2604 2605 // no validation rules for AllowSubmitWithOpenDeps 2606 2607 // no validation rules for AllowOwnerIfSubmittable 2608 2609 // no validation rules for TrustDryRunnerDeps 2610 2611 // no validation rules for AllowNonOwnerDryRunner 2612 2613 if len(errors) > 0 { 2614 return Verifiers_GerritCQAbilityMultiError(errors) 2615 } 2616 2617 return nil 2618 } 2619 2620 // Verifiers_GerritCQAbilityMultiError is an error wrapping multiple validation 2621 // errors returned by Verifiers_GerritCQAbility.ValidateAll() if the 2622 // designated constraints aren't met. 2623 type Verifiers_GerritCQAbilityMultiError []error 2624 2625 // Error returns a concatenation of all the error messages it wraps. 2626 func (m Verifiers_GerritCQAbilityMultiError) Error() string { 2627 var msgs []string 2628 for _, err := range m { 2629 msgs = append(msgs, err.Error()) 2630 } 2631 return strings.Join(msgs, "; ") 2632 } 2633 2634 // AllErrors returns a list of validation violation errors. 2635 func (m Verifiers_GerritCQAbilityMultiError) AllErrors() []error { return m } 2636 2637 // Verifiers_GerritCQAbilityValidationError is the validation error returned by 2638 // Verifiers_GerritCQAbility.Validate if the designated constraints aren't met. 2639 type Verifiers_GerritCQAbilityValidationError struct { 2640 field string 2641 reason string 2642 cause error 2643 key bool 2644 } 2645 2646 // Field function returns field value. 2647 func (e Verifiers_GerritCQAbilityValidationError) Field() string { return e.field } 2648 2649 // Reason function returns reason value. 2650 func (e Verifiers_GerritCQAbilityValidationError) Reason() string { return e.reason } 2651 2652 // Cause function returns cause value. 2653 func (e Verifiers_GerritCQAbilityValidationError) Cause() error { return e.cause } 2654 2655 // Key function returns key value. 2656 func (e Verifiers_GerritCQAbilityValidationError) Key() bool { return e.key } 2657 2658 // ErrorName returns error name. 2659 func (e Verifiers_GerritCQAbilityValidationError) ErrorName() string { 2660 return "Verifiers_GerritCQAbilityValidationError" 2661 } 2662 2663 // Error satisfies the builtin error interface 2664 func (e Verifiers_GerritCQAbilityValidationError) Error() string { 2665 cause := "" 2666 if e.cause != nil { 2667 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2668 } 2669 2670 key := "" 2671 if e.key { 2672 key = "key for " 2673 } 2674 2675 return fmt.Sprintf( 2676 "invalid %sVerifiers_GerritCQAbility.%s: %s%s", 2677 key, 2678 e.field, 2679 e.reason, 2680 cause) 2681 } 2682 2683 var _ error = Verifiers_GerritCQAbilityValidationError{} 2684 2685 var _ interface { 2686 Field() string 2687 Reason() string 2688 Key() bool 2689 Cause() error 2690 ErrorName() string 2691 } = Verifiers_GerritCQAbilityValidationError{} 2692 2693 // Validate checks the field values on Verifiers_TreeStatus with the rules 2694 // defined in the proto definition for this message. If any rules are 2695 // violated, the first error encountered is returned, or nil if there are no violations. 2696 func (m *Verifiers_TreeStatus) Validate() error { 2697 return m.validate(false) 2698 } 2699 2700 // ValidateAll checks the field values on Verifiers_TreeStatus with the rules 2701 // defined in the proto definition for this message. If any rules are 2702 // violated, the result is a list of violation errors wrapped in 2703 // Verifiers_TreeStatusMultiError, or nil if none found. 2704 func (m *Verifiers_TreeStatus) ValidateAll() error { 2705 return m.validate(true) 2706 } 2707 2708 func (m *Verifiers_TreeStatus) validate(all bool) error { 2709 if m == nil { 2710 return nil 2711 } 2712 2713 var errors []error 2714 2715 // no validation rules for Url 2716 2717 if len(errors) > 0 { 2718 return Verifiers_TreeStatusMultiError(errors) 2719 } 2720 2721 return nil 2722 } 2723 2724 // Verifiers_TreeStatusMultiError is an error wrapping multiple validation 2725 // errors returned by Verifiers_TreeStatus.ValidateAll() if the designated 2726 // constraints aren't met. 2727 type Verifiers_TreeStatusMultiError []error 2728 2729 // Error returns a concatenation of all the error messages it wraps. 2730 func (m Verifiers_TreeStatusMultiError) Error() string { 2731 var msgs []string 2732 for _, err := range m { 2733 msgs = append(msgs, err.Error()) 2734 } 2735 return strings.Join(msgs, "; ") 2736 } 2737 2738 // AllErrors returns a list of validation violation errors. 2739 func (m Verifiers_TreeStatusMultiError) AllErrors() []error { return m } 2740 2741 // Verifiers_TreeStatusValidationError is the validation error returned by 2742 // Verifiers_TreeStatus.Validate if the designated constraints aren't met. 2743 type Verifiers_TreeStatusValidationError struct { 2744 field string 2745 reason string 2746 cause error 2747 key bool 2748 } 2749 2750 // Field function returns field value. 2751 func (e Verifiers_TreeStatusValidationError) Field() string { return e.field } 2752 2753 // Reason function returns reason value. 2754 func (e Verifiers_TreeStatusValidationError) Reason() string { return e.reason } 2755 2756 // Cause function returns cause value. 2757 func (e Verifiers_TreeStatusValidationError) Cause() error { return e.cause } 2758 2759 // Key function returns key value. 2760 func (e Verifiers_TreeStatusValidationError) Key() bool { return e.key } 2761 2762 // ErrorName returns error name. 2763 func (e Verifiers_TreeStatusValidationError) ErrorName() string { 2764 return "Verifiers_TreeStatusValidationError" 2765 } 2766 2767 // Error satisfies the builtin error interface 2768 func (e Verifiers_TreeStatusValidationError) Error() string { 2769 cause := "" 2770 if e.cause != nil { 2771 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2772 } 2773 2774 key := "" 2775 if e.key { 2776 key = "key for " 2777 } 2778 2779 return fmt.Sprintf( 2780 "invalid %sVerifiers_TreeStatus.%s: %s%s", 2781 key, 2782 e.field, 2783 e.reason, 2784 cause) 2785 } 2786 2787 var _ error = Verifiers_TreeStatusValidationError{} 2788 2789 var _ interface { 2790 Field() string 2791 Reason() string 2792 Key() bool 2793 Cause() error 2794 ErrorName() string 2795 } = Verifiers_TreeStatusValidationError{} 2796 2797 // Validate checks the field values on Verifiers_Tryjob with the rules defined 2798 // in the proto definition for this message. If any rules are violated, the 2799 // first error encountered is returned, or nil if there are no violations. 2800 func (m *Verifiers_Tryjob) Validate() error { 2801 return m.validate(false) 2802 } 2803 2804 // ValidateAll checks the field values on Verifiers_Tryjob with the rules 2805 // defined in the proto definition for this message. If any rules are 2806 // violated, the result is a list of violation errors wrapped in 2807 // Verifiers_TryjobMultiError, or nil if none found. 2808 func (m *Verifiers_Tryjob) ValidateAll() error { 2809 return m.validate(true) 2810 } 2811 2812 func (m *Verifiers_Tryjob) validate(all bool) error { 2813 if m == nil { 2814 return nil 2815 } 2816 2817 var errors []error 2818 2819 for idx, item := range m.GetBuilders() { 2820 _, _ = idx, item 2821 2822 if all { 2823 switch v := interface{}(item).(type) { 2824 case interface{ ValidateAll() error }: 2825 if err := v.ValidateAll(); err != nil { 2826 errors = append(errors, Verifiers_TryjobValidationError{ 2827 field: fmt.Sprintf("Builders[%v]", idx), 2828 reason: "embedded message failed validation", 2829 cause: err, 2830 }) 2831 } 2832 case interface{ Validate() error }: 2833 if err := v.Validate(); err != nil { 2834 errors = append(errors, Verifiers_TryjobValidationError{ 2835 field: fmt.Sprintf("Builders[%v]", idx), 2836 reason: "embedded message failed validation", 2837 cause: err, 2838 }) 2839 } 2840 } 2841 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2842 if err := v.Validate(); err != nil { 2843 return Verifiers_TryjobValidationError{ 2844 field: fmt.Sprintf("Builders[%v]", idx), 2845 reason: "embedded message failed validation", 2846 cause: err, 2847 } 2848 } 2849 } 2850 2851 } 2852 2853 if all { 2854 switch v := interface{}(m.GetRetryConfig()).(type) { 2855 case interface{ ValidateAll() error }: 2856 if err := v.ValidateAll(); err != nil { 2857 errors = append(errors, Verifiers_TryjobValidationError{ 2858 field: "RetryConfig", 2859 reason: "embedded message failed validation", 2860 cause: err, 2861 }) 2862 } 2863 case interface{ Validate() error }: 2864 if err := v.Validate(); err != nil { 2865 errors = append(errors, Verifiers_TryjobValidationError{ 2866 field: "RetryConfig", 2867 reason: "embedded message failed validation", 2868 cause: err, 2869 }) 2870 } 2871 } 2872 } else if v, ok := interface{}(m.GetRetryConfig()).(interface{ Validate() error }); ok { 2873 if err := v.Validate(); err != nil { 2874 return Verifiers_TryjobValidationError{ 2875 field: "RetryConfig", 2876 reason: "embedded message failed validation", 2877 cause: err, 2878 } 2879 } 2880 } 2881 2882 // no validation rules for CancelStaleTryjobs 2883 2884 if len(errors) > 0 { 2885 return Verifiers_TryjobMultiError(errors) 2886 } 2887 2888 return nil 2889 } 2890 2891 // Verifiers_TryjobMultiError is an error wrapping multiple validation errors 2892 // returned by Verifiers_Tryjob.ValidateAll() if the designated constraints 2893 // aren't met. 2894 type Verifiers_TryjobMultiError []error 2895 2896 // Error returns a concatenation of all the error messages it wraps. 2897 func (m Verifiers_TryjobMultiError) Error() string { 2898 var msgs []string 2899 for _, err := range m { 2900 msgs = append(msgs, err.Error()) 2901 } 2902 return strings.Join(msgs, "; ") 2903 } 2904 2905 // AllErrors returns a list of validation violation errors. 2906 func (m Verifiers_TryjobMultiError) AllErrors() []error { return m } 2907 2908 // Verifiers_TryjobValidationError is the validation error returned by 2909 // Verifiers_Tryjob.Validate if the designated constraints aren't met. 2910 type Verifiers_TryjobValidationError struct { 2911 field string 2912 reason string 2913 cause error 2914 key bool 2915 } 2916 2917 // Field function returns field value. 2918 func (e Verifiers_TryjobValidationError) Field() string { return e.field } 2919 2920 // Reason function returns reason value. 2921 func (e Verifiers_TryjobValidationError) Reason() string { return e.reason } 2922 2923 // Cause function returns cause value. 2924 func (e Verifiers_TryjobValidationError) Cause() error { return e.cause } 2925 2926 // Key function returns key value. 2927 func (e Verifiers_TryjobValidationError) Key() bool { return e.key } 2928 2929 // ErrorName returns error name. 2930 func (e Verifiers_TryjobValidationError) ErrorName() string { return "Verifiers_TryjobValidationError" } 2931 2932 // Error satisfies the builtin error interface 2933 func (e Verifiers_TryjobValidationError) Error() string { 2934 cause := "" 2935 if e.cause != nil { 2936 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2937 } 2938 2939 key := "" 2940 if e.key { 2941 key = "key for " 2942 } 2943 2944 return fmt.Sprintf( 2945 "invalid %sVerifiers_Tryjob.%s: %s%s", 2946 key, 2947 e.field, 2948 e.reason, 2949 cause) 2950 } 2951 2952 var _ error = Verifiers_TryjobValidationError{} 2953 2954 var _ interface { 2955 Field() string 2956 Reason() string 2957 Key() bool 2958 Cause() error 2959 ErrorName() string 2960 } = Verifiers_TryjobValidationError{} 2961 2962 // Validate checks the field values on Verifiers_CQLinter with the rules 2963 // defined in the proto definition for this message. If any rules are 2964 // violated, the first error encountered is returned, or nil if there are no violations. 2965 func (m *Verifiers_CQLinter) Validate() error { 2966 return m.validate(false) 2967 } 2968 2969 // ValidateAll checks the field values on Verifiers_CQLinter with the rules 2970 // defined in the proto definition for this message. If any rules are 2971 // violated, the result is a list of violation errors wrapped in 2972 // Verifiers_CQLinterMultiError, or nil if none found. 2973 func (m *Verifiers_CQLinter) ValidateAll() error { 2974 return m.validate(true) 2975 } 2976 2977 func (m *Verifiers_CQLinter) validate(all bool) error { 2978 if m == nil { 2979 return nil 2980 } 2981 2982 var errors []error 2983 2984 if len(errors) > 0 { 2985 return Verifiers_CQLinterMultiError(errors) 2986 } 2987 2988 return nil 2989 } 2990 2991 // Verifiers_CQLinterMultiError is an error wrapping multiple validation errors 2992 // returned by Verifiers_CQLinter.ValidateAll() if the designated constraints 2993 // aren't met. 2994 type Verifiers_CQLinterMultiError []error 2995 2996 // Error returns a concatenation of all the error messages it wraps. 2997 func (m Verifiers_CQLinterMultiError) Error() string { 2998 var msgs []string 2999 for _, err := range m { 3000 msgs = append(msgs, err.Error()) 3001 } 3002 return strings.Join(msgs, "; ") 3003 } 3004 3005 // AllErrors returns a list of validation violation errors. 3006 func (m Verifiers_CQLinterMultiError) AllErrors() []error { return m } 3007 3008 // Verifiers_CQLinterValidationError is the validation error returned by 3009 // Verifiers_CQLinter.Validate if the designated constraints aren't met. 3010 type Verifiers_CQLinterValidationError struct { 3011 field string 3012 reason string 3013 cause error 3014 key bool 3015 } 3016 3017 // Field function returns field value. 3018 func (e Verifiers_CQLinterValidationError) Field() string { return e.field } 3019 3020 // Reason function returns reason value. 3021 func (e Verifiers_CQLinterValidationError) Reason() string { return e.reason } 3022 3023 // Cause function returns cause value. 3024 func (e Verifiers_CQLinterValidationError) Cause() error { return e.cause } 3025 3026 // Key function returns key value. 3027 func (e Verifiers_CQLinterValidationError) Key() bool { return e.key } 3028 3029 // ErrorName returns error name. 3030 func (e Verifiers_CQLinterValidationError) ErrorName() string { 3031 return "Verifiers_CQLinterValidationError" 3032 } 3033 3034 // Error satisfies the builtin error interface 3035 func (e Verifiers_CQLinterValidationError) Error() string { 3036 cause := "" 3037 if e.cause != nil { 3038 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3039 } 3040 3041 key := "" 3042 if e.key { 3043 key = "key for " 3044 } 3045 3046 return fmt.Sprintf( 3047 "invalid %sVerifiers_CQLinter.%s: %s%s", 3048 key, 3049 e.field, 3050 e.reason, 3051 cause) 3052 } 3053 3054 var _ error = Verifiers_CQLinterValidationError{} 3055 3056 var _ interface { 3057 Field() string 3058 Reason() string 3059 Key() bool 3060 Cause() error 3061 ErrorName() string 3062 } = Verifiers_CQLinterValidationError{} 3063 3064 // Validate checks the field values on Verifiers_Fake with the rules defined in 3065 // the proto definition for this message. If any rules are violated, the first 3066 // error encountered is returned, or nil if there are no violations. 3067 func (m *Verifiers_Fake) Validate() error { 3068 return m.validate(false) 3069 } 3070 3071 // ValidateAll checks the field values on Verifiers_Fake with the rules defined 3072 // in the proto definition for this message. If any rules are violated, the 3073 // result is a list of violation errors wrapped in Verifiers_FakeMultiError, 3074 // or nil if none found. 3075 func (m *Verifiers_Fake) ValidateAll() error { 3076 return m.validate(true) 3077 } 3078 3079 func (m *Verifiers_Fake) validate(all bool) error { 3080 if m == nil { 3081 return nil 3082 } 3083 3084 var errors []error 3085 3086 // no validation rules for Name 3087 3088 // no validation rules for EventualState 3089 3090 // no validation rules for Delay 3091 3092 if len(errors) > 0 { 3093 return Verifiers_FakeMultiError(errors) 3094 } 3095 3096 return nil 3097 } 3098 3099 // Verifiers_FakeMultiError is an error wrapping multiple validation errors 3100 // returned by Verifiers_Fake.ValidateAll() if the designated constraints 3101 // aren't met. 3102 type Verifiers_FakeMultiError []error 3103 3104 // Error returns a concatenation of all the error messages it wraps. 3105 func (m Verifiers_FakeMultiError) Error() string { 3106 var msgs []string 3107 for _, err := range m { 3108 msgs = append(msgs, err.Error()) 3109 } 3110 return strings.Join(msgs, "; ") 3111 } 3112 3113 // AllErrors returns a list of validation violation errors. 3114 func (m Verifiers_FakeMultiError) AllErrors() []error { return m } 3115 3116 // Verifiers_FakeValidationError is the validation error returned by 3117 // Verifiers_Fake.Validate if the designated constraints aren't met. 3118 type Verifiers_FakeValidationError struct { 3119 field string 3120 reason string 3121 cause error 3122 key bool 3123 } 3124 3125 // Field function returns field value. 3126 func (e Verifiers_FakeValidationError) Field() string { return e.field } 3127 3128 // Reason function returns reason value. 3129 func (e Verifiers_FakeValidationError) Reason() string { return e.reason } 3130 3131 // Cause function returns cause value. 3132 func (e Verifiers_FakeValidationError) Cause() error { return e.cause } 3133 3134 // Key function returns key value. 3135 func (e Verifiers_FakeValidationError) Key() bool { return e.key } 3136 3137 // ErrorName returns error name. 3138 func (e Verifiers_FakeValidationError) ErrorName() string { return "Verifiers_FakeValidationError" } 3139 3140 // Error satisfies the builtin error interface 3141 func (e Verifiers_FakeValidationError) Error() string { 3142 cause := "" 3143 if e.cause != nil { 3144 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3145 } 3146 3147 key := "" 3148 if e.key { 3149 key = "key for " 3150 } 3151 3152 return fmt.Sprintf( 3153 "invalid %sVerifiers_Fake.%s: %s%s", 3154 key, 3155 e.field, 3156 e.reason, 3157 cause) 3158 } 3159 3160 var _ error = Verifiers_FakeValidationError{} 3161 3162 var _ interface { 3163 Field() string 3164 Reason() string 3165 Key() bool 3166 Cause() error 3167 ErrorName() string 3168 } = Verifiers_FakeValidationError{} 3169 3170 // Validate checks the field values on Verifiers_Tryjob_Builder with the rules 3171 // defined in the proto definition for this message. If any rules are 3172 // violated, the first error encountered is returned, or nil if there are no violations. 3173 func (m *Verifiers_Tryjob_Builder) Validate() error { 3174 return m.validate(false) 3175 } 3176 3177 // ValidateAll checks the field values on Verifiers_Tryjob_Builder with the 3178 // rules defined in the proto definition for this message. If any rules are 3179 // violated, the result is a list of violation errors wrapped in 3180 // Verifiers_Tryjob_BuilderMultiError, or nil if none found. 3181 func (m *Verifiers_Tryjob_Builder) ValidateAll() error { 3182 return m.validate(true) 3183 } 3184 3185 func (m *Verifiers_Tryjob_Builder) validate(all bool) error { 3186 if m == nil { 3187 return nil 3188 } 3189 3190 var errors []error 3191 3192 // no validation rules for Host 3193 3194 // no validation rules for Name 3195 3196 // no validation rules for IncludableOnly 3197 3198 // no validation rules for ResultVisibility 3199 3200 // no validation rules for DisableReuse 3201 3202 // no validation rules for CancelStale 3203 3204 // no validation rules for ExperimentPercentage 3205 3206 if all { 3207 switch v := interface{}(m.GetEquivalentTo()).(type) { 3208 case interface{ ValidateAll() error }: 3209 if err := v.ValidateAll(); err != nil { 3210 errors = append(errors, Verifiers_Tryjob_BuilderValidationError{ 3211 field: "EquivalentTo", 3212 reason: "embedded message failed validation", 3213 cause: err, 3214 }) 3215 } 3216 case interface{ Validate() error }: 3217 if err := v.Validate(); err != nil { 3218 errors = append(errors, Verifiers_Tryjob_BuilderValidationError{ 3219 field: "EquivalentTo", 3220 reason: "embedded message failed validation", 3221 cause: err, 3222 }) 3223 } 3224 } 3225 } else if v, ok := interface{}(m.GetEquivalentTo()).(interface{ Validate() error }); ok { 3226 if err := v.Validate(); err != nil { 3227 return Verifiers_Tryjob_BuilderValidationError{ 3228 field: "EquivalentTo", 3229 reason: "embedded message failed validation", 3230 cause: err, 3231 } 3232 } 3233 } 3234 3235 for idx, item := range m.GetLocationFilters() { 3236 _, _ = idx, item 3237 3238 if all { 3239 switch v := interface{}(item).(type) { 3240 case interface{ ValidateAll() error }: 3241 if err := v.ValidateAll(); err != nil { 3242 errors = append(errors, Verifiers_Tryjob_BuilderValidationError{ 3243 field: fmt.Sprintf("LocationFilters[%v]", idx), 3244 reason: "embedded message failed validation", 3245 cause: err, 3246 }) 3247 } 3248 case interface{ Validate() error }: 3249 if err := v.Validate(); err != nil { 3250 errors = append(errors, Verifiers_Tryjob_BuilderValidationError{ 3251 field: fmt.Sprintf("LocationFilters[%v]", idx), 3252 reason: "embedded message failed validation", 3253 cause: err, 3254 }) 3255 } 3256 } 3257 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 3258 if err := v.Validate(); err != nil { 3259 return Verifiers_Tryjob_BuilderValidationError{ 3260 field: fmt.Sprintf("LocationFilters[%v]", idx), 3261 reason: "embedded message failed validation", 3262 cause: err, 3263 } 3264 } 3265 } 3266 3267 } 3268 3269 if len(errors) > 0 { 3270 return Verifiers_Tryjob_BuilderMultiError(errors) 3271 } 3272 3273 return nil 3274 } 3275 3276 // Verifiers_Tryjob_BuilderMultiError is an error wrapping multiple validation 3277 // errors returned by Verifiers_Tryjob_Builder.ValidateAll() if the designated 3278 // constraints aren't met. 3279 type Verifiers_Tryjob_BuilderMultiError []error 3280 3281 // Error returns a concatenation of all the error messages it wraps. 3282 func (m Verifiers_Tryjob_BuilderMultiError) Error() string { 3283 var msgs []string 3284 for _, err := range m { 3285 msgs = append(msgs, err.Error()) 3286 } 3287 return strings.Join(msgs, "; ") 3288 } 3289 3290 // AllErrors returns a list of validation violation errors. 3291 func (m Verifiers_Tryjob_BuilderMultiError) AllErrors() []error { return m } 3292 3293 // Verifiers_Tryjob_BuilderValidationError is the validation error returned by 3294 // Verifiers_Tryjob_Builder.Validate if the designated constraints aren't met. 3295 type Verifiers_Tryjob_BuilderValidationError struct { 3296 field string 3297 reason string 3298 cause error 3299 key bool 3300 } 3301 3302 // Field function returns field value. 3303 func (e Verifiers_Tryjob_BuilderValidationError) Field() string { return e.field } 3304 3305 // Reason function returns reason value. 3306 func (e Verifiers_Tryjob_BuilderValidationError) Reason() string { return e.reason } 3307 3308 // Cause function returns cause value. 3309 func (e Verifiers_Tryjob_BuilderValidationError) Cause() error { return e.cause } 3310 3311 // Key function returns key value. 3312 func (e Verifiers_Tryjob_BuilderValidationError) Key() bool { return e.key } 3313 3314 // ErrorName returns error name. 3315 func (e Verifiers_Tryjob_BuilderValidationError) ErrorName() string { 3316 return "Verifiers_Tryjob_BuilderValidationError" 3317 } 3318 3319 // Error satisfies the builtin error interface 3320 func (e Verifiers_Tryjob_BuilderValidationError) Error() string { 3321 cause := "" 3322 if e.cause != nil { 3323 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3324 } 3325 3326 key := "" 3327 if e.key { 3328 key = "key for " 3329 } 3330 3331 return fmt.Sprintf( 3332 "invalid %sVerifiers_Tryjob_Builder.%s: %s%s", 3333 key, 3334 e.field, 3335 e.reason, 3336 cause) 3337 } 3338 3339 var _ error = Verifiers_Tryjob_BuilderValidationError{} 3340 3341 var _ interface { 3342 Field() string 3343 Reason() string 3344 Key() bool 3345 Cause() error 3346 ErrorName() string 3347 } = Verifiers_Tryjob_BuilderValidationError{} 3348 3349 // Validate checks the field values on Verifiers_Tryjob_EquivalentBuilder with 3350 // the rules defined in the proto definition for this message. If any rules 3351 // are violated, the first error encountered is returned, or nil if there are 3352 // no violations. 3353 func (m *Verifiers_Tryjob_EquivalentBuilder) Validate() error { 3354 return m.validate(false) 3355 } 3356 3357 // ValidateAll checks the field values on Verifiers_Tryjob_EquivalentBuilder 3358 // with the rules defined in the proto definition for this message. If any 3359 // rules are violated, the result is a list of violation errors wrapped in 3360 // Verifiers_Tryjob_EquivalentBuilderMultiError, or nil if none found. 3361 func (m *Verifiers_Tryjob_EquivalentBuilder) ValidateAll() error { 3362 return m.validate(true) 3363 } 3364 3365 func (m *Verifiers_Tryjob_EquivalentBuilder) validate(all bool) error { 3366 if m == nil { 3367 return nil 3368 } 3369 3370 var errors []error 3371 3372 // no validation rules for Name 3373 3374 // no validation rules for Percentage 3375 3376 // no validation rules for OwnerWhitelistGroup 3377 3378 if len(errors) > 0 { 3379 return Verifiers_Tryjob_EquivalentBuilderMultiError(errors) 3380 } 3381 3382 return nil 3383 } 3384 3385 // Verifiers_Tryjob_EquivalentBuilderMultiError is an error wrapping multiple 3386 // validation errors returned by 3387 // Verifiers_Tryjob_EquivalentBuilder.ValidateAll() if the designated 3388 // constraints aren't met. 3389 type Verifiers_Tryjob_EquivalentBuilderMultiError []error 3390 3391 // Error returns a concatenation of all the error messages it wraps. 3392 func (m Verifiers_Tryjob_EquivalentBuilderMultiError) Error() string { 3393 var msgs []string 3394 for _, err := range m { 3395 msgs = append(msgs, err.Error()) 3396 } 3397 return strings.Join(msgs, "; ") 3398 } 3399 3400 // AllErrors returns a list of validation violation errors. 3401 func (m Verifiers_Tryjob_EquivalentBuilderMultiError) AllErrors() []error { return m } 3402 3403 // Verifiers_Tryjob_EquivalentBuilderValidationError is the validation error 3404 // returned by Verifiers_Tryjob_EquivalentBuilder.Validate if the designated 3405 // constraints aren't met. 3406 type Verifiers_Tryjob_EquivalentBuilderValidationError struct { 3407 field string 3408 reason string 3409 cause error 3410 key bool 3411 } 3412 3413 // Field function returns field value. 3414 func (e Verifiers_Tryjob_EquivalentBuilderValidationError) Field() string { return e.field } 3415 3416 // Reason function returns reason value. 3417 func (e Verifiers_Tryjob_EquivalentBuilderValidationError) Reason() string { return e.reason } 3418 3419 // Cause function returns cause value. 3420 func (e Verifiers_Tryjob_EquivalentBuilderValidationError) Cause() error { return e.cause } 3421 3422 // Key function returns key value. 3423 func (e Verifiers_Tryjob_EquivalentBuilderValidationError) Key() bool { return e.key } 3424 3425 // ErrorName returns error name. 3426 func (e Verifiers_Tryjob_EquivalentBuilderValidationError) ErrorName() string { 3427 return "Verifiers_Tryjob_EquivalentBuilderValidationError" 3428 } 3429 3430 // Error satisfies the builtin error interface 3431 func (e Verifiers_Tryjob_EquivalentBuilderValidationError) Error() string { 3432 cause := "" 3433 if e.cause != nil { 3434 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3435 } 3436 3437 key := "" 3438 if e.key { 3439 key = "key for " 3440 } 3441 3442 return fmt.Sprintf( 3443 "invalid %sVerifiers_Tryjob_EquivalentBuilder.%s: %s%s", 3444 key, 3445 e.field, 3446 e.reason, 3447 cause) 3448 } 3449 3450 var _ error = Verifiers_Tryjob_EquivalentBuilderValidationError{} 3451 3452 var _ interface { 3453 Field() string 3454 Reason() string 3455 Key() bool 3456 Cause() error 3457 ErrorName() string 3458 } = Verifiers_Tryjob_EquivalentBuilderValidationError{} 3459 3460 // Validate checks the field values on Verifiers_Tryjob_IncludableBuilder with 3461 // the rules defined in the proto definition for this message. If any rules 3462 // are violated, the first error encountered is returned, or nil if there are 3463 // no violations. 3464 func (m *Verifiers_Tryjob_IncludableBuilder) Validate() error { 3465 return m.validate(false) 3466 } 3467 3468 // ValidateAll checks the field values on Verifiers_Tryjob_IncludableBuilder 3469 // with the rules defined in the proto definition for this message. If any 3470 // rules are violated, the result is a list of violation errors wrapped in 3471 // Verifiers_Tryjob_IncludableBuilderMultiError, or nil if none found. 3472 func (m *Verifiers_Tryjob_IncludableBuilder) ValidateAll() error { 3473 return m.validate(true) 3474 } 3475 3476 func (m *Verifiers_Tryjob_IncludableBuilder) validate(all bool) error { 3477 if m == nil { 3478 return nil 3479 } 3480 3481 var errors []error 3482 3483 // no validation rules for Name 3484 3485 if len(errors) > 0 { 3486 return Verifiers_Tryjob_IncludableBuilderMultiError(errors) 3487 } 3488 3489 return nil 3490 } 3491 3492 // Verifiers_Tryjob_IncludableBuilderMultiError is an error wrapping multiple 3493 // validation errors returned by 3494 // Verifiers_Tryjob_IncludableBuilder.ValidateAll() if the designated 3495 // constraints aren't met. 3496 type Verifiers_Tryjob_IncludableBuilderMultiError []error 3497 3498 // Error returns a concatenation of all the error messages it wraps. 3499 func (m Verifiers_Tryjob_IncludableBuilderMultiError) Error() string { 3500 var msgs []string 3501 for _, err := range m { 3502 msgs = append(msgs, err.Error()) 3503 } 3504 return strings.Join(msgs, "; ") 3505 } 3506 3507 // AllErrors returns a list of validation violation errors. 3508 func (m Verifiers_Tryjob_IncludableBuilderMultiError) AllErrors() []error { return m } 3509 3510 // Verifiers_Tryjob_IncludableBuilderValidationError is the validation error 3511 // returned by Verifiers_Tryjob_IncludableBuilder.Validate if the designated 3512 // constraints aren't met. 3513 type Verifiers_Tryjob_IncludableBuilderValidationError struct { 3514 field string 3515 reason string 3516 cause error 3517 key bool 3518 } 3519 3520 // Field function returns field value. 3521 func (e Verifiers_Tryjob_IncludableBuilderValidationError) Field() string { return e.field } 3522 3523 // Reason function returns reason value. 3524 func (e Verifiers_Tryjob_IncludableBuilderValidationError) Reason() string { return e.reason } 3525 3526 // Cause function returns cause value. 3527 func (e Verifiers_Tryjob_IncludableBuilderValidationError) Cause() error { return e.cause } 3528 3529 // Key function returns key value. 3530 func (e Verifiers_Tryjob_IncludableBuilderValidationError) Key() bool { return e.key } 3531 3532 // ErrorName returns error name. 3533 func (e Verifiers_Tryjob_IncludableBuilderValidationError) ErrorName() string { 3534 return "Verifiers_Tryjob_IncludableBuilderValidationError" 3535 } 3536 3537 // Error satisfies the builtin error interface 3538 func (e Verifiers_Tryjob_IncludableBuilderValidationError) Error() string { 3539 cause := "" 3540 if e.cause != nil { 3541 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3542 } 3543 3544 key := "" 3545 if e.key { 3546 key = "key for " 3547 } 3548 3549 return fmt.Sprintf( 3550 "invalid %sVerifiers_Tryjob_IncludableBuilder.%s: %s%s", 3551 key, 3552 e.field, 3553 e.reason, 3554 cause) 3555 } 3556 3557 var _ error = Verifiers_Tryjob_IncludableBuilderValidationError{} 3558 3559 var _ interface { 3560 Field() string 3561 Reason() string 3562 Key() bool 3563 Cause() error 3564 ErrorName() string 3565 } = Verifiers_Tryjob_IncludableBuilderValidationError{} 3566 3567 // Validate checks the field values on Verifiers_Tryjob_RetryConfig with the 3568 // rules defined in the proto definition for this message. If any rules are 3569 // violated, the first error encountered is returned, or nil if there are no violations. 3570 func (m *Verifiers_Tryjob_RetryConfig) Validate() error { 3571 return m.validate(false) 3572 } 3573 3574 // ValidateAll checks the field values on Verifiers_Tryjob_RetryConfig with the 3575 // rules defined in the proto definition for this message. If any rules are 3576 // violated, the result is a list of violation errors wrapped in 3577 // Verifiers_Tryjob_RetryConfigMultiError, or nil if none found. 3578 func (m *Verifiers_Tryjob_RetryConfig) ValidateAll() error { 3579 return m.validate(true) 3580 } 3581 3582 func (m *Verifiers_Tryjob_RetryConfig) validate(all bool) error { 3583 if m == nil { 3584 return nil 3585 } 3586 3587 var errors []error 3588 3589 // no validation rules for SingleQuota 3590 3591 // no validation rules for GlobalQuota 3592 3593 // no validation rules for FailureWeight 3594 3595 // no validation rules for TransientFailureWeight 3596 3597 // no validation rules for TimeoutWeight 3598 3599 if len(errors) > 0 { 3600 return Verifiers_Tryjob_RetryConfigMultiError(errors) 3601 } 3602 3603 return nil 3604 } 3605 3606 // Verifiers_Tryjob_RetryConfigMultiError is an error wrapping multiple 3607 // validation errors returned by Verifiers_Tryjob_RetryConfig.ValidateAll() if 3608 // the designated constraints aren't met. 3609 type Verifiers_Tryjob_RetryConfigMultiError []error 3610 3611 // Error returns a concatenation of all the error messages it wraps. 3612 func (m Verifiers_Tryjob_RetryConfigMultiError) Error() string { 3613 var msgs []string 3614 for _, err := range m { 3615 msgs = append(msgs, err.Error()) 3616 } 3617 return strings.Join(msgs, "; ") 3618 } 3619 3620 // AllErrors returns a list of validation violation errors. 3621 func (m Verifiers_Tryjob_RetryConfigMultiError) AllErrors() []error { return m } 3622 3623 // Verifiers_Tryjob_RetryConfigValidationError is the validation error returned 3624 // by Verifiers_Tryjob_RetryConfig.Validate if the designated constraints 3625 // aren't met. 3626 type Verifiers_Tryjob_RetryConfigValidationError struct { 3627 field string 3628 reason string 3629 cause error 3630 key bool 3631 } 3632 3633 // Field function returns field value. 3634 func (e Verifiers_Tryjob_RetryConfigValidationError) Field() string { return e.field } 3635 3636 // Reason function returns reason value. 3637 func (e Verifiers_Tryjob_RetryConfigValidationError) Reason() string { return e.reason } 3638 3639 // Cause function returns cause value. 3640 func (e Verifiers_Tryjob_RetryConfigValidationError) Cause() error { return e.cause } 3641 3642 // Key function returns key value. 3643 func (e Verifiers_Tryjob_RetryConfigValidationError) Key() bool { return e.key } 3644 3645 // ErrorName returns error name. 3646 func (e Verifiers_Tryjob_RetryConfigValidationError) ErrorName() string { 3647 return "Verifiers_Tryjob_RetryConfigValidationError" 3648 } 3649 3650 // Error satisfies the builtin error interface 3651 func (e Verifiers_Tryjob_RetryConfigValidationError) Error() string { 3652 cause := "" 3653 if e.cause != nil { 3654 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3655 } 3656 3657 key := "" 3658 if e.key { 3659 key = "key for " 3660 } 3661 3662 return fmt.Sprintf( 3663 "invalid %sVerifiers_Tryjob_RetryConfig.%s: %s%s", 3664 key, 3665 e.field, 3666 e.reason, 3667 cause) 3668 } 3669 3670 var _ error = Verifiers_Tryjob_RetryConfigValidationError{} 3671 3672 var _ interface { 3673 Field() string 3674 Reason() string 3675 Key() bool 3676 Cause() error 3677 ErrorName() string 3678 } = Verifiers_Tryjob_RetryConfigValidationError{} 3679 3680 // Validate checks the field values on Verifiers_Tryjob_Builder_LocationFilter 3681 // with the rules defined in the proto definition for this message. If any 3682 // rules are violated, the first error encountered is returned, or nil if 3683 // there are no violations. 3684 func (m *Verifiers_Tryjob_Builder_LocationFilter) Validate() error { 3685 return m.validate(false) 3686 } 3687 3688 // ValidateAll checks the field values on 3689 // Verifiers_Tryjob_Builder_LocationFilter with the rules defined in the proto 3690 // definition for this message. If any rules are violated, the result is a 3691 // list of violation errors wrapped in 3692 // Verifiers_Tryjob_Builder_LocationFilterMultiError, or nil if none found. 3693 func (m *Verifiers_Tryjob_Builder_LocationFilter) ValidateAll() error { 3694 return m.validate(true) 3695 } 3696 3697 func (m *Verifiers_Tryjob_Builder_LocationFilter) validate(all bool) error { 3698 if m == nil { 3699 return nil 3700 } 3701 3702 var errors []error 3703 3704 // no validation rules for GerritHostRegexp 3705 3706 // no validation rules for GerritProjectRegexp 3707 3708 // no validation rules for PathRegexp 3709 3710 // no validation rules for Exclude 3711 3712 if len(errors) > 0 { 3713 return Verifiers_Tryjob_Builder_LocationFilterMultiError(errors) 3714 } 3715 3716 return nil 3717 } 3718 3719 // Verifiers_Tryjob_Builder_LocationFilterMultiError is an error wrapping 3720 // multiple validation errors returned by 3721 // Verifiers_Tryjob_Builder_LocationFilter.ValidateAll() if the designated 3722 // constraints aren't met. 3723 type Verifiers_Tryjob_Builder_LocationFilterMultiError []error 3724 3725 // Error returns a concatenation of all the error messages it wraps. 3726 func (m Verifiers_Tryjob_Builder_LocationFilterMultiError) Error() string { 3727 var msgs []string 3728 for _, err := range m { 3729 msgs = append(msgs, err.Error()) 3730 } 3731 return strings.Join(msgs, "; ") 3732 } 3733 3734 // AllErrors returns a list of validation violation errors. 3735 func (m Verifiers_Tryjob_Builder_LocationFilterMultiError) AllErrors() []error { return m } 3736 3737 // Verifiers_Tryjob_Builder_LocationFilterValidationError is the validation 3738 // error returned by Verifiers_Tryjob_Builder_LocationFilter.Validate if the 3739 // designated constraints aren't met. 3740 type Verifiers_Tryjob_Builder_LocationFilterValidationError struct { 3741 field string 3742 reason string 3743 cause error 3744 key bool 3745 } 3746 3747 // Field function returns field value. 3748 func (e Verifiers_Tryjob_Builder_LocationFilterValidationError) Field() string { return e.field } 3749 3750 // Reason function returns reason value. 3751 func (e Verifiers_Tryjob_Builder_LocationFilterValidationError) Reason() string { return e.reason } 3752 3753 // Cause function returns cause value. 3754 func (e Verifiers_Tryjob_Builder_LocationFilterValidationError) Cause() error { return e.cause } 3755 3756 // Key function returns key value. 3757 func (e Verifiers_Tryjob_Builder_LocationFilterValidationError) Key() bool { return e.key } 3758 3759 // ErrorName returns error name. 3760 func (e Verifiers_Tryjob_Builder_LocationFilterValidationError) ErrorName() string { 3761 return "Verifiers_Tryjob_Builder_LocationFilterValidationError" 3762 } 3763 3764 // Error satisfies the builtin error interface 3765 func (e Verifiers_Tryjob_Builder_LocationFilterValidationError) Error() string { 3766 cause := "" 3767 if e.cause != nil { 3768 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3769 } 3770 3771 key := "" 3772 if e.key { 3773 key = "key for " 3774 } 3775 3776 return fmt.Sprintf( 3777 "invalid %sVerifiers_Tryjob_Builder_LocationFilter.%s: %s%s", 3778 key, 3779 e.field, 3780 e.reason, 3781 cause) 3782 } 3783 3784 var _ error = Verifiers_Tryjob_Builder_LocationFilterValidationError{} 3785 3786 var _ interface { 3787 Field() string 3788 Reason() string 3789 Key() bool 3790 Cause() error 3791 ErrorName() string 3792 } = Verifiers_Tryjob_Builder_LocationFilterValidationError{} 3793 3794 // Validate checks the field values on UserLimit_Limit with the rules defined 3795 // in the proto definition for this message. If any rules are violated, the 3796 // first error encountered is returned, or nil if there are no violations. 3797 func (m *UserLimit_Limit) Validate() error { 3798 return m.validate(false) 3799 } 3800 3801 // ValidateAll checks the field values on UserLimit_Limit with the rules 3802 // defined in the proto definition for this message. If any rules are 3803 // violated, the result is a list of violation errors wrapped in 3804 // UserLimit_LimitMultiError, or nil if none found. 3805 func (m *UserLimit_Limit) ValidateAll() error { 3806 return m.validate(true) 3807 } 3808 3809 func (m *UserLimit_Limit) validate(all bool) error { 3810 if m == nil { 3811 return nil 3812 } 3813 3814 var errors []error 3815 3816 switch v := m.Limit.(type) { 3817 case *UserLimit_Limit_Value: 3818 if v == nil { 3819 err := UserLimit_LimitValidationError{ 3820 field: "Limit", 3821 reason: "oneof value cannot be a typed-nil", 3822 } 3823 if !all { 3824 return err 3825 } 3826 errors = append(errors, err) 3827 } 3828 // no validation rules for Value 3829 case *UserLimit_Limit_Unlimited: 3830 if v == nil { 3831 err := UserLimit_LimitValidationError{ 3832 field: "Limit", 3833 reason: "oneof value cannot be a typed-nil", 3834 } 3835 if !all { 3836 return err 3837 } 3838 errors = append(errors, err) 3839 } 3840 // no validation rules for Unlimited 3841 default: 3842 _ = v // ensures v is used 3843 } 3844 3845 if len(errors) > 0 { 3846 return UserLimit_LimitMultiError(errors) 3847 } 3848 3849 return nil 3850 } 3851 3852 // UserLimit_LimitMultiError is an error wrapping multiple validation errors 3853 // returned by UserLimit_Limit.ValidateAll() if the designated constraints 3854 // aren't met. 3855 type UserLimit_LimitMultiError []error 3856 3857 // Error returns a concatenation of all the error messages it wraps. 3858 func (m UserLimit_LimitMultiError) Error() string { 3859 var msgs []string 3860 for _, err := range m { 3861 msgs = append(msgs, err.Error()) 3862 } 3863 return strings.Join(msgs, "; ") 3864 } 3865 3866 // AllErrors returns a list of validation violation errors. 3867 func (m UserLimit_LimitMultiError) AllErrors() []error { return m } 3868 3869 // UserLimit_LimitValidationError is the validation error returned by 3870 // UserLimit_Limit.Validate if the designated constraints aren't met. 3871 type UserLimit_LimitValidationError struct { 3872 field string 3873 reason string 3874 cause error 3875 key bool 3876 } 3877 3878 // Field function returns field value. 3879 func (e UserLimit_LimitValidationError) Field() string { return e.field } 3880 3881 // Reason function returns reason value. 3882 func (e UserLimit_LimitValidationError) Reason() string { return e.reason } 3883 3884 // Cause function returns cause value. 3885 func (e UserLimit_LimitValidationError) Cause() error { return e.cause } 3886 3887 // Key function returns key value. 3888 func (e UserLimit_LimitValidationError) Key() bool { return e.key } 3889 3890 // ErrorName returns error name. 3891 func (e UserLimit_LimitValidationError) ErrorName() string { return "UserLimit_LimitValidationError" } 3892 3893 // Error satisfies the builtin error interface 3894 func (e UserLimit_LimitValidationError) Error() string { 3895 cause := "" 3896 if e.cause != nil { 3897 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3898 } 3899 3900 key := "" 3901 if e.key { 3902 key = "key for " 3903 } 3904 3905 return fmt.Sprintf( 3906 "invalid %sUserLimit_Limit.%s: %s%s", 3907 key, 3908 e.field, 3909 e.reason, 3910 cause) 3911 } 3912 3913 var _ error = UserLimit_LimitValidationError{} 3914 3915 var _ interface { 3916 Field() string 3917 Reason() string 3918 Key() bool 3919 Cause() error 3920 ErrorName() string 3921 } = UserLimit_LimitValidationError{} 3922 3923 // Validate checks the field values on UserLimit_Run with the rules defined in 3924 // the proto definition for this message. If any rules are violated, the first 3925 // error encountered is returned, or nil if there are no violations. 3926 func (m *UserLimit_Run) Validate() error { 3927 return m.validate(false) 3928 } 3929 3930 // ValidateAll checks the field values on UserLimit_Run with the rules defined 3931 // in the proto definition for this message. If any rules are violated, the 3932 // result is a list of violation errors wrapped in UserLimit_RunMultiError, or 3933 // nil if none found. 3934 func (m *UserLimit_Run) ValidateAll() error { 3935 return m.validate(true) 3936 } 3937 3938 func (m *UserLimit_Run) validate(all bool) error { 3939 if m == nil { 3940 return nil 3941 } 3942 3943 var errors []error 3944 3945 if all { 3946 switch v := interface{}(m.GetMaxActive()).(type) { 3947 case interface{ ValidateAll() error }: 3948 if err := v.ValidateAll(); err != nil { 3949 errors = append(errors, UserLimit_RunValidationError{ 3950 field: "MaxActive", 3951 reason: "embedded message failed validation", 3952 cause: err, 3953 }) 3954 } 3955 case interface{ Validate() error }: 3956 if err := v.Validate(); err != nil { 3957 errors = append(errors, UserLimit_RunValidationError{ 3958 field: "MaxActive", 3959 reason: "embedded message failed validation", 3960 cause: err, 3961 }) 3962 } 3963 } 3964 } else if v, ok := interface{}(m.GetMaxActive()).(interface{ Validate() error }); ok { 3965 if err := v.Validate(); err != nil { 3966 return UserLimit_RunValidationError{ 3967 field: "MaxActive", 3968 reason: "embedded message failed validation", 3969 cause: err, 3970 } 3971 } 3972 } 3973 3974 // no validation rules for ReachLimitMsg 3975 3976 if len(errors) > 0 { 3977 return UserLimit_RunMultiError(errors) 3978 } 3979 3980 return nil 3981 } 3982 3983 // UserLimit_RunMultiError is an error wrapping multiple validation errors 3984 // returned by UserLimit_Run.ValidateAll() if the designated constraints 3985 // aren't met. 3986 type UserLimit_RunMultiError []error 3987 3988 // Error returns a concatenation of all the error messages it wraps. 3989 func (m UserLimit_RunMultiError) Error() string { 3990 var msgs []string 3991 for _, err := range m { 3992 msgs = append(msgs, err.Error()) 3993 } 3994 return strings.Join(msgs, "; ") 3995 } 3996 3997 // AllErrors returns a list of validation violation errors. 3998 func (m UserLimit_RunMultiError) AllErrors() []error { return m } 3999 4000 // UserLimit_RunValidationError is the validation error returned by 4001 // UserLimit_Run.Validate if the designated constraints aren't met. 4002 type UserLimit_RunValidationError struct { 4003 field string 4004 reason string 4005 cause error 4006 key bool 4007 } 4008 4009 // Field function returns field value. 4010 func (e UserLimit_RunValidationError) Field() string { return e.field } 4011 4012 // Reason function returns reason value. 4013 func (e UserLimit_RunValidationError) Reason() string { return e.reason } 4014 4015 // Cause function returns cause value. 4016 func (e UserLimit_RunValidationError) Cause() error { return e.cause } 4017 4018 // Key function returns key value. 4019 func (e UserLimit_RunValidationError) Key() bool { return e.key } 4020 4021 // ErrorName returns error name. 4022 func (e UserLimit_RunValidationError) ErrorName() string { return "UserLimit_RunValidationError" } 4023 4024 // Error satisfies the builtin error interface 4025 func (e UserLimit_RunValidationError) Error() string { 4026 cause := "" 4027 if e.cause != nil { 4028 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4029 } 4030 4031 key := "" 4032 if e.key { 4033 key = "key for " 4034 } 4035 4036 return fmt.Sprintf( 4037 "invalid %sUserLimit_Run.%s: %s%s", 4038 key, 4039 e.field, 4040 e.reason, 4041 cause) 4042 } 4043 4044 var _ error = UserLimit_RunValidationError{} 4045 4046 var _ interface { 4047 Field() string 4048 Reason() string 4049 Key() bool 4050 Cause() error 4051 ErrorName() string 4052 } = UserLimit_RunValidationError{} 4053 4054 // Validate checks the field values on UserLimit_Tryjob with the rules defined 4055 // in the proto definition for this message. If any rules are violated, the 4056 // first error encountered is returned, or nil if there are no violations. 4057 func (m *UserLimit_Tryjob) Validate() error { 4058 return m.validate(false) 4059 } 4060 4061 // ValidateAll checks the field values on UserLimit_Tryjob with the rules 4062 // defined in the proto definition for this message. If any rules are 4063 // violated, the result is a list of violation errors wrapped in 4064 // UserLimit_TryjobMultiError, or nil if none found. 4065 func (m *UserLimit_Tryjob) ValidateAll() error { 4066 return m.validate(true) 4067 } 4068 4069 func (m *UserLimit_Tryjob) validate(all bool) error { 4070 if m == nil { 4071 return nil 4072 } 4073 4074 var errors []error 4075 4076 if all { 4077 switch v := interface{}(m.GetMaxActive()).(type) { 4078 case interface{ ValidateAll() error }: 4079 if err := v.ValidateAll(); err != nil { 4080 errors = append(errors, UserLimit_TryjobValidationError{ 4081 field: "MaxActive", 4082 reason: "embedded message failed validation", 4083 cause: err, 4084 }) 4085 } 4086 case interface{ Validate() error }: 4087 if err := v.Validate(); err != nil { 4088 errors = append(errors, UserLimit_TryjobValidationError{ 4089 field: "MaxActive", 4090 reason: "embedded message failed validation", 4091 cause: err, 4092 }) 4093 } 4094 } 4095 } else if v, ok := interface{}(m.GetMaxActive()).(interface{ Validate() error }); ok { 4096 if err := v.Validate(); err != nil { 4097 return UserLimit_TryjobValidationError{ 4098 field: "MaxActive", 4099 reason: "embedded message failed validation", 4100 cause: err, 4101 } 4102 } 4103 } 4104 4105 if len(errors) > 0 { 4106 return UserLimit_TryjobMultiError(errors) 4107 } 4108 4109 return nil 4110 } 4111 4112 // UserLimit_TryjobMultiError is an error wrapping multiple validation errors 4113 // returned by UserLimit_Tryjob.ValidateAll() if the designated constraints 4114 // aren't met. 4115 type UserLimit_TryjobMultiError []error 4116 4117 // Error returns a concatenation of all the error messages it wraps. 4118 func (m UserLimit_TryjobMultiError) Error() string { 4119 var msgs []string 4120 for _, err := range m { 4121 msgs = append(msgs, err.Error()) 4122 } 4123 return strings.Join(msgs, "; ") 4124 } 4125 4126 // AllErrors returns a list of validation violation errors. 4127 func (m UserLimit_TryjobMultiError) AllErrors() []error { return m } 4128 4129 // UserLimit_TryjobValidationError is the validation error returned by 4130 // UserLimit_Tryjob.Validate if the designated constraints aren't met. 4131 type UserLimit_TryjobValidationError struct { 4132 field string 4133 reason string 4134 cause error 4135 key bool 4136 } 4137 4138 // Field function returns field value. 4139 func (e UserLimit_TryjobValidationError) Field() string { return e.field } 4140 4141 // Reason function returns reason value. 4142 func (e UserLimit_TryjobValidationError) Reason() string { return e.reason } 4143 4144 // Cause function returns cause value. 4145 func (e UserLimit_TryjobValidationError) Cause() error { return e.cause } 4146 4147 // Key function returns key value. 4148 func (e UserLimit_TryjobValidationError) Key() bool { return e.key } 4149 4150 // ErrorName returns error name. 4151 func (e UserLimit_TryjobValidationError) ErrorName() string { return "UserLimit_TryjobValidationError" } 4152 4153 // Error satisfies the builtin error interface 4154 func (e UserLimit_TryjobValidationError) Error() string { 4155 cause := "" 4156 if e.cause != nil { 4157 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4158 } 4159 4160 key := "" 4161 if e.key { 4162 key = "key for " 4163 } 4164 4165 return fmt.Sprintf( 4166 "invalid %sUserLimit_Tryjob.%s: %s%s", 4167 key, 4168 e.field, 4169 e.reason, 4170 cause) 4171 } 4172 4173 var _ error = UserLimit_TryjobValidationError{} 4174 4175 var _ interface { 4176 Field() string 4177 Reason() string 4178 Key() bool 4179 Cause() error 4180 ErrorName() string 4181 } = UserLimit_TryjobValidationError{}