// 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 AuditLogEntry 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 *AuditLogEntry) Validate() error { return m.validate(false) } // ValidateAll checks the field values on AuditLogEntry 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 AuditLogEntryMultiError, or // nil if none found. func (m *AuditLogEntry) ValidateAll() error { return m.validate(true) } func (m *AuditLogEntry) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for LogName if all { switch v := interface{}(m.GetProtoPayload()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, AuditLogEntryValidationError{ field: "ProtoPayload", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, AuditLogEntryValidationError{ 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 AuditLogEntryValidationError{ 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.GetTimestamp()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, AuditLogEntryValidationError{ field: "Timestamp", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, AuditLogEntryValidationError{ 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 AuditLogEntryValidationError{ field: "Timestamp", reason: "embedded message failed validation", cause: err, } } } // no validation rules for Severity if m.CorrelationId != nil { // no validation rules for CorrelationId } if len(errors) > 0 { return AuditLogEntryMultiError(errors) } return nil } // AuditLogEntryMultiError is an error wrapping multiple validation errors // returned by AuditLogEntry.ValidateAll() if the designated constraints // aren't met. type AuditLogEntryMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m AuditLogEntryMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) } return strings.Join(msgs, "; ") } // AllErrors returns a list of validation violation errors. func (m AuditLogEntryMultiError) AllErrors() []error { return m } // AuditLogEntryValidationError is the validation error returned by // AuditLogEntry.Validate if the designated constraints aren't met. type AuditLogEntryValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e AuditLogEntryValidationError) Field() string { return e.field } // Reason function returns reason value. func (e AuditLogEntryValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e AuditLogEntryValidationError) Cause() error { return e.cause } // Key function returns key value. func (e AuditLogEntryValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e AuditLogEntryValidationError) ErrorName() string { return "AuditLogEntryValidationError" } // Error satisfies the builtin error interface func (e AuditLogEntryValidationError) 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 %sAuditLogEntry.%s: %s%s", key, e.field, e.reason, cause) } var _ error = AuditLogEntryValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = AuditLogEntryValidationError{} // 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 OperationName // no validation rules for ResourceName 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.GetResponseMetadata()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, AuditLogValidationError{ field: "ResponseMetadata", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, AuditLogValidationError{ field: "ResponseMetadata", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetResponseMetadata()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AuditLogValidationError{ field: "ResponseMetadata", reason: "embedded message failed validation", cause: err, } } } if m.Request != nil { 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 m.Response != nil { 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 m.Metadata != nil { 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 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 { msgs := make([]string, 0, len(m)) 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 PrincipalId 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, } } } } if m.PrincipalEmail != nil { // no validation rules for PrincipalEmail } if m.ServiceAccountName != nil { // no validation rules for ServiceAccountName } 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 { msgs := make([]string, 0, len(m)) 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 if m.Permission != nil { // no validation rules for Permission } if m.Granted != nil { // no validation rules for Granted } 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 { msgs := make([]string, 0, len(m)) 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 { msgs := make([]string, 0, len(m)) 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 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 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 { msgs := make([]string, 0, len(m)) 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 ResponseMetadata 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 *ResponseMetadata) Validate() error { return m.validate(false) } // ValidateAll checks the field values on ResponseMetadata 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 // ResponseMetadataMultiError, or nil if none found. func (m *ResponseMetadata) ValidateAll() error { return m.validate(true) } func (m *ResponseMetadata) validate(all bool) error { if m == nil { return nil } var errors []error if all { switch v := interface{}(m.GetStatusCode()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ResponseMetadataValidationError{ field: "StatusCode", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ResponseMetadataValidationError{ field: "StatusCode", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetStatusCode()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ResponseMetadataValidationError{ field: "StatusCode", reason: "embedded message failed validation", cause: err, } } } for idx, item := range m.GetErrorDetails() { _, _ = idx, item if all { switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ResponseMetadataValidationError{ field: fmt.Sprintf("ErrorDetails[%v]", idx), reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ResponseMetadataValidationError{ field: fmt.Sprintf("ErrorDetails[%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 ResponseMetadataValidationError{ field: fmt.Sprintf("ErrorDetails[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } if all { switch v := interface{}(m.GetResponseAttributes()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ResponseMetadataValidationError{ field: "ResponseAttributes", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ResponseMetadataValidationError{ field: "ResponseAttributes", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetResponseAttributes()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ResponseMetadataValidationError{ field: "ResponseAttributes", reason: "embedded message failed validation", cause: err, } } } if m.ErrorMessage != nil { // no validation rules for ErrorMessage } if len(errors) > 0 { return ResponseMetadataMultiError(errors) } return nil } // ResponseMetadataMultiError is an error wrapping multiple validation errors // returned by ResponseMetadata.ValidateAll() if the designated constraints // aren't met. type ResponseMetadataMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ResponseMetadataMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) } return strings.Join(msgs, "; ") } // AllErrors returns a list of validation violation errors. func (m ResponseMetadataMultiError) AllErrors() []error { return m } // ResponseMetadataValidationError is the validation error returned by // ResponseMetadata.Validate if the designated constraints aren't met. type ResponseMetadataValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ResponseMetadataValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ResponseMetadataValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ResponseMetadataValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ResponseMetadataValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ResponseMetadataValidationError) ErrorName() string { return "ResponseMetadataValidationError" } // Error satisfies the builtin error interface func (e ResponseMetadataValidationError) 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 %sResponseMetadata.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ResponseMetadataValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ResponseMetadataValidationError{} // 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_SystemPrincipal_: 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.GetSystemPrincipal()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ServiceAccountDelegationInfoValidationError{ field: "SystemPrincipal", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ServiceAccountDelegationInfoValidationError{ field: "SystemPrincipal", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetSystemPrincipal()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ServiceAccountDelegationInfoValidationError{ field: "SystemPrincipal", reason: "embedded message failed validation", cause: err, } } } case *ServiceAccountDelegationInfo_IdpPrincipal_: 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.GetIdpPrincipal()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ServiceAccountDelegationInfoValidationError{ field: "IdpPrincipal", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ServiceAccountDelegationInfoValidationError{ field: "IdpPrincipal", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetIdpPrincipal()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ServiceAccountDelegationInfoValidationError{ field: "IdpPrincipal", 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 { msgs := make([]string, 0, len(m)) 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 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 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 { msgs := make([]string, 0, len(m)) 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 Method // no validation rules for Headers // no validation rules for Path // no validation rules for Host // no validation rules for Scheme 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 Protocol 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 m.Id != nil { // no validation rules for Id } if m.Query != nil { // no validation rules for Query } 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 { msgs := make([]string, 0, len(m)) 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 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 m.NumResponseItems != nil { if all { switch v := interface{}(m.GetNumResponseItems()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, AttributeContext_ResponseValidationError{ field: "NumResponseItems", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, AttributeContext_ResponseValidationError{ field: "NumResponseItems", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetNumResponseItems()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AttributeContext_ResponseValidationError{ field: "NumResponseItems", reason: "embedded message failed validation", cause: err, } } } } if m.Size != nil { if all { switch v := interface{}(m.GetSize()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, AttributeContext_ResponseValidationError{ field: "Size", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, AttributeContext_ResponseValidationError{ field: "Size", reason: "embedded message failed validation", cause: err, }) } } } else if v, ok := interface{}(m.GetSize()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AttributeContext_ResponseValidationError{ field: "Size", 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 { msgs := make([]string, 0, len(m)) 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 // ServiceAccountDelegationInfo_SystemPrincipal 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_SystemPrincipal) Validate() error { return m.validate(false) } // ValidateAll checks the field values on // ServiceAccountDelegationInfo_SystemPrincipal 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_SystemPrincipalMultiError, or nil if none found. func (m *ServiceAccountDelegationInfo_SystemPrincipal) ValidateAll() error { return m.validate(true) } func (m *ServiceAccountDelegationInfo_SystemPrincipal) validate(all bool) error { if m == nil { return nil } var errors []error if m.ServiceMetadata != nil { if all { switch v := interface{}(m.GetServiceMetadata()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ServiceAccountDelegationInfo_SystemPrincipalValidationError{ field: "ServiceMetadata", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ServiceAccountDelegationInfo_SystemPrincipalValidationError{ 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_SystemPrincipalValidationError{ field: "ServiceMetadata", reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return ServiceAccountDelegationInfo_SystemPrincipalMultiError(errors) } return nil } // ServiceAccountDelegationInfo_SystemPrincipalMultiError is an error wrapping // multiple validation errors returned by // ServiceAccountDelegationInfo_SystemPrincipal.ValidateAll() if the // designated constraints aren't met. type ServiceAccountDelegationInfo_SystemPrincipalMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ServiceAccountDelegationInfo_SystemPrincipalMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) } return strings.Join(msgs, "; ") } // AllErrors returns a list of validation violation errors. func (m ServiceAccountDelegationInfo_SystemPrincipalMultiError) AllErrors() []error { return m } // ServiceAccountDelegationInfo_SystemPrincipalValidationError is the // validation error returned by // ServiceAccountDelegationInfo_SystemPrincipal.Validate if the designated // constraints aren't met. type ServiceAccountDelegationInfo_SystemPrincipalValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ServiceAccountDelegationInfo_SystemPrincipalValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ServiceAccountDelegationInfo_SystemPrincipalValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ServiceAccountDelegationInfo_SystemPrincipalValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ServiceAccountDelegationInfo_SystemPrincipalValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ServiceAccountDelegationInfo_SystemPrincipalValidationError) ErrorName() string { return "ServiceAccountDelegationInfo_SystemPrincipalValidationError" } // Error satisfies the builtin error interface func (e ServiceAccountDelegationInfo_SystemPrincipalValidationError) 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_SystemPrincipal.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ServiceAccountDelegationInfo_SystemPrincipalValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ServiceAccountDelegationInfo_SystemPrincipalValidationError{} // Validate checks the field values on // ServiceAccountDelegationInfo_IdpPrincipal 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_IdpPrincipal) Validate() error { return m.validate(false) } // ValidateAll checks the field values on // ServiceAccountDelegationInfo_IdpPrincipal 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_IdpPrincipalMultiError, or nil if none found. func (m *ServiceAccountDelegationInfo_IdpPrincipal) ValidateAll() error { return m.validate(true) } func (m *ServiceAccountDelegationInfo_IdpPrincipal) validate(all bool) error { if m == nil { return nil } var errors []error // no validation rules for PrincipalId // no validation rules for PrincipalEmail if m.ServiceMetadata != nil { if all { switch v := interface{}(m.GetServiceMetadata()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ServiceAccountDelegationInfo_IdpPrincipalValidationError{ field: "ServiceMetadata", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ServiceAccountDelegationInfo_IdpPrincipalValidationError{ 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_IdpPrincipalValidationError{ field: "ServiceMetadata", reason: "embedded message failed validation", cause: err, } } } } if len(errors) > 0 { return ServiceAccountDelegationInfo_IdpPrincipalMultiError(errors) } return nil } // ServiceAccountDelegationInfo_IdpPrincipalMultiError is an error wrapping // multiple validation errors returned by // ServiceAccountDelegationInfo_IdpPrincipal.ValidateAll() if the designated // constraints aren't met. type ServiceAccountDelegationInfo_IdpPrincipalMultiError []error // Error returns a concatenation of all the error messages it wraps. func (m ServiceAccountDelegationInfo_IdpPrincipalMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) } return strings.Join(msgs, "; ") } // AllErrors returns a list of validation violation errors. func (m ServiceAccountDelegationInfo_IdpPrincipalMultiError) AllErrors() []error { return m } // ServiceAccountDelegationInfo_IdpPrincipalValidationError is the validation // error returned by ServiceAccountDelegationInfo_IdpPrincipal.Validate if the // designated constraints aren't met. type ServiceAccountDelegationInfo_IdpPrincipalValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e ServiceAccountDelegationInfo_IdpPrincipalValidationError) Field() string { return e.field } // Reason function returns reason value. func (e ServiceAccountDelegationInfo_IdpPrincipalValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e ServiceAccountDelegationInfo_IdpPrincipalValidationError) Cause() error { return e.cause } // Key function returns key value. func (e ServiceAccountDelegationInfo_IdpPrincipalValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e ServiceAccountDelegationInfo_IdpPrincipalValidationError) ErrorName() string { return "ServiceAccountDelegationInfo_IdpPrincipalValidationError" } // Error satisfies the builtin error interface func (e ServiceAccountDelegationInfo_IdpPrincipalValidationError) 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_IdpPrincipal.%s: %s%s", key, e.field, e.reason, cause) } var _ error = ServiceAccountDelegationInfo_IdpPrincipalValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = ServiceAccountDelegationInfo_IdpPrincipalValidationError{}