audit-go/gen/go/audit/v1/audit_event.pb.validate.go
2024-07-18 14:33:11 +02:00

3005 lines
83 KiB
Go

// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: audit/v1/audit_event.proto
package auditV1
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
"google.golang.org/protobuf/types/known/anypb"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on AuditEvent with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *AuditEvent) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AuditEvent with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in AuditEventMultiError, or
// nil if none found.
func (m *AuditEvent) ValidateAll() error {
return m.validate(true)
}
func (m *AuditEvent) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for LogName
if all {
switch v := interface{}(m.GetResource()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "Resource",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "Resource",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditEventValidationError{
field: "Resource",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetProtoPayload()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "ProtoPayload",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "ProtoPayload",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetProtoPayload()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditEventValidationError{
field: "ProtoPayload",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for InsertId
// no validation rules for Labels
if all {
switch v := interface{}(m.GetOperation()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "Operation",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "Operation",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetOperation()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditEventValidationError{
field: "Operation",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetTimestamp()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "Timestamp",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "Timestamp",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetTimestamp()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditEventValidationError{
field: "Timestamp",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetReceiveTimestamp()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "ReceiveTimestamp",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "ReceiveTimestamp",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetReceiveTimestamp()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditEventValidationError{
field: "ReceiveTimestamp",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for Severity
// no validation rules for Trace
// no validation rules for SpanId
if all {
switch v := interface{}(m.GetSplit()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "Split",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditEventValidationError{
field: "Split",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetSplit()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditEventValidationError{
field: "Split",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return AuditEventMultiError(errors)
}
return nil
}
// AuditEventMultiError is an error wrapping multiple validation errors
// returned by AuditEvent.ValidateAll() if the designated constraints aren't met.
type AuditEventMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AuditEventMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AuditEventMultiError) AllErrors() []error { return m }
// AuditEventValidationError is the validation error returned by
// AuditEvent.Validate if the designated constraints aren't met.
type AuditEventValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AuditEventValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AuditEventValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AuditEventValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AuditEventValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AuditEventValidationError) ErrorName() string { return "AuditEventValidationError" }
// Error satisfies the builtin error interface
func (e AuditEventValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAuditEvent.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AuditEventValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AuditEventValidationError{}
// Validate checks the field values on MonitoredResource with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *MonitoredResource) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on MonitoredResource with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// MonitoredResourceMultiError, or nil if none found.
func (m *MonitoredResource) ValidateAll() error {
return m.validate(true)
}
func (m *MonitoredResource) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Type
// no validation rules for Labels
if len(errors) > 0 {
return MonitoredResourceMultiError(errors)
}
return nil
}
// MonitoredResourceMultiError is an error wrapping multiple validation errors
// returned by MonitoredResource.ValidateAll() if the designated constraints
// aren't met.
type MonitoredResourceMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m MonitoredResourceMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m MonitoredResourceMultiError) AllErrors() []error { return m }
// MonitoredResourceValidationError is the validation error returned by
// MonitoredResource.Validate if the designated constraints aren't met.
type MonitoredResourceValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e MonitoredResourceValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e MonitoredResourceValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e MonitoredResourceValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e MonitoredResourceValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e MonitoredResourceValidationError) ErrorName() string {
return "MonitoredResourceValidationError"
}
// Error satisfies the builtin error interface
func (e MonitoredResourceValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sMonitoredResource.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = MonitoredResourceValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = MonitoredResourceValidationError{}
// Validate checks the field values on LogEntryOperation with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *LogEntryOperation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LogEntryOperation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// LogEntryOperationMultiError, or nil if none found.
func (m *LogEntryOperation) ValidateAll() error {
return m.validate(true)
}
func (m *LogEntryOperation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Id
// no validation rules for Producer
// no validation rules for First
// no validation rules for Last
if len(errors) > 0 {
return LogEntryOperationMultiError(errors)
}
return nil
}
// LogEntryOperationMultiError is an error wrapping multiple validation errors
// returned by LogEntryOperation.ValidateAll() if the designated constraints
// aren't met.
type LogEntryOperationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LogEntryOperationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m LogEntryOperationMultiError) AllErrors() []error { return m }
// LogEntryOperationValidationError is the validation error returned by
// LogEntryOperation.Validate if the designated constraints aren't met.
type LogEntryOperationValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LogEntryOperationValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LogEntryOperationValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LogEntryOperationValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LogEntryOperationValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LogEntryOperationValidationError) ErrorName() string {
return "LogEntryOperationValidationError"
}
// Error satisfies the builtin error interface
func (e LogEntryOperationValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sLogEntryOperation.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LogEntryOperationValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LogEntryOperationValidationError{}
// Validate checks the field values on AuditLog with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *AuditLog) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AuditLog with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in AuditLogMultiError, or nil
// if none found.
func (m *AuditLog) ValidateAll() error {
return m.validate(true)
}
func (m *AuditLog) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for ServiceName
// no validation rules for MethodName
// no validation rules for ResourceName
if all {
switch v := interface{}(m.GetResourceLocation()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "ResourceLocation",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "ResourceLocation",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetResourceLocation()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditLogValidationError{
field: "ResourceLocation",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetResourceOriginalState()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "ResourceOriginalState",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "ResourceOriginalState",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetResourceOriginalState()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditLogValidationError{
field: "ResourceOriginalState",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for NumResponseItems
if all {
switch v := interface{}(m.GetStatus()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "Status",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "Status",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetStatus()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditLogValidationError{
field: "Status",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetAuthenticationInfo()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "AuthenticationInfo",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "AuthenticationInfo",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetAuthenticationInfo()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditLogValidationError{
field: "AuthenticationInfo",
reason: "embedded message failed validation",
cause: err,
}
}
}
for idx, item := range m.GetAuthorizationInfo() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditLogValidationError{
field: fmt.Sprintf("AuthorizationInfo[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditLogValidationError{
field: fmt.Sprintf("AuthorizationInfo[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditLogValidationError{
field: fmt.Sprintf("AuthorizationInfo[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if all {
switch v := interface{}(m.GetRequestMetadata()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "RequestMetadata",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "RequestMetadata",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetRequestMetadata()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditLogValidationError{
field: "RequestMetadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetRequest()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "Request",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "Request",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetRequest()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditLogValidationError{
field: "Request",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetResponse()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "Response",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "Response",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditLogValidationError{
field: "Response",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetMetadata()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditLogValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetServiceData()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "ServiceData",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuditLogValidationError{
field: "ServiceData",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetServiceData()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuditLogValidationError{
field: "ServiceData",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return AuditLogMultiError(errors)
}
return nil
}
// AuditLogMultiError is an error wrapping multiple validation errors returned
// by AuditLog.ValidateAll() if the designated constraints aren't met.
type AuditLogMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AuditLogMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AuditLogMultiError) AllErrors() []error { return m }
// AuditLogValidationError is the validation error returned by
// AuditLog.Validate if the designated constraints aren't met.
type AuditLogValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AuditLogValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AuditLogValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AuditLogValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AuditLogValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AuditLogValidationError) ErrorName() string { return "AuditLogValidationError" }
// Error satisfies the builtin error interface
func (e AuditLogValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAuditLog.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AuditLogValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AuditLogValidationError{}
// Validate checks the field values on AuthenticationInfo with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AuthenticationInfo) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AuthenticationInfo with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AuthenticationInfoMultiError, or nil if none found.
func (m *AuthenticationInfo) ValidateAll() error {
return m.validate(true)
}
func (m *AuthenticationInfo) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for PrincipalEmail
// no validation rules for AuthoritySelector
if all {
switch v := interface{}(m.GetThirdPartyPrincipal()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuthenticationInfoValidationError{
field: "ThirdPartyPrincipal",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuthenticationInfoValidationError{
field: "ThirdPartyPrincipal",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetThirdPartyPrincipal()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuthenticationInfoValidationError{
field: "ThirdPartyPrincipal",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for ServiceAccountKeyName
for idx, item := range m.GetServiceAccountDelegationInfo() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuthenticationInfoValidationError{
field: fmt.Sprintf("ServiceAccountDelegationInfo[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuthenticationInfoValidationError{
field: fmt.Sprintf("ServiceAccountDelegationInfo[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuthenticationInfoValidationError{
field: fmt.Sprintf("ServiceAccountDelegationInfo[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
// no validation rules for PrincipalSubject
if len(errors) > 0 {
return AuthenticationInfoMultiError(errors)
}
return nil
}
// AuthenticationInfoMultiError is an error wrapping multiple validation errors
// returned by AuthenticationInfo.ValidateAll() if the designated constraints
// aren't met.
type AuthenticationInfoMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AuthenticationInfoMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AuthenticationInfoMultiError) AllErrors() []error { return m }
// AuthenticationInfoValidationError is the validation error returned by
// AuthenticationInfo.Validate if the designated constraints aren't met.
type AuthenticationInfoValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AuthenticationInfoValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AuthenticationInfoValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AuthenticationInfoValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AuthenticationInfoValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AuthenticationInfoValidationError) ErrorName() string {
return "AuthenticationInfoValidationError"
}
// Error satisfies the builtin error interface
func (e AuthenticationInfoValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAuthenticationInfo.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AuthenticationInfoValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AuthenticationInfoValidationError{}
// Validate checks the field values on AuthorizationInfo with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *AuthorizationInfo) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AuthorizationInfo with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AuthorizationInfoMultiError, or nil if none found.
func (m *AuthorizationInfo) ValidateAll() error {
return m.validate(true)
}
func (m *AuthorizationInfo) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Resource
// no validation rules for Permission
// no validation rules for Granted
if all {
switch v := interface{}(m.GetResourceAttributes()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AuthorizationInfoValidationError{
field: "ResourceAttributes",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AuthorizationInfoValidationError{
field: "ResourceAttributes",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetResourceAttributes()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AuthorizationInfoValidationError{
field: "ResourceAttributes",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return AuthorizationInfoMultiError(errors)
}
return nil
}
// AuthorizationInfoMultiError is an error wrapping multiple validation errors
// returned by AuthorizationInfo.ValidateAll() if the designated constraints
// aren't met.
type AuthorizationInfoMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AuthorizationInfoMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AuthorizationInfoMultiError) AllErrors() []error { return m }
// AuthorizationInfoValidationError is the validation error returned by
// AuthorizationInfo.Validate if the designated constraints aren't met.
type AuthorizationInfoValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AuthorizationInfoValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AuthorizationInfoValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AuthorizationInfoValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AuthorizationInfoValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AuthorizationInfoValidationError) ErrorName() string {
return "AuthorizationInfoValidationError"
}
// Error satisfies the builtin error interface
func (e AuthorizationInfoValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAuthorizationInfo.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AuthorizationInfoValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AuthorizationInfoValidationError{}
// Validate checks the field values on AttributeContext with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *AttributeContext) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AttributeContext with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AttributeContextMultiError, or nil if none found.
func (m *AttributeContext) ValidateAll() error {
return m.validate(true)
}
func (m *AttributeContext) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return AttributeContextMultiError(errors)
}
return nil
}
// AttributeContextMultiError is an error wrapping multiple validation errors
// returned by AttributeContext.ValidateAll() if the designated constraints
// aren't met.
type AttributeContextMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AttributeContextMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AttributeContextMultiError) AllErrors() []error { return m }
// AttributeContextValidationError is the validation error returned by
// AttributeContext.Validate if the designated constraints aren't met.
type AttributeContextValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AttributeContextValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AttributeContextValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AttributeContextValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AttributeContextValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AttributeContextValidationError) ErrorName() string { return "AttributeContextValidationError" }
// Error satisfies the builtin error interface
func (e AttributeContextValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAttributeContext.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AttributeContextValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AttributeContextValidationError{}
// Validate checks the field values on RequestMetadata with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *RequestMetadata) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on RequestMetadata with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// RequestMetadataMultiError, or nil if none found.
func (m *RequestMetadata) ValidateAll() error {
return m.validate(true)
}
func (m *RequestMetadata) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for CallerIp
// no validation rules for CallerSuppliedUserAgent
// no validation rules for CallerNetwork
if all {
switch v := interface{}(m.GetRequestAttributes()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, RequestMetadataValidationError{
field: "RequestAttributes",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, RequestMetadataValidationError{
field: "RequestAttributes",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetRequestAttributes()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RequestMetadataValidationError{
field: "RequestAttributes",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetDestinationAttributes()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, RequestMetadataValidationError{
field: "DestinationAttributes",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, RequestMetadataValidationError{
field: "DestinationAttributes",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetDestinationAttributes()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RequestMetadataValidationError{
field: "DestinationAttributes",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return RequestMetadataMultiError(errors)
}
return nil
}
// RequestMetadataMultiError is an error wrapping multiple validation errors
// returned by RequestMetadata.ValidateAll() if the designated constraints
// aren't met.
type RequestMetadataMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m RequestMetadataMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m RequestMetadataMultiError) AllErrors() []error { return m }
// RequestMetadataValidationError is the validation error returned by
// RequestMetadata.Validate if the designated constraints aren't met.
type RequestMetadataValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RequestMetadataValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RequestMetadataValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RequestMetadataValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RequestMetadataValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RequestMetadataValidationError) ErrorName() string { return "RequestMetadataValidationError" }
// Error satisfies the builtin error interface
func (e RequestMetadataValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sRequestMetadata.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RequestMetadataValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RequestMetadataValidationError{}
// Validate checks the field values on ResourceLocation with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *ResourceLocation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ResourceLocation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// ResourceLocationMultiError, or nil if none found.
func (m *ResourceLocation) ValidateAll() error {
return m.validate(true)
}
func (m *ResourceLocation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return ResourceLocationMultiError(errors)
}
return nil
}
// ResourceLocationMultiError is an error wrapping multiple validation errors
// returned by ResourceLocation.ValidateAll() if the designated constraints
// aren't met.
type ResourceLocationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ResourceLocationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ResourceLocationMultiError) AllErrors() []error { return m }
// ResourceLocationValidationError is the validation error returned by
// ResourceLocation.Validate if the designated constraints aren't met.
type ResourceLocationValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ResourceLocationValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ResourceLocationValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ResourceLocationValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ResourceLocationValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ResourceLocationValidationError) ErrorName() string { return "ResourceLocationValidationError" }
// Error satisfies the builtin error interface
func (e ResourceLocationValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sResourceLocation.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ResourceLocationValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ResourceLocationValidationError{}
// Validate checks the field values on RpcStatus with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *RpcStatus) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on RpcStatus with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in RpcStatusMultiError, or nil
// if none found.
func (m *RpcStatus) ValidateAll() error {
return m.validate(true)
}
func (m *RpcStatus) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Code
// no validation rules for Message
for idx, item := range m.GetDetails() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, RpcStatusValidationError{
field: fmt.Sprintf("Details[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, RpcStatusValidationError{
field: fmt.Sprintf("Details[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RpcStatusValidationError{
field: fmt.Sprintf("Details[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return RpcStatusMultiError(errors)
}
return nil
}
// RpcStatusMultiError is an error wrapping multiple validation errors returned
// by RpcStatus.ValidateAll() if the designated constraints aren't met.
type RpcStatusMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m RpcStatusMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m RpcStatusMultiError) AllErrors() []error { return m }
// RpcStatusValidationError is the validation error returned by
// RpcStatus.Validate if the designated constraints aren't met.
type RpcStatusValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RpcStatusValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RpcStatusValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RpcStatusValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RpcStatusValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RpcStatusValidationError) ErrorName() string { return "RpcStatusValidationError" }
// Error satisfies the builtin error interface
func (e RpcStatusValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sRpcStatus.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RpcStatusValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RpcStatusValidationError{}
// Validate checks the field values on ServiceAccountDelegationInfo with the
// rules defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *ServiceAccountDelegationInfo) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ServiceAccountDelegationInfo with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// ServiceAccountDelegationInfoMultiError, or nil if none found.
func (m *ServiceAccountDelegationInfo) ValidateAll() error {
return m.validate(true)
}
func (m *ServiceAccountDelegationInfo) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
switch v := m.Authority.(type) {
case *ServiceAccountDelegationInfo_FirstPartyPrincipal_:
if v == nil {
err := ServiceAccountDelegationInfoValidationError{
field: "Authority",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetFirstPartyPrincipal()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ServiceAccountDelegationInfoValidationError{
field: "FirstPartyPrincipal",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ServiceAccountDelegationInfoValidationError{
field: "FirstPartyPrincipal",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetFirstPartyPrincipal()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ServiceAccountDelegationInfoValidationError{
field: "FirstPartyPrincipal",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *ServiceAccountDelegationInfo_ThirdPartyPrincipal_:
if v == nil {
err := ServiceAccountDelegationInfoValidationError{
field: "Authority",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetThirdPartyPrincipal()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ServiceAccountDelegationInfoValidationError{
field: "ThirdPartyPrincipal",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ServiceAccountDelegationInfoValidationError{
field: "ThirdPartyPrincipal",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetThirdPartyPrincipal()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ServiceAccountDelegationInfoValidationError{
field: "ThirdPartyPrincipal",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
_ = v // ensures v is used
}
if len(errors) > 0 {
return ServiceAccountDelegationInfoMultiError(errors)
}
return nil
}
// ServiceAccountDelegationInfoMultiError is an error wrapping multiple
// validation errors returned by ServiceAccountDelegationInfo.ValidateAll() if
// the designated constraints aren't met.
type ServiceAccountDelegationInfoMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ServiceAccountDelegationInfoMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ServiceAccountDelegationInfoMultiError) AllErrors() []error { return m }
// ServiceAccountDelegationInfoValidationError is the validation error returned
// by ServiceAccountDelegationInfo.Validate if the designated constraints
// aren't met.
type ServiceAccountDelegationInfoValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ServiceAccountDelegationInfoValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ServiceAccountDelegationInfoValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ServiceAccountDelegationInfoValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ServiceAccountDelegationInfoValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ServiceAccountDelegationInfoValidationError) ErrorName() string {
return "ServiceAccountDelegationInfoValidationError"
}
// Error satisfies the builtin error interface
func (e ServiceAccountDelegationInfoValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sServiceAccountDelegationInfo.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ServiceAccountDelegationInfoValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ServiceAccountDelegationInfoValidationError{}
// Validate checks the field values on LogSplit with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *LogSplit) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LogSplit with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in LogSplitMultiError, or nil
// if none found.
func (m *LogSplit) ValidateAll() error {
return m.validate(true)
}
func (m *LogSplit) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Uid
// no validation rules for Index
// no validation rules for TotalSplits
if len(errors) > 0 {
return LogSplitMultiError(errors)
}
return nil
}
// LogSplitMultiError is an error wrapping multiple validation errors returned
// by LogSplit.ValidateAll() if the designated constraints aren't met.
type LogSplitMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LogSplitMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m LogSplitMultiError) AllErrors() []error { return m }
// LogSplitValidationError is the validation error returned by
// LogSplit.Validate if the designated constraints aren't met.
type LogSplitValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LogSplitValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LogSplitValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LogSplitValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LogSplitValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LogSplitValidationError) ErrorName() string { return "LogSplitValidationError" }
// Error satisfies the builtin error interface
func (e LogSplitValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sLogSplit.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LogSplitValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LogSplitValidationError{}
// Validate checks the field values on AttributeContext_Peer with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AttributeContext_Peer) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AttributeContext_Peer with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AttributeContext_PeerMultiError, or nil if none found.
func (m *AttributeContext_Peer) ValidateAll() error {
return m.validate(true)
}
func (m *AttributeContext_Peer) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Ip
// no validation rules for Port
// no validation rules for Labels
// no validation rules for Principal
// no validation rules for RegionCode
if len(errors) > 0 {
return AttributeContext_PeerMultiError(errors)
}
return nil
}
// AttributeContext_PeerMultiError is an error wrapping multiple validation
// errors returned by AttributeContext_Peer.ValidateAll() if the designated
// constraints aren't met.
type AttributeContext_PeerMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AttributeContext_PeerMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AttributeContext_PeerMultiError) AllErrors() []error { return m }
// AttributeContext_PeerValidationError is the validation error returned by
// AttributeContext_Peer.Validate if the designated constraints aren't met.
type AttributeContext_PeerValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AttributeContext_PeerValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AttributeContext_PeerValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AttributeContext_PeerValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AttributeContext_PeerValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AttributeContext_PeerValidationError) ErrorName() string {
return "AttributeContext_PeerValidationError"
}
// Error satisfies the builtin error interface
func (e AttributeContext_PeerValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAttributeContext_Peer.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AttributeContext_PeerValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AttributeContext_PeerValidationError{}
// Validate checks the field values on AttributeContext_Auth with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AttributeContext_Auth) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AttributeContext_Auth with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AttributeContext_AuthMultiError, or nil if none found.
func (m *AttributeContext_Auth) ValidateAll() error {
return m.validate(true)
}
func (m *AttributeContext_Auth) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Principal
// no validation rules for Presenter
if all {
switch v := interface{}(m.GetClaims()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AttributeContext_AuthValidationError{
field: "Claims",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AttributeContext_AuthValidationError{
field: "Claims",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetClaims()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AttributeContext_AuthValidationError{
field: "Claims",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return AttributeContext_AuthMultiError(errors)
}
return nil
}
// AttributeContext_AuthMultiError is an error wrapping multiple validation
// errors returned by AttributeContext_Auth.ValidateAll() if the designated
// constraints aren't met.
type AttributeContext_AuthMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AttributeContext_AuthMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AttributeContext_AuthMultiError) AllErrors() []error { return m }
// AttributeContext_AuthValidationError is the validation error returned by
// AttributeContext_Auth.Validate if the designated constraints aren't met.
type AttributeContext_AuthValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AttributeContext_AuthValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AttributeContext_AuthValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AttributeContext_AuthValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AttributeContext_AuthValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AttributeContext_AuthValidationError) ErrorName() string {
return "AttributeContext_AuthValidationError"
}
// Error satisfies the builtin error interface
func (e AttributeContext_AuthValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAttributeContext_Auth.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AttributeContext_AuthValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AttributeContext_AuthValidationError{}
// Validate checks the field values on AttributeContext_Request with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AttributeContext_Request) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AttributeContext_Request with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AttributeContext_RequestMultiError, or nil if none found.
func (m *AttributeContext_Request) ValidateAll() error {
return m.validate(true)
}
func (m *AttributeContext_Request) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Id
// no validation rules for Method
// no validation rules for Headers
// no validation rules for Path
// no validation rules for Host
// no validation rules for Scheme
// no validation rules for Query
if all {
switch v := interface{}(m.GetTime()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AttributeContext_RequestValidationError{
field: "Time",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AttributeContext_RequestValidationError{
field: "Time",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetTime()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AttributeContext_RequestValidationError{
field: "Time",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for Size
// no validation rules for Protocol
// no validation rules for Reason
if all {
switch v := interface{}(m.GetAuth()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AttributeContext_RequestValidationError{
field: "Auth",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AttributeContext_RequestValidationError{
field: "Auth",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AttributeContext_RequestValidationError{
field: "Auth",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return AttributeContext_RequestMultiError(errors)
}
return nil
}
// AttributeContext_RequestMultiError is an error wrapping multiple validation
// errors returned by AttributeContext_Request.ValidateAll() if the designated
// constraints aren't met.
type AttributeContext_RequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AttributeContext_RequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AttributeContext_RequestMultiError) AllErrors() []error { return m }
// AttributeContext_RequestValidationError is the validation error returned by
// AttributeContext_Request.Validate if the designated constraints aren't met.
type AttributeContext_RequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AttributeContext_RequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AttributeContext_RequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AttributeContext_RequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AttributeContext_RequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AttributeContext_RequestValidationError) ErrorName() string {
return "AttributeContext_RequestValidationError"
}
// Error satisfies the builtin error interface
func (e AttributeContext_RequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAttributeContext_Request.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AttributeContext_RequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AttributeContext_RequestValidationError{}
// Validate checks the field values on AttributeContext_Response with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AttributeContext_Response) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AttributeContext_Response with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AttributeContext_ResponseMultiError, or nil if none found.
func (m *AttributeContext_Response) ValidateAll() error {
return m.validate(true)
}
func (m *AttributeContext_Response) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Code
// no validation rules for Size
// no validation rules for Headers
if all {
switch v := interface{}(m.GetTime()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, AttributeContext_ResponseValidationError{
field: "Time",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, AttributeContext_ResponseValidationError{
field: "Time",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetTime()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AttributeContext_ResponseValidationError{
field: "Time",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return AttributeContext_ResponseMultiError(errors)
}
return nil
}
// AttributeContext_ResponseMultiError is an error wrapping multiple validation
// errors returned by AttributeContext_Response.ValidateAll() if the
// designated constraints aren't met.
type AttributeContext_ResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AttributeContext_ResponseMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AttributeContext_ResponseMultiError) AllErrors() []error { return m }
// AttributeContext_ResponseValidationError is the validation error returned by
// AttributeContext_Response.Validate if the designated constraints aren't met.
type AttributeContext_ResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AttributeContext_ResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AttributeContext_ResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AttributeContext_ResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AttributeContext_ResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AttributeContext_ResponseValidationError) ErrorName() string {
return "AttributeContext_ResponseValidationError"
}
// Error satisfies the builtin error interface
func (e AttributeContext_ResponseValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAttributeContext_Response.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AttributeContext_ResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AttributeContext_ResponseValidationError{}
// Validate checks the field values on AttributeContext_Resource with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AttributeContext_Resource) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AttributeContext_Resource with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AttributeContext_ResourceMultiError, or nil if none found.
func (m *AttributeContext_Resource) ValidateAll() error {
return m.validate(true)
}
func (m *AttributeContext_Resource) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Service
// no validation rules for Name
// no validation rules for Type
// no validation rules for Labels
if len(errors) > 0 {
return AttributeContext_ResourceMultiError(errors)
}
return nil
}
// AttributeContext_ResourceMultiError is an error wrapping multiple validation
// errors returned by AttributeContext_Resource.ValidateAll() if the
// designated constraints aren't met.
type AttributeContext_ResourceMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AttributeContext_ResourceMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AttributeContext_ResourceMultiError) AllErrors() []error { return m }
// AttributeContext_ResourceValidationError is the validation error returned by
// AttributeContext_Resource.Validate if the designated constraints aren't met.
type AttributeContext_ResourceValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AttributeContext_ResourceValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AttributeContext_ResourceValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AttributeContext_ResourceValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AttributeContext_ResourceValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AttributeContext_ResourceValidationError) ErrorName() string {
return "AttributeContext_ResourceValidationError"
}
// Error satisfies the builtin error interface
func (e AttributeContext_ResourceValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAttributeContext_Resource.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AttributeContext_ResourceValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AttributeContext_ResourceValidationError{}
// Validate checks the field values on
// ServiceAccountDelegationInfo_FirstPartyPrincipal with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *ServiceAccountDelegationInfo_FirstPartyPrincipal) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on
// ServiceAccountDelegationInfo_FirstPartyPrincipal with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in
// ServiceAccountDelegationInfo_FirstPartyPrincipalMultiError, or nil if none found.
func (m *ServiceAccountDelegationInfo_FirstPartyPrincipal) ValidateAll() error {
return m.validate(true)
}
func (m *ServiceAccountDelegationInfo_FirstPartyPrincipal) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for PrincipalEmail
if all {
switch v := interface{}(m.GetServiceMetadata()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError{
field: "ServiceMetadata",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError{
field: "ServiceMetadata",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetServiceMetadata()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError{
field: "ServiceMetadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return ServiceAccountDelegationInfo_FirstPartyPrincipalMultiError(errors)
}
return nil
}
// ServiceAccountDelegationInfo_FirstPartyPrincipalMultiError is an error
// wrapping multiple validation errors returned by
// ServiceAccountDelegationInfo_FirstPartyPrincipal.ValidateAll() if the
// designated constraints aren't met.
type ServiceAccountDelegationInfo_FirstPartyPrincipalMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ServiceAccountDelegationInfo_FirstPartyPrincipalMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ServiceAccountDelegationInfo_FirstPartyPrincipalMultiError) AllErrors() []error { return m }
// ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError is the
// validation error returned by
// ServiceAccountDelegationInfo_FirstPartyPrincipal.Validate if the designated
// constraints aren't met.
type ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError) Field() string {
return e.field
}
// Reason function returns reason value.
func (e ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError) Reason() string {
return e.reason
}
// Cause function returns cause value.
func (e ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError) Cause() error {
return e.cause
}
// Key function returns key value.
func (e ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError) ErrorName() string {
return "ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError"
}
// Error satisfies the builtin error interface
func (e ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sServiceAccountDelegationInfo_FirstPartyPrincipal.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ServiceAccountDelegationInfo_FirstPartyPrincipalValidationError{}
// Validate checks the field values on
// ServiceAccountDelegationInfo_ThirdPartyPrincipal with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *ServiceAccountDelegationInfo_ThirdPartyPrincipal) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on
// ServiceAccountDelegationInfo_ThirdPartyPrincipal with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in
// ServiceAccountDelegationInfo_ThirdPartyPrincipalMultiError, or nil if none found.
func (m *ServiceAccountDelegationInfo_ThirdPartyPrincipal) ValidateAll() error {
return m.validate(true)
}
func (m *ServiceAccountDelegationInfo_ThirdPartyPrincipal) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if all {
switch v := interface{}(m.GetThirdPartyClaims()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError{
field: "ThirdPartyClaims",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError{
field: "ThirdPartyClaims",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetThirdPartyClaims()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError{
field: "ThirdPartyClaims",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return ServiceAccountDelegationInfo_ThirdPartyPrincipalMultiError(errors)
}
return nil
}
// ServiceAccountDelegationInfo_ThirdPartyPrincipalMultiError is an error
// wrapping multiple validation errors returned by
// ServiceAccountDelegationInfo_ThirdPartyPrincipal.ValidateAll() if the
// designated constraints aren't met.
type ServiceAccountDelegationInfo_ThirdPartyPrincipalMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ServiceAccountDelegationInfo_ThirdPartyPrincipalMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ServiceAccountDelegationInfo_ThirdPartyPrincipalMultiError) AllErrors() []error { return m }
// ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError is the
// validation error returned by
// ServiceAccountDelegationInfo_ThirdPartyPrincipal.Validate if the designated
// constraints aren't met.
type ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError) Field() string {
return e.field
}
// Reason function returns reason value.
func (e ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError) Reason() string {
return e.reason
}
// Cause function returns cause value.
func (e ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError) Cause() error {
return e.cause
}
// Key function returns key value.
func (e ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError) ErrorName() string {
return "ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError"
}
// Error satisfies the builtin error interface
func (e ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sServiceAccountDelegationInfo_ThirdPartyPrincipal.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ServiceAccountDelegationInfo_ThirdPartyPrincipalValidationError{}