github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/pkg/proto/developer/v1/developer.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: developer/v1/developer.proto 3 4 package developerv1 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 22 // ensure the imports are used 23 var ( 24 _ = bytes.MinRead 25 _ = errors.New("") 26 _ = fmt.Print 27 _ = utf8.UTFMax 28 _ = (*regexp.Regexp)(nil) 29 _ = (*strings.Reader)(nil) 30 _ = net.IPv4len 31 _ = time.Duration(0) 32 _ = (*url.URL)(nil) 33 _ = (*mail.Address)(nil) 34 _ = anypb.Any{} 35 _ = sort.Sort 36 ) 37 38 // Validate checks the field values on DeveloperRequest with the rules defined 39 // in the proto definition for this message. If any rules are violated, the 40 // first error encountered is returned, or nil if there are no violations. 41 func (m *DeveloperRequest) Validate() error { 42 return m.validate(false) 43 } 44 45 // ValidateAll checks the field values on DeveloperRequest with the rules 46 // defined in the proto definition for this message. If any rules are 47 // violated, the result is a list of violation errors wrapped in 48 // DeveloperRequestMultiError, or nil if none found. 49 func (m *DeveloperRequest) ValidateAll() error { 50 return m.validate(true) 51 } 52 53 func (m *DeveloperRequest) validate(all bool) error { 54 if m == nil { 55 return nil 56 } 57 58 var errors []error 59 60 if all { 61 switch v := interface{}(m.GetContext()).(type) { 62 case interface{ ValidateAll() error }: 63 if err := v.ValidateAll(); err != nil { 64 errors = append(errors, DeveloperRequestValidationError{ 65 field: "Context", 66 reason: "embedded message failed validation", 67 cause: err, 68 }) 69 } 70 case interface{ Validate() error }: 71 if err := v.Validate(); err != nil { 72 errors = append(errors, DeveloperRequestValidationError{ 73 field: "Context", 74 reason: "embedded message failed validation", 75 cause: err, 76 }) 77 } 78 } 79 } else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { 80 if err := v.Validate(); err != nil { 81 return DeveloperRequestValidationError{ 82 field: "Context", 83 reason: "embedded message failed validation", 84 cause: err, 85 } 86 } 87 } 88 89 for idx, item := range m.GetOperations() { 90 _, _ = idx, item 91 92 if all { 93 switch v := interface{}(item).(type) { 94 case interface{ ValidateAll() error }: 95 if err := v.ValidateAll(); err != nil { 96 errors = append(errors, DeveloperRequestValidationError{ 97 field: fmt.Sprintf("Operations[%v]", idx), 98 reason: "embedded message failed validation", 99 cause: err, 100 }) 101 } 102 case interface{ Validate() error }: 103 if err := v.Validate(); err != nil { 104 errors = append(errors, DeveloperRequestValidationError{ 105 field: fmt.Sprintf("Operations[%v]", idx), 106 reason: "embedded message failed validation", 107 cause: err, 108 }) 109 } 110 } 111 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 112 if err := v.Validate(); err != nil { 113 return DeveloperRequestValidationError{ 114 field: fmt.Sprintf("Operations[%v]", idx), 115 reason: "embedded message failed validation", 116 cause: err, 117 } 118 } 119 } 120 121 } 122 123 if len(errors) > 0 { 124 return DeveloperRequestMultiError(errors) 125 } 126 127 return nil 128 } 129 130 // DeveloperRequestMultiError is an error wrapping multiple validation errors 131 // returned by DeveloperRequest.ValidateAll() if the designated constraints 132 // aren't met. 133 type DeveloperRequestMultiError []error 134 135 // Error returns a concatenation of all the error messages it wraps. 136 func (m DeveloperRequestMultiError) Error() string { 137 var msgs []string 138 for _, err := range m { 139 msgs = append(msgs, err.Error()) 140 } 141 return strings.Join(msgs, "; ") 142 } 143 144 // AllErrors returns a list of validation violation errors. 145 func (m DeveloperRequestMultiError) AllErrors() []error { return m } 146 147 // DeveloperRequestValidationError is the validation error returned by 148 // DeveloperRequest.Validate if the designated constraints aren't met. 149 type DeveloperRequestValidationError struct { 150 field string 151 reason string 152 cause error 153 key bool 154 } 155 156 // Field function returns field value. 157 func (e DeveloperRequestValidationError) Field() string { return e.field } 158 159 // Reason function returns reason value. 160 func (e DeveloperRequestValidationError) Reason() string { return e.reason } 161 162 // Cause function returns cause value. 163 func (e DeveloperRequestValidationError) Cause() error { return e.cause } 164 165 // Key function returns key value. 166 func (e DeveloperRequestValidationError) Key() bool { return e.key } 167 168 // ErrorName returns error name. 169 func (e DeveloperRequestValidationError) ErrorName() string { return "DeveloperRequestValidationError" } 170 171 // Error satisfies the builtin error interface 172 func (e DeveloperRequestValidationError) Error() string { 173 cause := "" 174 if e.cause != nil { 175 cause = fmt.Sprintf(" | caused by: %v", e.cause) 176 } 177 178 key := "" 179 if e.key { 180 key = "key for " 181 } 182 183 return fmt.Sprintf( 184 "invalid %sDeveloperRequest.%s: %s%s", 185 key, 186 e.field, 187 e.reason, 188 cause) 189 } 190 191 var _ error = DeveloperRequestValidationError{} 192 193 var _ interface { 194 Field() string 195 Reason() string 196 Key() bool 197 Cause() error 198 ErrorName() string 199 } = DeveloperRequestValidationError{} 200 201 // Validate checks the field values on DeveloperResponse with the rules defined 202 // in the proto definition for this message. If any rules are violated, the 203 // first error encountered is returned, or nil if there are no violations. 204 func (m *DeveloperResponse) Validate() error { 205 return m.validate(false) 206 } 207 208 // ValidateAll checks the field values on DeveloperResponse with the rules 209 // defined in the proto definition for this message. If any rules are 210 // violated, the result is a list of violation errors wrapped in 211 // DeveloperResponseMultiError, or nil if none found. 212 func (m *DeveloperResponse) ValidateAll() error { 213 return m.validate(true) 214 } 215 216 func (m *DeveloperResponse) validate(all bool) error { 217 if m == nil { 218 return nil 219 } 220 221 var errors []error 222 223 // no validation rules for InternalError 224 225 if all { 226 switch v := interface{}(m.GetDeveloperErrors()).(type) { 227 case interface{ ValidateAll() error }: 228 if err := v.ValidateAll(); err != nil { 229 errors = append(errors, DeveloperResponseValidationError{ 230 field: "DeveloperErrors", 231 reason: "embedded message failed validation", 232 cause: err, 233 }) 234 } 235 case interface{ Validate() error }: 236 if err := v.Validate(); err != nil { 237 errors = append(errors, DeveloperResponseValidationError{ 238 field: "DeveloperErrors", 239 reason: "embedded message failed validation", 240 cause: err, 241 }) 242 } 243 } 244 } else if v, ok := interface{}(m.GetDeveloperErrors()).(interface{ Validate() error }); ok { 245 if err := v.Validate(); err != nil { 246 return DeveloperResponseValidationError{ 247 field: "DeveloperErrors", 248 reason: "embedded message failed validation", 249 cause: err, 250 } 251 } 252 } 253 254 if all { 255 switch v := interface{}(m.GetOperationsResults()).(type) { 256 case interface{ ValidateAll() error }: 257 if err := v.ValidateAll(); err != nil { 258 errors = append(errors, DeveloperResponseValidationError{ 259 field: "OperationsResults", 260 reason: "embedded message failed validation", 261 cause: err, 262 }) 263 } 264 case interface{ Validate() error }: 265 if err := v.Validate(); err != nil { 266 errors = append(errors, DeveloperResponseValidationError{ 267 field: "OperationsResults", 268 reason: "embedded message failed validation", 269 cause: err, 270 }) 271 } 272 } 273 } else if v, ok := interface{}(m.GetOperationsResults()).(interface{ Validate() error }); ok { 274 if err := v.Validate(); err != nil { 275 return DeveloperResponseValidationError{ 276 field: "OperationsResults", 277 reason: "embedded message failed validation", 278 cause: err, 279 } 280 } 281 } 282 283 if len(errors) > 0 { 284 return DeveloperResponseMultiError(errors) 285 } 286 287 return nil 288 } 289 290 // DeveloperResponseMultiError is an error wrapping multiple validation errors 291 // returned by DeveloperResponse.ValidateAll() if the designated constraints 292 // aren't met. 293 type DeveloperResponseMultiError []error 294 295 // Error returns a concatenation of all the error messages it wraps. 296 func (m DeveloperResponseMultiError) Error() string { 297 var msgs []string 298 for _, err := range m { 299 msgs = append(msgs, err.Error()) 300 } 301 return strings.Join(msgs, "; ") 302 } 303 304 // AllErrors returns a list of validation violation errors. 305 func (m DeveloperResponseMultiError) AllErrors() []error { return m } 306 307 // DeveloperResponseValidationError is the validation error returned by 308 // DeveloperResponse.Validate if the designated constraints aren't met. 309 type DeveloperResponseValidationError struct { 310 field string 311 reason string 312 cause error 313 key bool 314 } 315 316 // Field function returns field value. 317 func (e DeveloperResponseValidationError) Field() string { return e.field } 318 319 // Reason function returns reason value. 320 func (e DeveloperResponseValidationError) Reason() string { return e.reason } 321 322 // Cause function returns cause value. 323 func (e DeveloperResponseValidationError) Cause() error { return e.cause } 324 325 // Key function returns key value. 326 func (e DeveloperResponseValidationError) Key() bool { return e.key } 327 328 // ErrorName returns error name. 329 func (e DeveloperResponseValidationError) ErrorName() string { 330 return "DeveloperResponseValidationError" 331 } 332 333 // Error satisfies the builtin error interface 334 func (e DeveloperResponseValidationError) Error() string { 335 cause := "" 336 if e.cause != nil { 337 cause = fmt.Sprintf(" | caused by: %v", e.cause) 338 } 339 340 key := "" 341 if e.key { 342 key = "key for " 343 } 344 345 return fmt.Sprintf( 346 "invalid %sDeveloperResponse.%s: %s%s", 347 key, 348 e.field, 349 e.reason, 350 cause) 351 } 352 353 var _ error = DeveloperResponseValidationError{} 354 355 var _ interface { 356 Field() string 357 Reason() string 358 Key() bool 359 Cause() error 360 ErrorName() string 361 } = DeveloperResponseValidationError{} 362 363 // Validate checks the field values on RequestContext with the rules defined in 364 // the proto definition for this message. If any rules are violated, the first 365 // error encountered is returned, or nil if there are no violations. 366 func (m *RequestContext) Validate() error { 367 return m.validate(false) 368 } 369 370 // ValidateAll checks the field values on RequestContext with the rules defined 371 // in the proto definition for this message. If any rules are violated, the 372 // result is a list of violation errors wrapped in RequestContextMultiError, 373 // or nil if none found. 374 func (m *RequestContext) ValidateAll() error { 375 return m.validate(true) 376 } 377 378 func (m *RequestContext) validate(all bool) error { 379 if m == nil { 380 return nil 381 } 382 383 var errors []error 384 385 // no validation rules for Schema 386 387 for idx, item := range m.GetRelationships() { 388 _, _ = idx, item 389 390 if all { 391 switch v := interface{}(item).(type) { 392 case interface{ ValidateAll() error }: 393 if err := v.ValidateAll(); err != nil { 394 errors = append(errors, RequestContextValidationError{ 395 field: fmt.Sprintf("Relationships[%v]", idx), 396 reason: "embedded message failed validation", 397 cause: err, 398 }) 399 } 400 case interface{ Validate() error }: 401 if err := v.Validate(); err != nil { 402 errors = append(errors, RequestContextValidationError{ 403 field: fmt.Sprintf("Relationships[%v]", idx), 404 reason: "embedded message failed validation", 405 cause: err, 406 }) 407 } 408 } 409 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 410 if err := v.Validate(); err != nil { 411 return RequestContextValidationError{ 412 field: fmt.Sprintf("Relationships[%v]", idx), 413 reason: "embedded message failed validation", 414 cause: err, 415 } 416 } 417 } 418 419 } 420 421 if len(errors) > 0 { 422 return RequestContextMultiError(errors) 423 } 424 425 return nil 426 } 427 428 // RequestContextMultiError is an error wrapping multiple validation errors 429 // returned by RequestContext.ValidateAll() if the designated constraints 430 // aren't met. 431 type RequestContextMultiError []error 432 433 // Error returns a concatenation of all the error messages it wraps. 434 func (m RequestContextMultiError) Error() string { 435 var msgs []string 436 for _, err := range m { 437 msgs = append(msgs, err.Error()) 438 } 439 return strings.Join(msgs, "; ") 440 } 441 442 // AllErrors returns a list of validation violation errors. 443 func (m RequestContextMultiError) AllErrors() []error { return m } 444 445 // RequestContextValidationError is the validation error returned by 446 // RequestContext.Validate if the designated constraints aren't met. 447 type RequestContextValidationError struct { 448 field string 449 reason string 450 cause error 451 key bool 452 } 453 454 // Field function returns field value. 455 func (e RequestContextValidationError) Field() string { return e.field } 456 457 // Reason function returns reason value. 458 func (e RequestContextValidationError) Reason() string { return e.reason } 459 460 // Cause function returns cause value. 461 func (e RequestContextValidationError) Cause() error { return e.cause } 462 463 // Key function returns key value. 464 func (e RequestContextValidationError) Key() bool { return e.key } 465 466 // ErrorName returns error name. 467 func (e RequestContextValidationError) ErrorName() string { return "RequestContextValidationError" } 468 469 // Error satisfies the builtin error interface 470 func (e RequestContextValidationError) Error() string { 471 cause := "" 472 if e.cause != nil { 473 cause = fmt.Sprintf(" | caused by: %v", e.cause) 474 } 475 476 key := "" 477 if e.key { 478 key = "key for " 479 } 480 481 return fmt.Sprintf( 482 "invalid %sRequestContext.%s: %s%s", 483 key, 484 e.field, 485 e.reason, 486 cause) 487 } 488 489 var _ error = RequestContextValidationError{} 490 491 var _ interface { 492 Field() string 493 Reason() string 494 Key() bool 495 Cause() error 496 ErrorName() string 497 } = RequestContextValidationError{} 498 499 // Validate checks the field values on Operation with the rules defined in the 500 // proto definition for this message. If any rules are violated, the first 501 // error encountered is returned, or nil if there are no violations. 502 func (m *Operation) Validate() error { 503 return m.validate(false) 504 } 505 506 // ValidateAll checks the field values on Operation with the rules defined in 507 // the proto definition for this message. If any rules are violated, the 508 // result is a list of violation errors wrapped in OperationMultiError, or nil 509 // if none found. 510 func (m *Operation) ValidateAll() error { 511 return m.validate(true) 512 } 513 514 func (m *Operation) validate(all bool) error { 515 if m == nil { 516 return nil 517 } 518 519 var errors []error 520 521 if all { 522 switch v := interface{}(m.GetCheckParameters()).(type) { 523 case interface{ ValidateAll() error }: 524 if err := v.ValidateAll(); err != nil { 525 errors = append(errors, OperationValidationError{ 526 field: "CheckParameters", 527 reason: "embedded message failed validation", 528 cause: err, 529 }) 530 } 531 case interface{ Validate() error }: 532 if err := v.Validate(); err != nil { 533 errors = append(errors, OperationValidationError{ 534 field: "CheckParameters", 535 reason: "embedded message failed validation", 536 cause: err, 537 }) 538 } 539 } 540 } else if v, ok := interface{}(m.GetCheckParameters()).(interface{ Validate() error }); ok { 541 if err := v.Validate(); err != nil { 542 return OperationValidationError{ 543 field: "CheckParameters", 544 reason: "embedded message failed validation", 545 cause: err, 546 } 547 } 548 } 549 550 if all { 551 switch v := interface{}(m.GetAssertionsParameters()).(type) { 552 case interface{ ValidateAll() error }: 553 if err := v.ValidateAll(); err != nil { 554 errors = append(errors, OperationValidationError{ 555 field: "AssertionsParameters", 556 reason: "embedded message failed validation", 557 cause: err, 558 }) 559 } 560 case interface{ Validate() error }: 561 if err := v.Validate(); err != nil { 562 errors = append(errors, OperationValidationError{ 563 field: "AssertionsParameters", 564 reason: "embedded message failed validation", 565 cause: err, 566 }) 567 } 568 } 569 } else if v, ok := interface{}(m.GetAssertionsParameters()).(interface{ Validate() error }); ok { 570 if err := v.Validate(); err != nil { 571 return OperationValidationError{ 572 field: "AssertionsParameters", 573 reason: "embedded message failed validation", 574 cause: err, 575 } 576 } 577 } 578 579 if all { 580 switch v := interface{}(m.GetValidationParameters()).(type) { 581 case interface{ ValidateAll() error }: 582 if err := v.ValidateAll(); err != nil { 583 errors = append(errors, OperationValidationError{ 584 field: "ValidationParameters", 585 reason: "embedded message failed validation", 586 cause: err, 587 }) 588 } 589 case interface{ Validate() error }: 590 if err := v.Validate(); err != nil { 591 errors = append(errors, OperationValidationError{ 592 field: "ValidationParameters", 593 reason: "embedded message failed validation", 594 cause: err, 595 }) 596 } 597 } 598 } else if v, ok := interface{}(m.GetValidationParameters()).(interface{ Validate() error }); ok { 599 if err := v.Validate(); err != nil { 600 return OperationValidationError{ 601 field: "ValidationParameters", 602 reason: "embedded message failed validation", 603 cause: err, 604 } 605 } 606 } 607 608 if all { 609 switch v := interface{}(m.GetFormatSchemaParameters()).(type) { 610 case interface{ ValidateAll() error }: 611 if err := v.ValidateAll(); err != nil { 612 errors = append(errors, OperationValidationError{ 613 field: "FormatSchemaParameters", 614 reason: "embedded message failed validation", 615 cause: err, 616 }) 617 } 618 case interface{ Validate() error }: 619 if err := v.Validate(); err != nil { 620 errors = append(errors, OperationValidationError{ 621 field: "FormatSchemaParameters", 622 reason: "embedded message failed validation", 623 cause: err, 624 }) 625 } 626 } 627 } else if v, ok := interface{}(m.GetFormatSchemaParameters()).(interface{ Validate() error }); ok { 628 if err := v.Validate(); err != nil { 629 return OperationValidationError{ 630 field: "FormatSchemaParameters", 631 reason: "embedded message failed validation", 632 cause: err, 633 } 634 } 635 } 636 637 if len(errors) > 0 { 638 return OperationMultiError(errors) 639 } 640 641 return nil 642 } 643 644 // OperationMultiError is an error wrapping multiple validation errors returned 645 // by Operation.ValidateAll() if the designated constraints aren't met. 646 type OperationMultiError []error 647 648 // Error returns a concatenation of all the error messages it wraps. 649 func (m OperationMultiError) Error() string { 650 var msgs []string 651 for _, err := range m { 652 msgs = append(msgs, err.Error()) 653 } 654 return strings.Join(msgs, "; ") 655 } 656 657 // AllErrors returns a list of validation violation errors. 658 func (m OperationMultiError) AllErrors() []error { return m } 659 660 // OperationValidationError is the validation error returned by 661 // Operation.Validate if the designated constraints aren't met. 662 type OperationValidationError struct { 663 field string 664 reason string 665 cause error 666 key bool 667 } 668 669 // Field function returns field value. 670 func (e OperationValidationError) Field() string { return e.field } 671 672 // Reason function returns reason value. 673 func (e OperationValidationError) Reason() string { return e.reason } 674 675 // Cause function returns cause value. 676 func (e OperationValidationError) Cause() error { return e.cause } 677 678 // Key function returns key value. 679 func (e OperationValidationError) Key() bool { return e.key } 680 681 // ErrorName returns error name. 682 func (e OperationValidationError) ErrorName() string { return "OperationValidationError" } 683 684 // Error satisfies the builtin error interface 685 func (e OperationValidationError) Error() string { 686 cause := "" 687 if e.cause != nil { 688 cause = fmt.Sprintf(" | caused by: %v", e.cause) 689 } 690 691 key := "" 692 if e.key { 693 key = "key for " 694 } 695 696 return fmt.Sprintf( 697 "invalid %sOperation.%s: %s%s", 698 key, 699 e.field, 700 e.reason, 701 cause) 702 } 703 704 var _ error = OperationValidationError{} 705 706 var _ interface { 707 Field() string 708 Reason() string 709 Key() bool 710 Cause() error 711 ErrorName() string 712 } = OperationValidationError{} 713 714 // Validate checks the field values on OperationsResults with the rules defined 715 // in the proto definition for this message. If any rules are violated, the 716 // first error encountered is returned, or nil if there are no violations. 717 func (m *OperationsResults) Validate() error { 718 return m.validate(false) 719 } 720 721 // ValidateAll checks the field values on OperationsResults with the rules 722 // defined in the proto definition for this message. If any rules are 723 // violated, the result is a list of violation errors wrapped in 724 // OperationsResultsMultiError, or nil if none found. 725 func (m *OperationsResults) ValidateAll() error { 726 return m.validate(true) 727 } 728 729 func (m *OperationsResults) validate(all bool) error { 730 if m == nil { 731 return nil 732 } 733 734 var errors []error 735 736 { 737 sorted_keys := make([]uint64, len(m.GetResults())) 738 i := 0 739 for key := range m.GetResults() { 740 sorted_keys[i] = key 741 i++ 742 } 743 sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) 744 for _, key := range sorted_keys { 745 val := m.GetResults()[key] 746 _ = val 747 748 // no validation rules for Results[key] 749 750 if all { 751 switch v := interface{}(val).(type) { 752 case interface{ ValidateAll() error }: 753 if err := v.ValidateAll(); err != nil { 754 errors = append(errors, OperationsResultsValidationError{ 755 field: fmt.Sprintf("Results[%v]", key), 756 reason: "embedded message failed validation", 757 cause: err, 758 }) 759 } 760 case interface{ Validate() error }: 761 if err := v.Validate(); err != nil { 762 errors = append(errors, OperationsResultsValidationError{ 763 field: fmt.Sprintf("Results[%v]", key), 764 reason: "embedded message failed validation", 765 cause: err, 766 }) 767 } 768 } 769 } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { 770 if err := v.Validate(); err != nil { 771 return OperationsResultsValidationError{ 772 field: fmt.Sprintf("Results[%v]", key), 773 reason: "embedded message failed validation", 774 cause: err, 775 } 776 } 777 } 778 779 } 780 } 781 782 if len(errors) > 0 { 783 return OperationsResultsMultiError(errors) 784 } 785 786 return nil 787 } 788 789 // OperationsResultsMultiError is an error wrapping multiple validation errors 790 // returned by OperationsResults.ValidateAll() if the designated constraints 791 // aren't met. 792 type OperationsResultsMultiError []error 793 794 // Error returns a concatenation of all the error messages it wraps. 795 func (m OperationsResultsMultiError) Error() string { 796 var msgs []string 797 for _, err := range m { 798 msgs = append(msgs, err.Error()) 799 } 800 return strings.Join(msgs, "; ") 801 } 802 803 // AllErrors returns a list of validation violation errors. 804 func (m OperationsResultsMultiError) AllErrors() []error { return m } 805 806 // OperationsResultsValidationError is the validation error returned by 807 // OperationsResults.Validate if the designated constraints aren't met. 808 type OperationsResultsValidationError struct { 809 field string 810 reason string 811 cause error 812 key bool 813 } 814 815 // Field function returns field value. 816 func (e OperationsResultsValidationError) Field() string { return e.field } 817 818 // Reason function returns reason value. 819 func (e OperationsResultsValidationError) Reason() string { return e.reason } 820 821 // Cause function returns cause value. 822 func (e OperationsResultsValidationError) Cause() error { return e.cause } 823 824 // Key function returns key value. 825 func (e OperationsResultsValidationError) Key() bool { return e.key } 826 827 // ErrorName returns error name. 828 func (e OperationsResultsValidationError) ErrorName() string { 829 return "OperationsResultsValidationError" 830 } 831 832 // Error satisfies the builtin error interface 833 func (e OperationsResultsValidationError) Error() string { 834 cause := "" 835 if e.cause != nil { 836 cause = fmt.Sprintf(" | caused by: %v", e.cause) 837 } 838 839 key := "" 840 if e.key { 841 key = "key for " 842 } 843 844 return fmt.Sprintf( 845 "invalid %sOperationsResults.%s: %s%s", 846 key, 847 e.field, 848 e.reason, 849 cause) 850 } 851 852 var _ error = OperationsResultsValidationError{} 853 854 var _ interface { 855 Field() string 856 Reason() string 857 Key() bool 858 Cause() error 859 ErrorName() string 860 } = OperationsResultsValidationError{} 861 862 // Validate checks the field values on OperationResult with the rules defined 863 // in the proto definition for this message. If any rules are violated, the 864 // first error encountered is returned, or nil if there are no violations. 865 func (m *OperationResult) Validate() error { 866 return m.validate(false) 867 } 868 869 // ValidateAll checks the field values on OperationResult with the rules 870 // defined in the proto definition for this message. If any rules are 871 // violated, the result is a list of violation errors wrapped in 872 // OperationResultMultiError, or nil if none found. 873 func (m *OperationResult) ValidateAll() error { 874 return m.validate(true) 875 } 876 877 func (m *OperationResult) validate(all bool) error { 878 if m == nil { 879 return nil 880 } 881 882 var errors []error 883 884 if all { 885 switch v := interface{}(m.GetCheckResult()).(type) { 886 case interface{ ValidateAll() error }: 887 if err := v.ValidateAll(); err != nil { 888 errors = append(errors, OperationResultValidationError{ 889 field: "CheckResult", 890 reason: "embedded message failed validation", 891 cause: err, 892 }) 893 } 894 case interface{ Validate() error }: 895 if err := v.Validate(); err != nil { 896 errors = append(errors, OperationResultValidationError{ 897 field: "CheckResult", 898 reason: "embedded message failed validation", 899 cause: err, 900 }) 901 } 902 } 903 } else if v, ok := interface{}(m.GetCheckResult()).(interface{ Validate() error }); ok { 904 if err := v.Validate(); err != nil { 905 return OperationResultValidationError{ 906 field: "CheckResult", 907 reason: "embedded message failed validation", 908 cause: err, 909 } 910 } 911 } 912 913 if all { 914 switch v := interface{}(m.GetAssertionsResult()).(type) { 915 case interface{ ValidateAll() error }: 916 if err := v.ValidateAll(); err != nil { 917 errors = append(errors, OperationResultValidationError{ 918 field: "AssertionsResult", 919 reason: "embedded message failed validation", 920 cause: err, 921 }) 922 } 923 case interface{ Validate() error }: 924 if err := v.Validate(); err != nil { 925 errors = append(errors, OperationResultValidationError{ 926 field: "AssertionsResult", 927 reason: "embedded message failed validation", 928 cause: err, 929 }) 930 } 931 } 932 } else if v, ok := interface{}(m.GetAssertionsResult()).(interface{ Validate() error }); ok { 933 if err := v.Validate(); err != nil { 934 return OperationResultValidationError{ 935 field: "AssertionsResult", 936 reason: "embedded message failed validation", 937 cause: err, 938 } 939 } 940 } 941 942 if all { 943 switch v := interface{}(m.GetValidationResult()).(type) { 944 case interface{ ValidateAll() error }: 945 if err := v.ValidateAll(); err != nil { 946 errors = append(errors, OperationResultValidationError{ 947 field: "ValidationResult", 948 reason: "embedded message failed validation", 949 cause: err, 950 }) 951 } 952 case interface{ Validate() error }: 953 if err := v.Validate(); err != nil { 954 errors = append(errors, OperationResultValidationError{ 955 field: "ValidationResult", 956 reason: "embedded message failed validation", 957 cause: err, 958 }) 959 } 960 } 961 } else if v, ok := interface{}(m.GetValidationResult()).(interface{ Validate() error }); ok { 962 if err := v.Validate(); err != nil { 963 return OperationResultValidationError{ 964 field: "ValidationResult", 965 reason: "embedded message failed validation", 966 cause: err, 967 } 968 } 969 } 970 971 if all { 972 switch v := interface{}(m.GetFormatSchemaResult()).(type) { 973 case interface{ ValidateAll() error }: 974 if err := v.ValidateAll(); err != nil { 975 errors = append(errors, OperationResultValidationError{ 976 field: "FormatSchemaResult", 977 reason: "embedded message failed validation", 978 cause: err, 979 }) 980 } 981 case interface{ Validate() error }: 982 if err := v.Validate(); err != nil { 983 errors = append(errors, OperationResultValidationError{ 984 field: "FormatSchemaResult", 985 reason: "embedded message failed validation", 986 cause: err, 987 }) 988 } 989 } 990 } else if v, ok := interface{}(m.GetFormatSchemaResult()).(interface{ Validate() error }); ok { 991 if err := v.Validate(); err != nil { 992 return OperationResultValidationError{ 993 field: "FormatSchemaResult", 994 reason: "embedded message failed validation", 995 cause: err, 996 } 997 } 998 } 999 1000 if len(errors) > 0 { 1001 return OperationResultMultiError(errors) 1002 } 1003 1004 return nil 1005 } 1006 1007 // OperationResultMultiError is an error wrapping multiple validation errors 1008 // returned by OperationResult.ValidateAll() if the designated constraints 1009 // aren't met. 1010 type OperationResultMultiError []error 1011 1012 // Error returns a concatenation of all the error messages it wraps. 1013 func (m OperationResultMultiError) Error() string { 1014 var msgs []string 1015 for _, err := range m { 1016 msgs = append(msgs, err.Error()) 1017 } 1018 return strings.Join(msgs, "; ") 1019 } 1020 1021 // AllErrors returns a list of validation violation errors. 1022 func (m OperationResultMultiError) AllErrors() []error { return m } 1023 1024 // OperationResultValidationError is the validation error returned by 1025 // OperationResult.Validate if the designated constraints aren't met. 1026 type OperationResultValidationError struct { 1027 field string 1028 reason string 1029 cause error 1030 key bool 1031 } 1032 1033 // Field function returns field value. 1034 func (e OperationResultValidationError) Field() string { return e.field } 1035 1036 // Reason function returns reason value. 1037 func (e OperationResultValidationError) Reason() string { return e.reason } 1038 1039 // Cause function returns cause value. 1040 func (e OperationResultValidationError) Cause() error { return e.cause } 1041 1042 // Key function returns key value. 1043 func (e OperationResultValidationError) Key() bool { return e.key } 1044 1045 // ErrorName returns error name. 1046 func (e OperationResultValidationError) ErrorName() string { return "OperationResultValidationError" } 1047 1048 // Error satisfies the builtin error interface 1049 func (e OperationResultValidationError) Error() string { 1050 cause := "" 1051 if e.cause != nil { 1052 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1053 } 1054 1055 key := "" 1056 if e.key { 1057 key = "key for " 1058 } 1059 1060 return fmt.Sprintf( 1061 "invalid %sOperationResult.%s: %s%s", 1062 key, 1063 e.field, 1064 e.reason, 1065 cause) 1066 } 1067 1068 var _ error = OperationResultValidationError{} 1069 1070 var _ interface { 1071 Field() string 1072 Reason() string 1073 Key() bool 1074 Cause() error 1075 ErrorName() string 1076 } = OperationResultValidationError{} 1077 1078 // Validate checks the field values on DeveloperWarning with the rules defined 1079 // in the proto definition for this message. If any rules are violated, the 1080 // first error encountered is returned, or nil if there are no violations. 1081 func (m *DeveloperWarning) Validate() error { 1082 return m.validate(false) 1083 } 1084 1085 // ValidateAll checks the field values on DeveloperWarning with the rules 1086 // defined in the proto definition for this message. If any rules are 1087 // violated, the result is a list of violation errors wrapped in 1088 // DeveloperWarningMultiError, or nil if none found. 1089 func (m *DeveloperWarning) ValidateAll() error { 1090 return m.validate(true) 1091 } 1092 1093 func (m *DeveloperWarning) validate(all bool) error { 1094 if m == nil { 1095 return nil 1096 } 1097 1098 var errors []error 1099 1100 // no validation rules for Message 1101 1102 // no validation rules for Line 1103 1104 // no validation rules for Column 1105 1106 if len(errors) > 0 { 1107 return DeveloperWarningMultiError(errors) 1108 } 1109 1110 return nil 1111 } 1112 1113 // DeveloperWarningMultiError is an error wrapping multiple validation errors 1114 // returned by DeveloperWarning.ValidateAll() if the designated constraints 1115 // aren't met. 1116 type DeveloperWarningMultiError []error 1117 1118 // Error returns a concatenation of all the error messages it wraps. 1119 func (m DeveloperWarningMultiError) Error() string { 1120 var msgs []string 1121 for _, err := range m { 1122 msgs = append(msgs, err.Error()) 1123 } 1124 return strings.Join(msgs, "; ") 1125 } 1126 1127 // AllErrors returns a list of validation violation errors. 1128 func (m DeveloperWarningMultiError) AllErrors() []error { return m } 1129 1130 // DeveloperWarningValidationError is the validation error returned by 1131 // DeveloperWarning.Validate if the designated constraints aren't met. 1132 type DeveloperWarningValidationError struct { 1133 field string 1134 reason string 1135 cause error 1136 key bool 1137 } 1138 1139 // Field function returns field value. 1140 func (e DeveloperWarningValidationError) Field() string { return e.field } 1141 1142 // Reason function returns reason value. 1143 func (e DeveloperWarningValidationError) Reason() string { return e.reason } 1144 1145 // Cause function returns cause value. 1146 func (e DeveloperWarningValidationError) Cause() error { return e.cause } 1147 1148 // Key function returns key value. 1149 func (e DeveloperWarningValidationError) Key() bool { return e.key } 1150 1151 // ErrorName returns error name. 1152 func (e DeveloperWarningValidationError) ErrorName() string { return "DeveloperWarningValidationError" } 1153 1154 // Error satisfies the builtin error interface 1155 func (e DeveloperWarningValidationError) Error() string { 1156 cause := "" 1157 if e.cause != nil { 1158 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1159 } 1160 1161 key := "" 1162 if e.key { 1163 key = "key for " 1164 } 1165 1166 return fmt.Sprintf( 1167 "invalid %sDeveloperWarning.%s: %s%s", 1168 key, 1169 e.field, 1170 e.reason, 1171 cause) 1172 } 1173 1174 var _ error = DeveloperWarningValidationError{} 1175 1176 var _ interface { 1177 Field() string 1178 Reason() string 1179 Key() bool 1180 Cause() error 1181 ErrorName() string 1182 } = DeveloperWarningValidationError{} 1183 1184 // Validate checks the field values on DeveloperError with the rules defined in 1185 // the proto definition for this message. If any rules are violated, the first 1186 // error encountered is returned, or nil if there are no violations. 1187 func (m *DeveloperError) Validate() error { 1188 return m.validate(false) 1189 } 1190 1191 // ValidateAll checks the field values on DeveloperError with the rules defined 1192 // in the proto definition for this message. If any rules are violated, the 1193 // result is a list of violation errors wrapped in DeveloperErrorMultiError, 1194 // or nil if none found. 1195 func (m *DeveloperError) ValidateAll() error { 1196 return m.validate(true) 1197 } 1198 1199 func (m *DeveloperError) validate(all bool) error { 1200 if m == nil { 1201 return nil 1202 } 1203 1204 var errors []error 1205 1206 // no validation rules for Message 1207 1208 // no validation rules for Line 1209 1210 // no validation rules for Column 1211 1212 // no validation rules for Source 1213 1214 // no validation rules for Kind 1215 1216 // no validation rules for Context 1217 1218 if all { 1219 switch v := interface{}(m.GetCheckDebugInformation()).(type) { 1220 case interface{ ValidateAll() error }: 1221 if err := v.ValidateAll(); err != nil { 1222 errors = append(errors, DeveloperErrorValidationError{ 1223 field: "CheckDebugInformation", 1224 reason: "embedded message failed validation", 1225 cause: err, 1226 }) 1227 } 1228 case interface{ Validate() error }: 1229 if err := v.Validate(); err != nil { 1230 errors = append(errors, DeveloperErrorValidationError{ 1231 field: "CheckDebugInformation", 1232 reason: "embedded message failed validation", 1233 cause: err, 1234 }) 1235 } 1236 } 1237 } else if v, ok := interface{}(m.GetCheckDebugInformation()).(interface{ Validate() error }); ok { 1238 if err := v.Validate(); err != nil { 1239 return DeveloperErrorValidationError{ 1240 field: "CheckDebugInformation", 1241 reason: "embedded message failed validation", 1242 cause: err, 1243 } 1244 } 1245 } 1246 1247 if all { 1248 switch v := interface{}(m.GetCheckResolvedDebugInformation()).(type) { 1249 case interface{ ValidateAll() error }: 1250 if err := v.ValidateAll(); err != nil { 1251 errors = append(errors, DeveloperErrorValidationError{ 1252 field: "CheckResolvedDebugInformation", 1253 reason: "embedded message failed validation", 1254 cause: err, 1255 }) 1256 } 1257 case interface{ Validate() error }: 1258 if err := v.Validate(); err != nil { 1259 errors = append(errors, DeveloperErrorValidationError{ 1260 field: "CheckResolvedDebugInformation", 1261 reason: "embedded message failed validation", 1262 cause: err, 1263 }) 1264 } 1265 } 1266 } else if v, ok := interface{}(m.GetCheckResolvedDebugInformation()).(interface{ Validate() error }); ok { 1267 if err := v.Validate(); err != nil { 1268 return DeveloperErrorValidationError{ 1269 field: "CheckResolvedDebugInformation", 1270 reason: "embedded message failed validation", 1271 cause: err, 1272 } 1273 } 1274 } 1275 1276 if len(errors) > 0 { 1277 return DeveloperErrorMultiError(errors) 1278 } 1279 1280 return nil 1281 } 1282 1283 // DeveloperErrorMultiError is an error wrapping multiple validation errors 1284 // returned by DeveloperError.ValidateAll() if the designated constraints 1285 // aren't met. 1286 type DeveloperErrorMultiError []error 1287 1288 // Error returns a concatenation of all the error messages it wraps. 1289 func (m DeveloperErrorMultiError) Error() string { 1290 var msgs []string 1291 for _, err := range m { 1292 msgs = append(msgs, err.Error()) 1293 } 1294 return strings.Join(msgs, "; ") 1295 } 1296 1297 // AllErrors returns a list of validation violation errors. 1298 func (m DeveloperErrorMultiError) AllErrors() []error { return m } 1299 1300 // DeveloperErrorValidationError is the validation error returned by 1301 // DeveloperError.Validate if the designated constraints aren't met. 1302 type DeveloperErrorValidationError struct { 1303 field string 1304 reason string 1305 cause error 1306 key bool 1307 } 1308 1309 // Field function returns field value. 1310 func (e DeveloperErrorValidationError) Field() string { return e.field } 1311 1312 // Reason function returns reason value. 1313 func (e DeveloperErrorValidationError) Reason() string { return e.reason } 1314 1315 // Cause function returns cause value. 1316 func (e DeveloperErrorValidationError) Cause() error { return e.cause } 1317 1318 // Key function returns key value. 1319 func (e DeveloperErrorValidationError) Key() bool { return e.key } 1320 1321 // ErrorName returns error name. 1322 func (e DeveloperErrorValidationError) ErrorName() string { return "DeveloperErrorValidationError" } 1323 1324 // Error satisfies the builtin error interface 1325 func (e DeveloperErrorValidationError) Error() string { 1326 cause := "" 1327 if e.cause != nil { 1328 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1329 } 1330 1331 key := "" 1332 if e.key { 1333 key = "key for " 1334 } 1335 1336 return fmt.Sprintf( 1337 "invalid %sDeveloperError.%s: %s%s", 1338 key, 1339 e.field, 1340 e.reason, 1341 cause) 1342 } 1343 1344 var _ error = DeveloperErrorValidationError{} 1345 1346 var _ interface { 1347 Field() string 1348 Reason() string 1349 Key() bool 1350 Cause() error 1351 ErrorName() string 1352 } = DeveloperErrorValidationError{} 1353 1354 // Validate checks the field values on DeveloperErrors with the rules defined 1355 // in the proto definition for this message. If any rules are violated, the 1356 // first error encountered is returned, or nil if there are no violations. 1357 func (m *DeveloperErrors) Validate() error { 1358 return m.validate(false) 1359 } 1360 1361 // ValidateAll checks the field values on DeveloperErrors with the rules 1362 // defined in the proto definition for this message. If any rules are 1363 // violated, the result is a list of violation errors wrapped in 1364 // DeveloperErrorsMultiError, or nil if none found. 1365 func (m *DeveloperErrors) ValidateAll() error { 1366 return m.validate(true) 1367 } 1368 1369 func (m *DeveloperErrors) validate(all bool) error { 1370 if m == nil { 1371 return nil 1372 } 1373 1374 var errors []error 1375 1376 for idx, item := range m.GetInputErrors() { 1377 _, _ = idx, item 1378 1379 if all { 1380 switch v := interface{}(item).(type) { 1381 case interface{ ValidateAll() error }: 1382 if err := v.ValidateAll(); err != nil { 1383 errors = append(errors, DeveloperErrorsValidationError{ 1384 field: fmt.Sprintf("InputErrors[%v]", idx), 1385 reason: "embedded message failed validation", 1386 cause: err, 1387 }) 1388 } 1389 case interface{ Validate() error }: 1390 if err := v.Validate(); err != nil { 1391 errors = append(errors, DeveloperErrorsValidationError{ 1392 field: fmt.Sprintf("InputErrors[%v]", idx), 1393 reason: "embedded message failed validation", 1394 cause: err, 1395 }) 1396 } 1397 } 1398 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1399 if err := v.Validate(); err != nil { 1400 return DeveloperErrorsValidationError{ 1401 field: fmt.Sprintf("InputErrors[%v]", idx), 1402 reason: "embedded message failed validation", 1403 cause: err, 1404 } 1405 } 1406 } 1407 1408 } 1409 1410 if len(errors) > 0 { 1411 return DeveloperErrorsMultiError(errors) 1412 } 1413 1414 return nil 1415 } 1416 1417 // DeveloperErrorsMultiError is an error wrapping multiple validation errors 1418 // returned by DeveloperErrors.ValidateAll() if the designated constraints 1419 // aren't met. 1420 type DeveloperErrorsMultiError []error 1421 1422 // Error returns a concatenation of all the error messages it wraps. 1423 func (m DeveloperErrorsMultiError) Error() string { 1424 var msgs []string 1425 for _, err := range m { 1426 msgs = append(msgs, err.Error()) 1427 } 1428 return strings.Join(msgs, "; ") 1429 } 1430 1431 // AllErrors returns a list of validation violation errors. 1432 func (m DeveloperErrorsMultiError) AllErrors() []error { return m } 1433 1434 // DeveloperErrorsValidationError is the validation error returned by 1435 // DeveloperErrors.Validate if the designated constraints aren't met. 1436 type DeveloperErrorsValidationError struct { 1437 field string 1438 reason string 1439 cause error 1440 key bool 1441 } 1442 1443 // Field function returns field value. 1444 func (e DeveloperErrorsValidationError) Field() string { return e.field } 1445 1446 // Reason function returns reason value. 1447 func (e DeveloperErrorsValidationError) Reason() string { return e.reason } 1448 1449 // Cause function returns cause value. 1450 func (e DeveloperErrorsValidationError) Cause() error { return e.cause } 1451 1452 // Key function returns key value. 1453 func (e DeveloperErrorsValidationError) Key() bool { return e.key } 1454 1455 // ErrorName returns error name. 1456 func (e DeveloperErrorsValidationError) ErrorName() string { return "DeveloperErrorsValidationError" } 1457 1458 // Error satisfies the builtin error interface 1459 func (e DeveloperErrorsValidationError) Error() string { 1460 cause := "" 1461 if e.cause != nil { 1462 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1463 } 1464 1465 key := "" 1466 if e.key { 1467 key = "key for " 1468 } 1469 1470 return fmt.Sprintf( 1471 "invalid %sDeveloperErrors.%s: %s%s", 1472 key, 1473 e.field, 1474 e.reason, 1475 cause) 1476 } 1477 1478 var _ error = DeveloperErrorsValidationError{} 1479 1480 var _ interface { 1481 Field() string 1482 Reason() string 1483 Key() bool 1484 Cause() error 1485 ErrorName() string 1486 } = DeveloperErrorsValidationError{} 1487 1488 // Validate checks the field values on CheckOperationParameters with the rules 1489 // defined in the proto definition for this message. If any rules are 1490 // violated, the first error encountered is returned, or nil if there are no violations. 1491 func (m *CheckOperationParameters) Validate() error { 1492 return m.validate(false) 1493 } 1494 1495 // ValidateAll checks the field values on CheckOperationParameters with the 1496 // rules defined in the proto definition for this message. If any rules are 1497 // violated, the result is a list of violation errors wrapped in 1498 // CheckOperationParametersMultiError, or nil if none found. 1499 func (m *CheckOperationParameters) ValidateAll() error { 1500 return m.validate(true) 1501 } 1502 1503 func (m *CheckOperationParameters) validate(all bool) error { 1504 if m == nil { 1505 return nil 1506 } 1507 1508 var errors []error 1509 1510 if all { 1511 switch v := interface{}(m.GetResource()).(type) { 1512 case interface{ ValidateAll() error }: 1513 if err := v.ValidateAll(); err != nil { 1514 errors = append(errors, CheckOperationParametersValidationError{ 1515 field: "Resource", 1516 reason: "embedded message failed validation", 1517 cause: err, 1518 }) 1519 } 1520 case interface{ Validate() error }: 1521 if err := v.Validate(); err != nil { 1522 errors = append(errors, CheckOperationParametersValidationError{ 1523 field: "Resource", 1524 reason: "embedded message failed validation", 1525 cause: err, 1526 }) 1527 } 1528 } 1529 } else if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok { 1530 if err := v.Validate(); err != nil { 1531 return CheckOperationParametersValidationError{ 1532 field: "Resource", 1533 reason: "embedded message failed validation", 1534 cause: err, 1535 } 1536 } 1537 } 1538 1539 if all { 1540 switch v := interface{}(m.GetSubject()).(type) { 1541 case interface{ ValidateAll() error }: 1542 if err := v.ValidateAll(); err != nil { 1543 errors = append(errors, CheckOperationParametersValidationError{ 1544 field: "Subject", 1545 reason: "embedded message failed validation", 1546 cause: err, 1547 }) 1548 } 1549 case interface{ Validate() error }: 1550 if err := v.Validate(); err != nil { 1551 errors = append(errors, CheckOperationParametersValidationError{ 1552 field: "Subject", 1553 reason: "embedded message failed validation", 1554 cause: err, 1555 }) 1556 } 1557 } 1558 } else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { 1559 if err := v.Validate(); err != nil { 1560 return CheckOperationParametersValidationError{ 1561 field: "Subject", 1562 reason: "embedded message failed validation", 1563 cause: err, 1564 } 1565 } 1566 } 1567 1568 if all { 1569 switch v := interface{}(m.GetCaveatContext()).(type) { 1570 case interface{ ValidateAll() error }: 1571 if err := v.ValidateAll(); err != nil { 1572 errors = append(errors, CheckOperationParametersValidationError{ 1573 field: "CaveatContext", 1574 reason: "embedded message failed validation", 1575 cause: err, 1576 }) 1577 } 1578 case interface{ Validate() error }: 1579 if err := v.Validate(); err != nil { 1580 errors = append(errors, CheckOperationParametersValidationError{ 1581 field: "CaveatContext", 1582 reason: "embedded message failed validation", 1583 cause: err, 1584 }) 1585 } 1586 } 1587 } else if v, ok := interface{}(m.GetCaveatContext()).(interface{ Validate() error }); ok { 1588 if err := v.Validate(); err != nil { 1589 return CheckOperationParametersValidationError{ 1590 field: "CaveatContext", 1591 reason: "embedded message failed validation", 1592 cause: err, 1593 } 1594 } 1595 } 1596 1597 if len(errors) > 0 { 1598 return CheckOperationParametersMultiError(errors) 1599 } 1600 1601 return nil 1602 } 1603 1604 // CheckOperationParametersMultiError is an error wrapping multiple validation 1605 // errors returned by CheckOperationParameters.ValidateAll() if the designated 1606 // constraints aren't met. 1607 type CheckOperationParametersMultiError []error 1608 1609 // Error returns a concatenation of all the error messages it wraps. 1610 func (m CheckOperationParametersMultiError) Error() string { 1611 var msgs []string 1612 for _, err := range m { 1613 msgs = append(msgs, err.Error()) 1614 } 1615 return strings.Join(msgs, "; ") 1616 } 1617 1618 // AllErrors returns a list of validation violation errors. 1619 func (m CheckOperationParametersMultiError) AllErrors() []error { return m } 1620 1621 // CheckOperationParametersValidationError is the validation error returned by 1622 // CheckOperationParameters.Validate if the designated constraints aren't met. 1623 type CheckOperationParametersValidationError struct { 1624 field string 1625 reason string 1626 cause error 1627 key bool 1628 } 1629 1630 // Field function returns field value. 1631 func (e CheckOperationParametersValidationError) Field() string { return e.field } 1632 1633 // Reason function returns reason value. 1634 func (e CheckOperationParametersValidationError) Reason() string { return e.reason } 1635 1636 // Cause function returns cause value. 1637 func (e CheckOperationParametersValidationError) Cause() error { return e.cause } 1638 1639 // Key function returns key value. 1640 func (e CheckOperationParametersValidationError) Key() bool { return e.key } 1641 1642 // ErrorName returns error name. 1643 func (e CheckOperationParametersValidationError) ErrorName() string { 1644 return "CheckOperationParametersValidationError" 1645 } 1646 1647 // Error satisfies the builtin error interface 1648 func (e CheckOperationParametersValidationError) Error() string { 1649 cause := "" 1650 if e.cause != nil { 1651 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1652 } 1653 1654 key := "" 1655 if e.key { 1656 key = "key for " 1657 } 1658 1659 return fmt.Sprintf( 1660 "invalid %sCheckOperationParameters.%s: %s%s", 1661 key, 1662 e.field, 1663 e.reason, 1664 cause) 1665 } 1666 1667 var _ error = CheckOperationParametersValidationError{} 1668 1669 var _ interface { 1670 Field() string 1671 Reason() string 1672 Key() bool 1673 Cause() error 1674 ErrorName() string 1675 } = CheckOperationParametersValidationError{} 1676 1677 // Validate checks the field values on CheckOperationsResult with the rules 1678 // defined in the proto definition for this message. If any rules are 1679 // violated, the first error encountered is returned, or nil if there are no violations. 1680 func (m *CheckOperationsResult) Validate() error { 1681 return m.validate(false) 1682 } 1683 1684 // ValidateAll checks the field values on CheckOperationsResult with the rules 1685 // defined in the proto definition for this message. If any rules are 1686 // violated, the result is a list of violation errors wrapped in 1687 // CheckOperationsResultMultiError, or nil if none found. 1688 func (m *CheckOperationsResult) ValidateAll() error { 1689 return m.validate(true) 1690 } 1691 1692 func (m *CheckOperationsResult) validate(all bool) error { 1693 if m == nil { 1694 return nil 1695 } 1696 1697 var errors []error 1698 1699 // no validation rules for Membership 1700 1701 if all { 1702 switch v := interface{}(m.GetCheckError()).(type) { 1703 case interface{ ValidateAll() error }: 1704 if err := v.ValidateAll(); err != nil { 1705 errors = append(errors, CheckOperationsResultValidationError{ 1706 field: "CheckError", 1707 reason: "embedded message failed validation", 1708 cause: err, 1709 }) 1710 } 1711 case interface{ Validate() error }: 1712 if err := v.Validate(); err != nil { 1713 errors = append(errors, CheckOperationsResultValidationError{ 1714 field: "CheckError", 1715 reason: "embedded message failed validation", 1716 cause: err, 1717 }) 1718 } 1719 } 1720 } else if v, ok := interface{}(m.GetCheckError()).(interface{ Validate() error }); ok { 1721 if err := v.Validate(); err != nil { 1722 return CheckOperationsResultValidationError{ 1723 field: "CheckError", 1724 reason: "embedded message failed validation", 1725 cause: err, 1726 } 1727 } 1728 } 1729 1730 if all { 1731 switch v := interface{}(m.GetDebugInformation()).(type) { 1732 case interface{ ValidateAll() error }: 1733 if err := v.ValidateAll(); err != nil { 1734 errors = append(errors, CheckOperationsResultValidationError{ 1735 field: "DebugInformation", 1736 reason: "embedded message failed validation", 1737 cause: err, 1738 }) 1739 } 1740 case interface{ Validate() error }: 1741 if err := v.Validate(); err != nil { 1742 errors = append(errors, CheckOperationsResultValidationError{ 1743 field: "DebugInformation", 1744 reason: "embedded message failed validation", 1745 cause: err, 1746 }) 1747 } 1748 } 1749 } else if v, ok := interface{}(m.GetDebugInformation()).(interface{ Validate() error }); ok { 1750 if err := v.Validate(); err != nil { 1751 return CheckOperationsResultValidationError{ 1752 field: "DebugInformation", 1753 reason: "embedded message failed validation", 1754 cause: err, 1755 } 1756 } 1757 } 1758 1759 if all { 1760 switch v := interface{}(m.GetPartialCaveatInfo()).(type) { 1761 case interface{ ValidateAll() error }: 1762 if err := v.ValidateAll(); err != nil { 1763 errors = append(errors, CheckOperationsResultValidationError{ 1764 field: "PartialCaveatInfo", 1765 reason: "embedded message failed validation", 1766 cause: err, 1767 }) 1768 } 1769 case interface{ Validate() error }: 1770 if err := v.Validate(); err != nil { 1771 errors = append(errors, CheckOperationsResultValidationError{ 1772 field: "PartialCaveatInfo", 1773 reason: "embedded message failed validation", 1774 cause: err, 1775 }) 1776 } 1777 } 1778 } else if v, ok := interface{}(m.GetPartialCaveatInfo()).(interface{ Validate() error }); ok { 1779 if err := v.Validate(); err != nil { 1780 return CheckOperationsResultValidationError{ 1781 field: "PartialCaveatInfo", 1782 reason: "embedded message failed validation", 1783 cause: err, 1784 } 1785 } 1786 } 1787 1788 if all { 1789 switch v := interface{}(m.GetResolvedDebugInformation()).(type) { 1790 case interface{ ValidateAll() error }: 1791 if err := v.ValidateAll(); err != nil { 1792 errors = append(errors, CheckOperationsResultValidationError{ 1793 field: "ResolvedDebugInformation", 1794 reason: "embedded message failed validation", 1795 cause: err, 1796 }) 1797 } 1798 case interface{ Validate() error }: 1799 if err := v.Validate(); err != nil { 1800 errors = append(errors, CheckOperationsResultValidationError{ 1801 field: "ResolvedDebugInformation", 1802 reason: "embedded message failed validation", 1803 cause: err, 1804 }) 1805 } 1806 } 1807 } else if v, ok := interface{}(m.GetResolvedDebugInformation()).(interface{ Validate() error }); ok { 1808 if err := v.Validate(); err != nil { 1809 return CheckOperationsResultValidationError{ 1810 field: "ResolvedDebugInformation", 1811 reason: "embedded message failed validation", 1812 cause: err, 1813 } 1814 } 1815 } 1816 1817 if len(errors) > 0 { 1818 return CheckOperationsResultMultiError(errors) 1819 } 1820 1821 return nil 1822 } 1823 1824 // CheckOperationsResultMultiError is an error wrapping multiple validation 1825 // errors returned by CheckOperationsResult.ValidateAll() if the designated 1826 // constraints aren't met. 1827 type CheckOperationsResultMultiError []error 1828 1829 // Error returns a concatenation of all the error messages it wraps. 1830 func (m CheckOperationsResultMultiError) Error() string { 1831 var msgs []string 1832 for _, err := range m { 1833 msgs = append(msgs, err.Error()) 1834 } 1835 return strings.Join(msgs, "; ") 1836 } 1837 1838 // AllErrors returns a list of validation violation errors. 1839 func (m CheckOperationsResultMultiError) AllErrors() []error { return m } 1840 1841 // CheckOperationsResultValidationError is the validation error returned by 1842 // CheckOperationsResult.Validate if the designated constraints aren't met. 1843 type CheckOperationsResultValidationError struct { 1844 field string 1845 reason string 1846 cause error 1847 key bool 1848 } 1849 1850 // Field function returns field value. 1851 func (e CheckOperationsResultValidationError) Field() string { return e.field } 1852 1853 // Reason function returns reason value. 1854 func (e CheckOperationsResultValidationError) Reason() string { return e.reason } 1855 1856 // Cause function returns cause value. 1857 func (e CheckOperationsResultValidationError) Cause() error { return e.cause } 1858 1859 // Key function returns key value. 1860 func (e CheckOperationsResultValidationError) Key() bool { return e.key } 1861 1862 // ErrorName returns error name. 1863 func (e CheckOperationsResultValidationError) ErrorName() string { 1864 return "CheckOperationsResultValidationError" 1865 } 1866 1867 // Error satisfies the builtin error interface 1868 func (e CheckOperationsResultValidationError) Error() string { 1869 cause := "" 1870 if e.cause != nil { 1871 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1872 } 1873 1874 key := "" 1875 if e.key { 1876 key = "key for " 1877 } 1878 1879 return fmt.Sprintf( 1880 "invalid %sCheckOperationsResult.%s: %s%s", 1881 key, 1882 e.field, 1883 e.reason, 1884 cause) 1885 } 1886 1887 var _ error = CheckOperationsResultValidationError{} 1888 1889 var _ interface { 1890 Field() string 1891 Reason() string 1892 Key() bool 1893 Cause() error 1894 ErrorName() string 1895 } = CheckOperationsResultValidationError{} 1896 1897 // Validate checks the field values on PartialCaveatInfo with the rules defined 1898 // in the proto definition for this message. If any rules are violated, the 1899 // first error encountered is returned, or nil if there are no violations. 1900 func (m *PartialCaveatInfo) Validate() error { 1901 return m.validate(false) 1902 } 1903 1904 // ValidateAll checks the field values on PartialCaveatInfo with the rules 1905 // defined in the proto definition for this message. If any rules are 1906 // violated, the result is a list of violation errors wrapped in 1907 // PartialCaveatInfoMultiError, or nil if none found. 1908 func (m *PartialCaveatInfo) ValidateAll() error { 1909 return m.validate(true) 1910 } 1911 1912 func (m *PartialCaveatInfo) validate(all bool) error { 1913 if m == nil { 1914 return nil 1915 } 1916 1917 var errors []error 1918 1919 if len(m.GetMissingRequiredContext()) < 1 { 1920 err := PartialCaveatInfoValidationError{ 1921 field: "MissingRequiredContext", 1922 reason: "value must contain at least 1 item(s)", 1923 } 1924 if !all { 1925 return err 1926 } 1927 errors = append(errors, err) 1928 } 1929 1930 if len(errors) > 0 { 1931 return PartialCaveatInfoMultiError(errors) 1932 } 1933 1934 return nil 1935 } 1936 1937 // PartialCaveatInfoMultiError is an error wrapping multiple validation errors 1938 // returned by PartialCaveatInfo.ValidateAll() if the designated constraints 1939 // aren't met. 1940 type PartialCaveatInfoMultiError []error 1941 1942 // Error returns a concatenation of all the error messages it wraps. 1943 func (m PartialCaveatInfoMultiError) Error() string { 1944 var msgs []string 1945 for _, err := range m { 1946 msgs = append(msgs, err.Error()) 1947 } 1948 return strings.Join(msgs, "; ") 1949 } 1950 1951 // AllErrors returns a list of validation violation errors. 1952 func (m PartialCaveatInfoMultiError) AllErrors() []error { return m } 1953 1954 // PartialCaveatInfoValidationError is the validation error returned by 1955 // PartialCaveatInfo.Validate if the designated constraints aren't met. 1956 type PartialCaveatInfoValidationError struct { 1957 field string 1958 reason string 1959 cause error 1960 key bool 1961 } 1962 1963 // Field function returns field value. 1964 func (e PartialCaveatInfoValidationError) Field() string { return e.field } 1965 1966 // Reason function returns reason value. 1967 func (e PartialCaveatInfoValidationError) Reason() string { return e.reason } 1968 1969 // Cause function returns cause value. 1970 func (e PartialCaveatInfoValidationError) Cause() error { return e.cause } 1971 1972 // Key function returns key value. 1973 func (e PartialCaveatInfoValidationError) Key() bool { return e.key } 1974 1975 // ErrorName returns error name. 1976 func (e PartialCaveatInfoValidationError) ErrorName() string { 1977 return "PartialCaveatInfoValidationError" 1978 } 1979 1980 // Error satisfies the builtin error interface 1981 func (e PartialCaveatInfoValidationError) Error() string { 1982 cause := "" 1983 if e.cause != nil { 1984 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1985 } 1986 1987 key := "" 1988 if e.key { 1989 key = "key for " 1990 } 1991 1992 return fmt.Sprintf( 1993 "invalid %sPartialCaveatInfo.%s: %s%s", 1994 key, 1995 e.field, 1996 e.reason, 1997 cause) 1998 } 1999 2000 var _ error = PartialCaveatInfoValidationError{} 2001 2002 var _ interface { 2003 Field() string 2004 Reason() string 2005 Key() bool 2006 Cause() error 2007 ErrorName() string 2008 } = PartialCaveatInfoValidationError{} 2009 2010 // Validate checks the field values on RunAssertionsParameters with the rules 2011 // defined in the proto definition for this message. If any rules are 2012 // violated, the first error encountered is returned, or nil if there are no violations. 2013 func (m *RunAssertionsParameters) Validate() error { 2014 return m.validate(false) 2015 } 2016 2017 // ValidateAll checks the field values on RunAssertionsParameters with the 2018 // rules defined in the proto definition for this message. If any rules are 2019 // violated, the result is a list of violation errors wrapped in 2020 // RunAssertionsParametersMultiError, or nil if none found. 2021 func (m *RunAssertionsParameters) ValidateAll() error { 2022 return m.validate(true) 2023 } 2024 2025 func (m *RunAssertionsParameters) validate(all bool) error { 2026 if m == nil { 2027 return nil 2028 } 2029 2030 var errors []error 2031 2032 // no validation rules for AssertionsYaml 2033 2034 if len(errors) > 0 { 2035 return RunAssertionsParametersMultiError(errors) 2036 } 2037 2038 return nil 2039 } 2040 2041 // RunAssertionsParametersMultiError is an error wrapping multiple validation 2042 // errors returned by RunAssertionsParameters.ValidateAll() if the designated 2043 // constraints aren't met. 2044 type RunAssertionsParametersMultiError []error 2045 2046 // Error returns a concatenation of all the error messages it wraps. 2047 func (m RunAssertionsParametersMultiError) Error() string { 2048 var msgs []string 2049 for _, err := range m { 2050 msgs = append(msgs, err.Error()) 2051 } 2052 return strings.Join(msgs, "; ") 2053 } 2054 2055 // AllErrors returns a list of validation violation errors. 2056 func (m RunAssertionsParametersMultiError) AllErrors() []error { return m } 2057 2058 // RunAssertionsParametersValidationError is the validation error returned by 2059 // RunAssertionsParameters.Validate if the designated constraints aren't met. 2060 type RunAssertionsParametersValidationError struct { 2061 field string 2062 reason string 2063 cause error 2064 key bool 2065 } 2066 2067 // Field function returns field value. 2068 func (e RunAssertionsParametersValidationError) Field() string { return e.field } 2069 2070 // Reason function returns reason value. 2071 func (e RunAssertionsParametersValidationError) Reason() string { return e.reason } 2072 2073 // Cause function returns cause value. 2074 func (e RunAssertionsParametersValidationError) Cause() error { return e.cause } 2075 2076 // Key function returns key value. 2077 func (e RunAssertionsParametersValidationError) Key() bool { return e.key } 2078 2079 // ErrorName returns error name. 2080 func (e RunAssertionsParametersValidationError) ErrorName() string { 2081 return "RunAssertionsParametersValidationError" 2082 } 2083 2084 // Error satisfies the builtin error interface 2085 func (e RunAssertionsParametersValidationError) Error() string { 2086 cause := "" 2087 if e.cause != nil { 2088 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2089 } 2090 2091 key := "" 2092 if e.key { 2093 key = "key for " 2094 } 2095 2096 return fmt.Sprintf( 2097 "invalid %sRunAssertionsParameters.%s: %s%s", 2098 key, 2099 e.field, 2100 e.reason, 2101 cause) 2102 } 2103 2104 var _ error = RunAssertionsParametersValidationError{} 2105 2106 var _ interface { 2107 Field() string 2108 Reason() string 2109 Key() bool 2110 Cause() error 2111 ErrorName() string 2112 } = RunAssertionsParametersValidationError{} 2113 2114 // Validate checks the field values on RunAssertionsResult with the rules 2115 // defined in the proto definition for this message. If any rules are 2116 // violated, the first error encountered is returned, or nil if there are no violations. 2117 func (m *RunAssertionsResult) Validate() error { 2118 return m.validate(false) 2119 } 2120 2121 // ValidateAll checks the field values on RunAssertionsResult with the rules 2122 // defined in the proto definition for this message. If any rules are 2123 // violated, the result is a list of violation errors wrapped in 2124 // RunAssertionsResultMultiError, or nil if none found. 2125 func (m *RunAssertionsResult) ValidateAll() error { 2126 return m.validate(true) 2127 } 2128 2129 func (m *RunAssertionsResult) validate(all bool) error { 2130 if m == nil { 2131 return nil 2132 } 2133 2134 var errors []error 2135 2136 if all { 2137 switch v := interface{}(m.GetInputError()).(type) { 2138 case interface{ ValidateAll() error }: 2139 if err := v.ValidateAll(); err != nil { 2140 errors = append(errors, RunAssertionsResultValidationError{ 2141 field: "InputError", 2142 reason: "embedded message failed validation", 2143 cause: err, 2144 }) 2145 } 2146 case interface{ Validate() error }: 2147 if err := v.Validate(); err != nil { 2148 errors = append(errors, RunAssertionsResultValidationError{ 2149 field: "InputError", 2150 reason: "embedded message failed validation", 2151 cause: err, 2152 }) 2153 } 2154 } 2155 } else if v, ok := interface{}(m.GetInputError()).(interface{ Validate() error }); ok { 2156 if err := v.Validate(); err != nil { 2157 return RunAssertionsResultValidationError{ 2158 field: "InputError", 2159 reason: "embedded message failed validation", 2160 cause: err, 2161 } 2162 } 2163 } 2164 2165 for idx, item := range m.GetValidationErrors() { 2166 _, _ = idx, item 2167 2168 if all { 2169 switch v := interface{}(item).(type) { 2170 case interface{ ValidateAll() error }: 2171 if err := v.ValidateAll(); err != nil { 2172 errors = append(errors, RunAssertionsResultValidationError{ 2173 field: fmt.Sprintf("ValidationErrors[%v]", idx), 2174 reason: "embedded message failed validation", 2175 cause: err, 2176 }) 2177 } 2178 case interface{ Validate() error }: 2179 if err := v.Validate(); err != nil { 2180 errors = append(errors, RunAssertionsResultValidationError{ 2181 field: fmt.Sprintf("ValidationErrors[%v]", idx), 2182 reason: "embedded message failed validation", 2183 cause: err, 2184 }) 2185 } 2186 } 2187 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2188 if err := v.Validate(); err != nil { 2189 return RunAssertionsResultValidationError{ 2190 field: fmt.Sprintf("ValidationErrors[%v]", idx), 2191 reason: "embedded message failed validation", 2192 cause: err, 2193 } 2194 } 2195 } 2196 2197 } 2198 2199 if len(errors) > 0 { 2200 return RunAssertionsResultMultiError(errors) 2201 } 2202 2203 return nil 2204 } 2205 2206 // RunAssertionsResultMultiError is an error wrapping multiple validation 2207 // errors returned by RunAssertionsResult.ValidateAll() if the designated 2208 // constraints aren't met. 2209 type RunAssertionsResultMultiError []error 2210 2211 // Error returns a concatenation of all the error messages it wraps. 2212 func (m RunAssertionsResultMultiError) Error() string { 2213 var msgs []string 2214 for _, err := range m { 2215 msgs = append(msgs, err.Error()) 2216 } 2217 return strings.Join(msgs, "; ") 2218 } 2219 2220 // AllErrors returns a list of validation violation errors. 2221 func (m RunAssertionsResultMultiError) AllErrors() []error { return m } 2222 2223 // RunAssertionsResultValidationError is the validation error returned by 2224 // RunAssertionsResult.Validate if the designated constraints aren't met. 2225 type RunAssertionsResultValidationError struct { 2226 field string 2227 reason string 2228 cause error 2229 key bool 2230 } 2231 2232 // Field function returns field value. 2233 func (e RunAssertionsResultValidationError) Field() string { return e.field } 2234 2235 // Reason function returns reason value. 2236 func (e RunAssertionsResultValidationError) Reason() string { return e.reason } 2237 2238 // Cause function returns cause value. 2239 func (e RunAssertionsResultValidationError) Cause() error { return e.cause } 2240 2241 // Key function returns key value. 2242 func (e RunAssertionsResultValidationError) Key() bool { return e.key } 2243 2244 // ErrorName returns error name. 2245 func (e RunAssertionsResultValidationError) ErrorName() string { 2246 return "RunAssertionsResultValidationError" 2247 } 2248 2249 // Error satisfies the builtin error interface 2250 func (e RunAssertionsResultValidationError) Error() string { 2251 cause := "" 2252 if e.cause != nil { 2253 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2254 } 2255 2256 key := "" 2257 if e.key { 2258 key = "key for " 2259 } 2260 2261 return fmt.Sprintf( 2262 "invalid %sRunAssertionsResult.%s: %s%s", 2263 key, 2264 e.field, 2265 e.reason, 2266 cause) 2267 } 2268 2269 var _ error = RunAssertionsResultValidationError{} 2270 2271 var _ interface { 2272 Field() string 2273 Reason() string 2274 Key() bool 2275 Cause() error 2276 ErrorName() string 2277 } = RunAssertionsResultValidationError{} 2278 2279 // Validate checks the field values on RunValidationParameters with the rules 2280 // defined in the proto definition for this message. If any rules are 2281 // violated, the first error encountered is returned, or nil if there are no violations. 2282 func (m *RunValidationParameters) Validate() error { 2283 return m.validate(false) 2284 } 2285 2286 // ValidateAll checks the field values on RunValidationParameters with the 2287 // rules defined in the proto definition for this message. If any rules are 2288 // violated, the result is a list of violation errors wrapped in 2289 // RunValidationParametersMultiError, or nil if none found. 2290 func (m *RunValidationParameters) ValidateAll() error { 2291 return m.validate(true) 2292 } 2293 2294 func (m *RunValidationParameters) validate(all bool) error { 2295 if m == nil { 2296 return nil 2297 } 2298 2299 var errors []error 2300 2301 // no validation rules for ValidationYaml 2302 2303 if len(errors) > 0 { 2304 return RunValidationParametersMultiError(errors) 2305 } 2306 2307 return nil 2308 } 2309 2310 // RunValidationParametersMultiError is an error wrapping multiple validation 2311 // errors returned by RunValidationParameters.ValidateAll() if the designated 2312 // constraints aren't met. 2313 type RunValidationParametersMultiError []error 2314 2315 // Error returns a concatenation of all the error messages it wraps. 2316 func (m RunValidationParametersMultiError) Error() string { 2317 var msgs []string 2318 for _, err := range m { 2319 msgs = append(msgs, err.Error()) 2320 } 2321 return strings.Join(msgs, "; ") 2322 } 2323 2324 // AllErrors returns a list of validation violation errors. 2325 func (m RunValidationParametersMultiError) AllErrors() []error { return m } 2326 2327 // RunValidationParametersValidationError is the validation error returned by 2328 // RunValidationParameters.Validate if the designated constraints aren't met. 2329 type RunValidationParametersValidationError struct { 2330 field string 2331 reason string 2332 cause error 2333 key bool 2334 } 2335 2336 // Field function returns field value. 2337 func (e RunValidationParametersValidationError) Field() string { return e.field } 2338 2339 // Reason function returns reason value. 2340 func (e RunValidationParametersValidationError) Reason() string { return e.reason } 2341 2342 // Cause function returns cause value. 2343 func (e RunValidationParametersValidationError) Cause() error { return e.cause } 2344 2345 // Key function returns key value. 2346 func (e RunValidationParametersValidationError) Key() bool { return e.key } 2347 2348 // ErrorName returns error name. 2349 func (e RunValidationParametersValidationError) ErrorName() string { 2350 return "RunValidationParametersValidationError" 2351 } 2352 2353 // Error satisfies the builtin error interface 2354 func (e RunValidationParametersValidationError) Error() string { 2355 cause := "" 2356 if e.cause != nil { 2357 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2358 } 2359 2360 key := "" 2361 if e.key { 2362 key = "key for " 2363 } 2364 2365 return fmt.Sprintf( 2366 "invalid %sRunValidationParameters.%s: %s%s", 2367 key, 2368 e.field, 2369 e.reason, 2370 cause) 2371 } 2372 2373 var _ error = RunValidationParametersValidationError{} 2374 2375 var _ interface { 2376 Field() string 2377 Reason() string 2378 Key() bool 2379 Cause() error 2380 ErrorName() string 2381 } = RunValidationParametersValidationError{} 2382 2383 // Validate checks the field values on RunValidationResult with the rules 2384 // defined in the proto definition for this message. If any rules are 2385 // violated, the first error encountered is returned, or nil if there are no violations. 2386 func (m *RunValidationResult) Validate() error { 2387 return m.validate(false) 2388 } 2389 2390 // ValidateAll checks the field values on RunValidationResult with the rules 2391 // defined in the proto definition for this message. If any rules are 2392 // violated, the result is a list of violation errors wrapped in 2393 // RunValidationResultMultiError, or nil if none found. 2394 func (m *RunValidationResult) ValidateAll() error { 2395 return m.validate(true) 2396 } 2397 2398 func (m *RunValidationResult) validate(all bool) error { 2399 if m == nil { 2400 return nil 2401 } 2402 2403 var errors []error 2404 2405 if all { 2406 switch v := interface{}(m.GetInputError()).(type) { 2407 case interface{ ValidateAll() error }: 2408 if err := v.ValidateAll(); err != nil { 2409 errors = append(errors, RunValidationResultValidationError{ 2410 field: "InputError", 2411 reason: "embedded message failed validation", 2412 cause: err, 2413 }) 2414 } 2415 case interface{ Validate() error }: 2416 if err := v.Validate(); err != nil { 2417 errors = append(errors, RunValidationResultValidationError{ 2418 field: "InputError", 2419 reason: "embedded message failed validation", 2420 cause: err, 2421 }) 2422 } 2423 } 2424 } else if v, ok := interface{}(m.GetInputError()).(interface{ Validate() error }); ok { 2425 if err := v.Validate(); err != nil { 2426 return RunValidationResultValidationError{ 2427 field: "InputError", 2428 reason: "embedded message failed validation", 2429 cause: err, 2430 } 2431 } 2432 } 2433 2434 // no validation rules for UpdatedValidationYaml 2435 2436 for idx, item := range m.GetValidationErrors() { 2437 _, _ = idx, item 2438 2439 if all { 2440 switch v := interface{}(item).(type) { 2441 case interface{ ValidateAll() error }: 2442 if err := v.ValidateAll(); err != nil { 2443 errors = append(errors, RunValidationResultValidationError{ 2444 field: fmt.Sprintf("ValidationErrors[%v]", idx), 2445 reason: "embedded message failed validation", 2446 cause: err, 2447 }) 2448 } 2449 case interface{ Validate() error }: 2450 if err := v.Validate(); err != nil { 2451 errors = append(errors, RunValidationResultValidationError{ 2452 field: fmt.Sprintf("ValidationErrors[%v]", idx), 2453 reason: "embedded message failed validation", 2454 cause: err, 2455 }) 2456 } 2457 } 2458 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2459 if err := v.Validate(); err != nil { 2460 return RunValidationResultValidationError{ 2461 field: fmt.Sprintf("ValidationErrors[%v]", idx), 2462 reason: "embedded message failed validation", 2463 cause: err, 2464 } 2465 } 2466 } 2467 2468 } 2469 2470 if len(errors) > 0 { 2471 return RunValidationResultMultiError(errors) 2472 } 2473 2474 return nil 2475 } 2476 2477 // RunValidationResultMultiError is an error wrapping multiple validation 2478 // errors returned by RunValidationResult.ValidateAll() if the designated 2479 // constraints aren't met. 2480 type RunValidationResultMultiError []error 2481 2482 // Error returns a concatenation of all the error messages it wraps. 2483 func (m RunValidationResultMultiError) Error() string { 2484 var msgs []string 2485 for _, err := range m { 2486 msgs = append(msgs, err.Error()) 2487 } 2488 return strings.Join(msgs, "; ") 2489 } 2490 2491 // AllErrors returns a list of validation violation errors. 2492 func (m RunValidationResultMultiError) AllErrors() []error { return m } 2493 2494 // RunValidationResultValidationError is the validation error returned by 2495 // RunValidationResult.Validate if the designated constraints aren't met. 2496 type RunValidationResultValidationError struct { 2497 field string 2498 reason string 2499 cause error 2500 key bool 2501 } 2502 2503 // Field function returns field value. 2504 func (e RunValidationResultValidationError) Field() string { return e.field } 2505 2506 // Reason function returns reason value. 2507 func (e RunValidationResultValidationError) Reason() string { return e.reason } 2508 2509 // Cause function returns cause value. 2510 func (e RunValidationResultValidationError) Cause() error { return e.cause } 2511 2512 // Key function returns key value. 2513 func (e RunValidationResultValidationError) Key() bool { return e.key } 2514 2515 // ErrorName returns error name. 2516 func (e RunValidationResultValidationError) ErrorName() string { 2517 return "RunValidationResultValidationError" 2518 } 2519 2520 // Error satisfies the builtin error interface 2521 func (e RunValidationResultValidationError) Error() string { 2522 cause := "" 2523 if e.cause != nil { 2524 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2525 } 2526 2527 key := "" 2528 if e.key { 2529 key = "key for " 2530 } 2531 2532 return fmt.Sprintf( 2533 "invalid %sRunValidationResult.%s: %s%s", 2534 key, 2535 e.field, 2536 e.reason, 2537 cause) 2538 } 2539 2540 var _ error = RunValidationResultValidationError{} 2541 2542 var _ interface { 2543 Field() string 2544 Reason() string 2545 Key() bool 2546 Cause() error 2547 ErrorName() string 2548 } = RunValidationResultValidationError{} 2549 2550 // Validate checks the field values on FormatSchemaParameters with the rules 2551 // defined in the proto definition for this message. If any rules are 2552 // violated, the first error encountered is returned, or nil if there are no violations. 2553 func (m *FormatSchemaParameters) Validate() error { 2554 return m.validate(false) 2555 } 2556 2557 // ValidateAll checks the field values on FormatSchemaParameters with the rules 2558 // defined in the proto definition for this message. If any rules are 2559 // violated, the result is a list of violation errors wrapped in 2560 // FormatSchemaParametersMultiError, or nil if none found. 2561 func (m *FormatSchemaParameters) ValidateAll() error { 2562 return m.validate(true) 2563 } 2564 2565 func (m *FormatSchemaParameters) validate(all bool) error { 2566 if m == nil { 2567 return nil 2568 } 2569 2570 var errors []error 2571 2572 if len(errors) > 0 { 2573 return FormatSchemaParametersMultiError(errors) 2574 } 2575 2576 return nil 2577 } 2578 2579 // FormatSchemaParametersMultiError is an error wrapping multiple validation 2580 // errors returned by FormatSchemaParameters.ValidateAll() if the designated 2581 // constraints aren't met. 2582 type FormatSchemaParametersMultiError []error 2583 2584 // Error returns a concatenation of all the error messages it wraps. 2585 func (m FormatSchemaParametersMultiError) Error() string { 2586 var msgs []string 2587 for _, err := range m { 2588 msgs = append(msgs, err.Error()) 2589 } 2590 return strings.Join(msgs, "; ") 2591 } 2592 2593 // AllErrors returns a list of validation violation errors. 2594 func (m FormatSchemaParametersMultiError) AllErrors() []error { return m } 2595 2596 // FormatSchemaParametersValidationError is the validation error returned by 2597 // FormatSchemaParameters.Validate if the designated constraints aren't met. 2598 type FormatSchemaParametersValidationError struct { 2599 field string 2600 reason string 2601 cause error 2602 key bool 2603 } 2604 2605 // Field function returns field value. 2606 func (e FormatSchemaParametersValidationError) Field() string { return e.field } 2607 2608 // Reason function returns reason value. 2609 func (e FormatSchemaParametersValidationError) Reason() string { return e.reason } 2610 2611 // Cause function returns cause value. 2612 func (e FormatSchemaParametersValidationError) Cause() error { return e.cause } 2613 2614 // Key function returns key value. 2615 func (e FormatSchemaParametersValidationError) Key() bool { return e.key } 2616 2617 // ErrorName returns error name. 2618 func (e FormatSchemaParametersValidationError) ErrorName() string { 2619 return "FormatSchemaParametersValidationError" 2620 } 2621 2622 // Error satisfies the builtin error interface 2623 func (e FormatSchemaParametersValidationError) Error() string { 2624 cause := "" 2625 if e.cause != nil { 2626 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2627 } 2628 2629 key := "" 2630 if e.key { 2631 key = "key for " 2632 } 2633 2634 return fmt.Sprintf( 2635 "invalid %sFormatSchemaParameters.%s: %s%s", 2636 key, 2637 e.field, 2638 e.reason, 2639 cause) 2640 } 2641 2642 var _ error = FormatSchemaParametersValidationError{} 2643 2644 var _ interface { 2645 Field() string 2646 Reason() string 2647 Key() bool 2648 Cause() error 2649 ErrorName() string 2650 } = FormatSchemaParametersValidationError{} 2651 2652 // Validate checks the field values on FormatSchemaResult with the rules 2653 // defined in the proto definition for this message. If any rules are 2654 // violated, the first error encountered is returned, or nil if there are no violations. 2655 func (m *FormatSchemaResult) Validate() error { 2656 return m.validate(false) 2657 } 2658 2659 // ValidateAll checks the field values on FormatSchemaResult with the rules 2660 // defined in the proto definition for this message. If any rules are 2661 // violated, the result is a list of violation errors wrapped in 2662 // FormatSchemaResultMultiError, or nil if none found. 2663 func (m *FormatSchemaResult) ValidateAll() error { 2664 return m.validate(true) 2665 } 2666 2667 func (m *FormatSchemaResult) validate(all bool) error { 2668 if m == nil { 2669 return nil 2670 } 2671 2672 var errors []error 2673 2674 // no validation rules for FormattedSchema 2675 2676 if len(errors) > 0 { 2677 return FormatSchemaResultMultiError(errors) 2678 } 2679 2680 return nil 2681 } 2682 2683 // FormatSchemaResultMultiError is an error wrapping multiple validation errors 2684 // returned by FormatSchemaResult.ValidateAll() if the designated constraints 2685 // aren't met. 2686 type FormatSchemaResultMultiError []error 2687 2688 // Error returns a concatenation of all the error messages it wraps. 2689 func (m FormatSchemaResultMultiError) Error() string { 2690 var msgs []string 2691 for _, err := range m { 2692 msgs = append(msgs, err.Error()) 2693 } 2694 return strings.Join(msgs, "; ") 2695 } 2696 2697 // AllErrors returns a list of validation violation errors. 2698 func (m FormatSchemaResultMultiError) AllErrors() []error { return m } 2699 2700 // FormatSchemaResultValidationError is the validation error returned by 2701 // FormatSchemaResult.Validate if the designated constraints aren't met. 2702 type FormatSchemaResultValidationError struct { 2703 field string 2704 reason string 2705 cause error 2706 key bool 2707 } 2708 2709 // Field function returns field value. 2710 func (e FormatSchemaResultValidationError) Field() string { return e.field } 2711 2712 // Reason function returns reason value. 2713 func (e FormatSchemaResultValidationError) Reason() string { return e.reason } 2714 2715 // Cause function returns cause value. 2716 func (e FormatSchemaResultValidationError) Cause() error { return e.cause } 2717 2718 // Key function returns key value. 2719 func (e FormatSchemaResultValidationError) Key() bool { return e.key } 2720 2721 // ErrorName returns error name. 2722 func (e FormatSchemaResultValidationError) ErrorName() string { 2723 return "FormatSchemaResultValidationError" 2724 } 2725 2726 // Error satisfies the builtin error interface 2727 func (e FormatSchemaResultValidationError) Error() string { 2728 cause := "" 2729 if e.cause != nil { 2730 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2731 } 2732 2733 key := "" 2734 if e.key { 2735 key = "key for " 2736 } 2737 2738 return fmt.Sprintf( 2739 "invalid %sFormatSchemaResult.%s: %s%s", 2740 key, 2741 e.field, 2742 e.reason, 2743 cause) 2744 } 2745 2746 var _ error = FormatSchemaResultValidationError{} 2747 2748 var _ interface { 2749 Field() string 2750 Reason() string 2751 Key() bool 2752 Cause() error 2753 ErrorName() string 2754 } = FormatSchemaResultValidationError{}