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