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