go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/cv/api/v0/service_gerrit.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: go.chromium.org/luci/cv/api/v0/service_gerrit.proto 3 4 package cvpb 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 GetCLRunInfoRequest with the rules 39 // defined in the proto definition for this message. If any rules are 40 // violated, the first error encountered is returned, or nil if there are no violations. 41 func (m *GetCLRunInfoRequest) Validate() error { 42 return m.validate(false) 43 } 44 45 // ValidateAll checks the field values on GetCLRunInfoRequest 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 // GetCLRunInfoRequestMultiError, or nil if none found. 49 func (m *GetCLRunInfoRequest) ValidateAll() error { 50 return m.validate(true) 51 } 52 53 func (m *GetCLRunInfoRequest) 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.GetGerritChange()).(type) { 62 case interface{ ValidateAll() error }: 63 if err := v.ValidateAll(); err != nil { 64 errors = append(errors, GetCLRunInfoRequestValidationError{ 65 field: "GerritChange", 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, GetCLRunInfoRequestValidationError{ 73 field: "GerritChange", 74 reason: "embedded message failed validation", 75 cause: err, 76 }) 77 } 78 } 79 } else if v, ok := interface{}(m.GetGerritChange()).(interface{ Validate() error }); ok { 80 if err := v.Validate(); err != nil { 81 return GetCLRunInfoRequestValidationError{ 82 field: "GerritChange", 83 reason: "embedded message failed validation", 84 cause: err, 85 } 86 } 87 } 88 89 if len(errors) > 0 { 90 return GetCLRunInfoRequestMultiError(errors) 91 } 92 93 return nil 94 } 95 96 // GetCLRunInfoRequestMultiError is an error wrapping multiple validation 97 // errors returned by GetCLRunInfoRequest.ValidateAll() if the designated 98 // constraints aren't met. 99 type GetCLRunInfoRequestMultiError []error 100 101 // Error returns a concatenation of all the error messages it wraps. 102 func (m GetCLRunInfoRequestMultiError) Error() string { 103 var msgs []string 104 for _, err := range m { 105 msgs = append(msgs, err.Error()) 106 } 107 return strings.Join(msgs, "; ") 108 } 109 110 // AllErrors returns a list of validation violation errors. 111 func (m GetCLRunInfoRequestMultiError) AllErrors() []error { return m } 112 113 // GetCLRunInfoRequestValidationError is the validation error returned by 114 // GetCLRunInfoRequest.Validate if the designated constraints aren't met. 115 type GetCLRunInfoRequestValidationError struct { 116 field string 117 reason string 118 cause error 119 key bool 120 } 121 122 // Field function returns field value. 123 func (e GetCLRunInfoRequestValidationError) Field() string { return e.field } 124 125 // Reason function returns reason value. 126 func (e GetCLRunInfoRequestValidationError) Reason() string { return e.reason } 127 128 // Cause function returns cause value. 129 func (e GetCLRunInfoRequestValidationError) Cause() error { return e.cause } 130 131 // Key function returns key value. 132 func (e GetCLRunInfoRequestValidationError) Key() bool { return e.key } 133 134 // ErrorName returns error name. 135 func (e GetCLRunInfoRequestValidationError) ErrorName() string { 136 return "GetCLRunInfoRequestValidationError" 137 } 138 139 // Error satisfies the builtin error interface 140 func (e GetCLRunInfoRequestValidationError) Error() string { 141 cause := "" 142 if e.cause != nil { 143 cause = fmt.Sprintf(" | caused by: %v", e.cause) 144 } 145 146 key := "" 147 if e.key { 148 key = "key for " 149 } 150 151 return fmt.Sprintf( 152 "invalid %sGetCLRunInfoRequest.%s: %s%s", 153 key, 154 e.field, 155 e.reason, 156 cause) 157 } 158 159 var _ error = GetCLRunInfoRequestValidationError{} 160 161 var _ interface { 162 Field() string 163 Reason() string 164 Key() bool 165 Cause() error 166 ErrorName() string 167 } = GetCLRunInfoRequestValidationError{} 168 169 // Validate checks the field values on GetCLRunInfoResponse with the rules 170 // defined in the proto definition for this message. If any rules are 171 // violated, the first error encountered is returned, or nil if there are no violations. 172 func (m *GetCLRunInfoResponse) Validate() error { 173 return m.validate(false) 174 } 175 176 // ValidateAll checks the field values on GetCLRunInfoResponse with the rules 177 // defined in the proto definition for this message. If any rules are 178 // violated, the result is a list of violation errors wrapped in 179 // GetCLRunInfoResponseMultiError, or nil if none found. 180 func (m *GetCLRunInfoResponse) ValidateAll() error { 181 return m.validate(true) 182 } 183 184 func (m *GetCLRunInfoResponse) validate(all bool) error { 185 if m == nil { 186 return nil 187 } 188 189 var errors []error 190 191 for idx, item := range m.GetRunsAsOrigin() { 192 _, _ = idx, item 193 194 if all { 195 switch v := interface{}(item).(type) { 196 case interface{ ValidateAll() error }: 197 if err := v.ValidateAll(); err != nil { 198 errors = append(errors, GetCLRunInfoResponseValidationError{ 199 field: fmt.Sprintf("RunsAsOrigin[%v]", idx), 200 reason: "embedded message failed validation", 201 cause: err, 202 }) 203 } 204 case interface{ Validate() error }: 205 if err := v.Validate(); err != nil { 206 errors = append(errors, GetCLRunInfoResponseValidationError{ 207 field: fmt.Sprintf("RunsAsOrigin[%v]", idx), 208 reason: "embedded message failed validation", 209 cause: err, 210 }) 211 } 212 } 213 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 214 if err := v.Validate(); err != nil { 215 return GetCLRunInfoResponseValidationError{ 216 field: fmt.Sprintf("RunsAsOrigin[%v]", idx), 217 reason: "embedded message failed validation", 218 cause: err, 219 } 220 } 221 } 222 223 } 224 225 for idx, item := range m.GetRunsAsDep() { 226 _, _ = idx, item 227 228 if all { 229 switch v := interface{}(item).(type) { 230 case interface{ ValidateAll() error }: 231 if err := v.ValidateAll(); err != nil { 232 errors = append(errors, GetCLRunInfoResponseValidationError{ 233 field: fmt.Sprintf("RunsAsDep[%v]", idx), 234 reason: "embedded message failed validation", 235 cause: err, 236 }) 237 } 238 case interface{ Validate() error }: 239 if err := v.Validate(); err != nil { 240 errors = append(errors, GetCLRunInfoResponseValidationError{ 241 field: fmt.Sprintf("RunsAsDep[%v]", idx), 242 reason: "embedded message failed validation", 243 cause: err, 244 }) 245 } 246 } 247 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 248 if err := v.Validate(); err != nil { 249 return GetCLRunInfoResponseValidationError{ 250 field: fmt.Sprintf("RunsAsDep[%v]", idx), 251 reason: "embedded message failed validation", 252 cause: err, 253 } 254 } 255 } 256 257 } 258 259 for idx, item := range m.GetDepChangeInfos() { 260 _, _ = idx, item 261 262 if all { 263 switch v := interface{}(item).(type) { 264 case interface{ ValidateAll() error }: 265 if err := v.ValidateAll(); err != nil { 266 errors = append(errors, GetCLRunInfoResponseValidationError{ 267 field: fmt.Sprintf("DepChangeInfos[%v]", idx), 268 reason: "embedded message failed validation", 269 cause: err, 270 }) 271 } 272 case interface{ Validate() error }: 273 if err := v.Validate(); err != nil { 274 errors = append(errors, GetCLRunInfoResponseValidationError{ 275 field: fmt.Sprintf("DepChangeInfos[%v]", idx), 276 reason: "embedded message failed validation", 277 cause: err, 278 }) 279 } 280 } 281 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 282 if err := v.Validate(); err != nil { 283 return GetCLRunInfoResponseValidationError{ 284 field: fmt.Sprintf("DepChangeInfos[%v]", idx), 285 reason: "embedded message failed validation", 286 cause: err, 287 } 288 } 289 } 290 291 } 292 293 if len(errors) > 0 { 294 return GetCLRunInfoResponseMultiError(errors) 295 } 296 297 return nil 298 } 299 300 // GetCLRunInfoResponseMultiError is an error wrapping multiple validation 301 // errors returned by GetCLRunInfoResponse.ValidateAll() if the designated 302 // constraints aren't met. 303 type GetCLRunInfoResponseMultiError []error 304 305 // Error returns a concatenation of all the error messages it wraps. 306 func (m GetCLRunInfoResponseMultiError) Error() string { 307 var msgs []string 308 for _, err := range m { 309 msgs = append(msgs, err.Error()) 310 } 311 return strings.Join(msgs, "; ") 312 } 313 314 // AllErrors returns a list of validation violation errors. 315 func (m GetCLRunInfoResponseMultiError) AllErrors() []error { return m } 316 317 // GetCLRunInfoResponseValidationError is the validation error returned by 318 // GetCLRunInfoResponse.Validate if the designated constraints aren't met. 319 type GetCLRunInfoResponseValidationError struct { 320 field string 321 reason string 322 cause error 323 key bool 324 } 325 326 // Field function returns field value. 327 func (e GetCLRunInfoResponseValidationError) Field() string { return e.field } 328 329 // Reason function returns reason value. 330 func (e GetCLRunInfoResponseValidationError) Reason() string { return e.reason } 331 332 // Cause function returns cause value. 333 func (e GetCLRunInfoResponseValidationError) Cause() error { return e.cause } 334 335 // Key function returns key value. 336 func (e GetCLRunInfoResponseValidationError) Key() bool { return e.key } 337 338 // ErrorName returns error name. 339 func (e GetCLRunInfoResponseValidationError) ErrorName() string { 340 return "GetCLRunInfoResponseValidationError" 341 } 342 343 // Error satisfies the builtin error interface 344 func (e GetCLRunInfoResponseValidationError) Error() string { 345 cause := "" 346 if e.cause != nil { 347 cause = fmt.Sprintf(" | caused by: %v", e.cause) 348 } 349 350 key := "" 351 if e.key { 352 key = "key for " 353 } 354 355 return fmt.Sprintf( 356 "invalid %sGetCLRunInfoResponse.%s: %s%s", 357 key, 358 e.field, 359 e.reason, 360 cause) 361 } 362 363 var _ error = GetCLRunInfoResponseValidationError{} 364 365 var _ interface { 366 Field() string 367 Reason() string 368 Key() bool 369 Cause() error 370 ErrorName() string 371 } = GetCLRunInfoResponseValidationError{} 372 373 // Validate checks the field values on GetCLRunInfoResponse_RunInfo with the 374 // rules defined in the proto definition for this message. If any rules are 375 // violated, the first error encountered is returned, or nil if there are no violations. 376 func (m *GetCLRunInfoResponse_RunInfo) Validate() error { 377 return m.validate(false) 378 } 379 380 // ValidateAll checks the field values on GetCLRunInfoResponse_RunInfo with the 381 // rules defined in the proto definition for this message. If any rules are 382 // violated, the result is a list of violation errors wrapped in 383 // GetCLRunInfoResponse_RunInfoMultiError, or nil if none found. 384 func (m *GetCLRunInfoResponse_RunInfo) ValidateAll() error { 385 return m.validate(true) 386 } 387 388 func (m *GetCLRunInfoResponse_RunInfo) validate(all bool) error { 389 if m == nil { 390 return nil 391 } 392 393 var errors []error 394 395 // no validation rules for Id 396 397 if all { 398 switch v := interface{}(m.GetCreateTime()).(type) { 399 case interface{ ValidateAll() error }: 400 if err := v.ValidateAll(); err != nil { 401 errors = append(errors, GetCLRunInfoResponse_RunInfoValidationError{ 402 field: "CreateTime", 403 reason: "embedded message failed validation", 404 cause: err, 405 }) 406 } 407 case interface{ Validate() error }: 408 if err := v.Validate(); err != nil { 409 errors = append(errors, GetCLRunInfoResponse_RunInfoValidationError{ 410 field: "CreateTime", 411 reason: "embedded message failed validation", 412 cause: err, 413 }) 414 } 415 } 416 } else if v, ok := interface{}(m.GetCreateTime()).(interface{ Validate() error }); ok { 417 if err := v.Validate(); err != nil { 418 return GetCLRunInfoResponse_RunInfoValidationError{ 419 field: "CreateTime", 420 reason: "embedded message failed validation", 421 cause: err, 422 } 423 } 424 } 425 426 if all { 427 switch v := interface{}(m.GetStartTime()).(type) { 428 case interface{ ValidateAll() error }: 429 if err := v.ValidateAll(); err != nil { 430 errors = append(errors, GetCLRunInfoResponse_RunInfoValidationError{ 431 field: "StartTime", 432 reason: "embedded message failed validation", 433 cause: err, 434 }) 435 } 436 case interface{ Validate() error }: 437 if err := v.Validate(); err != nil { 438 errors = append(errors, GetCLRunInfoResponse_RunInfoValidationError{ 439 field: "StartTime", 440 reason: "embedded message failed validation", 441 cause: err, 442 }) 443 } 444 } 445 } else if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok { 446 if err := v.Validate(); err != nil { 447 return GetCLRunInfoResponse_RunInfoValidationError{ 448 field: "StartTime", 449 reason: "embedded message failed validation", 450 cause: err, 451 } 452 } 453 } 454 455 if all { 456 switch v := interface{}(m.GetOriginChange()).(type) { 457 case interface{ ValidateAll() error }: 458 if err := v.ValidateAll(); err != nil { 459 errors = append(errors, GetCLRunInfoResponse_RunInfoValidationError{ 460 field: "OriginChange", 461 reason: "embedded message failed validation", 462 cause: err, 463 }) 464 } 465 case interface{ Validate() error }: 466 if err := v.Validate(); err != nil { 467 errors = append(errors, GetCLRunInfoResponse_RunInfoValidationError{ 468 field: "OriginChange", 469 reason: "embedded message failed validation", 470 cause: err, 471 }) 472 } 473 } 474 } else if v, ok := interface{}(m.GetOriginChange()).(interface{ Validate() error }); ok { 475 if err := v.Validate(); err != nil { 476 return GetCLRunInfoResponse_RunInfoValidationError{ 477 field: "OriginChange", 478 reason: "embedded message failed validation", 479 cause: err, 480 } 481 } 482 } 483 484 // no validation rules for Mode 485 486 if len(errors) > 0 { 487 return GetCLRunInfoResponse_RunInfoMultiError(errors) 488 } 489 490 return nil 491 } 492 493 // GetCLRunInfoResponse_RunInfoMultiError is an error wrapping multiple 494 // validation errors returned by GetCLRunInfoResponse_RunInfo.ValidateAll() if 495 // the designated constraints aren't met. 496 type GetCLRunInfoResponse_RunInfoMultiError []error 497 498 // Error returns a concatenation of all the error messages it wraps. 499 func (m GetCLRunInfoResponse_RunInfoMultiError) Error() string { 500 var msgs []string 501 for _, err := range m { 502 msgs = append(msgs, err.Error()) 503 } 504 return strings.Join(msgs, "; ") 505 } 506 507 // AllErrors returns a list of validation violation errors. 508 func (m GetCLRunInfoResponse_RunInfoMultiError) AllErrors() []error { return m } 509 510 // GetCLRunInfoResponse_RunInfoValidationError is the validation error returned 511 // by GetCLRunInfoResponse_RunInfo.Validate if the designated constraints 512 // aren't met. 513 type GetCLRunInfoResponse_RunInfoValidationError struct { 514 field string 515 reason string 516 cause error 517 key bool 518 } 519 520 // Field function returns field value. 521 func (e GetCLRunInfoResponse_RunInfoValidationError) Field() string { return e.field } 522 523 // Reason function returns reason value. 524 func (e GetCLRunInfoResponse_RunInfoValidationError) Reason() string { return e.reason } 525 526 // Cause function returns cause value. 527 func (e GetCLRunInfoResponse_RunInfoValidationError) Cause() error { return e.cause } 528 529 // Key function returns key value. 530 func (e GetCLRunInfoResponse_RunInfoValidationError) Key() bool { return e.key } 531 532 // ErrorName returns error name. 533 func (e GetCLRunInfoResponse_RunInfoValidationError) ErrorName() string { 534 return "GetCLRunInfoResponse_RunInfoValidationError" 535 } 536 537 // Error satisfies the builtin error interface 538 func (e GetCLRunInfoResponse_RunInfoValidationError) Error() string { 539 cause := "" 540 if e.cause != nil { 541 cause = fmt.Sprintf(" | caused by: %v", e.cause) 542 } 543 544 key := "" 545 if e.key { 546 key = "key for " 547 } 548 549 return fmt.Sprintf( 550 "invalid %sGetCLRunInfoResponse_RunInfo.%s: %s%s", 551 key, 552 e.field, 553 e.reason, 554 cause) 555 } 556 557 var _ error = GetCLRunInfoResponse_RunInfoValidationError{} 558 559 var _ interface { 560 Field() string 561 Reason() string 562 Key() bool 563 Cause() error 564 ErrorName() string 565 } = GetCLRunInfoResponse_RunInfoValidationError{} 566 567 // Validate checks the field values on GetCLRunInfoResponse_DepChangeInfo with 568 // the rules defined in the proto definition for this message. If any rules 569 // are violated, the first error encountered is returned, or nil if there are 570 // no violations. 571 func (m *GetCLRunInfoResponse_DepChangeInfo) Validate() error { 572 return m.validate(false) 573 } 574 575 // ValidateAll checks the field values on GetCLRunInfoResponse_DepChangeInfo 576 // with the rules defined in the proto definition for this message. If any 577 // rules are violated, the result is a list of violation errors wrapped in 578 // GetCLRunInfoResponse_DepChangeInfoMultiError, or nil if none found. 579 func (m *GetCLRunInfoResponse_DepChangeInfo) ValidateAll() error { 580 return m.validate(true) 581 } 582 583 func (m *GetCLRunInfoResponse_DepChangeInfo) validate(all bool) error { 584 if m == nil { 585 return nil 586 } 587 588 var errors []error 589 590 if all { 591 switch v := interface{}(m.GetGerritChange()).(type) { 592 case interface{ ValidateAll() error }: 593 if err := v.ValidateAll(); err != nil { 594 errors = append(errors, GetCLRunInfoResponse_DepChangeInfoValidationError{ 595 field: "GerritChange", 596 reason: "embedded message failed validation", 597 cause: err, 598 }) 599 } 600 case interface{ Validate() error }: 601 if err := v.Validate(); err != nil { 602 errors = append(errors, GetCLRunInfoResponse_DepChangeInfoValidationError{ 603 field: "GerritChange", 604 reason: "embedded message failed validation", 605 cause: err, 606 }) 607 } 608 } 609 } else if v, ok := interface{}(m.GetGerritChange()).(interface{ Validate() error }); ok { 610 if err := v.Validate(); err != nil { 611 return GetCLRunInfoResponse_DepChangeInfoValidationError{ 612 field: "GerritChange", 613 reason: "embedded message failed validation", 614 cause: err, 615 } 616 } 617 } 618 619 for idx, item := range m.GetRuns() { 620 _, _ = idx, item 621 622 if all { 623 switch v := interface{}(item).(type) { 624 case interface{ ValidateAll() error }: 625 if err := v.ValidateAll(); err != nil { 626 errors = append(errors, GetCLRunInfoResponse_DepChangeInfoValidationError{ 627 field: fmt.Sprintf("Runs[%v]", idx), 628 reason: "embedded message failed validation", 629 cause: err, 630 }) 631 } 632 case interface{ Validate() error }: 633 if err := v.Validate(); err != nil { 634 errors = append(errors, GetCLRunInfoResponse_DepChangeInfoValidationError{ 635 field: fmt.Sprintf("Runs[%v]", idx), 636 reason: "embedded message failed validation", 637 cause: err, 638 }) 639 } 640 } 641 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { 642 if err := v.Validate(); err != nil { 643 return GetCLRunInfoResponse_DepChangeInfoValidationError{ 644 field: fmt.Sprintf("Runs[%v]", idx), 645 reason: "embedded message failed validation", 646 cause: err, 647 } 648 } 649 } 650 651 } 652 653 // no validation rules for ChangeOwner 654 655 if len(errors) > 0 { 656 return GetCLRunInfoResponse_DepChangeInfoMultiError(errors) 657 } 658 659 return nil 660 } 661 662 // GetCLRunInfoResponse_DepChangeInfoMultiError is an error wrapping multiple 663 // validation errors returned by 664 // GetCLRunInfoResponse_DepChangeInfo.ValidateAll() if the designated 665 // constraints aren't met. 666 type GetCLRunInfoResponse_DepChangeInfoMultiError []error 667 668 // Error returns a concatenation of all the error messages it wraps. 669 func (m GetCLRunInfoResponse_DepChangeInfoMultiError) Error() string { 670 var msgs []string 671 for _, err := range m { 672 msgs = append(msgs, err.Error()) 673 } 674 return strings.Join(msgs, "; ") 675 } 676 677 // AllErrors returns a list of validation violation errors. 678 func (m GetCLRunInfoResponse_DepChangeInfoMultiError) AllErrors() []error { return m } 679 680 // GetCLRunInfoResponse_DepChangeInfoValidationError is the validation error 681 // returned by GetCLRunInfoResponse_DepChangeInfo.Validate if the designated 682 // constraints aren't met. 683 type GetCLRunInfoResponse_DepChangeInfoValidationError struct { 684 field string 685 reason string 686 cause error 687 key bool 688 } 689 690 // Field function returns field value. 691 func (e GetCLRunInfoResponse_DepChangeInfoValidationError) Field() string { return e.field } 692 693 // Reason function returns reason value. 694 func (e GetCLRunInfoResponse_DepChangeInfoValidationError) Reason() string { return e.reason } 695 696 // Cause function returns cause value. 697 func (e GetCLRunInfoResponse_DepChangeInfoValidationError) Cause() error { return e.cause } 698 699 // Key function returns key value. 700 func (e GetCLRunInfoResponse_DepChangeInfoValidationError) Key() bool { return e.key } 701 702 // ErrorName returns error name. 703 func (e GetCLRunInfoResponse_DepChangeInfoValidationError) ErrorName() string { 704 return "GetCLRunInfoResponse_DepChangeInfoValidationError" 705 } 706 707 // Error satisfies the builtin error interface 708 func (e GetCLRunInfoResponse_DepChangeInfoValidationError) Error() string { 709 cause := "" 710 if e.cause != nil { 711 cause = fmt.Sprintf(" | caused by: %v", e.cause) 712 } 713 714 key := "" 715 if e.key { 716 key = "key for " 717 } 718 719 return fmt.Sprintf( 720 "invalid %sGetCLRunInfoResponse_DepChangeInfo.%s: %s%s", 721 key, 722 e.field, 723 e.reason, 724 cause) 725 } 726 727 var _ error = GetCLRunInfoResponse_DepChangeInfoValidationError{} 728 729 var _ interface { 730 Field() string 731 Reason() string 732 Key() bool 733 Cause() error 734 ErrorName() string 735 } = GetCLRunInfoResponse_DepChangeInfoValidationError{}