blob: f0043b6ceef17d661a8690cc8d13e3e0204a478f [file] [log] [blame]
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: go.chromium.org/luci/cv/internal/run/eventpb/longop.proto
package eventpb
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 LongOpCompleted 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 *LongOpCompleted) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LongOpCompleted 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
// LongOpCompletedMultiError, or nil if none found.
func (m *LongOpCompleted) ValidateAll() error {
return m.validate(true)
}
func (m *LongOpCompleted) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for OperationId
// no validation rules for Status
switch v := m.Result.(type) {
case *LongOpCompleted_PostStartMessage_:
if v == nil {
err := LongOpCompletedValidationError{
field: "Result",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetPostStartMessage()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompletedValidationError{
field: "PostStartMessage",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompletedValidationError{
field: "PostStartMessage",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetPostStartMessage()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LongOpCompletedValidationError{
field: "PostStartMessage",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *LongOpCompleted_ResetTriggers_:
if v == nil {
err := LongOpCompletedValidationError{
field: "Result",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetResetTriggers()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompletedValidationError{
field: "ResetTriggers",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompletedValidationError{
field: "ResetTriggers",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetResetTriggers()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LongOpCompletedValidationError{
field: "ResetTriggers",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *LongOpCompleted_ExecuteTryjobs:
if v == nil {
err := LongOpCompletedValidationError{
field: "Result",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetExecuteTryjobs()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompletedValidationError{
field: "ExecuteTryjobs",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompletedValidationError{
field: "ExecuteTryjobs",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetExecuteTryjobs()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LongOpCompletedValidationError{
field: "ExecuteTryjobs",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *LongOpCompleted_ExecutePostAction:
if v == nil {
err := LongOpCompletedValidationError{
field: "Result",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetExecutePostAction()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompletedValidationError{
field: "ExecutePostAction",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompletedValidationError{
field: "ExecutePostAction",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetExecutePostAction()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LongOpCompletedValidationError{
field: "ExecutePostAction",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *LongOpCompleted_PostGerritMessage_:
if v == nil {
err := LongOpCompletedValidationError{
field: "Result",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetPostGerritMessage()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompletedValidationError{
field: "PostGerritMessage",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompletedValidationError{
field: "PostGerritMessage",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetPostGerritMessage()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LongOpCompletedValidationError{
field: "PostGerritMessage",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
_ = v // ensures v is used
}
if len(errors) > 0 {
return LongOpCompletedMultiError(errors)
}
return nil
}
// LongOpCompletedMultiError is an error wrapping multiple validation errors
// returned by LongOpCompleted.ValidateAll() if the designated constraints
// aren't met.
type LongOpCompletedMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LongOpCompletedMultiError) 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 LongOpCompletedMultiError) AllErrors() []error { return m }
// LongOpCompletedValidationError is the validation error returned by
// LongOpCompleted.Validate if the designated constraints aren't met.
type LongOpCompletedValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LongOpCompletedValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LongOpCompletedValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LongOpCompletedValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LongOpCompletedValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LongOpCompletedValidationError) ErrorName() string { return "LongOpCompletedValidationError" }
// Error satisfies the builtin error interface
func (e LongOpCompletedValidationError) 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 %sLongOpCompleted.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LongOpCompletedValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LongOpCompletedValidationError{}
// Validate checks the field values on LongOpCompleted_PostStartMessage 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 *LongOpCompleted_PostStartMessage) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LongOpCompleted_PostStartMessage 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
// LongOpCompleted_PostStartMessageMultiError, or nil if none found.
func (m *LongOpCompleted_PostStartMessage) ValidateAll() error {
return m.validate(true)
}
func (m *LongOpCompleted_PostStartMessage) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if all {
switch v := interface{}(m.GetTime()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompleted_PostStartMessageValidationError{
field: "Time",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompleted_PostStartMessageValidationError{
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 LongOpCompleted_PostStartMessageValidationError{
field: "Time",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return LongOpCompleted_PostStartMessageMultiError(errors)
}
return nil
}
// LongOpCompleted_PostStartMessageMultiError is an error wrapping multiple
// validation errors returned by
// LongOpCompleted_PostStartMessage.ValidateAll() if the designated
// constraints aren't met.
type LongOpCompleted_PostStartMessageMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LongOpCompleted_PostStartMessageMultiError) 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 LongOpCompleted_PostStartMessageMultiError) AllErrors() []error { return m }
// LongOpCompleted_PostStartMessageValidationError is the validation error
// returned by LongOpCompleted_PostStartMessage.Validate if the designated
// constraints aren't met.
type LongOpCompleted_PostStartMessageValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LongOpCompleted_PostStartMessageValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LongOpCompleted_PostStartMessageValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LongOpCompleted_PostStartMessageValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LongOpCompleted_PostStartMessageValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LongOpCompleted_PostStartMessageValidationError) ErrorName() string {
return "LongOpCompleted_PostStartMessageValidationError"
}
// Error satisfies the builtin error interface
func (e LongOpCompleted_PostStartMessageValidationError) 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 %sLongOpCompleted_PostStartMessage.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LongOpCompleted_PostStartMessageValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LongOpCompleted_PostStartMessageValidationError{}
// Validate checks the field values on LongOpCompleted_PostGerritMessage 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 *LongOpCompleted_PostGerritMessage) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LongOpCompleted_PostGerritMessage
// 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
// LongOpCompleted_PostGerritMessageMultiError, or nil if none found.
func (m *LongOpCompleted_PostGerritMessage) ValidateAll() error {
return m.validate(true)
}
func (m *LongOpCompleted_PostGerritMessage) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if all {
switch v := interface{}(m.GetTime()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompleted_PostGerritMessageValidationError{
field: "Time",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompleted_PostGerritMessageValidationError{
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 LongOpCompleted_PostGerritMessageValidationError{
field: "Time",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return LongOpCompleted_PostGerritMessageMultiError(errors)
}
return nil
}
// LongOpCompleted_PostGerritMessageMultiError is an error wrapping multiple
// validation errors returned by
// LongOpCompleted_PostGerritMessage.ValidateAll() if the designated
// constraints aren't met.
type LongOpCompleted_PostGerritMessageMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LongOpCompleted_PostGerritMessageMultiError) 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 LongOpCompleted_PostGerritMessageMultiError) AllErrors() []error { return m }
// LongOpCompleted_PostGerritMessageValidationError is the validation error
// returned by LongOpCompleted_PostGerritMessage.Validate if the designated
// constraints aren't met.
type LongOpCompleted_PostGerritMessageValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LongOpCompleted_PostGerritMessageValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LongOpCompleted_PostGerritMessageValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LongOpCompleted_PostGerritMessageValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LongOpCompleted_PostGerritMessageValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LongOpCompleted_PostGerritMessageValidationError) ErrorName() string {
return "LongOpCompleted_PostGerritMessageValidationError"
}
// Error satisfies the builtin error interface
func (e LongOpCompleted_PostGerritMessageValidationError) 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 %sLongOpCompleted_PostGerritMessage.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LongOpCompleted_PostGerritMessageValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LongOpCompleted_PostGerritMessageValidationError{}
// Validate checks the field values on LongOpCompleted_ResetTriggers 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 *LongOpCompleted_ResetTriggers) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LongOpCompleted_ResetTriggers 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
// LongOpCompleted_ResetTriggersMultiError, or nil if none found.
func (m *LongOpCompleted_ResetTriggers) ValidateAll() error {
return m.validate(true)
}
func (m *LongOpCompleted_ResetTriggers) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetResults() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompleted_ResetTriggersValidationError{
field: fmt.Sprintf("Results[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompleted_ResetTriggersValidationError{
field: fmt.Sprintf("Results[%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 LongOpCompleted_ResetTriggersValidationError{
field: fmt.Sprintf("Results[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(errors) > 0 {
return LongOpCompleted_ResetTriggersMultiError(errors)
}
return nil
}
// LongOpCompleted_ResetTriggersMultiError is an error wrapping multiple
// validation errors returned by LongOpCompleted_ResetTriggers.ValidateAll()
// if the designated constraints aren't met.
type LongOpCompleted_ResetTriggersMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LongOpCompleted_ResetTriggersMultiError) 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 LongOpCompleted_ResetTriggersMultiError) AllErrors() []error { return m }
// LongOpCompleted_ResetTriggersValidationError is the validation error
// returned by LongOpCompleted_ResetTriggers.Validate if the designated
// constraints aren't met.
type LongOpCompleted_ResetTriggersValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LongOpCompleted_ResetTriggersValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LongOpCompleted_ResetTriggersValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LongOpCompleted_ResetTriggersValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LongOpCompleted_ResetTriggersValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LongOpCompleted_ResetTriggersValidationError) ErrorName() string {
return "LongOpCompleted_ResetTriggersValidationError"
}
// Error satisfies the builtin error interface
func (e LongOpCompleted_ResetTriggersValidationError) 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 %sLongOpCompleted_ResetTriggers.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LongOpCompleted_ResetTriggersValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LongOpCompleted_ResetTriggersValidationError{}
// Validate checks the field values on LongOpCompleted_ExecutePostActionResult
// 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 *LongOpCompleted_ExecutePostActionResult) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on
// LongOpCompleted_ExecutePostActionResult 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
// LongOpCompleted_ExecutePostActionResultMultiError, or nil if none found.
func (m *LongOpCompleted_ExecutePostActionResult) ValidateAll() error {
return m.validate(true)
}
func (m *LongOpCompleted_ExecutePostActionResult) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Summary
if len(errors) > 0 {
return LongOpCompleted_ExecutePostActionResultMultiError(errors)
}
return nil
}
// LongOpCompleted_ExecutePostActionResultMultiError is an error wrapping
// multiple validation errors returned by
// LongOpCompleted_ExecutePostActionResult.ValidateAll() if the designated
// constraints aren't met.
type LongOpCompleted_ExecutePostActionResultMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LongOpCompleted_ExecutePostActionResultMultiError) 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 LongOpCompleted_ExecutePostActionResultMultiError) AllErrors() []error { return m }
// LongOpCompleted_ExecutePostActionResultValidationError is the validation
// error returned by LongOpCompleted_ExecutePostActionResult.Validate if the
// designated constraints aren't met.
type LongOpCompleted_ExecutePostActionResultValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LongOpCompleted_ExecutePostActionResultValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LongOpCompleted_ExecutePostActionResultValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LongOpCompleted_ExecutePostActionResultValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LongOpCompleted_ExecutePostActionResultValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LongOpCompleted_ExecutePostActionResultValidationError) ErrorName() string {
return "LongOpCompleted_ExecutePostActionResultValidationError"
}
// Error satisfies the builtin error interface
func (e LongOpCompleted_ExecutePostActionResultValidationError) 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 %sLongOpCompleted_ExecutePostActionResult.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LongOpCompleted_ExecutePostActionResultValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LongOpCompleted_ExecutePostActionResultValidationError{}
// Validate checks the field values on LongOpCompleted_ResetTriggers_Result
// 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 *LongOpCompleted_ResetTriggers_Result) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on LongOpCompleted_ResetTriggers_Result
// 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
// LongOpCompleted_ResetTriggers_ResultMultiError, or nil if none found.
func (m *LongOpCompleted_ResetTriggers_Result) ValidateAll() error {
return m.validate(true)
}
func (m *LongOpCompleted_ResetTriggers_Result) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Id
// no validation rules for ExternalId
switch v := m.Detail.(type) {
case *LongOpCompleted_ResetTriggers_Result_SuccessInfo:
if v == nil {
err := LongOpCompleted_ResetTriggers_ResultValidationError{
field: "Detail",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetSuccessInfo()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompleted_ResetTriggers_ResultValidationError{
field: "SuccessInfo",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompleted_ResetTriggers_ResultValidationError{
field: "SuccessInfo",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetSuccessInfo()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LongOpCompleted_ResetTriggers_ResultValidationError{
field: "SuccessInfo",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *LongOpCompleted_ResetTriggers_Result_FailureInfo:
if v == nil {
err := LongOpCompleted_ResetTriggers_ResultValidationError{
field: "Detail",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetFailureInfo()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompleted_ResetTriggers_ResultValidationError{
field: "FailureInfo",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompleted_ResetTriggers_ResultValidationError{
field: "FailureInfo",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetFailureInfo()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LongOpCompleted_ResetTriggers_ResultValidationError{
field: "FailureInfo",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
_ = v // ensures v is used
}
if len(errors) > 0 {
return LongOpCompleted_ResetTriggers_ResultMultiError(errors)
}
return nil
}
// LongOpCompleted_ResetTriggers_ResultMultiError is an error wrapping multiple
// validation errors returned by
// LongOpCompleted_ResetTriggers_Result.ValidateAll() if the designated
// constraints aren't met.
type LongOpCompleted_ResetTriggers_ResultMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LongOpCompleted_ResetTriggers_ResultMultiError) 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 LongOpCompleted_ResetTriggers_ResultMultiError) AllErrors() []error { return m }
// LongOpCompleted_ResetTriggers_ResultValidationError is the validation error
// returned by LongOpCompleted_ResetTriggers_Result.Validate if the designated
// constraints aren't met.
type LongOpCompleted_ResetTriggers_ResultValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LongOpCompleted_ResetTriggers_ResultValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LongOpCompleted_ResetTriggers_ResultValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LongOpCompleted_ResetTriggers_ResultValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LongOpCompleted_ResetTriggers_ResultValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LongOpCompleted_ResetTriggers_ResultValidationError) ErrorName() string {
return "LongOpCompleted_ResetTriggers_ResultValidationError"
}
// Error satisfies the builtin error interface
func (e LongOpCompleted_ResetTriggers_ResultValidationError) 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 %sLongOpCompleted_ResetTriggers_Result.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LongOpCompleted_ResetTriggers_ResultValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LongOpCompleted_ResetTriggers_ResultValidationError{}
// Validate checks the field values on
// LongOpCompleted_ResetTriggers_Result_Success 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 *LongOpCompleted_ResetTriggers_Result_Success) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on
// LongOpCompleted_ResetTriggers_Result_Success 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
// LongOpCompleted_ResetTriggers_Result_SuccessMultiError, or nil if none found.
func (m *LongOpCompleted_ResetTriggers_Result_Success) ValidateAll() error {
return m.validate(true)
}
func (m *LongOpCompleted_ResetTriggers_Result_Success) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if all {
switch v := interface{}(m.GetResetAt()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, LongOpCompleted_ResetTriggers_Result_SuccessValidationError{
field: "ResetAt",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, LongOpCompleted_ResetTriggers_Result_SuccessValidationError{
field: "ResetAt",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetResetAt()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LongOpCompleted_ResetTriggers_Result_SuccessValidationError{
field: "ResetAt",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return LongOpCompleted_ResetTriggers_Result_SuccessMultiError(errors)
}
return nil
}
// LongOpCompleted_ResetTriggers_Result_SuccessMultiError is an error wrapping
// multiple validation errors returned by
// LongOpCompleted_ResetTriggers_Result_Success.ValidateAll() if the
// designated constraints aren't met.
type LongOpCompleted_ResetTriggers_Result_SuccessMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LongOpCompleted_ResetTriggers_Result_SuccessMultiError) 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 LongOpCompleted_ResetTriggers_Result_SuccessMultiError) AllErrors() []error { return m }
// LongOpCompleted_ResetTriggers_Result_SuccessValidationError is the
// validation error returned by
// LongOpCompleted_ResetTriggers_Result_Success.Validate if the designated
// constraints aren't met.
type LongOpCompleted_ResetTriggers_Result_SuccessValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LongOpCompleted_ResetTriggers_Result_SuccessValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LongOpCompleted_ResetTriggers_Result_SuccessValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LongOpCompleted_ResetTriggers_Result_SuccessValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LongOpCompleted_ResetTriggers_Result_SuccessValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LongOpCompleted_ResetTriggers_Result_SuccessValidationError) ErrorName() string {
return "LongOpCompleted_ResetTriggers_Result_SuccessValidationError"
}
// Error satisfies the builtin error interface
func (e LongOpCompleted_ResetTriggers_Result_SuccessValidationError) 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 %sLongOpCompleted_ResetTriggers_Result_Success.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LongOpCompleted_ResetTriggers_Result_SuccessValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LongOpCompleted_ResetTriggers_Result_SuccessValidationError{}
// Validate checks the field values on
// LongOpCompleted_ResetTriggers_Result_Failure 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 *LongOpCompleted_ResetTriggers_Result_Failure) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on
// LongOpCompleted_ResetTriggers_Result_Failure 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
// LongOpCompleted_ResetTriggers_Result_FailureMultiError, or nil if none found.
func (m *LongOpCompleted_ResetTriggers_Result_Failure) ValidateAll() error {
return m.validate(true)
}
func (m *LongOpCompleted_ResetTriggers_Result_Failure) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for FailureMessage
if len(errors) > 0 {
return LongOpCompleted_ResetTriggers_Result_FailureMultiError(errors)
}
return nil
}
// LongOpCompleted_ResetTriggers_Result_FailureMultiError is an error wrapping
// multiple validation errors returned by
// LongOpCompleted_ResetTriggers_Result_Failure.ValidateAll() if the
// designated constraints aren't met.
type LongOpCompleted_ResetTriggers_Result_FailureMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m LongOpCompleted_ResetTriggers_Result_FailureMultiError) 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 LongOpCompleted_ResetTriggers_Result_FailureMultiError) AllErrors() []error { return m }
// LongOpCompleted_ResetTriggers_Result_FailureValidationError is the
// validation error returned by
// LongOpCompleted_ResetTriggers_Result_Failure.Validate if the designated
// constraints aren't met.
type LongOpCompleted_ResetTriggers_Result_FailureValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LongOpCompleted_ResetTriggers_Result_FailureValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LongOpCompleted_ResetTriggers_Result_FailureValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LongOpCompleted_ResetTriggers_Result_FailureValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LongOpCompleted_ResetTriggers_Result_FailureValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LongOpCompleted_ResetTriggers_Result_FailureValidationError) ErrorName() string {
return "LongOpCompleted_ResetTriggers_Result_FailureValidationError"
}
// Error satisfies the builtin error interface
func (e LongOpCompleted_ResetTriggers_Result_FailureValidationError) 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 %sLongOpCompleted_ResetTriggers_Result_Failure.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LongOpCompleted_ResetTriggers_Result_FailureValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LongOpCompleted_ResetTriggers_Result_FailureValidationError{}