github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-control-plane/envoy/api/v2/core/grpc_service.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: envoy/api/v2/core/grpc_service.proto 3 4 package envoy_api_v2_core 5 6 import ( 7 "bytes" 8 "errors" 9 "fmt" 10 "net" 11 "net/mail" 12 "net/url" 13 "regexp" 14 "strings" 15 "time" 16 "unicode/utf8" 17 18 "google.golang.org/protobuf/types/known/anypb" 19 ) 20 21 // ensure the imports are used 22 var ( 23 _ = bytes.MinRead 24 _ = errors.New("") 25 _ = fmt.Print 26 _ = utf8.UTFMax 27 _ = (*regexp.Regexp)(nil) 28 _ = (*strings.Reader)(nil) 29 _ = net.IPv4len 30 _ = time.Duration(0) 31 _ = (*url.URL)(nil) 32 _ = (*mail.Address)(nil) 33 _ = anypb.Any{} 34 ) 35 36 // Validate checks the field values on GrpcService with the rules defined in 37 // the proto definition for this message. If any rules are violated, an error 38 // is returned. 39 func (m *GrpcService) Validate() error { 40 if m == nil { 41 return nil 42 } 43 44 if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { 45 if err := v.Validate(); err != nil { 46 return GrpcServiceValidationError{ 47 field: "Timeout", 48 reason: "embedded message failed validation", 49 cause: err, 50 } 51 } 52 } 53 54 for idx, item := range m.GetInitialMetadata() { 55 _, _ = idx, item 56 57 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 58 if err := v.Validate(); err != nil { 59 return GrpcServiceValidationError{ 60 field: fmt.Sprintf("InitialMetadata[%v]", idx), 61 reason: "embedded message failed validation", 62 cause: err, 63 } 64 } 65 } 66 67 } 68 69 switch m.TargetSpecifier.(type) { 70 71 case *GrpcService_EnvoyGrpc_: 72 73 if v, ok := interface{}(m.GetEnvoyGrpc()).(interface{ Validate() error }); ok { 74 if err := v.Validate(); err != nil { 75 return GrpcServiceValidationError{ 76 field: "EnvoyGrpc", 77 reason: "embedded message failed validation", 78 cause: err, 79 } 80 } 81 } 82 83 case *GrpcService_GoogleGrpc_: 84 85 if v, ok := interface{}(m.GetGoogleGrpc()).(interface{ Validate() error }); ok { 86 if err := v.Validate(); err != nil { 87 return GrpcServiceValidationError{ 88 field: "GoogleGrpc", 89 reason: "embedded message failed validation", 90 cause: err, 91 } 92 } 93 } 94 95 default: 96 return GrpcServiceValidationError{ 97 field: "TargetSpecifier", 98 reason: "value is required", 99 } 100 101 } 102 103 return nil 104 } 105 106 // GrpcServiceValidationError is the validation error returned by 107 // GrpcService.Validate if the designated constraints aren't met. 108 type GrpcServiceValidationError struct { 109 field string 110 reason string 111 cause error 112 key bool 113 } 114 115 // Field function returns field value. 116 func (e GrpcServiceValidationError) Field() string { return e.field } 117 118 // Reason function returns reason value. 119 func (e GrpcServiceValidationError) Reason() string { return e.reason } 120 121 // Cause function returns cause value. 122 func (e GrpcServiceValidationError) Cause() error { return e.cause } 123 124 // Key function returns key value. 125 func (e GrpcServiceValidationError) Key() bool { return e.key } 126 127 // ErrorName returns error name. 128 func (e GrpcServiceValidationError) ErrorName() string { return "GrpcServiceValidationError" } 129 130 // Error satisfies the builtin error interface 131 func (e GrpcServiceValidationError) Error() string { 132 cause := "" 133 if e.cause != nil { 134 cause = fmt.Sprintf(" | caused by: %v", e.cause) 135 } 136 137 key := "" 138 if e.key { 139 key = "key for " 140 } 141 142 return fmt.Sprintf( 143 "invalid %sGrpcService.%s: %s%s", 144 key, 145 e.field, 146 e.reason, 147 cause) 148 } 149 150 var _ error = GrpcServiceValidationError{} 151 152 var _ interface { 153 Field() string 154 Reason() string 155 Key() bool 156 Cause() error 157 ErrorName() string 158 } = GrpcServiceValidationError{} 159 160 // Validate checks the field values on GrpcService_EnvoyGrpc with the rules 161 // defined in the proto definition for this message. If any rules are 162 // violated, an error is returned. 163 func (m *GrpcService_EnvoyGrpc) Validate() error { 164 if m == nil { 165 return nil 166 } 167 168 if len(m.GetClusterName()) < 1 { 169 return GrpcService_EnvoyGrpcValidationError{ 170 field: "ClusterName", 171 reason: "value length must be at least 1 bytes", 172 } 173 } 174 175 return nil 176 } 177 178 // GrpcService_EnvoyGrpcValidationError is the validation error returned by 179 // GrpcService_EnvoyGrpc.Validate if the designated constraints aren't met. 180 type GrpcService_EnvoyGrpcValidationError struct { 181 field string 182 reason string 183 cause error 184 key bool 185 } 186 187 // Field function returns field value. 188 func (e GrpcService_EnvoyGrpcValidationError) Field() string { return e.field } 189 190 // Reason function returns reason value. 191 func (e GrpcService_EnvoyGrpcValidationError) Reason() string { return e.reason } 192 193 // Cause function returns cause value. 194 func (e GrpcService_EnvoyGrpcValidationError) Cause() error { return e.cause } 195 196 // Key function returns key value. 197 func (e GrpcService_EnvoyGrpcValidationError) Key() bool { return e.key } 198 199 // ErrorName returns error name. 200 func (e GrpcService_EnvoyGrpcValidationError) ErrorName() string { 201 return "GrpcService_EnvoyGrpcValidationError" 202 } 203 204 // Error satisfies the builtin error interface 205 func (e GrpcService_EnvoyGrpcValidationError) Error() string { 206 cause := "" 207 if e.cause != nil { 208 cause = fmt.Sprintf(" | caused by: %v", e.cause) 209 } 210 211 key := "" 212 if e.key { 213 key = "key for " 214 } 215 216 return fmt.Sprintf( 217 "invalid %sGrpcService_EnvoyGrpc.%s: %s%s", 218 key, 219 e.field, 220 e.reason, 221 cause) 222 } 223 224 var _ error = GrpcService_EnvoyGrpcValidationError{} 225 226 var _ interface { 227 Field() string 228 Reason() string 229 Key() bool 230 Cause() error 231 ErrorName() string 232 } = GrpcService_EnvoyGrpcValidationError{} 233 234 // Validate checks the field values on GrpcService_GoogleGrpc with the rules 235 // defined in the proto definition for this message. If any rules are 236 // violated, an error is returned. 237 func (m *GrpcService_GoogleGrpc) Validate() error { 238 if m == nil { 239 return nil 240 } 241 242 if len(m.GetTargetUri()) < 1 { 243 return GrpcService_GoogleGrpcValidationError{ 244 field: "TargetUri", 245 reason: "value length must be at least 1 bytes", 246 } 247 } 248 249 if v, ok := interface{}(m.GetChannelCredentials()).(interface{ Validate() error }); ok { 250 if err := v.Validate(); err != nil { 251 return GrpcService_GoogleGrpcValidationError{ 252 field: "ChannelCredentials", 253 reason: "embedded message failed validation", 254 cause: err, 255 } 256 } 257 } 258 259 for idx, item := range m.GetCallCredentials() { 260 _, _ = idx, item 261 262 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 263 if err := v.Validate(); err != nil { 264 return GrpcService_GoogleGrpcValidationError{ 265 field: fmt.Sprintf("CallCredentials[%v]", idx), 266 reason: "embedded message failed validation", 267 cause: err, 268 } 269 } 270 } 271 272 } 273 274 if len(m.GetStatPrefix()) < 1 { 275 return GrpcService_GoogleGrpcValidationError{ 276 field: "StatPrefix", 277 reason: "value length must be at least 1 bytes", 278 } 279 } 280 281 // no validation rules for CredentialsFactoryName 282 283 if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { 284 if err := v.Validate(); err != nil { 285 return GrpcService_GoogleGrpcValidationError{ 286 field: "Config", 287 reason: "embedded message failed validation", 288 cause: err, 289 } 290 } 291 } 292 293 return nil 294 } 295 296 // GrpcService_GoogleGrpcValidationError is the validation error returned by 297 // GrpcService_GoogleGrpc.Validate if the designated constraints aren't met. 298 type GrpcService_GoogleGrpcValidationError struct { 299 field string 300 reason string 301 cause error 302 key bool 303 } 304 305 // Field function returns field value. 306 func (e GrpcService_GoogleGrpcValidationError) Field() string { return e.field } 307 308 // Reason function returns reason value. 309 func (e GrpcService_GoogleGrpcValidationError) Reason() string { return e.reason } 310 311 // Cause function returns cause value. 312 func (e GrpcService_GoogleGrpcValidationError) Cause() error { return e.cause } 313 314 // Key function returns key value. 315 func (e GrpcService_GoogleGrpcValidationError) Key() bool { return e.key } 316 317 // ErrorName returns error name. 318 func (e GrpcService_GoogleGrpcValidationError) ErrorName() string { 319 return "GrpcService_GoogleGrpcValidationError" 320 } 321 322 // Error satisfies the builtin error interface 323 func (e GrpcService_GoogleGrpcValidationError) Error() string { 324 cause := "" 325 if e.cause != nil { 326 cause = fmt.Sprintf(" | caused by: %v", e.cause) 327 } 328 329 key := "" 330 if e.key { 331 key = "key for " 332 } 333 334 return fmt.Sprintf( 335 "invalid %sGrpcService_GoogleGrpc.%s: %s%s", 336 key, 337 e.field, 338 e.reason, 339 cause) 340 } 341 342 var _ error = GrpcService_GoogleGrpcValidationError{} 343 344 var _ interface { 345 Field() string 346 Reason() string 347 Key() bool 348 Cause() error 349 ErrorName() string 350 } = GrpcService_GoogleGrpcValidationError{} 351 352 // Validate checks the field values on GrpcService_GoogleGrpc_SslCredentials 353 // with the rules defined in the proto definition for this message. If any 354 // rules are violated, an error is returned. 355 func (m *GrpcService_GoogleGrpc_SslCredentials) Validate() error { 356 if m == nil { 357 return nil 358 } 359 360 if v, ok := interface{}(m.GetRootCerts()).(interface{ Validate() error }); ok { 361 if err := v.Validate(); err != nil { 362 return GrpcService_GoogleGrpc_SslCredentialsValidationError{ 363 field: "RootCerts", 364 reason: "embedded message failed validation", 365 cause: err, 366 } 367 } 368 } 369 370 if v, ok := interface{}(m.GetPrivateKey()).(interface{ Validate() error }); ok { 371 if err := v.Validate(); err != nil { 372 return GrpcService_GoogleGrpc_SslCredentialsValidationError{ 373 field: "PrivateKey", 374 reason: "embedded message failed validation", 375 cause: err, 376 } 377 } 378 } 379 380 if v, ok := interface{}(m.GetCertChain()).(interface{ Validate() error }); ok { 381 if err := v.Validate(); err != nil { 382 return GrpcService_GoogleGrpc_SslCredentialsValidationError{ 383 field: "CertChain", 384 reason: "embedded message failed validation", 385 cause: err, 386 } 387 } 388 } 389 390 return nil 391 } 392 393 // GrpcService_GoogleGrpc_SslCredentialsValidationError is the validation error 394 // returned by GrpcService_GoogleGrpc_SslCredentials.Validate if the 395 // designated constraints aren't met. 396 type GrpcService_GoogleGrpc_SslCredentialsValidationError struct { 397 field string 398 reason string 399 cause error 400 key bool 401 } 402 403 // Field function returns field value. 404 func (e GrpcService_GoogleGrpc_SslCredentialsValidationError) Field() string { return e.field } 405 406 // Reason function returns reason value. 407 func (e GrpcService_GoogleGrpc_SslCredentialsValidationError) Reason() string { return e.reason } 408 409 // Cause function returns cause value. 410 func (e GrpcService_GoogleGrpc_SslCredentialsValidationError) Cause() error { return e.cause } 411 412 // Key function returns key value. 413 func (e GrpcService_GoogleGrpc_SslCredentialsValidationError) Key() bool { return e.key } 414 415 // ErrorName returns error name. 416 func (e GrpcService_GoogleGrpc_SslCredentialsValidationError) ErrorName() string { 417 return "GrpcService_GoogleGrpc_SslCredentialsValidationError" 418 } 419 420 // Error satisfies the builtin error interface 421 func (e GrpcService_GoogleGrpc_SslCredentialsValidationError) Error() string { 422 cause := "" 423 if e.cause != nil { 424 cause = fmt.Sprintf(" | caused by: %v", e.cause) 425 } 426 427 key := "" 428 if e.key { 429 key = "key for " 430 } 431 432 return fmt.Sprintf( 433 "invalid %sGrpcService_GoogleGrpc_SslCredentials.%s: %s%s", 434 key, 435 e.field, 436 e.reason, 437 cause) 438 } 439 440 var _ error = GrpcService_GoogleGrpc_SslCredentialsValidationError{} 441 442 var _ interface { 443 Field() string 444 Reason() string 445 Key() bool 446 Cause() error 447 ErrorName() string 448 } = GrpcService_GoogleGrpc_SslCredentialsValidationError{} 449 450 // Validate checks the field values on 451 // GrpcService_GoogleGrpc_GoogleLocalCredentials with the rules defined in the 452 // proto definition for this message. If any rules are violated, an error is returned. 453 func (m *GrpcService_GoogleGrpc_GoogleLocalCredentials) Validate() error { 454 if m == nil { 455 return nil 456 } 457 458 return nil 459 } 460 461 // GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError is the 462 // validation error returned by 463 // GrpcService_GoogleGrpc_GoogleLocalCredentials.Validate if the designated 464 // constraints aren't met. 465 type GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError struct { 466 field string 467 reason string 468 cause error 469 key bool 470 } 471 472 // Field function returns field value. 473 func (e GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError) Field() string { return e.field } 474 475 // Reason function returns reason value. 476 func (e GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError) Reason() string { 477 return e.reason 478 } 479 480 // Cause function returns cause value. 481 func (e GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError) Cause() error { return e.cause } 482 483 // Key function returns key value. 484 func (e GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError) Key() bool { return e.key } 485 486 // ErrorName returns error name. 487 func (e GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError) ErrorName() string { 488 return "GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError" 489 } 490 491 // Error satisfies the builtin error interface 492 func (e GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError) Error() string { 493 cause := "" 494 if e.cause != nil { 495 cause = fmt.Sprintf(" | caused by: %v", e.cause) 496 } 497 498 key := "" 499 if e.key { 500 key = "key for " 501 } 502 503 return fmt.Sprintf( 504 "invalid %sGrpcService_GoogleGrpc_GoogleLocalCredentials.%s: %s%s", 505 key, 506 e.field, 507 e.reason, 508 cause) 509 } 510 511 var _ error = GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError{} 512 513 var _ interface { 514 Field() string 515 Reason() string 516 Key() bool 517 Cause() error 518 ErrorName() string 519 } = GrpcService_GoogleGrpc_GoogleLocalCredentialsValidationError{} 520 521 // Validate checks the field values on 522 // GrpcService_GoogleGrpc_ChannelCredentials with the rules defined in the 523 // proto definition for this message. If any rules are violated, an error is returned. 524 func (m *GrpcService_GoogleGrpc_ChannelCredentials) Validate() error { 525 if m == nil { 526 return nil 527 } 528 529 switch m.CredentialSpecifier.(type) { 530 531 case *GrpcService_GoogleGrpc_ChannelCredentials_SslCredentials: 532 533 if v, ok := interface{}(m.GetSslCredentials()).(interface{ Validate() error }); ok { 534 if err := v.Validate(); err != nil { 535 return GrpcService_GoogleGrpc_ChannelCredentialsValidationError{ 536 field: "SslCredentials", 537 reason: "embedded message failed validation", 538 cause: err, 539 } 540 } 541 } 542 543 case *GrpcService_GoogleGrpc_ChannelCredentials_GoogleDefault: 544 545 if v, ok := interface{}(m.GetGoogleDefault()).(interface{ Validate() error }); ok { 546 if err := v.Validate(); err != nil { 547 return GrpcService_GoogleGrpc_ChannelCredentialsValidationError{ 548 field: "GoogleDefault", 549 reason: "embedded message failed validation", 550 cause: err, 551 } 552 } 553 } 554 555 case *GrpcService_GoogleGrpc_ChannelCredentials_LocalCredentials: 556 557 if v, ok := interface{}(m.GetLocalCredentials()).(interface{ Validate() error }); ok { 558 if err := v.Validate(); err != nil { 559 return GrpcService_GoogleGrpc_ChannelCredentialsValidationError{ 560 field: "LocalCredentials", 561 reason: "embedded message failed validation", 562 cause: err, 563 } 564 } 565 } 566 567 default: 568 return GrpcService_GoogleGrpc_ChannelCredentialsValidationError{ 569 field: "CredentialSpecifier", 570 reason: "value is required", 571 } 572 573 } 574 575 return nil 576 } 577 578 // GrpcService_GoogleGrpc_ChannelCredentialsValidationError is the validation 579 // error returned by GrpcService_GoogleGrpc_ChannelCredentials.Validate if the 580 // designated constraints aren't met. 581 type GrpcService_GoogleGrpc_ChannelCredentialsValidationError struct { 582 field string 583 reason string 584 cause error 585 key bool 586 } 587 588 // Field function returns field value. 589 func (e GrpcService_GoogleGrpc_ChannelCredentialsValidationError) Field() string { return e.field } 590 591 // Reason function returns reason value. 592 func (e GrpcService_GoogleGrpc_ChannelCredentialsValidationError) Reason() string { return e.reason } 593 594 // Cause function returns cause value. 595 func (e GrpcService_GoogleGrpc_ChannelCredentialsValidationError) Cause() error { return e.cause } 596 597 // Key function returns key value. 598 func (e GrpcService_GoogleGrpc_ChannelCredentialsValidationError) Key() bool { return e.key } 599 600 // ErrorName returns error name. 601 func (e GrpcService_GoogleGrpc_ChannelCredentialsValidationError) ErrorName() string { 602 return "GrpcService_GoogleGrpc_ChannelCredentialsValidationError" 603 } 604 605 // Error satisfies the builtin error interface 606 func (e GrpcService_GoogleGrpc_ChannelCredentialsValidationError) Error() string { 607 cause := "" 608 if e.cause != nil { 609 cause = fmt.Sprintf(" | caused by: %v", e.cause) 610 } 611 612 key := "" 613 if e.key { 614 key = "key for " 615 } 616 617 return fmt.Sprintf( 618 "invalid %sGrpcService_GoogleGrpc_ChannelCredentials.%s: %s%s", 619 key, 620 e.field, 621 e.reason, 622 cause) 623 } 624 625 var _ error = GrpcService_GoogleGrpc_ChannelCredentialsValidationError{} 626 627 var _ interface { 628 Field() string 629 Reason() string 630 Key() bool 631 Cause() error 632 ErrorName() string 633 } = GrpcService_GoogleGrpc_ChannelCredentialsValidationError{} 634 635 // Validate checks the field values on GrpcService_GoogleGrpc_CallCredentials 636 // with the rules defined in the proto definition for this message. If any 637 // rules are violated, an error is returned. 638 func (m *GrpcService_GoogleGrpc_CallCredentials) Validate() error { 639 if m == nil { 640 return nil 641 } 642 643 switch m.CredentialSpecifier.(type) { 644 645 case *GrpcService_GoogleGrpc_CallCredentials_AccessToken: 646 // no validation rules for AccessToken 647 648 case *GrpcService_GoogleGrpc_CallCredentials_GoogleComputeEngine: 649 650 if v, ok := interface{}(m.GetGoogleComputeEngine()).(interface{ Validate() error }); ok { 651 if err := v.Validate(); err != nil { 652 return GrpcService_GoogleGrpc_CallCredentialsValidationError{ 653 field: "GoogleComputeEngine", 654 reason: "embedded message failed validation", 655 cause: err, 656 } 657 } 658 } 659 660 case *GrpcService_GoogleGrpc_CallCredentials_GoogleRefreshToken: 661 // no validation rules for GoogleRefreshToken 662 663 case *GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJwtAccess: 664 665 if v, ok := interface{}(m.GetServiceAccountJwtAccess()).(interface{ Validate() error }); ok { 666 if err := v.Validate(); err != nil { 667 return GrpcService_GoogleGrpc_CallCredentialsValidationError{ 668 field: "ServiceAccountJwtAccess", 669 reason: "embedded message failed validation", 670 cause: err, 671 } 672 } 673 } 674 675 case *GrpcService_GoogleGrpc_CallCredentials_GoogleIam: 676 677 if v, ok := interface{}(m.GetGoogleIam()).(interface{ Validate() error }); ok { 678 if err := v.Validate(); err != nil { 679 return GrpcService_GoogleGrpc_CallCredentialsValidationError{ 680 field: "GoogleIam", 681 reason: "embedded message failed validation", 682 cause: err, 683 } 684 } 685 } 686 687 case *GrpcService_GoogleGrpc_CallCredentials_FromPlugin: 688 689 if v, ok := interface{}(m.GetFromPlugin()).(interface{ Validate() error }); ok { 690 if err := v.Validate(); err != nil { 691 return GrpcService_GoogleGrpc_CallCredentialsValidationError{ 692 field: "FromPlugin", 693 reason: "embedded message failed validation", 694 cause: err, 695 } 696 } 697 } 698 699 case *GrpcService_GoogleGrpc_CallCredentials_StsService_: 700 701 if v, ok := interface{}(m.GetStsService()).(interface{ Validate() error }); ok { 702 if err := v.Validate(); err != nil { 703 return GrpcService_GoogleGrpc_CallCredentialsValidationError{ 704 field: "StsService", 705 reason: "embedded message failed validation", 706 cause: err, 707 } 708 } 709 } 710 711 default: 712 return GrpcService_GoogleGrpc_CallCredentialsValidationError{ 713 field: "CredentialSpecifier", 714 reason: "value is required", 715 } 716 717 } 718 719 return nil 720 } 721 722 // GrpcService_GoogleGrpc_CallCredentialsValidationError is the validation 723 // error returned by GrpcService_GoogleGrpc_CallCredentials.Validate if the 724 // designated constraints aren't met. 725 type GrpcService_GoogleGrpc_CallCredentialsValidationError struct { 726 field string 727 reason string 728 cause error 729 key bool 730 } 731 732 // Field function returns field value. 733 func (e GrpcService_GoogleGrpc_CallCredentialsValidationError) Field() string { return e.field } 734 735 // Reason function returns reason value. 736 func (e GrpcService_GoogleGrpc_CallCredentialsValidationError) Reason() string { return e.reason } 737 738 // Cause function returns cause value. 739 func (e GrpcService_GoogleGrpc_CallCredentialsValidationError) Cause() error { return e.cause } 740 741 // Key function returns key value. 742 func (e GrpcService_GoogleGrpc_CallCredentialsValidationError) Key() bool { return e.key } 743 744 // ErrorName returns error name. 745 func (e GrpcService_GoogleGrpc_CallCredentialsValidationError) ErrorName() string { 746 return "GrpcService_GoogleGrpc_CallCredentialsValidationError" 747 } 748 749 // Error satisfies the builtin error interface 750 func (e GrpcService_GoogleGrpc_CallCredentialsValidationError) Error() string { 751 cause := "" 752 if e.cause != nil { 753 cause = fmt.Sprintf(" | caused by: %v", e.cause) 754 } 755 756 key := "" 757 if e.key { 758 key = "key for " 759 } 760 761 return fmt.Sprintf( 762 "invalid %sGrpcService_GoogleGrpc_CallCredentials.%s: %s%s", 763 key, 764 e.field, 765 e.reason, 766 cause) 767 } 768 769 var _ error = GrpcService_GoogleGrpc_CallCredentialsValidationError{} 770 771 var _ interface { 772 Field() string 773 Reason() string 774 Key() bool 775 Cause() error 776 ErrorName() string 777 } = GrpcService_GoogleGrpc_CallCredentialsValidationError{} 778 779 // Validate checks the field values on 780 // GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials 781 // with the rules defined in the proto definition for this message. If any 782 // rules are violated, an error is returned. 783 func (m *GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials) Validate() error { 784 if m == nil { 785 return nil 786 } 787 788 // no validation rules for JsonKey 789 790 // no validation rules for TokenLifetimeSeconds 791 792 return nil 793 } 794 795 // GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError 796 // is the validation error returned by 797 // GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials.Validate 798 // if the designated constraints aren't met. 799 type GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError struct { 800 field string 801 reason string 802 cause error 803 key bool 804 } 805 806 // Field function returns field value. 807 func (e GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError) Field() string { 808 return e.field 809 } 810 811 // Reason function returns reason value. 812 func (e GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError) Reason() string { 813 return e.reason 814 } 815 816 // Cause function returns cause value. 817 func (e GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError) Cause() error { 818 return e.cause 819 } 820 821 // Key function returns key value. 822 func (e GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError) Key() bool { 823 return e.key 824 } 825 826 // ErrorName returns error name. 827 func (e GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError) ErrorName() string { 828 return "GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError" 829 } 830 831 // Error satisfies the builtin error interface 832 func (e GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError) Error() string { 833 cause := "" 834 if e.cause != nil { 835 cause = fmt.Sprintf(" | caused by: %v", e.cause) 836 } 837 838 key := "" 839 if e.key { 840 key = "key for " 841 } 842 843 return fmt.Sprintf( 844 "invalid %sGrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials.%s: %s%s", 845 key, 846 e.field, 847 e.reason, 848 cause) 849 } 850 851 var _ error = GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError{} 852 853 var _ interface { 854 Field() string 855 Reason() string 856 Key() bool 857 Cause() error 858 ErrorName() string 859 } = GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentialsValidationError{} 860 861 // Validate checks the field values on 862 // GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials with the rules 863 // defined in the proto definition for this message. If any rules are 864 // violated, an error is returned. 865 func (m *GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials) Validate() error { 866 if m == nil { 867 return nil 868 } 869 870 // no validation rules for AuthorizationToken 871 872 // no validation rules for AuthoritySelector 873 874 return nil 875 } 876 877 // GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError 878 // is the validation error returned by 879 // GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials.Validate if the 880 // designated constraints aren't met. 881 type GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError struct { 882 field string 883 reason string 884 cause error 885 key bool 886 } 887 888 // Field function returns field value. 889 func (e GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError) Field() string { 890 return e.field 891 } 892 893 // Reason function returns reason value. 894 func (e GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError) Reason() string { 895 return e.reason 896 } 897 898 // Cause function returns cause value. 899 func (e GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError) Cause() error { 900 return e.cause 901 } 902 903 // Key function returns key value. 904 func (e GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError) Key() bool { 905 return e.key 906 } 907 908 // ErrorName returns error name. 909 func (e GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError) ErrorName() string { 910 return "GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError" 911 } 912 913 // Error satisfies the builtin error interface 914 func (e GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError) Error() string { 915 cause := "" 916 if e.cause != nil { 917 cause = fmt.Sprintf(" | caused by: %v", e.cause) 918 } 919 920 key := "" 921 if e.key { 922 key = "key for " 923 } 924 925 return fmt.Sprintf( 926 "invalid %sGrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials.%s: %s%s", 927 key, 928 e.field, 929 e.reason, 930 cause) 931 } 932 933 var _ error = GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError{} 934 935 var _ interface { 936 Field() string 937 Reason() string 938 Key() bool 939 Cause() error 940 ErrorName() string 941 } = GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentialsValidationError{} 942 943 // Validate checks the field values on 944 // GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin with 945 // the rules defined in the proto definition for this message. If any rules 946 // are violated, an error is returned. 947 func (m *GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin) Validate() error { 948 if m == nil { 949 return nil 950 } 951 952 // no validation rules for Name 953 954 switch m.ConfigType.(type) { 955 956 case *GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_Config: 957 958 if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { 959 if err := v.Validate(); err != nil { 960 return GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError{ 961 field: "Config", 962 reason: "embedded message failed validation", 963 cause: err, 964 } 965 } 966 } 967 968 case *GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_TypedConfig: 969 970 if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { 971 if err := v.Validate(); err != nil { 972 return GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError{ 973 field: "TypedConfig", 974 reason: "embedded message failed validation", 975 cause: err, 976 } 977 } 978 } 979 980 } 981 982 return nil 983 } 984 985 // GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError 986 // is the validation error returned by 987 // GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin.Validate 988 // if the designated constraints aren't met. 989 type GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError struct { 990 field string 991 reason string 992 cause error 993 key bool 994 } 995 996 // Field function returns field value. 997 func (e GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError) Field() string { 998 return e.field 999 } 1000 1001 // Reason function returns reason value. 1002 func (e GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError) Reason() string { 1003 return e.reason 1004 } 1005 1006 // Cause function returns cause value. 1007 func (e GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError) Cause() error { 1008 return e.cause 1009 } 1010 1011 // Key function returns key value. 1012 func (e GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError) Key() bool { 1013 return e.key 1014 } 1015 1016 // ErrorName returns error name. 1017 func (e GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError) ErrorName() string { 1018 return "GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError" 1019 } 1020 1021 // Error satisfies the builtin error interface 1022 func (e GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError) Error() string { 1023 cause := "" 1024 if e.cause != nil { 1025 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1026 } 1027 1028 key := "" 1029 if e.key { 1030 key = "key for " 1031 } 1032 1033 return fmt.Sprintf( 1034 "invalid %sGrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin.%s: %s%s", 1035 key, 1036 e.field, 1037 e.reason, 1038 cause) 1039 } 1040 1041 var _ error = GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError{} 1042 1043 var _ interface { 1044 Field() string 1045 Reason() string 1046 Key() bool 1047 Cause() error 1048 ErrorName() string 1049 } = GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError{} 1050 1051 // Validate checks the field values on 1052 // GrpcService_GoogleGrpc_CallCredentials_StsService with the rules defined in 1053 // the proto definition for this message. If any rules are violated, an error 1054 // is returned. 1055 func (m *GrpcService_GoogleGrpc_CallCredentials_StsService) Validate() error { 1056 if m == nil { 1057 return nil 1058 } 1059 1060 // no validation rules for TokenExchangeServiceUri 1061 1062 // no validation rules for Resource 1063 1064 // no validation rules for Audience 1065 1066 // no validation rules for Scope 1067 1068 // no validation rules for RequestedTokenType 1069 1070 if len(m.GetSubjectTokenPath()) < 1 { 1071 return GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError{ 1072 field: "SubjectTokenPath", 1073 reason: "value length must be at least 1 bytes", 1074 } 1075 } 1076 1077 if len(m.GetSubjectTokenType()) < 1 { 1078 return GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError{ 1079 field: "SubjectTokenType", 1080 reason: "value length must be at least 1 bytes", 1081 } 1082 } 1083 1084 // no validation rules for ActorTokenPath 1085 1086 // no validation rules for ActorTokenType 1087 1088 return nil 1089 } 1090 1091 // GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError is the 1092 // validation error returned by 1093 // GrpcService_GoogleGrpc_CallCredentials_StsService.Validate if the 1094 // designated constraints aren't met. 1095 type GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError struct { 1096 field string 1097 reason string 1098 cause error 1099 key bool 1100 } 1101 1102 // Field function returns field value. 1103 func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) Field() string { 1104 return e.field 1105 } 1106 1107 // Reason function returns reason value. 1108 func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) Reason() string { 1109 return e.reason 1110 } 1111 1112 // Cause function returns cause value. 1113 func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) Cause() error { 1114 return e.cause 1115 } 1116 1117 // Key function returns key value. 1118 func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) Key() bool { return e.key } 1119 1120 // ErrorName returns error name. 1121 func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) ErrorName() string { 1122 return "GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError" 1123 } 1124 1125 // Error satisfies the builtin error interface 1126 func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) Error() string { 1127 cause := "" 1128 if e.cause != nil { 1129 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1130 } 1131 1132 key := "" 1133 if e.key { 1134 key = "key for " 1135 } 1136 1137 return fmt.Sprintf( 1138 "invalid %sGrpcService_GoogleGrpc_CallCredentials_StsService.%s: %s%s", 1139 key, 1140 e.field, 1141 e.reason, 1142 cause) 1143 } 1144 1145 var _ error = GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError{} 1146 1147 var _ interface { 1148 Field() string 1149 Reason() string 1150 Key() bool 1151 Cause() error 1152 ErrorName() string 1153 } = GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError{}