1// Code generated by protoc-gen-validate. DO NOT EDIT. 2// source: envoy/api/v2/route/route_components.proto 3 4package envoy_api_v2_route 5 6import ( 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 "github.com/golang/protobuf/ptypes" 19 20 core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core" 21) 22 23// ensure the imports are used 24var ( 25 _ = bytes.MinRead 26 _ = errors.New("") 27 _ = fmt.Print 28 _ = utf8.UTFMax 29 _ = (*regexp.Regexp)(nil) 30 _ = (*strings.Reader)(nil) 31 _ = net.IPv4len 32 _ = time.Duration(0) 33 _ = (*url.URL)(nil) 34 _ = (*mail.Address)(nil) 35 _ = ptypes.DynamicAny{} 36 37 _ = core.RoutingPriority(0) 38 39 _ = core.RequestMethod(0) 40) 41 42// define the regex for a UUID once up-front 43var _route_components_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") 44 45// Validate checks the field values on VirtualHost with the rules defined in 46// the proto definition for this message. If any rules are violated, an error 47// is returned. 48func (m *VirtualHost) Validate() error { 49 if m == nil { 50 return nil 51 } 52 53 if len(m.GetName()) < 1 { 54 return VirtualHostValidationError{ 55 field: "Name", 56 reason: "value length must be at least 1 bytes", 57 } 58 } 59 60 if len(m.GetDomains()) < 1 { 61 return VirtualHostValidationError{ 62 field: "Domains", 63 reason: "value must contain at least 1 item(s)", 64 } 65 } 66 67 for idx, item := range m.GetDomains() { 68 _, _ = idx, item 69 70 if !_VirtualHost_Domains_Pattern.MatchString(item) { 71 return VirtualHostValidationError{ 72 field: fmt.Sprintf("Domains[%v]", idx), 73 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 74 } 75 } 76 77 } 78 79 for idx, item := range m.GetRoutes() { 80 _, _ = idx, item 81 82 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 83 if err := v.Validate(); err != nil { 84 return VirtualHostValidationError{ 85 field: fmt.Sprintf("Routes[%v]", idx), 86 reason: "embedded message failed validation", 87 cause: err, 88 } 89 } 90 } 91 92 } 93 94 if _, ok := VirtualHost_TlsRequirementType_name[int32(m.GetRequireTls())]; !ok { 95 return VirtualHostValidationError{ 96 field: "RequireTls", 97 reason: "value must be one of the defined enum values", 98 } 99 } 100 101 for idx, item := range m.GetVirtualClusters() { 102 _, _ = idx, item 103 104 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 105 if err := v.Validate(); err != nil { 106 return VirtualHostValidationError{ 107 field: fmt.Sprintf("VirtualClusters[%v]", idx), 108 reason: "embedded message failed validation", 109 cause: err, 110 } 111 } 112 } 113 114 } 115 116 for idx, item := range m.GetRateLimits() { 117 _, _ = idx, item 118 119 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 120 if err := v.Validate(); err != nil { 121 return VirtualHostValidationError{ 122 field: fmt.Sprintf("RateLimits[%v]", idx), 123 reason: "embedded message failed validation", 124 cause: err, 125 } 126 } 127 } 128 129 } 130 131 if len(m.GetRequestHeadersToAdd()) > 1000 { 132 return VirtualHostValidationError{ 133 field: "RequestHeadersToAdd", 134 reason: "value must contain no more than 1000 item(s)", 135 } 136 } 137 138 for idx, item := range m.GetRequestHeadersToAdd() { 139 _, _ = idx, item 140 141 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 142 if err := v.Validate(); err != nil { 143 return VirtualHostValidationError{ 144 field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), 145 reason: "embedded message failed validation", 146 cause: err, 147 } 148 } 149 } 150 151 } 152 153 if len(m.GetResponseHeadersToAdd()) > 1000 { 154 return VirtualHostValidationError{ 155 field: "ResponseHeadersToAdd", 156 reason: "value must contain no more than 1000 item(s)", 157 } 158 } 159 160 for idx, item := range m.GetResponseHeadersToAdd() { 161 _, _ = idx, item 162 163 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 164 if err := v.Validate(); err != nil { 165 return VirtualHostValidationError{ 166 field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx), 167 reason: "embedded message failed validation", 168 cause: err, 169 } 170 } 171 } 172 173 } 174 175 if v, ok := interface{}(m.GetCors()).(interface{ Validate() error }); ok { 176 if err := v.Validate(); err != nil { 177 return VirtualHostValidationError{ 178 field: "Cors", 179 reason: "embedded message failed validation", 180 cause: err, 181 } 182 } 183 } 184 185 for key, val := range m.GetPerFilterConfig() { 186 _ = val 187 188 // no validation rules for PerFilterConfig[key] 189 190 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 191 if err := v.Validate(); err != nil { 192 return VirtualHostValidationError{ 193 field: fmt.Sprintf("PerFilterConfig[%v]", key), 194 reason: "embedded message failed validation", 195 cause: err, 196 } 197 } 198 } 199 200 } 201 202 for key, val := range m.GetTypedPerFilterConfig() { 203 _ = val 204 205 // no validation rules for TypedPerFilterConfig[key] 206 207 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 208 if err := v.Validate(); err != nil { 209 return VirtualHostValidationError{ 210 field: fmt.Sprintf("TypedPerFilterConfig[%v]", key), 211 reason: "embedded message failed validation", 212 cause: err, 213 } 214 } 215 } 216 217 } 218 219 // no validation rules for IncludeRequestAttemptCount 220 221 // no validation rules for IncludeAttemptCountInResponse 222 223 if v, ok := interface{}(m.GetRetryPolicy()).(interface{ Validate() error }); ok { 224 if err := v.Validate(); err != nil { 225 return VirtualHostValidationError{ 226 field: "RetryPolicy", 227 reason: "embedded message failed validation", 228 cause: err, 229 } 230 } 231 } 232 233 if v, ok := interface{}(m.GetRetryPolicyTypedConfig()).(interface{ Validate() error }); ok { 234 if err := v.Validate(); err != nil { 235 return VirtualHostValidationError{ 236 field: "RetryPolicyTypedConfig", 237 reason: "embedded message failed validation", 238 cause: err, 239 } 240 } 241 } 242 243 if v, ok := interface{}(m.GetHedgePolicy()).(interface{ Validate() error }); ok { 244 if err := v.Validate(); err != nil { 245 return VirtualHostValidationError{ 246 field: "HedgePolicy", 247 reason: "embedded message failed validation", 248 cause: err, 249 } 250 } 251 } 252 253 if v, ok := interface{}(m.GetPerRequestBufferLimitBytes()).(interface{ Validate() error }); ok { 254 if err := v.Validate(); err != nil { 255 return VirtualHostValidationError{ 256 field: "PerRequestBufferLimitBytes", 257 reason: "embedded message failed validation", 258 cause: err, 259 } 260 } 261 } 262 263 return nil 264} 265 266// VirtualHostValidationError is the validation error returned by 267// VirtualHost.Validate if the designated constraints aren't met. 268type VirtualHostValidationError struct { 269 field string 270 reason string 271 cause error 272 key bool 273} 274 275// Field function returns field value. 276func (e VirtualHostValidationError) Field() string { return e.field } 277 278// Reason function returns reason value. 279func (e VirtualHostValidationError) Reason() string { return e.reason } 280 281// Cause function returns cause value. 282func (e VirtualHostValidationError) Cause() error { return e.cause } 283 284// Key function returns key value. 285func (e VirtualHostValidationError) Key() bool { return e.key } 286 287// ErrorName returns error name. 288func (e VirtualHostValidationError) ErrorName() string { return "VirtualHostValidationError" } 289 290// Error satisfies the builtin error interface 291func (e VirtualHostValidationError) Error() string { 292 cause := "" 293 if e.cause != nil { 294 cause = fmt.Sprintf(" | caused by: %v", e.cause) 295 } 296 297 key := "" 298 if e.key { 299 key = "key for " 300 } 301 302 return fmt.Sprintf( 303 "invalid %sVirtualHost.%s: %s%s", 304 key, 305 e.field, 306 e.reason, 307 cause) 308} 309 310var _ error = VirtualHostValidationError{} 311 312var _ interface { 313 Field() string 314 Reason() string 315 Key() bool 316 Cause() error 317 ErrorName() string 318} = VirtualHostValidationError{} 319 320var _VirtualHost_Domains_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 321 322// Validate checks the field values on FilterAction with the rules defined in 323// the proto definition for this message. If any rules are violated, an error 324// is returned. 325func (m *FilterAction) Validate() error { 326 if m == nil { 327 return nil 328 } 329 330 if v, ok := interface{}(m.GetAction()).(interface{ Validate() error }); ok { 331 if err := v.Validate(); err != nil { 332 return FilterActionValidationError{ 333 field: "Action", 334 reason: "embedded message failed validation", 335 cause: err, 336 } 337 } 338 } 339 340 return nil 341} 342 343// FilterActionValidationError is the validation error returned by 344// FilterAction.Validate if the designated constraints aren't met. 345type FilterActionValidationError struct { 346 field string 347 reason string 348 cause error 349 key bool 350} 351 352// Field function returns field value. 353func (e FilterActionValidationError) Field() string { return e.field } 354 355// Reason function returns reason value. 356func (e FilterActionValidationError) Reason() string { return e.reason } 357 358// Cause function returns cause value. 359func (e FilterActionValidationError) Cause() error { return e.cause } 360 361// Key function returns key value. 362func (e FilterActionValidationError) Key() bool { return e.key } 363 364// ErrorName returns error name. 365func (e FilterActionValidationError) ErrorName() string { return "FilterActionValidationError" } 366 367// Error satisfies the builtin error interface 368func (e FilterActionValidationError) Error() string { 369 cause := "" 370 if e.cause != nil { 371 cause = fmt.Sprintf(" | caused by: %v", e.cause) 372 } 373 374 key := "" 375 if e.key { 376 key = "key for " 377 } 378 379 return fmt.Sprintf( 380 "invalid %sFilterAction.%s: %s%s", 381 key, 382 e.field, 383 e.reason, 384 cause) 385} 386 387var _ error = FilterActionValidationError{} 388 389var _ interface { 390 Field() string 391 Reason() string 392 Key() bool 393 Cause() error 394 ErrorName() string 395} = FilterActionValidationError{} 396 397// Validate checks the field values on Route with the rules defined in the 398// proto definition for this message. If any rules are violated, an error is returned. 399func (m *Route) Validate() error { 400 if m == nil { 401 return nil 402 } 403 404 // no validation rules for Name 405 406 if m.GetMatch() == nil { 407 return RouteValidationError{ 408 field: "Match", 409 reason: "value is required", 410 } 411 } 412 413 if v, ok := interface{}(m.GetMatch()).(interface{ Validate() error }); ok { 414 if err := v.Validate(); err != nil { 415 return RouteValidationError{ 416 field: "Match", 417 reason: "embedded message failed validation", 418 cause: err, 419 } 420 } 421 } 422 423 if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { 424 if err := v.Validate(); err != nil { 425 return RouteValidationError{ 426 field: "Metadata", 427 reason: "embedded message failed validation", 428 cause: err, 429 } 430 } 431 } 432 433 if v, ok := interface{}(m.GetDecorator()).(interface{ Validate() error }); ok { 434 if err := v.Validate(); err != nil { 435 return RouteValidationError{ 436 field: "Decorator", 437 reason: "embedded message failed validation", 438 cause: err, 439 } 440 } 441 } 442 443 for key, val := range m.GetPerFilterConfig() { 444 _ = val 445 446 // no validation rules for PerFilterConfig[key] 447 448 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 449 if err := v.Validate(); err != nil { 450 return RouteValidationError{ 451 field: fmt.Sprintf("PerFilterConfig[%v]", key), 452 reason: "embedded message failed validation", 453 cause: err, 454 } 455 } 456 } 457 458 } 459 460 for key, val := range m.GetTypedPerFilterConfig() { 461 _ = val 462 463 // no validation rules for TypedPerFilterConfig[key] 464 465 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 466 if err := v.Validate(); err != nil { 467 return RouteValidationError{ 468 field: fmt.Sprintf("TypedPerFilterConfig[%v]", key), 469 reason: "embedded message failed validation", 470 cause: err, 471 } 472 } 473 } 474 475 } 476 477 if len(m.GetRequestHeadersToAdd()) > 1000 { 478 return RouteValidationError{ 479 field: "RequestHeadersToAdd", 480 reason: "value must contain no more than 1000 item(s)", 481 } 482 } 483 484 for idx, item := range m.GetRequestHeadersToAdd() { 485 _, _ = idx, item 486 487 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 488 if err := v.Validate(); err != nil { 489 return RouteValidationError{ 490 field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), 491 reason: "embedded message failed validation", 492 cause: err, 493 } 494 } 495 } 496 497 } 498 499 if len(m.GetResponseHeadersToAdd()) > 1000 { 500 return RouteValidationError{ 501 field: "ResponseHeadersToAdd", 502 reason: "value must contain no more than 1000 item(s)", 503 } 504 } 505 506 for idx, item := range m.GetResponseHeadersToAdd() { 507 _, _ = idx, item 508 509 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 510 if err := v.Validate(); err != nil { 511 return RouteValidationError{ 512 field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx), 513 reason: "embedded message failed validation", 514 cause: err, 515 } 516 } 517 } 518 519 } 520 521 if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok { 522 if err := v.Validate(); err != nil { 523 return RouteValidationError{ 524 field: "Tracing", 525 reason: "embedded message failed validation", 526 cause: err, 527 } 528 } 529 } 530 531 if v, ok := interface{}(m.GetPerRequestBufferLimitBytes()).(interface{ Validate() error }); ok { 532 if err := v.Validate(); err != nil { 533 return RouteValidationError{ 534 field: "PerRequestBufferLimitBytes", 535 reason: "embedded message failed validation", 536 cause: err, 537 } 538 } 539 } 540 541 switch m.Action.(type) { 542 543 case *Route_Route: 544 545 if v, ok := interface{}(m.GetRoute()).(interface{ Validate() error }); ok { 546 if err := v.Validate(); err != nil { 547 return RouteValidationError{ 548 field: "Route", 549 reason: "embedded message failed validation", 550 cause: err, 551 } 552 } 553 } 554 555 case *Route_Redirect: 556 557 if v, ok := interface{}(m.GetRedirect()).(interface{ Validate() error }); ok { 558 if err := v.Validate(); err != nil { 559 return RouteValidationError{ 560 field: "Redirect", 561 reason: "embedded message failed validation", 562 cause: err, 563 } 564 } 565 } 566 567 case *Route_DirectResponse: 568 569 if v, ok := interface{}(m.GetDirectResponse()).(interface{ Validate() error }); ok { 570 if err := v.Validate(); err != nil { 571 return RouteValidationError{ 572 field: "DirectResponse", 573 reason: "embedded message failed validation", 574 cause: err, 575 } 576 } 577 } 578 579 case *Route_FilterAction: 580 581 if v, ok := interface{}(m.GetFilterAction()).(interface{ Validate() error }); ok { 582 if err := v.Validate(); err != nil { 583 return RouteValidationError{ 584 field: "FilterAction", 585 reason: "embedded message failed validation", 586 cause: err, 587 } 588 } 589 } 590 591 default: 592 return RouteValidationError{ 593 field: "Action", 594 reason: "value is required", 595 } 596 597 } 598 599 return nil 600} 601 602// RouteValidationError is the validation error returned by Route.Validate if 603// the designated constraints aren't met. 604type RouteValidationError struct { 605 field string 606 reason string 607 cause error 608 key bool 609} 610 611// Field function returns field value. 612func (e RouteValidationError) Field() string { return e.field } 613 614// Reason function returns reason value. 615func (e RouteValidationError) Reason() string { return e.reason } 616 617// Cause function returns cause value. 618func (e RouteValidationError) Cause() error { return e.cause } 619 620// Key function returns key value. 621func (e RouteValidationError) Key() bool { return e.key } 622 623// ErrorName returns error name. 624func (e RouteValidationError) ErrorName() string { return "RouteValidationError" } 625 626// Error satisfies the builtin error interface 627func (e RouteValidationError) Error() string { 628 cause := "" 629 if e.cause != nil { 630 cause = fmt.Sprintf(" | caused by: %v", e.cause) 631 } 632 633 key := "" 634 if e.key { 635 key = "key for " 636 } 637 638 return fmt.Sprintf( 639 "invalid %sRoute.%s: %s%s", 640 key, 641 e.field, 642 e.reason, 643 cause) 644} 645 646var _ error = RouteValidationError{} 647 648var _ interface { 649 Field() string 650 Reason() string 651 Key() bool 652 Cause() error 653 ErrorName() string 654} = RouteValidationError{} 655 656// Validate checks the field values on WeightedCluster with the rules defined 657// in the proto definition for this message. If any rules are violated, an 658// error is returned. 659func (m *WeightedCluster) Validate() error { 660 if m == nil { 661 return nil 662 } 663 664 if len(m.GetClusters()) < 1 { 665 return WeightedClusterValidationError{ 666 field: "Clusters", 667 reason: "value must contain at least 1 item(s)", 668 } 669 } 670 671 for idx, item := range m.GetClusters() { 672 _, _ = idx, item 673 674 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 675 if err := v.Validate(); err != nil { 676 return WeightedClusterValidationError{ 677 field: fmt.Sprintf("Clusters[%v]", idx), 678 reason: "embedded message failed validation", 679 cause: err, 680 } 681 } 682 } 683 684 } 685 686 if wrapper := m.GetTotalWeight(); wrapper != nil { 687 688 if wrapper.GetValue() < 1 { 689 return WeightedClusterValidationError{ 690 field: "TotalWeight", 691 reason: "value must be greater than or equal to 1", 692 } 693 } 694 695 } 696 697 // no validation rules for RuntimeKeyPrefix 698 699 return nil 700} 701 702// WeightedClusterValidationError is the validation error returned by 703// WeightedCluster.Validate if the designated constraints aren't met. 704type WeightedClusterValidationError struct { 705 field string 706 reason string 707 cause error 708 key bool 709} 710 711// Field function returns field value. 712func (e WeightedClusterValidationError) Field() string { return e.field } 713 714// Reason function returns reason value. 715func (e WeightedClusterValidationError) Reason() string { return e.reason } 716 717// Cause function returns cause value. 718func (e WeightedClusterValidationError) Cause() error { return e.cause } 719 720// Key function returns key value. 721func (e WeightedClusterValidationError) Key() bool { return e.key } 722 723// ErrorName returns error name. 724func (e WeightedClusterValidationError) ErrorName() string { return "WeightedClusterValidationError" } 725 726// Error satisfies the builtin error interface 727func (e WeightedClusterValidationError) Error() string { 728 cause := "" 729 if e.cause != nil { 730 cause = fmt.Sprintf(" | caused by: %v", e.cause) 731 } 732 733 key := "" 734 if e.key { 735 key = "key for " 736 } 737 738 return fmt.Sprintf( 739 "invalid %sWeightedCluster.%s: %s%s", 740 key, 741 e.field, 742 e.reason, 743 cause) 744} 745 746var _ error = WeightedClusterValidationError{} 747 748var _ interface { 749 Field() string 750 Reason() string 751 Key() bool 752 Cause() error 753 ErrorName() string 754} = WeightedClusterValidationError{} 755 756// Validate checks the field values on RouteMatch with the rules defined in the 757// proto definition for this message. If any rules are violated, an error is returned. 758func (m *RouteMatch) Validate() error { 759 if m == nil { 760 return nil 761 } 762 763 if v, ok := interface{}(m.GetCaseSensitive()).(interface{ Validate() error }); ok { 764 if err := v.Validate(); err != nil { 765 return RouteMatchValidationError{ 766 field: "CaseSensitive", 767 reason: "embedded message failed validation", 768 cause: err, 769 } 770 } 771 } 772 773 if v, ok := interface{}(m.GetRuntimeFraction()).(interface{ Validate() error }); ok { 774 if err := v.Validate(); err != nil { 775 return RouteMatchValidationError{ 776 field: "RuntimeFraction", 777 reason: "embedded message failed validation", 778 cause: err, 779 } 780 } 781 } 782 783 for idx, item := range m.GetHeaders() { 784 _, _ = idx, item 785 786 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 787 if err := v.Validate(); err != nil { 788 return RouteMatchValidationError{ 789 field: fmt.Sprintf("Headers[%v]", idx), 790 reason: "embedded message failed validation", 791 cause: err, 792 } 793 } 794 } 795 796 } 797 798 for idx, item := range m.GetQueryParameters() { 799 _, _ = idx, item 800 801 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 802 if err := v.Validate(); err != nil { 803 return RouteMatchValidationError{ 804 field: fmt.Sprintf("QueryParameters[%v]", idx), 805 reason: "embedded message failed validation", 806 cause: err, 807 } 808 } 809 } 810 811 } 812 813 if v, ok := interface{}(m.GetGrpc()).(interface{ Validate() error }); ok { 814 if err := v.Validate(); err != nil { 815 return RouteMatchValidationError{ 816 field: "Grpc", 817 reason: "embedded message failed validation", 818 cause: err, 819 } 820 } 821 } 822 823 if v, ok := interface{}(m.GetTlsContext()).(interface{ Validate() error }); ok { 824 if err := v.Validate(); err != nil { 825 return RouteMatchValidationError{ 826 field: "TlsContext", 827 reason: "embedded message failed validation", 828 cause: err, 829 } 830 } 831 } 832 833 switch m.PathSpecifier.(type) { 834 835 case *RouteMatch_Prefix: 836 // no validation rules for Prefix 837 838 case *RouteMatch_Path: 839 // no validation rules for Path 840 841 case *RouteMatch_Regex: 842 843 if len(m.GetRegex()) > 1024 { 844 return RouteMatchValidationError{ 845 field: "Regex", 846 reason: "value length must be at most 1024 bytes", 847 } 848 } 849 850 case *RouteMatch_SafeRegex: 851 852 if m.GetSafeRegex() == nil { 853 return RouteMatchValidationError{ 854 field: "SafeRegex", 855 reason: "value is required", 856 } 857 } 858 859 if v, ok := interface{}(m.GetSafeRegex()).(interface{ Validate() error }); ok { 860 if err := v.Validate(); err != nil { 861 return RouteMatchValidationError{ 862 field: "SafeRegex", 863 reason: "embedded message failed validation", 864 cause: err, 865 } 866 } 867 } 868 869 default: 870 return RouteMatchValidationError{ 871 field: "PathSpecifier", 872 reason: "value is required", 873 } 874 875 } 876 877 return nil 878} 879 880// RouteMatchValidationError is the validation error returned by 881// RouteMatch.Validate if the designated constraints aren't met. 882type RouteMatchValidationError struct { 883 field string 884 reason string 885 cause error 886 key bool 887} 888 889// Field function returns field value. 890func (e RouteMatchValidationError) Field() string { return e.field } 891 892// Reason function returns reason value. 893func (e RouteMatchValidationError) Reason() string { return e.reason } 894 895// Cause function returns cause value. 896func (e RouteMatchValidationError) Cause() error { return e.cause } 897 898// Key function returns key value. 899func (e RouteMatchValidationError) Key() bool { return e.key } 900 901// ErrorName returns error name. 902func (e RouteMatchValidationError) ErrorName() string { return "RouteMatchValidationError" } 903 904// Error satisfies the builtin error interface 905func (e RouteMatchValidationError) Error() string { 906 cause := "" 907 if e.cause != nil { 908 cause = fmt.Sprintf(" | caused by: %v", e.cause) 909 } 910 911 key := "" 912 if e.key { 913 key = "key for " 914 } 915 916 return fmt.Sprintf( 917 "invalid %sRouteMatch.%s: %s%s", 918 key, 919 e.field, 920 e.reason, 921 cause) 922} 923 924var _ error = RouteMatchValidationError{} 925 926var _ interface { 927 Field() string 928 Reason() string 929 Key() bool 930 Cause() error 931 ErrorName() string 932} = RouteMatchValidationError{} 933 934// Validate checks the field values on CorsPolicy with the rules defined in the 935// proto definition for this message. If any rules are violated, an error is returned. 936func (m *CorsPolicy) Validate() error { 937 if m == nil { 938 return nil 939 } 940 941 for idx, item := range m.GetAllowOriginRegex() { 942 _, _ = idx, item 943 944 if len(item) > 1024 { 945 return CorsPolicyValidationError{ 946 field: fmt.Sprintf("AllowOriginRegex[%v]", idx), 947 reason: "value length must be at most 1024 bytes", 948 } 949 } 950 951 } 952 953 for idx, item := range m.GetAllowOriginStringMatch() { 954 _, _ = idx, item 955 956 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 957 if err := v.Validate(); err != nil { 958 return CorsPolicyValidationError{ 959 field: fmt.Sprintf("AllowOriginStringMatch[%v]", idx), 960 reason: "embedded message failed validation", 961 cause: err, 962 } 963 } 964 } 965 966 } 967 968 // no validation rules for AllowMethods 969 970 // no validation rules for AllowHeaders 971 972 // no validation rules for ExposeHeaders 973 974 // no validation rules for MaxAge 975 976 if v, ok := interface{}(m.GetAllowCredentials()).(interface{ Validate() error }); ok { 977 if err := v.Validate(); err != nil { 978 return CorsPolicyValidationError{ 979 field: "AllowCredentials", 980 reason: "embedded message failed validation", 981 cause: err, 982 } 983 } 984 } 985 986 if v, ok := interface{}(m.GetShadowEnabled()).(interface{ Validate() error }); ok { 987 if err := v.Validate(); err != nil { 988 return CorsPolicyValidationError{ 989 field: "ShadowEnabled", 990 reason: "embedded message failed validation", 991 cause: err, 992 } 993 } 994 } 995 996 switch m.EnabledSpecifier.(type) { 997 998 case *CorsPolicy_Enabled: 999 1000 if v, ok := interface{}(m.GetEnabled()).(interface{ Validate() error }); ok { 1001 if err := v.Validate(); err != nil { 1002 return CorsPolicyValidationError{ 1003 field: "Enabled", 1004 reason: "embedded message failed validation", 1005 cause: err, 1006 } 1007 } 1008 } 1009 1010 case *CorsPolicy_FilterEnabled: 1011 1012 if v, ok := interface{}(m.GetFilterEnabled()).(interface{ Validate() error }); ok { 1013 if err := v.Validate(); err != nil { 1014 return CorsPolicyValidationError{ 1015 field: "FilterEnabled", 1016 reason: "embedded message failed validation", 1017 cause: err, 1018 } 1019 } 1020 } 1021 1022 } 1023 1024 return nil 1025} 1026 1027// CorsPolicyValidationError is the validation error returned by 1028// CorsPolicy.Validate if the designated constraints aren't met. 1029type CorsPolicyValidationError struct { 1030 field string 1031 reason string 1032 cause error 1033 key bool 1034} 1035 1036// Field function returns field value. 1037func (e CorsPolicyValidationError) Field() string { return e.field } 1038 1039// Reason function returns reason value. 1040func (e CorsPolicyValidationError) Reason() string { return e.reason } 1041 1042// Cause function returns cause value. 1043func (e CorsPolicyValidationError) Cause() error { return e.cause } 1044 1045// Key function returns key value. 1046func (e CorsPolicyValidationError) Key() bool { return e.key } 1047 1048// ErrorName returns error name. 1049func (e CorsPolicyValidationError) ErrorName() string { return "CorsPolicyValidationError" } 1050 1051// Error satisfies the builtin error interface 1052func (e CorsPolicyValidationError) Error() string { 1053 cause := "" 1054 if e.cause != nil { 1055 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1056 } 1057 1058 key := "" 1059 if e.key { 1060 key = "key for " 1061 } 1062 1063 return fmt.Sprintf( 1064 "invalid %sCorsPolicy.%s: %s%s", 1065 key, 1066 e.field, 1067 e.reason, 1068 cause) 1069} 1070 1071var _ error = CorsPolicyValidationError{} 1072 1073var _ interface { 1074 Field() string 1075 Reason() string 1076 Key() bool 1077 Cause() error 1078 ErrorName() string 1079} = CorsPolicyValidationError{} 1080 1081// Validate checks the field values on RouteAction with the rules defined in 1082// the proto definition for this message. If any rules are violated, an error 1083// is returned. 1084func (m *RouteAction) Validate() error { 1085 if m == nil { 1086 return nil 1087 } 1088 1089 if _, ok := RouteAction_ClusterNotFoundResponseCode_name[int32(m.GetClusterNotFoundResponseCode())]; !ok { 1090 return RouteActionValidationError{ 1091 field: "ClusterNotFoundResponseCode", 1092 reason: "value must be one of the defined enum values", 1093 } 1094 } 1095 1096 if v, ok := interface{}(m.GetMetadataMatch()).(interface{ Validate() error }); ok { 1097 if err := v.Validate(); err != nil { 1098 return RouteActionValidationError{ 1099 field: "MetadataMatch", 1100 reason: "embedded message failed validation", 1101 cause: err, 1102 } 1103 } 1104 } 1105 1106 if !_RouteAction_PrefixRewrite_Pattern.MatchString(m.GetPrefixRewrite()) { 1107 return RouteActionValidationError{ 1108 field: "PrefixRewrite", 1109 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1110 } 1111 } 1112 1113 if v, ok := interface{}(m.GetRegexRewrite()).(interface{ Validate() error }); ok { 1114 if err := v.Validate(); err != nil { 1115 return RouteActionValidationError{ 1116 field: "RegexRewrite", 1117 reason: "embedded message failed validation", 1118 cause: err, 1119 } 1120 } 1121 } 1122 1123 if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { 1124 if err := v.Validate(); err != nil { 1125 return RouteActionValidationError{ 1126 field: "Timeout", 1127 reason: "embedded message failed validation", 1128 cause: err, 1129 } 1130 } 1131 } 1132 1133 if v, ok := interface{}(m.GetIdleTimeout()).(interface{ Validate() error }); ok { 1134 if err := v.Validate(); err != nil { 1135 return RouteActionValidationError{ 1136 field: "IdleTimeout", 1137 reason: "embedded message failed validation", 1138 cause: err, 1139 } 1140 } 1141 } 1142 1143 if v, ok := interface{}(m.GetRetryPolicy()).(interface{ Validate() error }); ok { 1144 if err := v.Validate(); err != nil { 1145 return RouteActionValidationError{ 1146 field: "RetryPolicy", 1147 reason: "embedded message failed validation", 1148 cause: err, 1149 } 1150 } 1151 } 1152 1153 if v, ok := interface{}(m.GetRetryPolicyTypedConfig()).(interface{ Validate() error }); ok { 1154 if err := v.Validate(); err != nil { 1155 return RouteActionValidationError{ 1156 field: "RetryPolicyTypedConfig", 1157 reason: "embedded message failed validation", 1158 cause: err, 1159 } 1160 } 1161 } 1162 1163 if v, ok := interface{}(m.GetRequestMirrorPolicy()).(interface{ Validate() error }); ok { 1164 if err := v.Validate(); err != nil { 1165 return RouteActionValidationError{ 1166 field: "RequestMirrorPolicy", 1167 reason: "embedded message failed validation", 1168 cause: err, 1169 } 1170 } 1171 } 1172 1173 for idx, item := range m.GetRequestMirrorPolicies() { 1174 _, _ = idx, item 1175 1176 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1177 if err := v.Validate(); err != nil { 1178 return RouteActionValidationError{ 1179 field: fmt.Sprintf("RequestMirrorPolicies[%v]", idx), 1180 reason: "embedded message failed validation", 1181 cause: err, 1182 } 1183 } 1184 } 1185 1186 } 1187 1188 if _, ok := core.RoutingPriority_name[int32(m.GetPriority())]; !ok { 1189 return RouteActionValidationError{ 1190 field: "Priority", 1191 reason: "value must be one of the defined enum values", 1192 } 1193 } 1194 1195 for idx, item := range m.GetRateLimits() { 1196 _, _ = idx, item 1197 1198 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1199 if err := v.Validate(); err != nil { 1200 return RouteActionValidationError{ 1201 field: fmt.Sprintf("RateLimits[%v]", idx), 1202 reason: "embedded message failed validation", 1203 cause: err, 1204 } 1205 } 1206 } 1207 1208 } 1209 1210 if v, ok := interface{}(m.GetIncludeVhRateLimits()).(interface{ Validate() error }); ok { 1211 if err := v.Validate(); err != nil { 1212 return RouteActionValidationError{ 1213 field: "IncludeVhRateLimits", 1214 reason: "embedded message failed validation", 1215 cause: err, 1216 } 1217 } 1218 } 1219 1220 for idx, item := range m.GetHashPolicy() { 1221 _, _ = idx, item 1222 1223 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1224 if err := v.Validate(); err != nil { 1225 return RouteActionValidationError{ 1226 field: fmt.Sprintf("HashPolicy[%v]", idx), 1227 reason: "embedded message failed validation", 1228 cause: err, 1229 } 1230 } 1231 } 1232 1233 } 1234 1235 if v, ok := interface{}(m.GetCors()).(interface{ Validate() error }); ok { 1236 if err := v.Validate(); err != nil { 1237 return RouteActionValidationError{ 1238 field: "Cors", 1239 reason: "embedded message failed validation", 1240 cause: err, 1241 } 1242 } 1243 } 1244 1245 if v, ok := interface{}(m.GetMaxGrpcTimeout()).(interface{ Validate() error }); ok { 1246 if err := v.Validate(); err != nil { 1247 return RouteActionValidationError{ 1248 field: "MaxGrpcTimeout", 1249 reason: "embedded message failed validation", 1250 cause: err, 1251 } 1252 } 1253 } 1254 1255 if v, ok := interface{}(m.GetGrpcTimeoutOffset()).(interface{ Validate() error }); ok { 1256 if err := v.Validate(); err != nil { 1257 return RouteActionValidationError{ 1258 field: "GrpcTimeoutOffset", 1259 reason: "embedded message failed validation", 1260 cause: err, 1261 } 1262 } 1263 } 1264 1265 for idx, item := range m.GetUpgradeConfigs() { 1266 _, _ = idx, item 1267 1268 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1269 if err := v.Validate(); err != nil { 1270 return RouteActionValidationError{ 1271 field: fmt.Sprintf("UpgradeConfigs[%v]", idx), 1272 reason: "embedded message failed validation", 1273 cause: err, 1274 } 1275 } 1276 } 1277 1278 } 1279 1280 // no validation rules for InternalRedirectAction 1281 1282 if v, ok := interface{}(m.GetMaxInternalRedirects()).(interface{ Validate() error }); ok { 1283 if err := v.Validate(); err != nil { 1284 return RouteActionValidationError{ 1285 field: "MaxInternalRedirects", 1286 reason: "embedded message failed validation", 1287 cause: err, 1288 } 1289 } 1290 } 1291 1292 if v, ok := interface{}(m.GetHedgePolicy()).(interface{ Validate() error }); ok { 1293 if err := v.Validate(); err != nil { 1294 return RouteActionValidationError{ 1295 field: "HedgePolicy", 1296 reason: "embedded message failed validation", 1297 cause: err, 1298 } 1299 } 1300 } 1301 1302 switch m.ClusterSpecifier.(type) { 1303 1304 case *RouteAction_Cluster: 1305 1306 if len(m.GetCluster()) < 1 { 1307 return RouteActionValidationError{ 1308 field: "Cluster", 1309 reason: "value length must be at least 1 bytes", 1310 } 1311 } 1312 1313 case *RouteAction_ClusterHeader: 1314 1315 if len(m.GetClusterHeader()) < 1 { 1316 return RouteActionValidationError{ 1317 field: "ClusterHeader", 1318 reason: "value length must be at least 1 bytes", 1319 } 1320 } 1321 1322 if !_RouteAction_ClusterHeader_Pattern.MatchString(m.GetClusterHeader()) { 1323 return RouteActionValidationError{ 1324 field: "ClusterHeader", 1325 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1326 } 1327 } 1328 1329 case *RouteAction_WeightedClusters: 1330 1331 if v, ok := interface{}(m.GetWeightedClusters()).(interface{ Validate() error }); ok { 1332 if err := v.Validate(); err != nil { 1333 return RouteActionValidationError{ 1334 field: "WeightedClusters", 1335 reason: "embedded message failed validation", 1336 cause: err, 1337 } 1338 } 1339 } 1340 1341 default: 1342 return RouteActionValidationError{ 1343 field: "ClusterSpecifier", 1344 reason: "value is required", 1345 } 1346 1347 } 1348 1349 switch m.HostRewriteSpecifier.(type) { 1350 1351 case *RouteAction_HostRewrite: 1352 1353 if !_RouteAction_HostRewrite_Pattern.MatchString(m.GetHostRewrite()) { 1354 return RouteActionValidationError{ 1355 field: "HostRewrite", 1356 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1357 } 1358 } 1359 1360 case *RouteAction_AutoHostRewrite: 1361 1362 if v, ok := interface{}(m.GetAutoHostRewrite()).(interface{ Validate() error }); ok { 1363 if err := v.Validate(); err != nil { 1364 return RouteActionValidationError{ 1365 field: "AutoHostRewrite", 1366 reason: "embedded message failed validation", 1367 cause: err, 1368 } 1369 } 1370 } 1371 1372 case *RouteAction_AutoHostRewriteHeader: 1373 1374 if !_RouteAction_AutoHostRewriteHeader_Pattern.MatchString(m.GetAutoHostRewriteHeader()) { 1375 return RouteActionValidationError{ 1376 field: "AutoHostRewriteHeader", 1377 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1378 } 1379 } 1380 1381 } 1382 1383 return nil 1384} 1385 1386// RouteActionValidationError is the validation error returned by 1387// RouteAction.Validate if the designated constraints aren't met. 1388type RouteActionValidationError struct { 1389 field string 1390 reason string 1391 cause error 1392 key bool 1393} 1394 1395// Field function returns field value. 1396func (e RouteActionValidationError) Field() string { return e.field } 1397 1398// Reason function returns reason value. 1399func (e RouteActionValidationError) Reason() string { return e.reason } 1400 1401// Cause function returns cause value. 1402func (e RouteActionValidationError) Cause() error { return e.cause } 1403 1404// Key function returns key value. 1405func (e RouteActionValidationError) Key() bool { return e.key } 1406 1407// ErrorName returns error name. 1408func (e RouteActionValidationError) ErrorName() string { return "RouteActionValidationError" } 1409 1410// Error satisfies the builtin error interface 1411func (e RouteActionValidationError) Error() string { 1412 cause := "" 1413 if e.cause != nil { 1414 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1415 } 1416 1417 key := "" 1418 if e.key { 1419 key = "key for " 1420 } 1421 1422 return fmt.Sprintf( 1423 "invalid %sRouteAction.%s: %s%s", 1424 key, 1425 e.field, 1426 e.reason, 1427 cause) 1428} 1429 1430var _ error = RouteActionValidationError{} 1431 1432var _ interface { 1433 Field() string 1434 Reason() string 1435 Key() bool 1436 Cause() error 1437 ErrorName() string 1438} = RouteActionValidationError{} 1439 1440var _RouteAction_ClusterHeader_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1441 1442var _RouteAction_PrefixRewrite_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1443 1444var _RouteAction_HostRewrite_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1445 1446var _RouteAction_AutoHostRewriteHeader_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1447 1448// Validate checks the field values on RetryPolicy with the rules defined in 1449// the proto definition for this message. If any rules are violated, an error 1450// is returned. 1451func (m *RetryPolicy) Validate() error { 1452 if m == nil { 1453 return nil 1454 } 1455 1456 // no validation rules for RetryOn 1457 1458 if v, ok := interface{}(m.GetNumRetries()).(interface{ Validate() error }); ok { 1459 if err := v.Validate(); err != nil { 1460 return RetryPolicyValidationError{ 1461 field: "NumRetries", 1462 reason: "embedded message failed validation", 1463 cause: err, 1464 } 1465 } 1466 } 1467 1468 if v, ok := interface{}(m.GetPerTryTimeout()).(interface{ Validate() error }); ok { 1469 if err := v.Validate(); err != nil { 1470 return RetryPolicyValidationError{ 1471 field: "PerTryTimeout", 1472 reason: "embedded message failed validation", 1473 cause: err, 1474 } 1475 } 1476 } 1477 1478 if v, ok := interface{}(m.GetRetryPriority()).(interface{ Validate() error }); ok { 1479 if err := v.Validate(); err != nil { 1480 return RetryPolicyValidationError{ 1481 field: "RetryPriority", 1482 reason: "embedded message failed validation", 1483 cause: err, 1484 } 1485 } 1486 } 1487 1488 for idx, item := range m.GetRetryHostPredicate() { 1489 _, _ = idx, item 1490 1491 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1492 if err := v.Validate(); err != nil { 1493 return RetryPolicyValidationError{ 1494 field: fmt.Sprintf("RetryHostPredicate[%v]", idx), 1495 reason: "embedded message failed validation", 1496 cause: err, 1497 } 1498 } 1499 } 1500 1501 } 1502 1503 // no validation rules for HostSelectionRetryMaxAttempts 1504 1505 if v, ok := interface{}(m.GetRetryBackOff()).(interface{ Validate() error }); ok { 1506 if err := v.Validate(); err != nil { 1507 return RetryPolicyValidationError{ 1508 field: "RetryBackOff", 1509 reason: "embedded message failed validation", 1510 cause: err, 1511 } 1512 } 1513 } 1514 1515 for idx, item := range m.GetRetriableHeaders() { 1516 _, _ = idx, item 1517 1518 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1519 if err := v.Validate(); err != nil { 1520 return RetryPolicyValidationError{ 1521 field: fmt.Sprintf("RetriableHeaders[%v]", idx), 1522 reason: "embedded message failed validation", 1523 cause: err, 1524 } 1525 } 1526 } 1527 1528 } 1529 1530 for idx, item := range m.GetRetriableRequestHeaders() { 1531 _, _ = idx, item 1532 1533 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1534 if err := v.Validate(); err != nil { 1535 return RetryPolicyValidationError{ 1536 field: fmt.Sprintf("RetriableRequestHeaders[%v]", idx), 1537 reason: "embedded message failed validation", 1538 cause: err, 1539 } 1540 } 1541 } 1542 1543 } 1544 1545 return nil 1546} 1547 1548// RetryPolicyValidationError is the validation error returned by 1549// RetryPolicy.Validate if the designated constraints aren't met. 1550type RetryPolicyValidationError struct { 1551 field string 1552 reason string 1553 cause error 1554 key bool 1555} 1556 1557// Field function returns field value. 1558func (e RetryPolicyValidationError) Field() string { return e.field } 1559 1560// Reason function returns reason value. 1561func (e RetryPolicyValidationError) Reason() string { return e.reason } 1562 1563// Cause function returns cause value. 1564func (e RetryPolicyValidationError) Cause() error { return e.cause } 1565 1566// Key function returns key value. 1567func (e RetryPolicyValidationError) Key() bool { return e.key } 1568 1569// ErrorName returns error name. 1570func (e RetryPolicyValidationError) ErrorName() string { return "RetryPolicyValidationError" } 1571 1572// Error satisfies the builtin error interface 1573func (e RetryPolicyValidationError) Error() string { 1574 cause := "" 1575 if e.cause != nil { 1576 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1577 } 1578 1579 key := "" 1580 if e.key { 1581 key = "key for " 1582 } 1583 1584 return fmt.Sprintf( 1585 "invalid %sRetryPolicy.%s: %s%s", 1586 key, 1587 e.field, 1588 e.reason, 1589 cause) 1590} 1591 1592var _ error = RetryPolicyValidationError{} 1593 1594var _ interface { 1595 Field() string 1596 Reason() string 1597 Key() bool 1598 Cause() error 1599 ErrorName() string 1600} = RetryPolicyValidationError{} 1601 1602// Validate checks the field values on HedgePolicy with the rules defined in 1603// the proto definition for this message. If any rules are violated, an error 1604// is returned. 1605func (m *HedgePolicy) Validate() error { 1606 if m == nil { 1607 return nil 1608 } 1609 1610 if wrapper := m.GetInitialRequests(); wrapper != nil { 1611 1612 if wrapper.GetValue() < 1 { 1613 return HedgePolicyValidationError{ 1614 field: "InitialRequests", 1615 reason: "value must be greater than or equal to 1", 1616 } 1617 } 1618 1619 } 1620 1621 if v, ok := interface{}(m.GetAdditionalRequestChance()).(interface{ Validate() error }); ok { 1622 if err := v.Validate(); err != nil { 1623 return HedgePolicyValidationError{ 1624 field: "AdditionalRequestChance", 1625 reason: "embedded message failed validation", 1626 cause: err, 1627 } 1628 } 1629 } 1630 1631 // no validation rules for HedgeOnPerTryTimeout 1632 1633 return nil 1634} 1635 1636// HedgePolicyValidationError is the validation error returned by 1637// HedgePolicy.Validate if the designated constraints aren't met. 1638type HedgePolicyValidationError struct { 1639 field string 1640 reason string 1641 cause error 1642 key bool 1643} 1644 1645// Field function returns field value. 1646func (e HedgePolicyValidationError) Field() string { return e.field } 1647 1648// Reason function returns reason value. 1649func (e HedgePolicyValidationError) Reason() string { return e.reason } 1650 1651// Cause function returns cause value. 1652func (e HedgePolicyValidationError) Cause() error { return e.cause } 1653 1654// Key function returns key value. 1655func (e HedgePolicyValidationError) Key() bool { return e.key } 1656 1657// ErrorName returns error name. 1658func (e HedgePolicyValidationError) ErrorName() string { return "HedgePolicyValidationError" } 1659 1660// Error satisfies the builtin error interface 1661func (e HedgePolicyValidationError) Error() string { 1662 cause := "" 1663 if e.cause != nil { 1664 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1665 } 1666 1667 key := "" 1668 if e.key { 1669 key = "key for " 1670 } 1671 1672 return fmt.Sprintf( 1673 "invalid %sHedgePolicy.%s: %s%s", 1674 key, 1675 e.field, 1676 e.reason, 1677 cause) 1678} 1679 1680var _ error = HedgePolicyValidationError{} 1681 1682var _ interface { 1683 Field() string 1684 Reason() string 1685 Key() bool 1686 Cause() error 1687 ErrorName() string 1688} = HedgePolicyValidationError{} 1689 1690// Validate checks the field values on RedirectAction with the rules defined in 1691// the proto definition for this message. If any rules are violated, an error 1692// is returned. 1693func (m *RedirectAction) Validate() error { 1694 if m == nil { 1695 return nil 1696 } 1697 1698 if !_RedirectAction_HostRedirect_Pattern.MatchString(m.GetHostRedirect()) { 1699 return RedirectActionValidationError{ 1700 field: "HostRedirect", 1701 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1702 } 1703 } 1704 1705 // no validation rules for PortRedirect 1706 1707 if _, ok := RedirectAction_RedirectResponseCode_name[int32(m.GetResponseCode())]; !ok { 1708 return RedirectActionValidationError{ 1709 field: "ResponseCode", 1710 reason: "value must be one of the defined enum values", 1711 } 1712 } 1713 1714 // no validation rules for StripQuery 1715 1716 switch m.SchemeRewriteSpecifier.(type) { 1717 1718 case *RedirectAction_HttpsRedirect: 1719 // no validation rules for HttpsRedirect 1720 1721 case *RedirectAction_SchemeRedirect: 1722 // no validation rules for SchemeRedirect 1723 1724 } 1725 1726 switch m.PathRewriteSpecifier.(type) { 1727 1728 case *RedirectAction_PathRedirect: 1729 1730 if !_RedirectAction_PathRedirect_Pattern.MatchString(m.GetPathRedirect()) { 1731 return RedirectActionValidationError{ 1732 field: "PathRedirect", 1733 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1734 } 1735 } 1736 1737 case *RedirectAction_PrefixRewrite: 1738 1739 if !_RedirectAction_PrefixRewrite_Pattern.MatchString(m.GetPrefixRewrite()) { 1740 return RedirectActionValidationError{ 1741 field: "PrefixRewrite", 1742 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1743 } 1744 } 1745 1746 } 1747 1748 return nil 1749} 1750 1751// RedirectActionValidationError is the validation error returned by 1752// RedirectAction.Validate if the designated constraints aren't met. 1753type RedirectActionValidationError struct { 1754 field string 1755 reason string 1756 cause error 1757 key bool 1758} 1759 1760// Field function returns field value. 1761func (e RedirectActionValidationError) Field() string { return e.field } 1762 1763// Reason function returns reason value. 1764func (e RedirectActionValidationError) Reason() string { return e.reason } 1765 1766// Cause function returns cause value. 1767func (e RedirectActionValidationError) Cause() error { return e.cause } 1768 1769// Key function returns key value. 1770func (e RedirectActionValidationError) Key() bool { return e.key } 1771 1772// ErrorName returns error name. 1773func (e RedirectActionValidationError) ErrorName() string { return "RedirectActionValidationError" } 1774 1775// Error satisfies the builtin error interface 1776func (e RedirectActionValidationError) Error() string { 1777 cause := "" 1778 if e.cause != nil { 1779 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1780 } 1781 1782 key := "" 1783 if e.key { 1784 key = "key for " 1785 } 1786 1787 return fmt.Sprintf( 1788 "invalid %sRedirectAction.%s: %s%s", 1789 key, 1790 e.field, 1791 e.reason, 1792 cause) 1793} 1794 1795var _ error = RedirectActionValidationError{} 1796 1797var _ interface { 1798 Field() string 1799 Reason() string 1800 Key() bool 1801 Cause() error 1802 ErrorName() string 1803} = RedirectActionValidationError{} 1804 1805var _RedirectAction_HostRedirect_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1806 1807var _RedirectAction_PathRedirect_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1808 1809var _RedirectAction_PrefixRewrite_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1810 1811// Validate checks the field values on DirectResponseAction with the rules 1812// defined in the proto definition for this message. If any rules are 1813// violated, an error is returned. 1814func (m *DirectResponseAction) Validate() error { 1815 if m == nil { 1816 return nil 1817 } 1818 1819 if val := m.GetStatus(); val < 100 || val >= 600 { 1820 return DirectResponseActionValidationError{ 1821 field: "Status", 1822 reason: "value must be inside range [100, 600)", 1823 } 1824 } 1825 1826 if v, ok := interface{}(m.GetBody()).(interface{ Validate() error }); ok { 1827 if err := v.Validate(); err != nil { 1828 return DirectResponseActionValidationError{ 1829 field: "Body", 1830 reason: "embedded message failed validation", 1831 cause: err, 1832 } 1833 } 1834 } 1835 1836 return nil 1837} 1838 1839// DirectResponseActionValidationError is the validation error returned by 1840// DirectResponseAction.Validate if the designated constraints aren't met. 1841type DirectResponseActionValidationError struct { 1842 field string 1843 reason string 1844 cause error 1845 key bool 1846} 1847 1848// Field function returns field value. 1849func (e DirectResponseActionValidationError) Field() string { return e.field } 1850 1851// Reason function returns reason value. 1852func (e DirectResponseActionValidationError) Reason() string { return e.reason } 1853 1854// Cause function returns cause value. 1855func (e DirectResponseActionValidationError) Cause() error { return e.cause } 1856 1857// Key function returns key value. 1858func (e DirectResponseActionValidationError) Key() bool { return e.key } 1859 1860// ErrorName returns error name. 1861func (e DirectResponseActionValidationError) ErrorName() string { 1862 return "DirectResponseActionValidationError" 1863} 1864 1865// Error satisfies the builtin error interface 1866func (e DirectResponseActionValidationError) Error() string { 1867 cause := "" 1868 if e.cause != nil { 1869 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1870 } 1871 1872 key := "" 1873 if e.key { 1874 key = "key for " 1875 } 1876 1877 return fmt.Sprintf( 1878 "invalid %sDirectResponseAction.%s: %s%s", 1879 key, 1880 e.field, 1881 e.reason, 1882 cause) 1883} 1884 1885var _ error = DirectResponseActionValidationError{} 1886 1887var _ interface { 1888 Field() string 1889 Reason() string 1890 Key() bool 1891 Cause() error 1892 ErrorName() string 1893} = DirectResponseActionValidationError{} 1894 1895// Validate checks the field values on Decorator with the rules defined in the 1896// proto definition for this message. If any rules are violated, an error is returned. 1897func (m *Decorator) Validate() error { 1898 if m == nil { 1899 return nil 1900 } 1901 1902 if len(m.GetOperation()) < 1 { 1903 return DecoratorValidationError{ 1904 field: "Operation", 1905 reason: "value length must be at least 1 bytes", 1906 } 1907 } 1908 1909 if v, ok := interface{}(m.GetPropagate()).(interface{ Validate() error }); ok { 1910 if err := v.Validate(); err != nil { 1911 return DecoratorValidationError{ 1912 field: "Propagate", 1913 reason: "embedded message failed validation", 1914 cause: err, 1915 } 1916 } 1917 } 1918 1919 return nil 1920} 1921 1922// DecoratorValidationError is the validation error returned by 1923// Decorator.Validate if the designated constraints aren't met. 1924type DecoratorValidationError struct { 1925 field string 1926 reason string 1927 cause error 1928 key bool 1929} 1930 1931// Field function returns field value. 1932func (e DecoratorValidationError) Field() string { return e.field } 1933 1934// Reason function returns reason value. 1935func (e DecoratorValidationError) Reason() string { return e.reason } 1936 1937// Cause function returns cause value. 1938func (e DecoratorValidationError) Cause() error { return e.cause } 1939 1940// Key function returns key value. 1941func (e DecoratorValidationError) Key() bool { return e.key } 1942 1943// ErrorName returns error name. 1944func (e DecoratorValidationError) ErrorName() string { return "DecoratorValidationError" } 1945 1946// Error satisfies the builtin error interface 1947func (e DecoratorValidationError) Error() string { 1948 cause := "" 1949 if e.cause != nil { 1950 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1951 } 1952 1953 key := "" 1954 if e.key { 1955 key = "key for " 1956 } 1957 1958 return fmt.Sprintf( 1959 "invalid %sDecorator.%s: %s%s", 1960 key, 1961 e.field, 1962 e.reason, 1963 cause) 1964} 1965 1966var _ error = DecoratorValidationError{} 1967 1968var _ interface { 1969 Field() string 1970 Reason() string 1971 Key() bool 1972 Cause() error 1973 ErrorName() string 1974} = DecoratorValidationError{} 1975 1976// Validate checks the field values on Tracing with the rules defined in the 1977// proto definition for this message. If any rules are violated, an error is returned. 1978func (m *Tracing) Validate() error { 1979 if m == nil { 1980 return nil 1981 } 1982 1983 if v, ok := interface{}(m.GetClientSampling()).(interface{ Validate() error }); ok { 1984 if err := v.Validate(); err != nil { 1985 return TracingValidationError{ 1986 field: "ClientSampling", 1987 reason: "embedded message failed validation", 1988 cause: err, 1989 } 1990 } 1991 } 1992 1993 if v, ok := interface{}(m.GetRandomSampling()).(interface{ Validate() error }); ok { 1994 if err := v.Validate(); err != nil { 1995 return TracingValidationError{ 1996 field: "RandomSampling", 1997 reason: "embedded message failed validation", 1998 cause: err, 1999 } 2000 } 2001 } 2002 2003 if v, ok := interface{}(m.GetOverallSampling()).(interface{ Validate() error }); ok { 2004 if err := v.Validate(); err != nil { 2005 return TracingValidationError{ 2006 field: "OverallSampling", 2007 reason: "embedded message failed validation", 2008 cause: err, 2009 } 2010 } 2011 } 2012 2013 for idx, item := range m.GetCustomTags() { 2014 _, _ = idx, item 2015 2016 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2017 if err := v.Validate(); err != nil { 2018 return TracingValidationError{ 2019 field: fmt.Sprintf("CustomTags[%v]", idx), 2020 reason: "embedded message failed validation", 2021 cause: err, 2022 } 2023 } 2024 } 2025 2026 } 2027 2028 return nil 2029} 2030 2031// TracingValidationError is the validation error returned by Tracing.Validate 2032// if the designated constraints aren't met. 2033type TracingValidationError struct { 2034 field string 2035 reason string 2036 cause error 2037 key bool 2038} 2039 2040// Field function returns field value. 2041func (e TracingValidationError) Field() string { return e.field } 2042 2043// Reason function returns reason value. 2044func (e TracingValidationError) Reason() string { return e.reason } 2045 2046// Cause function returns cause value. 2047func (e TracingValidationError) Cause() error { return e.cause } 2048 2049// Key function returns key value. 2050func (e TracingValidationError) Key() bool { return e.key } 2051 2052// ErrorName returns error name. 2053func (e TracingValidationError) ErrorName() string { return "TracingValidationError" } 2054 2055// Error satisfies the builtin error interface 2056func (e TracingValidationError) Error() string { 2057 cause := "" 2058 if e.cause != nil { 2059 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2060 } 2061 2062 key := "" 2063 if e.key { 2064 key = "key for " 2065 } 2066 2067 return fmt.Sprintf( 2068 "invalid %sTracing.%s: %s%s", 2069 key, 2070 e.field, 2071 e.reason, 2072 cause) 2073} 2074 2075var _ error = TracingValidationError{} 2076 2077var _ interface { 2078 Field() string 2079 Reason() string 2080 Key() bool 2081 Cause() error 2082 ErrorName() string 2083} = TracingValidationError{} 2084 2085// Validate checks the field values on VirtualCluster with the rules defined in 2086// the proto definition for this message. If any rules are violated, an error 2087// is returned. 2088func (m *VirtualCluster) Validate() error { 2089 if m == nil { 2090 return nil 2091 } 2092 2093 if len(m.GetPattern()) > 1024 { 2094 return VirtualClusterValidationError{ 2095 field: "Pattern", 2096 reason: "value length must be at most 1024 bytes", 2097 } 2098 } 2099 2100 for idx, item := range m.GetHeaders() { 2101 _, _ = idx, item 2102 2103 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2104 if err := v.Validate(); err != nil { 2105 return VirtualClusterValidationError{ 2106 field: fmt.Sprintf("Headers[%v]", idx), 2107 reason: "embedded message failed validation", 2108 cause: err, 2109 } 2110 } 2111 } 2112 2113 } 2114 2115 if len(m.GetName()) < 1 { 2116 return VirtualClusterValidationError{ 2117 field: "Name", 2118 reason: "value length must be at least 1 bytes", 2119 } 2120 } 2121 2122 // no validation rules for Method 2123 2124 return nil 2125} 2126 2127// VirtualClusterValidationError is the validation error returned by 2128// VirtualCluster.Validate if the designated constraints aren't met. 2129type VirtualClusterValidationError struct { 2130 field string 2131 reason string 2132 cause error 2133 key bool 2134} 2135 2136// Field function returns field value. 2137func (e VirtualClusterValidationError) Field() string { return e.field } 2138 2139// Reason function returns reason value. 2140func (e VirtualClusterValidationError) Reason() string { return e.reason } 2141 2142// Cause function returns cause value. 2143func (e VirtualClusterValidationError) Cause() error { return e.cause } 2144 2145// Key function returns key value. 2146func (e VirtualClusterValidationError) Key() bool { return e.key } 2147 2148// ErrorName returns error name. 2149func (e VirtualClusterValidationError) ErrorName() string { return "VirtualClusterValidationError" } 2150 2151// Error satisfies the builtin error interface 2152func (e VirtualClusterValidationError) Error() string { 2153 cause := "" 2154 if e.cause != nil { 2155 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2156 } 2157 2158 key := "" 2159 if e.key { 2160 key = "key for " 2161 } 2162 2163 return fmt.Sprintf( 2164 "invalid %sVirtualCluster.%s: %s%s", 2165 key, 2166 e.field, 2167 e.reason, 2168 cause) 2169} 2170 2171var _ error = VirtualClusterValidationError{} 2172 2173var _ interface { 2174 Field() string 2175 Reason() string 2176 Key() bool 2177 Cause() error 2178 ErrorName() string 2179} = VirtualClusterValidationError{} 2180 2181// Validate checks the field values on RateLimit with the rules defined in the 2182// proto definition for this message. If any rules are violated, an error is returned. 2183func (m *RateLimit) Validate() error { 2184 if m == nil { 2185 return nil 2186 } 2187 2188 if wrapper := m.GetStage(); wrapper != nil { 2189 2190 if wrapper.GetValue() > 10 { 2191 return RateLimitValidationError{ 2192 field: "Stage", 2193 reason: "value must be less than or equal to 10", 2194 } 2195 } 2196 2197 } 2198 2199 // no validation rules for DisableKey 2200 2201 if len(m.GetActions()) < 1 { 2202 return RateLimitValidationError{ 2203 field: "Actions", 2204 reason: "value must contain at least 1 item(s)", 2205 } 2206 } 2207 2208 for idx, item := range m.GetActions() { 2209 _, _ = idx, item 2210 2211 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2212 if err := v.Validate(); err != nil { 2213 return RateLimitValidationError{ 2214 field: fmt.Sprintf("Actions[%v]", idx), 2215 reason: "embedded message failed validation", 2216 cause: err, 2217 } 2218 } 2219 } 2220 2221 } 2222 2223 return nil 2224} 2225 2226// RateLimitValidationError is the validation error returned by 2227// RateLimit.Validate if the designated constraints aren't met. 2228type RateLimitValidationError struct { 2229 field string 2230 reason string 2231 cause error 2232 key bool 2233} 2234 2235// Field function returns field value. 2236func (e RateLimitValidationError) Field() string { return e.field } 2237 2238// Reason function returns reason value. 2239func (e RateLimitValidationError) Reason() string { return e.reason } 2240 2241// Cause function returns cause value. 2242func (e RateLimitValidationError) Cause() error { return e.cause } 2243 2244// Key function returns key value. 2245func (e RateLimitValidationError) Key() bool { return e.key } 2246 2247// ErrorName returns error name. 2248func (e RateLimitValidationError) ErrorName() string { return "RateLimitValidationError" } 2249 2250// Error satisfies the builtin error interface 2251func (e RateLimitValidationError) Error() string { 2252 cause := "" 2253 if e.cause != nil { 2254 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2255 } 2256 2257 key := "" 2258 if e.key { 2259 key = "key for " 2260 } 2261 2262 return fmt.Sprintf( 2263 "invalid %sRateLimit.%s: %s%s", 2264 key, 2265 e.field, 2266 e.reason, 2267 cause) 2268} 2269 2270var _ error = RateLimitValidationError{} 2271 2272var _ interface { 2273 Field() string 2274 Reason() string 2275 Key() bool 2276 Cause() error 2277 ErrorName() string 2278} = RateLimitValidationError{} 2279 2280// Validate checks the field values on HeaderMatcher with the rules defined in 2281// the proto definition for this message. If any rules are violated, an error 2282// is returned. 2283func (m *HeaderMatcher) Validate() error { 2284 if m == nil { 2285 return nil 2286 } 2287 2288 if len(m.GetName()) < 1 { 2289 return HeaderMatcherValidationError{ 2290 field: "Name", 2291 reason: "value length must be at least 1 bytes", 2292 } 2293 } 2294 2295 if !_HeaderMatcher_Name_Pattern.MatchString(m.GetName()) { 2296 return HeaderMatcherValidationError{ 2297 field: "Name", 2298 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 2299 } 2300 } 2301 2302 // no validation rules for InvertMatch 2303 2304 switch m.HeaderMatchSpecifier.(type) { 2305 2306 case *HeaderMatcher_ExactMatch: 2307 // no validation rules for ExactMatch 2308 2309 case *HeaderMatcher_RegexMatch: 2310 2311 if len(m.GetRegexMatch()) > 1024 { 2312 return HeaderMatcherValidationError{ 2313 field: "RegexMatch", 2314 reason: "value length must be at most 1024 bytes", 2315 } 2316 } 2317 2318 case *HeaderMatcher_SafeRegexMatch: 2319 2320 if v, ok := interface{}(m.GetSafeRegexMatch()).(interface{ Validate() error }); ok { 2321 if err := v.Validate(); err != nil { 2322 return HeaderMatcherValidationError{ 2323 field: "SafeRegexMatch", 2324 reason: "embedded message failed validation", 2325 cause: err, 2326 } 2327 } 2328 } 2329 2330 case *HeaderMatcher_RangeMatch: 2331 2332 if v, ok := interface{}(m.GetRangeMatch()).(interface{ Validate() error }); ok { 2333 if err := v.Validate(); err != nil { 2334 return HeaderMatcherValidationError{ 2335 field: "RangeMatch", 2336 reason: "embedded message failed validation", 2337 cause: err, 2338 } 2339 } 2340 } 2341 2342 case *HeaderMatcher_PresentMatch: 2343 // no validation rules for PresentMatch 2344 2345 case *HeaderMatcher_PrefixMatch: 2346 2347 if len(m.GetPrefixMatch()) < 1 { 2348 return HeaderMatcherValidationError{ 2349 field: "PrefixMatch", 2350 reason: "value length must be at least 1 bytes", 2351 } 2352 } 2353 2354 case *HeaderMatcher_SuffixMatch: 2355 2356 if len(m.GetSuffixMatch()) < 1 { 2357 return HeaderMatcherValidationError{ 2358 field: "SuffixMatch", 2359 reason: "value length must be at least 1 bytes", 2360 } 2361 } 2362 2363 } 2364 2365 return nil 2366} 2367 2368// HeaderMatcherValidationError is the validation error returned by 2369// HeaderMatcher.Validate if the designated constraints aren't met. 2370type HeaderMatcherValidationError struct { 2371 field string 2372 reason string 2373 cause error 2374 key bool 2375} 2376 2377// Field function returns field value. 2378func (e HeaderMatcherValidationError) Field() string { return e.field } 2379 2380// Reason function returns reason value. 2381func (e HeaderMatcherValidationError) Reason() string { return e.reason } 2382 2383// Cause function returns cause value. 2384func (e HeaderMatcherValidationError) Cause() error { return e.cause } 2385 2386// Key function returns key value. 2387func (e HeaderMatcherValidationError) Key() bool { return e.key } 2388 2389// ErrorName returns error name. 2390func (e HeaderMatcherValidationError) ErrorName() string { return "HeaderMatcherValidationError" } 2391 2392// Error satisfies the builtin error interface 2393func (e HeaderMatcherValidationError) Error() string { 2394 cause := "" 2395 if e.cause != nil { 2396 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2397 } 2398 2399 key := "" 2400 if e.key { 2401 key = "key for " 2402 } 2403 2404 return fmt.Sprintf( 2405 "invalid %sHeaderMatcher.%s: %s%s", 2406 key, 2407 e.field, 2408 e.reason, 2409 cause) 2410} 2411 2412var _ error = HeaderMatcherValidationError{} 2413 2414var _ interface { 2415 Field() string 2416 Reason() string 2417 Key() bool 2418 Cause() error 2419 ErrorName() string 2420} = HeaderMatcherValidationError{} 2421 2422var _HeaderMatcher_Name_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 2423 2424// Validate checks the field values on QueryParameterMatcher with the rules 2425// defined in the proto definition for this message. If any rules are 2426// violated, an error is returned. 2427func (m *QueryParameterMatcher) Validate() error { 2428 if m == nil { 2429 return nil 2430 } 2431 2432 if l := len(m.GetName()); l < 1 || l > 1024 { 2433 return QueryParameterMatcherValidationError{ 2434 field: "Name", 2435 reason: "value length must be between 1 and 1024 bytes, inclusive", 2436 } 2437 } 2438 2439 // no validation rules for Value 2440 2441 if v, ok := interface{}(m.GetRegex()).(interface{ Validate() error }); ok { 2442 if err := v.Validate(); err != nil { 2443 return QueryParameterMatcherValidationError{ 2444 field: "Regex", 2445 reason: "embedded message failed validation", 2446 cause: err, 2447 } 2448 } 2449 } 2450 2451 switch m.QueryParameterMatchSpecifier.(type) { 2452 2453 case *QueryParameterMatcher_StringMatch: 2454 2455 if m.GetStringMatch() == nil { 2456 return QueryParameterMatcherValidationError{ 2457 field: "StringMatch", 2458 reason: "value is required", 2459 } 2460 } 2461 2462 if v, ok := interface{}(m.GetStringMatch()).(interface{ Validate() error }); ok { 2463 if err := v.Validate(); err != nil { 2464 return QueryParameterMatcherValidationError{ 2465 field: "StringMatch", 2466 reason: "embedded message failed validation", 2467 cause: err, 2468 } 2469 } 2470 } 2471 2472 case *QueryParameterMatcher_PresentMatch: 2473 // no validation rules for PresentMatch 2474 2475 } 2476 2477 return nil 2478} 2479 2480// QueryParameterMatcherValidationError is the validation error returned by 2481// QueryParameterMatcher.Validate if the designated constraints aren't met. 2482type QueryParameterMatcherValidationError struct { 2483 field string 2484 reason string 2485 cause error 2486 key bool 2487} 2488 2489// Field function returns field value. 2490func (e QueryParameterMatcherValidationError) Field() string { return e.field } 2491 2492// Reason function returns reason value. 2493func (e QueryParameterMatcherValidationError) Reason() string { return e.reason } 2494 2495// Cause function returns cause value. 2496func (e QueryParameterMatcherValidationError) Cause() error { return e.cause } 2497 2498// Key function returns key value. 2499func (e QueryParameterMatcherValidationError) Key() bool { return e.key } 2500 2501// ErrorName returns error name. 2502func (e QueryParameterMatcherValidationError) ErrorName() string { 2503 return "QueryParameterMatcherValidationError" 2504} 2505 2506// Error satisfies the builtin error interface 2507func (e QueryParameterMatcherValidationError) Error() string { 2508 cause := "" 2509 if e.cause != nil { 2510 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2511 } 2512 2513 key := "" 2514 if e.key { 2515 key = "key for " 2516 } 2517 2518 return fmt.Sprintf( 2519 "invalid %sQueryParameterMatcher.%s: %s%s", 2520 key, 2521 e.field, 2522 e.reason, 2523 cause) 2524} 2525 2526var _ error = QueryParameterMatcherValidationError{} 2527 2528var _ interface { 2529 Field() string 2530 Reason() string 2531 Key() bool 2532 Cause() error 2533 ErrorName() string 2534} = QueryParameterMatcherValidationError{} 2535 2536// Validate checks the field values on WeightedCluster_ClusterWeight with the 2537// rules defined in the proto definition for this message. If any rules are 2538// violated, an error is returned. 2539func (m *WeightedCluster_ClusterWeight) Validate() error { 2540 if m == nil { 2541 return nil 2542 } 2543 2544 if len(m.GetName()) < 1 { 2545 return WeightedCluster_ClusterWeightValidationError{ 2546 field: "Name", 2547 reason: "value length must be at least 1 bytes", 2548 } 2549 } 2550 2551 if v, ok := interface{}(m.GetWeight()).(interface{ Validate() error }); ok { 2552 if err := v.Validate(); err != nil { 2553 return WeightedCluster_ClusterWeightValidationError{ 2554 field: "Weight", 2555 reason: "embedded message failed validation", 2556 cause: err, 2557 } 2558 } 2559 } 2560 2561 if v, ok := interface{}(m.GetMetadataMatch()).(interface{ Validate() error }); ok { 2562 if err := v.Validate(); err != nil { 2563 return WeightedCluster_ClusterWeightValidationError{ 2564 field: "MetadataMatch", 2565 reason: "embedded message failed validation", 2566 cause: err, 2567 } 2568 } 2569 } 2570 2571 if len(m.GetRequestHeadersToAdd()) > 1000 { 2572 return WeightedCluster_ClusterWeightValidationError{ 2573 field: "RequestHeadersToAdd", 2574 reason: "value must contain no more than 1000 item(s)", 2575 } 2576 } 2577 2578 for idx, item := range m.GetRequestHeadersToAdd() { 2579 _, _ = idx, item 2580 2581 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2582 if err := v.Validate(); err != nil { 2583 return WeightedCluster_ClusterWeightValidationError{ 2584 field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), 2585 reason: "embedded message failed validation", 2586 cause: err, 2587 } 2588 } 2589 } 2590 2591 } 2592 2593 if len(m.GetResponseHeadersToAdd()) > 1000 { 2594 return WeightedCluster_ClusterWeightValidationError{ 2595 field: "ResponseHeadersToAdd", 2596 reason: "value must contain no more than 1000 item(s)", 2597 } 2598 } 2599 2600 for idx, item := range m.GetResponseHeadersToAdd() { 2601 _, _ = idx, item 2602 2603 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2604 if err := v.Validate(); err != nil { 2605 return WeightedCluster_ClusterWeightValidationError{ 2606 field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx), 2607 reason: "embedded message failed validation", 2608 cause: err, 2609 } 2610 } 2611 } 2612 2613 } 2614 2615 for key, val := range m.GetPerFilterConfig() { 2616 _ = val 2617 2618 // no validation rules for PerFilterConfig[key] 2619 2620 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 2621 if err := v.Validate(); err != nil { 2622 return WeightedCluster_ClusterWeightValidationError{ 2623 field: fmt.Sprintf("PerFilterConfig[%v]", key), 2624 reason: "embedded message failed validation", 2625 cause: err, 2626 } 2627 } 2628 } 2629 2630 } 2631 2632 for key, val := range m.GetTypedPerFilterConfig() { 2633 _ = val 2634 2635 // no validation rules for TypedPerFilterConfig[key] 2636 2637 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 2638 if err := v.Validate(); err != nil { 2639 return WeightedCluster_ClusterWeightValidationError{ 2640 field: fmt.Sprintf("TypedPerFilterConfig[%v]", key), 2641 reason: "embedded message failed validation", 2642 cause: err, 2643 } 2644 } 2645 } 2646 2647 } 2648 2649 return nil 2650} 2651 2652// WeightedCluster_ClusterWeightValidationError is the validation error 2653// returned by WeightedCluster_ClusterWeight.Validate if the designated 2654// constraints aren't met. 2655type WeightedCluster_ClusterWeightValidationError struct { 2656 field string 2657 reason string 2658 cause error 2659 key bool 2660} 2661 2662// Field function returns field value. 2663func (e WeightedCluster_ClusterWeightValidationError) Field() string { return e.field } 2664 2665// Reason function returns reason value. 2666func (e WeightedCluster_ClusterWeightValidationError) Reason() string { return e.reason } 2667 2668// Cause function returns cause value. 2669func (e WeightedCluster_ClusterWeightValidationError) Cause() error { return e.cause } 2670 2671// Key function returns key value. 2672func (e WeightedCluster_ClusterWeightValidationError) Key() bool { return e.key } 2673 2674// ErrorName returns error name. 2675func (e WeightedCluster_ClusterWeightValidationError) ErrorName() string { 2676 return "WeightedCluster_ClusterWeightValidationError" 2677} 2678 2679// Error satisfies the builtin error interface 2680func (e WeightedCluster_ClusterWeightValidationError) Error() string { 2681 cause := "" 2682 if e.cause != nil { 2683 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2684 } 2685 2686 key := "" 2687 if e.key { 2688 key = "key for " 2689 } 2690 2691 return fmt.Sprintf( 2692 "invalid %sWeightedCluster_ClusterWeight.%s: %s%s", 2693 key, 2694 e.field, 2695 e.reason, 2696 cause) 2697} 2698 2699var _ error = WeightedCluster_ClusterWeightValidationError{} 2700 2701var _ interface { 2702 Field() string 2703 Reason() string 2704 Key() bool 2705 Cause() error 2706 ErrorName() string 2707} = WeightedCluster_ClusterWeightValidationError{} 2708 2709// Validate checks the field values on RouteMatch_GrpcRouteMatchOptions with 2710// the rules defined in the proto definition for this message. If any rules 2711// are violated, an error is returned. 2712func (m *RouteMatch_GrpcRouteMatchOptions) Validate() error { 2713 if m == nil { 2714 return nil 2715 } 2716 2717 return nil 2718} 2719 2720// RouteMatch_GrpcRouteMatchOptionsValidationError is the validation error 2721// returned by RouteMatch_GrpcRouteMatchOptions.Validate if the designated 2722// constraints aren't met. 2723type RouteMatch_GrpcRouteMatchOptionsValidationError struct { 2724 field string 2725 reason string 2726 cause error 2727 key bool 2728} 2729 2730// Field function returns field value. 2731func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Field() string { return e.field } 2732 2733// Reason function returns reason value. 2734func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Reason() string { return e.reason } 2735 2736// Cause function returns cause value. 2737func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Cause() error { return e.cause } 2738 2739// Key function returns key value. 2740func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Key() bool { return e.key } 2741 2742// ErrorName returns error name. 2743func (e RouteMatch_GrpcRouteMatchOptionsValidationError) ErrorName() string { 2744 return "RouteMatch_GrpcRouteMatchOptionsValidationError" 2745} 2746 2747// Error satisfies the builtin error interface 2748func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Error() string { 2749 cause := "" 2750 if e.cause != nil { 2751 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2752 } 2753 2754 key := "" 2755 if e.key { 2756 key = "key for " 2757 } 2758 2759 return fmt.Sprintf( 2760 "invalid %sRouteMatch_GrpcRouteMatchOptions.%s: %s%s", 2761 key, 2762 e.field, 2763 e.reason, 2764 cause) 2765} 2766 2767var _ error = RouteMatch_GrpcRouteMatchOptionsValidationError{} 2768 2769var _ interface { 2770 Field() string 2771 Reason() string 2772 Key() bool 2773 Cause() error 2774 ErrorName() string 2775} = RouteMatch_GrpcRouteMatchOptionsValidationError{} 2776 2777// Validate checks the field values on RouteMatch_TlsContextMatchOptions with 2778// the rules defined in the proto definition for this message. If any rules 2779// are violated, an error is returned. 2780func (m *RouteMatch_TlsContextMatchOptions) Validate() error { 2781 if m == nil { 2782 return nil 2783 } 2784 2785 if v, ok := interface{}(m.GetPresented()).(interface{ Validate() error }); ok { 2786 if err := v.Validate(); err != nil { 2787 return RouteMatch_TlsContextMatchOptionsValidationError{ 2788 field: "Presented", 2789 reason: "embedded message failed validation", 2790 cause: err, 2791 } 2792 } 2793 } 2794 2795 if v, ok := interface{}(m.GetValidated()).(interface{ Validate() error }); ok { 2796 if err := v.Validate(); err != nil { 2797 return RouteMatch_TlsContextMatchOptionsValidationError{ 2798 field: "Validated", 2799 reason: "embedded message failed validation", 2800 cause: err, 2801 } 2802 } 2803 } 2804 2805 return nil 2806} 2807 2808// RouteMatch_TlsContextMatchOptionsValidationError is the validation error 2809// returned by RouteMatch_TlsContextMatchOptions.Validate if the designated 2810// constraints aren't met. 2811type RouteMatch_TlsContextMatchOptionsValidationError struct { 2812 field string 2813 reason string 2814 cause error 2815 key bool 2816} 2817 2818// Field function returns field value. 2819func (e RouteMatch_TlsContextMatchOptionsValidationError) Field() string { return e.field } 2820 2821// Reason function returns reason value. 2822func (e RouteMatch_TlsContextMatchOptionsValidationError) Reason() string { return e.reason } 2823 2824// Cause function returns cause value. 2825func (e RouteMatch_TlsContextMatchOptionsValidationError) Cause() error { return e.cause } 2826 2827// Key function returns key value. 2828func (e RouteMatch_TlsContextMatchOptionsValidationError) Key() bool { return e.key } 2829 2830// ErrorName returns error name. 2831func (e RouteMatch_TlsContextMatchOptionsValidationError) ErrorName() string { 2832 return "RouteMatch_TlsContextMatchOptionsValidationError" 2833} 2834 2835// Error satisfies the builtin error interface 2836func (e RouteMatch_TlsContextMatchOptionsValidationError) Error() string { 2837 cause := "" 2838 if e.cause != nil { 2839 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2840 } 2841 2842 key := "" 2843 if e.key { 2844 key = "key for " 2845 } 2846 2847 return fmt.Sprintf( 2848 "invalid %sRouteMatch_TlsContextMatchOptions.%s: %s%s", 2849 key, 2850 e.field, 2851 e.reason, 2852 cause) 2853} 2854 2855var _ error = RouteMatch_TlsContextMatchOptionsValidationError{} 2856 2857var _ interface { 2858 Field() string 2859 Reason() string 2860 Key() bool 2861 Cause() error 2862 ErrorName() string 2863} = RouteMatch_TlsContextMatchOptionsValidationError{} 2864 2865// Validate checks the field values on RouteAction_RequestMirrorPolicy with the 2866// rules defined in the proto definition for this message. If any rules are 2867// violated, an error is returned. 2868func (m *RouteAction_RequestMirrorPolicy) Validate() error { 2869 if m == nil { 2870 return nil 2871 } 2872 2873 if len(m.GetCluster()) < 1 { 2874 return RouteAction_RequestMirrorPolicyValidationError{ 2875 field: "Cluster", 2876 reason: "value length must be at least 1 bytes", 2877 } 2878 } 2879 2880 // no validation rules for RuntimeKey 2881 2882 if v, ok := interface{}(m.GetRuntimeFraction()).(interface{ Validate() error }); ok { 2883 if err := v.Validate(); err != nil { 2884 return RouteAction_RequestMirrorPolicyValidationError{ 2885 field: "RuntimeFraction", 2886 reason: "embedded message failed validation", 2887 cause: err, 2888 } 2889 } 2890 } 2891 2892 if v, ok := interface{}(m.GetTraceSampled()).(interface{ Validate() error }); ok { 2893 if err := v.Validate(); err != nil { 2894 return RouteAction_RequestMirrorPolicyValidationError{ 2895 field: "TraceSampled", 2896 reason: "embedded message failed validation", 2897 cause: err, 2898 } 2899 } 2900 } 2901 2902 return nil 2903} 2904 2905// RouteAction_RequestMirrorPolicyValidationError is the validation error 2906// returned by RouteAction_RequestMirrorPolicy.Validate if the designated 2907// constraints aren't met. 2908type RouteAction_RequestMirrorPolicyValidationError struct { 2909 field string 2910 reason string 2911 cause error 2912 key bool 2913} 2914 2915// Field function returns field value. 2916func (e RouteAction_RequestMirrorPolicyValidationError) Field() string { return e.field } 2917 2918// Reason function returns reason value. 2919func (e RouteAction_RequestMirrorPolicyValidationError) Reason() string { return e.reason } 2920 2921// Cause function returns cause value. 2922func (e RouteAction_RequestMirrorPolicyValidationError) Cause() error { return e.cause } 2923 2924// Key function returns key value. 2925func (e RouteAction_RequestMirrorPolicyValidationError) Key() bool { return e.key } 2926 2927// ErrorName returns error name. 2928func (e RouteAction_RequestMirrorPolicyValidationError) ErrorName() string { 2929 return "RouteAction_RequestMirrorPolicyValidationError" 2930} 2931 2932// Error satisfies the builtin error interface 2933func (e RouteAction_RequestMirrorPolicyValidationError) Error() string { 2934 cause := "" 2935 if e.cause != nil { 2936 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2937 } 2938 2939 key := "" 2940 if e.key { 2941 key = "key for " 2942 } 2943 2944 return fmt.Sprintf( 2945 "invalid %sRouteAction_RequestMirrorPolicy.%s: %s%s", 2946 key, 2947 e.field, 2948 e.reason, 2949 cause) 2950} 2951 2952var _ error = RouteAction_RequestMirrorPolicyValidationError{} 2953 2954var _ interface { 2955 Field() string 2956 Reason() string 2957 Key() bool 2958 Cause() error 2959 ErrorName() string 2960} = RouteAction_RequestMirrorPolicyValidationError{} 2961 2962// Validate checks the field values on RouteAction_HashPolicy with the rules 2963// defined in the proto definition for this message. If any rules are 2964// violated, an error is returned. 2965func (m *RouteAction_HashPolicy) Validate() error { 2966 if m == nil { 2967 return nil 2968 } 2969 2970 // no validation rules for Terminal 2971 2972 switch m.PolicySpecifier.(type) { 2973 2974 case *RouteAction_HashPolicy_Header_: 2975 2976 if v, ok := interface{}(m.GetHeader()).(interface{ Validate() error }); ok { 2977 if err := v.Validate(); err != nil { 2978 return RouteAction_HashPolicyValidationError{ 2979 field: "Header", 2980 reason: "embedded message failed validation", 2981 cause: err, 2982 } 2983 } 2984 } 2985 2986 case *RouteAction_HashPolicy_Cookie_: 2987 2988 if v, ok := interface{}(m.GetCookie()).(interface{ Validate() error }); ok { 2989 if err := v.Validate(); err != nil { 2990 return RouteAction_HashPolicyValidationError{ 2991 field: "Cookie", 2992 reason: "embedded message failed validation", 2993 cause: err, 2994 } 2995 } 2996 } 2997 2998 case *RouteAction_HashPolicy_ConnectionProperties_: 2999 3000 if v, ok := interface{}(m.GetConnectionProperties()).(interface{ Validate() error }); ok { 3001 if err := v.Validate(); err != nil { 3002 return RouteAction_HashPolicyValidationError{ 3003 field: "ConnectionProperties", 3004 reason: "embedded message failed validation", 3005 cause: err, 3006 } 3007 } 3008 } 3009 3010 case *RouteAction_HashPolicy_QueryParameter_: 3011 3012 if v, ok := interface{}(m.GetQueryParameter()).(interface{ Validate() error }); ok { 3013 if err := v.Validate(); err != nil { 3014 return RouteAction_HashPolicyValidationError{ 3015 field: "QueryParameter", 3016 reason: "embedded message failed validation", 3017 cause: err, 3018 } 3019 } 3020 } 3021 3022 case *RouteAction_HashPolicy_FilterState_: 3023 3024 if v, ok := interface{}(m.GetFilterState()).(interface{ Validate() error }); ok { 3025 if err := v.Validate(); err != nil { 3026 return RouteAction_HashPolicyValidationError{ 3027 field: "FilterState", 3028 reason: "embedded message failed validation", 3029 cause: err, 3030 } 3031 } 3032 } 3033 3034 default: 3035 return RouteAction_HashPolicyValidationError{ 3036 field: "PolicySpecifier", 3037 reason: "value is required", 3038 } 3039 3040 } 3041 3042 return nil 3043} 3044 3045// RouteAction_HashPolicyValidationError is the validation error returned by 3046// RouteAction_HashPolicy.Validate if the designated constraints aren't met. 3047type RouteAction_HashPolicyValidationError struct { 3048 field string 3049 reason string 3050 cause error 3051 key bool 3052} 3053 3054// Field function returns field value. 3055func (e RouteAction_HashPolicyValidationError) Field() string { return e.field } 3056 3057// Reason function returns reason value. 3058func (e RouteAction_HashPolicyValidationError) Reason() string { return e.reason } 3059 3060// Cause function returns cause value. 3061func (e RouteAction_HashPolicyValidationError) Cause() error { return e.cause } 3062 3063// Key function returns key value. 3064func (e RouteAction_HashPolicyValidationError) Key() bool { return e.key } 3065 3066// ErrorName returns error name. 3067func (e RouteAction_HashPolicyValidationError) ErrorName() string { 3068 return "RouteAction_HashPolicyValidationError" 3069} 3070 3071// Error satisfies the builtin error interface 3072func (e RouteAction_HashPolicyValidationError) Error() string { 3073 cause := "" 3074 if e.cause != nil { 3075 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3076 } 3077 3078 key := "" 3079 if e.key { 3080 key = "key for " 3081 } 3082 3083 return fmt.Sprintf( 3084 "invalid %sRouteAction_HashPolicy.%s: %s%s", 3085 key, 3086 e.field, 3087 e.reason, 3088 cause) 3089} 3090 3091var _ error = RouteAction_HashPolicyValidationError{} 3092 3093var _ interface { 3094 Field() string 3095 Reason() string 3096 Key() bool 3097 Cause() error 3098 ErrorName() string 3099} = RouteAction_HashPolicyValidationError{} 3100 3101// Validate checks the field values on RouteAction_UpgradeConfig with the rules 3102// defined in the proto definition for this message. If any rules are 3103// violated, an error is returned. 3104func (m *RouteAction_UpgradeConfig) Validate() error { 3105 if m == nil { 3106 return nil 3107 } 3108 3109 if !_RouteAction_UpgradeConfig_UpgradeType_Pattern.MatchString(m.GetUpgradeType()) { 3110 return RouteAction_UpgradeConfigValidationError{ 3111 field: "UpgradeType", 3112 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 3113 } 3114 } 3115 3116 if v, ok := interface{}(m.GetEnabled()).(interface{ Validate() error }); ok { 3117 if err := v.Validate(); err != nil { 3118 return RouteAction_UpgradeConfigValidationError{ 3119 field: "Enabled", 3120 reason: "embedded message failed validation", 3121 cause: err, 3122 } 3123 } 3124 } 3125 3126 return nil 3127} 3128 3129// RouteAction_UpgradeConfigValidationError is the validation error returned by 3130// RouteAction_UpgradeConfig.Validate if the designated constraints aren't met. 3131type RouteAction_UpgradeConfigValidationError struct { 3132 field string 3133 reason string 3134 cause error 3135 key bool 3136} 3137 3138// Field function returns field value. 3139func (e RouteAction_UpgradeConfigValidationError) Field() string { return e.field } 3140 3141// Reason function returns reason value. 3142func (e RouteAction_UpgradeConfigValidationError) Reason() string { return e.reason } 3143 3144// Cause function returns cause value. 3145func (e RouteAction_UpgradeConfigValidationError) Cause() error { return e.cause } 3146 3147// Key function returns key value. 3148func (e RouteAction_UpgradeConfigValidationError) Key() bool { return e.key } 3149 3150// ErrorName returns error name. 3151func (e RouteAction_UpgradeConfigValidationError) ErrorName() string { 3152 return "RouteAction_UpgradeConfigValidationError" 3153} 3154 3155// Error satisfies the builtin error interface 3156func (e RouteAction_UpgradeConfigValidationError) Error() string { 3157 cause := "" 3158 if e.cause != nil { 3159 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3160 } 3161 3162 key := "" 3163 if e.key { 3164 key = "key for " 3165 } 3166 3167 return fmt.Sprintf( 3168 "invalid %sRouteAction_UpgradeConfig.%s: %s%s", 3169 key, 3170 e.field, 3171 e.reason, 3172 cause) 3173} 3174 3175var _ error = RouteAction_UpgradeConfigValidationError{} 3176 3177var _ interface { 3178 Field() string 3179 Reason() string 3180 Key() bool 3181 Cause() error 3182 ErrorName() string 3183} = RouteAction_UpgradeConfigValidationError{} 3184 3185var _RouteAction_UpgradeConfig_UpgradeType_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 3186 3187// Validate checks the field values on RouteAction_HashPolicy_Header with the 3188// rules defined in the proto definition for this message. If any rules are 3189// violated, an error is returned. 3190func (m *RouteAction_HashPolicy_Header) Validate() error { 3191 if m == nil { 3192 return nil 3193 } 3194 3195 if len(m.GetHeaderName()) < 1 { 3196 return RouteAction_HashPolicy_HeaderValidationError{ 3197 field: "HeaderName", 3198 reason: "value length must be at least 1 bytes", 3199 } 3200 } 3201 3202 if !_RouteAction_HashPolicy_Header_HeaderName_Pattern.MatchString(m.GetHeaderName()) { 3203 return RouteAction_HashPolicy_HeaderValidationError{ 3204 field: "HeaderName", 3205 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 3206 } 3207 } 3208 3209 return nil 3210} 3211 3212// RouteAction_HashPolicy_HeaderValidationError is the validation error 3213// returned by RouteAction_HashPolicy_Header.Validate if the designated 3214// constraints aren't met. 3215type RouteAction_HashPolicy_HeaderValidationError struct { 3216 field string 3217 reason string 3218 cause error 3219 key bool 3220} 3221 3222// Field function returns field value. 3223func (e RouteAction_HashPolicy_HeaderValidationError) Field() string { return e.field } 3224 3225// Reason function returns reason value. 3226func (e RouteAction_HashPolicy_HeaderValidationError) Reason() string { return e.reason } 3227 3228// Cause function returns cause value. 3229func (e RouteAction_HashPolicy_HeaderValidationError) Cause() error { return e.cause } 3230 3231// Key function returns key value. 3232func (e RouteAction_HashPolicy_HeaderValidationError) Key() bool { return e.key } 3233 3234// ErrorName returns error name. 3235func (e RouteAction_HashPolicy_HeaderValidationError) ErrorName() string { 3236 return "RouteAction_HashPolicy_HeaderValidationError" 3237} 3238 3239// Error satisfies the builtin error interface 3240func (e RouteAction_HashPolicy_HeaderValidationError) Error() string { 3241 cause := "" 3242 if e.cause != nil { 3243 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3244 } 3245 3246 key := "" 3247 if e.key { 3248 key = "key for " 3249 } 3250 3251 return fmt.Sprintf( 3252 "invalid %sRouteAction_HashPolicy_Header.%s: %s%s", 3253 key, 3254 e.field, 3255 e.reason, 3256 cause) 3257} 3258 3259var _ error = RouteAction_HashPolicy_HeaderValidationError{} 3260 3261var _ interface { 3262 Field() string 3263 Reason() string 3264 Key() bool 3265 Cause() error 3266 ErrorName() string 3267} = RouteAction_HashPolicy_HeaderValidationError{} 3268 3269var _RouteAction_HashPolicy_Header_HeaderName_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 3270 3271// Validate checks the field values on RouteAction_HashPolicy_Cookie with the 3272// rules defined in the proto definition for this message. If any rules are 3273// violated, an error is returned. 3274func (m *RouteAction_HashPolicy_Cookie) Validate() error { 3275 if m == nil { 3276 return nil 3277 } 3278 3279 if len(m.GetName()) < 1 { 3280 return RouteAction_HashPolicy_CookieValidationError{ 3281 field: "Name", 3282 reason: "value length must be at least 1 bytes", 3283 } 3284 } 3285 3286 if v, ok := interface{}(m.GetTtl()).(interface{ Validate() error }); ok { 3287 if err := v.Validate(); err != nil { 3288 return RouteAction_HashPolicy_CookieValidationError{ 3289 field: "Ttl", 3290 reason: "embedded message failed validation", 3291 cause: err, 3292 } 3293 } 3294 } 3295 3296 // no validation rules for Path 3297 3298 return nil 3299} 3300 3301// RouteAction_HashPolicy_CookieValidationError is the validation error 3302// returned by RouteAction_HashPolicy_Cookie.Validate if the designated 3303// constraints aren't met. 3304type RouteAction_HashPolicy_CookieValidationError struct { 3305 field string 3306 reason string 3307 cause error 3308 key bool 3309} 3310 3311// Field function returns field value. 3312func (e RouteAction_HashPolicy_CookieValidationError) Field() string { return e.field } 3313 3314// Reason function returns reason value. 3315func (e RouteAction_HashPolicy_CookieValidationError) Reason() string { return e.reason } 3316 3317// Cause function returns cause value. 3318func (e RouteAction_HashPolicy_CookieValidationError) Cause() error { return e.cause } 3319 3320// Key function returns key value. 3321func (e RouteAction_HashPolicy_CookieValidationError) Key() bool { return e.key } 3322 3323// ErrorName returns error name. 3324func (e RouteAction_HashPolicy_CookieValidationError) ErrorName() string { 3325 return "RouteAction_HashPolicy_CookieValidationError" 3326} 3327 3328// Error satisfies the builtin error interface 3329func (e RouteAction_HashPolicy_CookieValidationError) Error() string { 3330 cause := "" 3331 if e.cause != nil { 3332 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3333 } 3334 3335 key := "" 3336 if e.key { 3337 key = "key for " 3338 } 3339 3340 return fmt.Sprintf( 3341 "invalid %sRouteAction_HashPolicy_Cookie.%s: %s%s", 3342 key, 3343 e.field, 3344 e.reason, 3345 cause) 3346} 3347 3348var _ error = RouteAction_HashPolicy_CookieValidationError{} 3349 3350var _ interface { 3351 Field() string 3352 Reason() string 3353 Key() bool 3354 Cause() error 3355 ErrorName() string 3356} = RouteAction_HashPolicy_CookieValidationError{} 3357 3358// Validate checks the field values on 3359// RouteAction_HashPolicy_ConnectionProperties with the rules defined in the 3360// proto definition for this message. If any rules are violated, an error is returned. 3361func (m *RouteAction_HashPolicy_ConnectionProperties) Validate() error { 3362 if m == nil { 3363 return nil 3364 } 3365 3366 // no validation rules for SourceIp 3367 3368 return nil 3369} 3370 3371// RouteAction_HashPolicy_ConnectionPropertiesValidationError is the validation 3372// error returned by RouteAction_HashPolicy_ConnectionProperties.Validate if 3373// the designated constraints aren't met. 3374type RouteAction_HashPolicy_ConnectionPropertiesValidationError struct { 3375 field string 3376 reason string 3377 cause error 3378 key bool 3379} 3380 3381// Field function returns field value. 3382func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Field() string { return e.field } 3383 3384// Reason function returns reason value. 3385func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Reason() string { return e.reason } 3386 3387// Cause function returns cause value. 3388func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Cause() error { return e.cause } 3389 3390// Key function returns key value. 3391func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Key() bool { return e.key } 3392 3393// ErrorName returns error name. 3394func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) ErrorName() string { 3395 return "RouteAction_HashPolicy_ConnectionPropertiesValidationError" 3396} 3397 3398// Error satisfies the builtin error interface 3399func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Error() string { 3400 cause := "" 3401 if e.cause != nil { 3402 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3403 } 3404 3405 key := "" 3406 if e.key { 3407 key = "key for " 3408 } 3409 3410 return fmt.Sprintf( 3411 "invalid %sRouteAction_HashPolicy_ConnectionProperties.%s: %s%s", 3412 key, 3413 e.field, 3414 e.reason, 3415 cause) 3416} 3417 3418var _ error = RouteAction_HashPolicy_ConnectionPropertiesValidationError{} 3419 3420var _ interface { 3421 Field() string 3422 Reason() string 3423 Key() bool 3424 Cause() error 3425 ErrorName() string 3426} = RouteAction_HashPolicy_ConnectionPropertiesValidationError{} 3427 3428// Validate checks the field values on RouteAction_HashPolicy_QueryParameter 3429// with the rules defined in the proto definition for this message. If any 3430// rules are violated, an error is returned. 3431func (m *RouteAction_HashPolicy_QueryParameter) Validate() error { 3432 if m == nil { 3433 return nil 3434 } 3435 3436 if len(m.GetName()) < 1 { 3437 return RouteAction_HashPolicy_QueryParameterValidationError{ 3438 field: "Name", 3439 reason: "value length must be at least 1 bytes", 3440 } 3441 } 3442 3443 return nil 3444} 3445 3446// RouteAction_HashPolicy_QueryParameterValidationError is the validation error 3447// returned by RouteAction_HashPolicy_QueryParameter.Validate if the 3448// designated constraints aren't met. 3449type RouteAction_HashPolicy_QueryParameterValidationError struct { 3450 field string 3451 reason string 3452 cause error 3453 key bool 3454} 3455 3456// Field function returns field value. 3457func (e RouteAction_HashPolicy_QueryParameterValidationError) Field() string { return e.field } 3458 3459// Reason function returns reason value. 3460func (e RouteAction_HashPolicy_QueryParameterValidationError) Reason() string { return e.reason } 3461 3462// Cause function returns cause value. 3463func (e RouteAction_HashPolicy_QueryParameterValidationError) Cause() error { return e.cause } 3464 3465// Key function returns key value. 3466func (e RouteAction_HashPolicy_QueryParameterValidationError) Key() bool { return e.key } 3467 3468// ErrorName returns error name. 3469func (e RouteAction_HashPolicy_QueryParameterValidationError) ErrorName() string { 3470 return "RouteAction_HashPolicy_QueryParameterValidationError" 3471} 3472 3473// Error satisfies the builtin error interface 3474func (e RouteAction_HashPolicy_QueryParameterValidationError) Error() string { 3475 cause := "" 3476 if e.cause != nil { 3477 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3478 } 3479 3480 key := "" 3481 if e.key { 3482 key = "key for " 3483 } 3484 3485 return fmt.Sprintf( 3486 "invalid %sRouteAction_HashPolicy_QueryParameter.%s: %s%s", 3487 key, 3488 e.field, 3489 e.reason, 3490 cause) 3491} 3492 3493var _ error = RouteAction_HashPolicy_QueryParameterValidationError{} 3494 3495var _ interface { 3496 Field() string 3497 Reason() string 3498 Key() bool 3499 Cause() error 3500 ErrorName() string 3501} = RouteAction_HashPolicy_QueryParameterValidationError{} 3502 3503// Validate checks the field values on RouteAction_HashPolicy_FilterState with 3504// the rules defined in the proto definition for this message. If any rules 3505// are violated, an error is returned. 3506func (m *RouteAction_HashPolicy_FilterState) Validate() error { 3507 if m == nil { 3508 return nil 3509 } 3510 3511 if len(m.GetKey()) < 1 { 3512 return RouteAction_HashPolicy_FilterStateValidationError{ 3513 field: "Key", 3514 reason: "value length must be at least 1 bytes", 3515 } 3516 } 3517 3518 return nil 3519} 3520 3521// RouteAction_HashPolicy_FilterStateValidationError is the validation error 3522// returned by RouteAction_HashPolicy_FilterState.Validate if the designated 3523// constraints aren't met. 3524type RouteAction_HashPolicy_FilterStateValidationError struct { 3525 field string 3526 reason string 3527 cause error 3528 key bool 3529} 3530 3531// Field function returns field value. 3532func (e RouteAction_HashPolicy_FilterStateValidationError) Field() string { return e.field } 3533 3534// Reason function returns reason value. 3535func (e RouteAction_HashPolicy_FilterStateValidationError) Reason() string { return e.reason } 3536 3537// Cause function returns cause value. 3538func (e RouteAction_HashPolicy_FilterStateValidationError) Cause() error { return e.cause } 3539 3540// Key function returns key value. 3541func (e RouteAction_HashPolicy_FilterStateValidationError) Key() bool { return e.key } 3542 3543// ErrorName returns error name. 3544func (e RouteAction_HashPolicy_FilterStateValidationError) ErrorName() string { 3545 return "RouteAction_HashPolicy_FilterStateValidationError" 3546} 3547 3548// Error satisfies the builtin error interface 3549func (e RouteAction_HashPolicy_FilterStateValidationError) Error() string { 3550 cause := "" 3551 if e.cause != nil { 3552 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3553 } 3554 3555 key := "" 3556 if e.key { 3557 key = "key for " 3558 } 3559 3560 return fmt.Sprintf( 3561 "invalid %sRouteAction_HashPolicy_FilterState.%s: %s%s", 3562 key, 3563 e.field, 3564 e.reason, 3565 cause) 3566} 3567 3568var _ error = RouteAction_HashPolicy_FilterStateValidationError{} 3569 3570var _ interface { 3571 Field() string 3572 Reason() string 3573 Key() bool 3574 Cause() error 3575 ErrorName() string 3576} = RouteAction_HashPolicy_FilterStateValidationError{} 3577 3578// Validate checks the field values on RetryPolicy_RetryPriority with the rules 3579// defined in the proto definition for this message. If any rules are 3580// violated, an error is returned. 3581func (m *RetryPolicy_RetryPriority) Validate() error { 3582 if m == nil { 3583 return nil 3584 } 3585 3586 if len(m.GetName()) < 1 { 3587 return RetryPolicy_RetryPriorityValidationError{ 3588 field: "Name", 3589 reason: "value length must be at least 1 bytes", 3590 } 3591 } 3592 3593 switch m.ConfigType.(type) { 3594 3595 case *RetryPolicy_RetryPriority_Config: 3596 3597 if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { 3598 if err := v.Validate(); err != nil { 3599 return RetryPolicy_RetryPriorityValidationError{ 3600 field: "Config", 3601 reason: "embedded message failed validation", 3602 cause: err, 3603 } 3604 } 3605 } 3606 3607 case *RetryPolicy_RetryPriority_TypedConfig: 3608 3609 if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { 3610 if err := v.Validate(); err != nil { 3611 return RetryPolicy_RetryPriorityValidationError{ 3612 field: "TypedConfig", 3613 reason: "embedded message failed validation", 3614 cause: err, 3615 } 3616 } 3617 } 3618 3619 } 3620 3621 return nil 3622} 3623 3624// RetryPolicy_RetryPriorityValidationError is the validation error returned by 3625// RetryPolicy_RetryPriority.Validate if the designated constraints aren't met. 3626type RetryPolicy_RetryPriorityValidationError struct { 3627 field string 3628 reason string 3629 cause error 3630 key bool 3631} 3632 3633// Field function returns field value. 3634func (e RetryPolicy_RetryPriorityValidationError) Field() string { return e.field } 3635 3636// Reason function returns reason value. 3637func (e RetryPolicy_RetryPriorityValidationError) Reason() string { return e.reason } 3638 3639// Cause function returns cause value. 3640func (e RetryPolicy_RetryPriorityValidationError) Cause() error { return e.cause } 3641 3642// Key function returns key value. 3643func (e RetryPolicy_RetryPriorityValidationError) Key() bool { return e.key } 3644 3645// ErrorName returns error name. 3646func (e RetryPolicy_RetryPriorityValidationError) ErrorName() string { 3647 return "RetryPolicy_RetryPriorityValidationError" 3648} 3649 3650// Error satisfies the builtin error interface 3651func (e RetryPolicy_RetryPriorityValidationError) Error() string { 3652 cause := "" 3653 if e.cause != nil { 3654 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3655 } 3656 3657 key := "" 3658 if e.key { 3659 key = "key for " 3660 } 3661 3662 return fmt.Sprintf( 3663 "invalid %sRetryPolicy_RetryPriority.%s: %s%s", 3664 key, 3665 e.field, 3666 e.reason, 3667 cause) 3668} 3669 3670var _ error = RetryPolicy_RetryPriorityValidationError{} 3671 3672var _ interface { 3673 Field() string 3674 Reason() string 3675 Key() bool 3676 Cause() error 3677 ErrorName() string 3678} = RetryPolicy_RetryPriorityValidationError{} 3679 3680// Validate checks the field values on RetryPolicy_RetryHostPredicate with the 3681// rules defined in the proto definition for this message. If any rules are 3682// violated, an error is returned. 3683func (m *RetryPolicy_RetryHostPredicate) Validate() error { 3684 if m == nil { 3685 return nil 3686 } 3687 3688 if len(m.GetName()) < 1 { 3689 return RetryPolicy_RetryHostPredicateValidationError{ 3690 field: "Name", 3691 reason: "value length must be at least 1 bytes", 3692 } 3693 } 3694 3695 switch m.ConfigType.(type) { 3696 3697 case *RetryPolicy_RetryHostPredicate_Config: 3698 3699 if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { 3700 if err := v.Validate(); err != nil { 3701 return RetryPolicy_RetryHostPredicateValidationError{ 3702 field: "Config", 3703 reason: "embedded message failed validation", 3704 cause: err, 3705 } 3706 } 3707 } 3708 3709 case *RetryPolicy_RetryHostPredicate_TypedConfig: 3710 3711 if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { 3712 if err := v.Validate(); err != nil { 3713 return RetryPolicy_RetryHostPredicateValidationError{ 3714 field: "TypedConfig", 3715 reason: "embedded message failed validation", 3716 cause: err, 3717 } 3718 } 3719 } 3720 3721 } 3722 3723 return nil 3724} 3725 3726// RetryPolicy_RetryHostPredicateValidationError is the validation error 3727// returned by RetryPolicy_RetryHostPredicate.Validate if the designated 3728// constraints aren't met. 3729type RetryPolicy_RetryHostPredicateValidationError struct { 3730 field string 3731 reason string 3732 cause error 3733 key bool 3734} 3735 3736// Field function returns field value. 3737func (e RetryPolicy_RetryHostPredicateValidationError) Field() string { return e.field } 3738 3739// Reason function returns reason value. 3740func (e RetryPolicy_RetryHostPredicateValidationError) Reason() string { return e.reason } 3741 3742// Cause function returns cause value. 3743func (e RetryPolicy_RetryHostPredicateValidationError) Cause() error { return e.cause } 3744 3745// Key function returns key value. 3746func (e RetryPolicy_RetryHostPredicateValidationError) Key() bool { return e.key } 3747 3748// ErrorName returns error name. 3749func (e RetryPolicy_RetryHostPredicateValidationError) ErrorName() string { 3750 return "RetryPolicy_RetryHostPredicateValidationError" 3751} 3752 3753// Error satisfies the builtin error interface 3754func (e RetryPolicy_RetryHostPredicateValidationError) Error() string { 3755 cause := "" 3756 if e.cause != nil { 3757 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3758 } 3759 3760 key := "" 3761 if e.key { 3762 key = "key for " 3763 } 3764 3765 return fmt.Sprintf( 3766 "invalid %sRetryPolicy_RetryHostPredicate.%s: %s%s", 3767 key, 3768 e.field, 3769 e.reason, 3770 cause) 3771} 3772 3773var _ error = RetryPolicy_RetryHostPredicateValidationError{} 3774 3775var _ interface { 3776 Field() string 3777 Reason() string 3778 Key() bool 3779 Cause() error 3780 ErrorName() string 3781} = RetryPolicy_RetryHostPredicateValidationError{} 3782 3783// Validate checks the field values on RetryPolicy_RetryBackOff with the rules 3784// defined in the proto definition for this message. If any rules are 3785// violated, an error is returned. 3786func (m *RetryPolicy_RetryBackOff) Validate() error { 3787 if m == nil { 3788 return nil 3789 } 3790 3791 if m.GetBaseInterval() == nil { 3792 return RetryPolicy_RetryBackOffValidationError{ 3793 field: "BaseInterval", 3794 reason: "value is required", 3795 } 3796 } 3797 3798 if d := m.GetBaseInterval(); d != nil { 3799 dur, err := ptypes.Duration(d) 3800 if err != nil { 3801 return RetryPolicy_RetryBackOffValidationError{ 3802 field: "BaseInterval", 3803 reason: "value is not a valid duration", 3804 cause: err, 3805 } 3806 } 3807 3808 gt := time.Duration(0*time.Second + 0*time.Nanosecond) 3809 3810 if dur <= gt { 3811 return RetryPolicy_RetryBackOffValidationError{ 3812 field: "BaseInterval", 3813 reason: "value must be greater than 0s", 3814 } 3815 } 3816 3817 } 3818 3819 if d := m.GetMaxInterval(); d != nil { 3820 dur, err := ptypes.Duration(d) 3821 if err != nil { 3822 return RetryPolicy_RetryBackOffValidationError{ 3823 field: "MaxInterval", 3824 reason: "value is not a valid duration", 3825 cause: err, 3826 } 3827 } 3828 3829 gt := time.Duration(0*time.Second + 0*time.Nanosecond) 3830 3831 if dur <= gt { 3832 return RetryPolicy_RetryBackOffValidationError{ 3833 field: "MaxInterval", 3834 reason: "value must be greater than 0s", 3835 } 3836 } 3837 3838 } 3839 3840 return nil 3841} 3842 3843// RetryPolicy_RetryBackOffValidationError is the validation error returned by 3844// RetryPolicy_RetryBackOff.Validate if the designated constraints aren't met. 3845type RetryPolicy_RetryBackOffValidationError struct { 3846 field string 3847 reason string 3848 cause error 3849 key bool 3850} 3851 3852// Field function returns field value. 3853func (e RetryPolicy_RetryBackOffValidationError) Field() string { return e.field } 3854 3855// Reason function returns reason value. 3856func (e RetryPolicy_RetryBackOffValidationError) Reason() string { return e.reason } 3857 3858// Cause function returns cause value. 3859func (e RetryPolicy_RetryBackOffValidationError) Cause() error { return e.cause } 3860 3861// Key function returns key value. 3862func (e RetryPolicy_RetryBackOffValidationError) Key() bool { return e.key } 3863 3864// ErrorName returns error name. 3865func (e RetryPolicy_RetryBackOffValidationError) ErrorName() string { 3866 return "RetryPolicy_RetryBackOffValidationError" 3867} 3868 3869// Error satisfies the builtin error interface 3870func (e RetryPolicy_RetryBackOffValidationError) Error() string { 3871 cause := "" 3872 if e.cause != nil { 3873 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3874 } 3875 3876 key := "" 3877 if e.key { 3878 key = "key for " 3879 } 3880 3881 return fmt.Sprintf( 3882 "invalid %sRetryPolicy_RetryBackOff.%s: %s%s", 3883 key, 3884 e.field, 3885 e.reason, 3886 cause) 3887} 3888 3889var _ error = RetryPolicy_RetryBackOffValidationError{} 3890 3891var _ interface { 3892 Field() string 3893 Reason() string 3894 Key() bool 3895 Cause() error 3896 ErrorName() string 3897} = RetryPolicy_RetryBackOffValidationError{} 3898 3899// Validate checks the field values on RateLimit_Action with the rules defined 3900// in the proto definition for this message. If any rules are violated, an 3901// error is returned. 3902func (m *RateLimit_Action) Validate() error { 3903 if m == nil { 3904 return nil 3905 } 3906 3907 switch m.ActionSpecifier.(type) { 3908 3909 case *RateLimit_Action_SourceCluster_: 3910 3911 if v, ok := interface{}(m.GetSourceCluster()).(interface{ Validate() error }); ok { 3912 if err := v.Validate(); err != nil { 3913 return RateLimit_ActionValidationError{ 3914 field: "SourceCluster", 3915 reason: "embedded message failed validation", 3916 cause: err, 3917 } 3918 } 3919 } 3920 3921 case *RateLimit_Action_DestinationCluster_: 3922 3923 if v, ok := interface{}(m.GetDestinationCluster()).(interface{ Validate() error }); ok { 3924 if err := v.Validate(); err != nil { 3925 return RateLimit_ActionValidationError{ 3926 field: "DestinationCluster", 3927 reason: "embedded message failed validation", 3928 cause: err, 3929 } 3930 } 3931 } 3932 3933 case *RateLimit_Action_RequestHeaders_: 3934 3935 if v, ok := interface{}(m.GetRequestHeaders()).(interface{ Validate() error }); ok { 3936 if err := v.Validate(); err != nil { 3937 return RateLimit_ActionValidationError{ 3938 field: "RequestHeaders", 3939 reason: "embedded message failed validation", 3940 cause: err, 3941 } 3942 } 3943 } 3944 3945 case *RateLimit_Action_RemoteAddress_: 3946 3947 if v, ok := interface{}(m.GetRemoteAddress()).(interface{ Validate() error }); ok { 3948 if err := v.Validate(); err != nil { 3949 return RateLimit_ActionValidationError{ 3950 field: "RemoteAddress", 3951 reason: "embedded message failed validation", 3952 cause: err, 3953 } 3954 } 3955 } 3956 3957 case *RateLimit_Action_GenericKey_: 3958 3959 if v, ok := interface{}(m.GetGenericKey()).(interface{ Validate() error }); ok { 3960 if err := v.Validate(); err != nil { 3961 return RateLimit_ActionValidationError{ 3962 field: "GenericKey", 3963 reason: "embedded message failed validation", 3964 cause: err, 3965 } 3966 } 3967 } 3968 3969 case *RateLimit_Action_HeaderValueMatch_: 3970 3971 if v, ok := interface{}(m.GetHeaderValueMatch()).(interface{ Validate() error }); ok { 3972 if err := v.Validate(); err != nil { 3973 return RateLimit_ActionValidationError{ 3974 field: "HeaderValueMatch", 3975 reason: "embedded message failed validation", 3976 cause: err, 3977 } 3978 } 3979 } 3980 3981 default: 3982 return RateLimit_ActionValidationError{ 3983 field: "ActionSpecifier", 3984 reason: "value is required", 3985 } 3986 3987 } 3988 3989 return nil 3990} 3991 3992// RateLimit_ActionValidationError is the validation error returned by 3993// RateLimit_Action.Validate if the designated constraints aren't met. 3994type RateLimit_ActionValidationError struct { 3995 field string 3996 reason string 3997 cause error 3998 key bool 3999} 4000 4001// Field function returns field value. 4002func (e RateLimit_ActionValidationError) Field() string { return e.field } 4003 4004// Reason function returns reason value. 4005func (e RateLimit_ActionValidationError) Reason() string { return e.reason } 4006 4007// Cause function returns cause value. 4008func (e RateLimit_ActionValidationError) Cause() error { return e.cause } 4009 4010// Key function returns key value. 4011func (e RateLimit_ActionValidationError) Key() bool { return e.key } 4012 4013// ErrorName returns error name. 4014func (e RateLimit_ActionValidationError) ErrorName() string { return "RateLimit_ActionValidationError" } 4015 4016// Error satisfies the builtin error interface 4017func (e RateLimit_ActionValidationError) Error() string { 4018 cause := "" 4019 if e.cause != nil { 4020 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4021 } 4022 4023 key := "" 4024 if e.key { 4025 key = "key for " 4026 } 4027 4028 return fmt.Sprintf( 4029 "invalid %sRateLimit_Action.%s: %s%s", 4030 key, 4031 e.field, 4032 e.reason, 4033 cause) 4034} 4035 4036var _ error = RateLimit_ActionValidationError{} 4037 4038var _ interface { 4039 Field() string 4040 Reason() string 4041 Key() bool 4042 Cause() error 4043 ErrorName() string 4044} = RateLimit_ActionValidationError{} 4045 4046// Validate checks the field values on RateLimit_Action_SourceCluster with the 4047// rules defined in the proto definition for this message. If any rules are 4048// violated, an error is returned. 4049func (m *RateLimit_Action_SourceCluster) Validate() error { 4050 if m == nil { 4051 return nil 4052 } 4053 4054 return nil 4055} 4056 4057// RateLimit_Action_SourceClusterValidationError is the validation error 4058// returned by RateLimit_Action_SourceCluster.Validate if the designated 4059// constraints aren't met. 4060type RateLimit_Action_SourceClusterValidationError struct { 4061 field string 4062 reason string 4063 cause error 4064 key bool 4065} 4066 4067// Field function returns field value. 4068func (e RateLimit_Action_SourceClusterValidationError) Field() string { return e.field } 4069 4070// Reason function returns reason value. 4071func (e RateLimit_Action_SourceClusterValidationError) Reason() string { return e.reason } 4072 4073// Cause function returns cause value. 4074func (e RateLimit_Action_SourceClusterValidationError) Cause() error { return e.cause } 4075 4076// Key function returns key value. 4077func (e RateLimit_Action_SourceClusterValidationError) Key() bool { return e.key } 4078 4079// ErrorName returns error name. 4080func (e RateLimit_Action_SourceClusterValidationError) ErrorName() string { 4081 return "RateLimit_Action_SourceClusterValidationError" 4082} 4083 4084// Error satisfies the builtin error interface 4085func (e RateLimit_Action_SourceClusterValidationError) Error() string { 4086 cause := "" 4087 if e.cause != nil { 4088 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4089 } 4090 4091 key := "" 4092 if e.key { 4093 key = "key for " 4094 } 4095 4096 return fmt.Sprintf( 4097 "invalid %sRateLimit_Action_SourceCluster.%s: %s%s", 4098 key, 4099 e.field, 4100 e.reason, 4101 cause) 4102} 4103 4104var _ error = RateLimit_Action_SourceClusterValidationError{} 4105 4106var _ interface { 4107 Field() string 4108 Reason() string 4109 Key() bool 4110 Cause() error 4111 ErrorName() string 4112} = RateLimit_Action_SourceClusterValidationError{} 4113 4114// Validate checks the field values on RateLimit_Action_DestinationCluster with 4115// the rules defined in the proto definition for this message. If any rules 4116// are violated, an error is returned. 4117func (m *RateLimit_Action_DestinationCluster) Validate() error { 4118 if m == nil { 4119 return nil 4120 } 4121 4122 return nil 4123} 4124 4125// RateLimit_Action_DestinationClusterValidationError is the validation error 4126// returned by RateLimit_Action_DestinationCluster.Validate if the designated 4127// constraints aren't met. 4128type RateLimit_Action_DestinationClusterValidationError struct { 4129 field string 4130 reason string 4131 cause error 4132 key bool 4133} 4134 4135// Field function returns field value. 4136func (e RateLimit_Action_DestinationClusterValidationError) Field() string { return e.field } 4137 4138// Reason function returns reason value. 4139func (e RateLimit_Action_DestinationClusterValidationError) Reason() string { return e.reason } 4140 4141// Cause function returns cause value. 4142func (e RateLimit_Action_DestinationClusterValidationError) Cause() error { return e.cause } 4143 4144// Key function returns key value. 4145func (e RateLimit_Action_DestinationClusterValidationError) Key() bool { return e.key } 4146 4147// ErrorName returns error name. 4148func (e RateLimit_Action_DestinationClusterValidationError) ErrorName() string { 4149 return "RateLimit_Action_DestinationClusterValidationError" 4150} 4151 4152// Error satisfies the builtin error interface 4153func (e RateLimit_Action_DestinationClusterValidationError) Error() string { 4154 cause := "" 4155 if e.cause != nil { 4156 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4157 } 4158 4159 key := "" 4160 if e.key { 4161 key = "key for " 4162 } 4163 4164 return fmt.Sprintf( 4165 "invalid %sRateLimit_Action_DestinationCluster.%s: %s%s", 4166 key, 4167 e.field, 4168 e.reason, 4169 cause) 4170} 4171 4172var _ error = RateLimit_Action_DestinationClusterValidationError{} 4173 4174var _ interface { 4175 Field() string 4176 Reason() string 4177 Key() bool 4178 Cause() error 4179 ErrorName() string 4180} = RateLimit_Action_DestinationClusterValidationError{} 4181 4182// Validate checks the field values on RateLimit_Action_RequestHeaders with the 4183// rules defined in the proto definition for this message. If any rules are 4184// violated, an error is returned. 4185func (m *RateLimit_Action_RequestHeaders) Validate() error { 4186 if m == nil { 4187 return nil 4188 } 4189 4190 if len(m.GetHeaderName()) < 1 { 4191 return RateLimit_Action_RequestHeadersValidationError{ 4192 field: "HeaderName", 4193 reason: "value length must be at least 1 bytes", 4194 } 4195 } 4196 4197 if !_RateLimit_Action_RequestHeaders_HeaderName_Pattern.MatchString(m.GetHeaderName()) { 4198 return RateLimit_Action_RequestHeadersValidationError{ 4199 field: "HeaderName", 4200 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 4201 } 4202 } 4203 4204 if len(m.GetDescriptorKey()) < 1 { 4205 return RateLimit_Action_RequestHeadersValidationError{ 4206 field: "DescriptorKey", 4207 reason: "value length must be at least 1 bytes", 4208 } 4209 } 4210 4211 return nil 4212} 4213 4214// RateLimit_Action_RequestHeadersValidationError is the validation error 4215// returned by RateLimit_Action_RequestHeaders.Validate if the designated 4216// constraints aren't met. 4217type RateLimit_Action_RequestHeadersValidationError struct { 4218 field string 4219 reason string 4220 cause error 4221 key bool 4222} 4223 4224// Field function returns field value. 4225func (e RateLimit_Action_RequestHeadersValidationError) Field() string { return e.field } 4226 4227// Reason function returns reason value. 4228func (e RateLimit_Action_RequestHeadersValidationError) Reason() string { return e.reason } 4229 4230// Cause function returns cause value. 4231func (e RateLimit_Action_RequestHeadersValidationError) Cause() error { return e.cause } 4232 4233// Key function returns key value. 4234func (e RateLimit_Action_RequestHeadersValidationError) Key() bool { return e.key } 4235 4236// ErrorName returns error name. 4237func (e RateLimit_Action_RequestHeadersValidationError) ErrorName() string { 4238 return "RateLimit_Action_RequestHeadersValidationError" 4239} 4240 4241// Error satisfies the builtin error interface 4242func (e RateLimit_Action_RequestHeadersValidationError) Error() string { 4243 cause := "" 4244 if e.cause != nil { 4245 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4246 } 4247 4248 key := "" 4249 if e.key { 4250 key = "key for " 4251 } 4252 4253 return fmt.Sprintf( 4254 "invalid %sRateLimit_Action_RequestHeaders.%s: %s%s", 4255 key, 4256 e.field, 4257 e.reason, 4258 cause) 4259} 4260 4261var _ error = RateLimit_Action_RequestHeadersValidationError{} 4262 4263var _ interface { 4264 Field() string 4265 Reason() string 4266 Key() bool 4267 Cause() error 4268 ErrorName() string 4269} = RateLimit_Action_RequestHeadersValidationError{} 4270 4271var _RateLimit_Action_RequestHeaders_HeaderName_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 4272 4273// Validate checks the field values on RateLimit_Action_RemoteAddress with the 4274// rules defined in the proto definition for this message. If any rules are 4275// violated, an error is returned. 4276func (m *RateLimit_Action_RemoteAddress) Validate() error { 4277 if m == nil { 4278 return nil 4279 } 4280 4281 return nil 4282} 4283 4284// RateLimit_Action_RemoteAddressValidationError is the validation error 4285// returned by RateLimit_Action_RemoteAddress.Validate if the designated 4286// constraints aren't met. 4287type RateLimit_Action_RemoteAddressValidationError struct { 4288 field string 4289 reason string 4290 cause error 4291 key bool 4292} 4293 4294// Field function returns field value. 4295func (e RateLimit_Action_RemoteAddressValidationError) Field() string { return e.field } 4296 4297// Reason function returns reason value. 4298func (e RateLimit_Action_RemoteAddressValidationError) Reason() string { return e.reason } 4299 4300// Cause function returns cause value. 4301func (e RateLimit_Action_RemoteAddressValidationError) Cause() error { return e.cause } 4302 4303// Key function returns key value. 4304func (e RateLimit_Action_RemoteAddressValidationError) Key() bool { return e.key } 4305 4306// ErrorName returns error name. 4307func (e RateLimit_Action_RemoteAddressValidationError) ErrorName() string { 4308 return "RateLimit_Action_RemoteAddressValidationError" 4309} 4310 4311// Error satisfies the builtin error interface 4312func (e RateLimit_Action_RemoteAddressValidationError) Error() string { 4313 cause := "" 4314 if e.cause != nil { 4315 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4316 } 4317 4318 key := "" 4319 if e.key { 4320 key = "key for " 4321 } 4322 4323 return fmt.Sprintf( 4324 "invalid %sRateLimit_Action_RemoteAddress.%s: %s%s", 4325 key, 4326 e.field, 4327 e.reason, 4328 cause) 4329} 4330 4331var _ error = RateLimit_Action_RemoteAddressValidationError{} 4332 4333var _ interface { 4334 Field() string 4335 Reason() string 4336 Key() bool 4337 Cause() error 4338 ErrorName() string 4339} = RateLimit_Action_RemoteAddressValidationError{} 4340 4341// Validate checks the field values on RateLimit_Action_GenericKey with the 4342// rules defined in the proto definition for this message. If any rules are 4343// violated, an error is returned. 4344func (m *RateLimit_Action_GenericKey) Validate() error { 4345 if m == nil { 4346 return nil 4347 } 4348 4349 if len(m.GetDescriptorValue()) < 1 { 4350 return RateLimit_Action_GenericKeyValidationError{ 4351 field: "DescriptorValue", 4352 reason: "value length must be at least 1 bytes", 4353 } 4354 } 4355 4356 return nil 4357} 4358 4359// RateLimit_Action_GenericKeyValidationError is the validation error returned 4360// by RateLimit_Action_GenericKey.Validate if the designated constraints 4361// aren't met. 4362type RateLimit_Action_GenericKeyValidationError struct { 4363 field string 4364 reason string 4365 cause error 4366 key bool 4367} 4368 4369// Field function returns field value. 4370func (e RateLimit_Action_GenericKeyValidationError) Field() string { return e.field } 4371 4372// Reason function returns reason value. 4373func (e RateLimit_Action_GenericKeyValidationError) Reason() string { return e.reason } 4374 4375// Cause function returns cause value. 4376func (e RateLimit_Action_GenericKeyValidationError) Cause() error { return e.cause } 4377 4378// Key function returns key value. 4379func (e RateLimit_Action_GenericKeyValidationError) Key() bool { return e.key } 4380 4381// ErrorName returns error name. 4382func (e RateLimit_Action_GenericKeyValidationError) ErrorName() string { 4383 return "RateLimit_Action_GenericKeyValidationError" 4384} 4385 4386// Error satisfies the builtin error interface 4387func (e RateLimit_Action_GenericKeyValidationError) Error() string { 4388 cause := "" 4389 if e.cause != nil { 4390 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4391 } 4392 4393 key := "" 4394 if e.key { 4395 key = "key for " 4396 } 4397 4398 return fmt.Sprintf( 4399 "invalid %sRateLimit_Action_GenericKey.%s: %s%s", 4400 key, 4401 e.field, 4402 e.reason, 4403 cause) 4404} 4405 4406var _ error = RateLimit_Action_GenericKeyValidationError{} 4407 4408var _ interface { 4409 Field() string 4410 Reason() string 4411 Key() bool 4412 Cause() error 4413 ErrorName() string 4414} = RateLimit_Action_GenericKeyValidationError{} 4415 4416// Validate checks the field values on RateLimit_Action_HeaderValueMatch with 4417// the rules defined in the proto definition for this message. If any rules 4418// are violated, an error is returned. 4419func (m *RateLimit_Action_HeaderValueMatch) Validate() error { 4420 if m == nil { 4421 return nil 4422 } 4423 4424 if len(m.GetDescriptorValue()) < 1 { 4425 return RateLimit_Action_HeaderValueMatchValidationError{ 4426 field: "DescriptorValue", 4427 reason: "value length must be at least 1 bytes", 4428 } 4429 } 4430 4431 if v, ok := interface{}(m.GetExpectMatch()).(interface{ Validate() error }); ok { 4432 if err := v.Validate(); err != nil { 4433 return RateLimit_Action_HeaderValueMatchValidationError{ 4434 field: "ExpectMatch", 4435 reason: "embedded message failed validation", 4436 cause: err, 4437 } 4438 } 4439 } 4440 4441 if len(m.GetHeaders()) < 1 { 4442 return RateLimit_Action_HeaderValueMatchValidationError{ 4443 field: "Headers", 4444 reason: "value must contain at least 1 item(s)", 4445 } 4446 } 4447 4448 for idx, item := range m.GetHeaders() { 4449 _, _ = idx, item 4450 4451 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 4452 if err := v.Validate(); err != nil { 4453 return RateLimit_Action_HeaderValueMatchValidationError{ 4454 field: fmt.Sprintf("Headers[%v]", idx), 4455 reason: "embedded message failed validation", 4456 cause: err, 4457 } 4458 } 4459 } 4460 4461 } 4462 4463 return nil 4464} 4465 4466// RateLimit_Action_HeaderValueMatchValidationError is the validation error 4467// returned by RateLimit_Action_HeaderValueMatch.Validate if the designated 4468// constraints aren't met. 4469type RateLimit_Action_HeaderValueMatchValidationError struct { 4470 field string 4471 reason string 4472 cause error 4473 key bool 4474} 4475 4476// Field function returns field value. 4477func (e RateLimit_Action_HeaderValueMatchValidationError) Field() string { return e.field } 4478 4479// Reason function returns reason value. 4480func (e RateLimit_Action_HeaderValueMatchValidationError) Reason() string { return e.reason } 4481 4482// Cause function returns cause value. 4483func (e RateLimit_Action_HeaderValueMatchValidationError) Cause() error { return e.cause } 4484 4485// Key function returns key value. 4486func (e RateLimit_Action_HeaderValueMatchValidationError) Key() bool { return e.key } 4487 4488// ErrorName returns error name. 4489func (e RateLimit_Action_HeaderValueMatchValidationError) ErrorName() string { 4490 return "RateLimit_Action_HeaderValueMatchValidationError" 4491} 4492 4493// Error satisfies the builtin error interface 4494func (e RateLimit_Action_HeaderValueMatchValidationError) Error() string { 4495 cause := "" 4496 if e.cause != nil { 4497 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4498 } 4499 4500 key := "" 4501 if e.key { 4502 key = "key for " 4503 } 4504 4505 return fmt.Sprintf( 4506 "invalid %sRateLimit_Action_HeaderValueMatch.%s: %s%s", 4507 key, 4508 e.field, 4509 e.reason, 4510 cause) 4511} 4512 4513var _ error = RateLimit_Action_HeaderValueMatchValidationError{} 4514 4515var _ interface { 4516 Field() string 4517 Reason() string 4518 Key() bool 4519 Cause() error 4520 ErrorName() string 4521} = RateLimit_Action_HeaderValueMatchValidationError{} 4522