| // Code generated by protoc-gen-validate. DO NOT EDIT. |
| // source: go.chromium.org/luci/cv/internal/run/storage.proto |
| |
| package run |
| |
| import ( |
| "bytes" |
| "errors" |
| "fmt" |
| "net" |
| "net/mail" |
| "net/url" |
| "regexp" |
| "sort" |
| "strings" |
| "time" |
| "unicode/utf8" |
| |
| "google.golang.org/protobuf/types/known/anypb" |
| |
| gerrit "go.chromium.org/luci/cv/internal/gerrit" |
| |
| tryjob "go.chromium.org/luci/cv/internal/tryjob" |
| ) |
| |
| // 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 |
| |
| _ = gerrit.Whom(0) |
| |
| _ = tryjob.Status(0) |
| ) |
| |
| // Validate checks the field values on Trigger 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 *Trigger) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on Trigger 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 TriggerMultiError, or nil if none found. |
| func (m *Trigger) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *Trigger) 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, TriggerValidationError{ |
| field: "Time", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TriggerValidationError{ |
| 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 TriggerValidationError{ |
| field: "Time", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| // no validation rules for Mode |
| |
| if all { |
| switch v := interface{}(m.GetModeDefinition()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TriggerValidationError{ |
| field: "ModeDefinition", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TriggerValidationError{ |
| field: "ModeDefinition", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetModeDefinition()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return TriggerValidationError{ |
| field: "ModeDefinition", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| // no validation rules for Email |
| |
| // no validation rules for GerritAccountId |
| |
| if len(errors) > 0 { |
| return TriggerMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // TriggerMultiError is an error wrapping multiple validation errors returned |
| // by Trigger.ValidateAll() if the designated constraints aren't met. |
| type TriggerMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m TriggerMultiError) 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 TriggerMultiError) AllErrors() []error { return m } |
| |
| // TriggerValidationError is the validation error returned by Trigger.Validate |
| // if the designated constraints aren't met. |
| type TriggerValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e TriggerValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e TriggerValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e TriggerValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e TriggerValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e TriggerValidationError) ErrorName() string { return "TriggerValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e TriggerValidationError) 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 %sTrigger.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = TriggerValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = TriggerValidationError{} |
| |
| // Validate checks the field values on Triggers 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 *Triggers) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on Triggers 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 TriggersMultiError, or nil |
| // if none found. |
| func (m *Triggers) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *Triggers) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if all { |
| switch v := interface{}(m.GetCqVoteTrigger()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TriggersValidationError{ |
| field: "CqVoteTrigger", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TriggersValidationError{ |
| field: "CqVoteTrigger", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetCqVoteTrigger()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return TriggersValidationError{ |
| field: "CqVoteTrigger", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| if all { |
| switch v := interface{}(m.GetNewPatchsetRunTrigger()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TriggersValidationError{ |
| field: "NewPatchsetRunTrigger", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TriggersValidationError{ |
| field: "NewPatchsetRunTrigger", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetNewPatchsetRunTrigger()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return TriggersValidationError{ |
| field: "NewPatchsetRunTrigger", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| if len(errors) > 0 { |
| return TriggersMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // TriggersMultiError is an error wrapping multiple validation errors returned |
| // by Triggers.ValidateAll() if the designated constraints aren't met. |
| type TriggersMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m TriggersMultiError) 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 TriggersMultiError) AllErrors() []error { return m } |
| |
| // TriggersValidationError is the validation error returned by |
| // Triggers.Validate if the designated constraints aren't met. |
| type TriggersValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e TriggersValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e TriggersValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e TriggersValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e TriggersValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e TriggersValidationError) ErrorName() string { return "TriggersValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e TriggersValidationError) 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 %sTriggers.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = TriggersValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = TriggersValidationError{} |
| |
| // Validate checks the field values on Submission 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 *Submission) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on Submission 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 SubmissionMultiError, or |
| // nil if none found. |
| func (m *Submission) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *Submission) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if all { |
| switch v := interface{}(m.GetDeadline()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, SubmissionValidationError{ |
| field: "Deadline", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, SubmissionValidationError{ |
| field: "Deadline", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetDeadline()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return SubmissionValidationError{ |
| field: "Deadline", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| // no validation rules for TaskId |
| |
| // no validation rules for TreeOpen |
| |
| if all { |
| switch v := interface{}(m.GetLastTreeCheckTime()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, SubmissionValidationError{ |
| field: "LastTreeCheckTime", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, SubmissionValidationError{ |
| field: "LastTreeCheckTime", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetLastTreeCheckTime()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return SubmissionValidationError{ |
| field: "LastTreeCheckTime", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| if all { |
| switch v := interface{}(m.GetTreeErrorSince()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, SubmissionValidationError{ |
| field: "TreeErrorSince", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, SubmissionValidationError{ |
| field: "TreeErrorSince", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetTreeErrorSince()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return SubmissionValidationError{ |
| field: "TreeErrorSince", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| if len(errors) > 0 { |
| return SubmissionMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // SubmissionMultiError is an error wrapping multiple validation errors |
| // returned by Submission.ValidateAll() if the designated constraints aren't met. |
| type SubmissionMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m SubmissionMultiError) 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 SubmissionMultiError) AllErrors() []error { return m } |
| |
| // SubmissionValidationError is the validation error returned by |
| // Submission.Validate if the designated constraints aren't met. |
| type SubmissionValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e SubmissionValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e SubmissionValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e SubmissionValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e SubmissionValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e SubmissionValidationError) ErrorName() string { return "SubmissionValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e SubmissionValidationError) 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 %sSubmission.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = SubmissionValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = SubmissionValidationError{} |
| |
| // Validate checks the field values on Options 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 *Options) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on Options 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 OptionsMultiError, or nil if none found. |
| func (m *Options) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *Options) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for SkipTreeChecks |
| |
| // no validation rules for SkipEquivalentBuilders |
| |
| // no validation rules for AvoidCancellingTryjobs |
| |
| // no validation rules for SkipTryjobs |
| |
| // no validation rules for SkipPresubmit |
| |
| if len(errors) > 0 { |
| return OptionsMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // OptionsMultiError is an error wrapping multiple validation errors returned |
| // by Options.ValidateAll() if the designated constraints aren't met. |
| type OptionsMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m OptionsMultiError) 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 OptionsMultiError) AllErrors() []error { return m } |
| |
| // OptionsValidationError is the validation error returned by Options.Validate |
| // if the designated constraints aren't met. |
| type OptionsValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e OptionsValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e OptionsValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e OptionsValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e OptionsValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e OptionsValidationError) ErrorName() string { return "OptionsValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e OptionsValidationError) 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 %sOptions.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = OptionsValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = OptionsValidationError{} |
| |
| // Validate checks the field values on LogEntries 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 *LogEntries) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntries 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 LogEntriesMultiError, or |
| // nil if none found. |
| func (m *LogEntries) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntries) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| for idx, item := range m.GetEntries() { |
| _, _ = idx, item |
| |
| if all { |
| switch v := interface{}(item).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntriesValidationError{ |
| field: fmt.Sprintf("Entries[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntriesValidationError{ |
| field: fmt.Sprintf("Entries[%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 LogEntriesValidationError{ |
| field: fmt.Sprintf("Entries[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| } |
| |
| if len(errors) > 0 { |
| return LogEntriesMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntriesMultiError is an error wrapping multiple validation errors |
| // returned by LogEntries.ValidateAll() if the designated constraints aren't met. |
| type LogEntriesMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntriesMultiError) 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 LogEntriesMultiError) AllErrors() []error { return m } |
| |
| // LogEntriesValidationError is the validation error returned by |
| // LogEntries.Validate if the designated constraints aren't met. |
| type LogEntriesValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntriesValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntriesValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntriesValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntriesValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntriesValidationError) ErrorName() string { return "LogEntriesValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntriesValidationError) 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 %sLogEntries.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntriesValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntriesValidationError{} |
| |
| // Validate checks the field values on LogEntry 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 *LogEntry) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry 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 LogEntryMultiError, or nil |
| // if none found. |
| func (m *LogEntry) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry) 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, LogEntryValidationError{ |
| field: "Time", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| 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 LogEntryValidationError{ |
| field: "Time", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| switch v := m.Kind.(type) { |
| case *LogEntry_Created_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetCreated()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "Created", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "Created", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetCreated()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "Created", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_Started_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetStarted()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "Started", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "Started", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetStarted()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "Started", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_ConfigChanged_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetConfigChanged()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "ConfigChanged", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "ConfigChanged", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetConfigChanged()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "ConfigChanged", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_TryjobsRequirementUpdated_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetTryjobsRequirementUpdated()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "TryjobsRequirementUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "TryjobsRequirementUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetTryjobsRequirementUpdated()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "TryjobsRequirementUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_TryjobsUpdated_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetTryjobsUpdated()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "TryjobsUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "TryjobsUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetTryjobsUpdated()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "TryjobsUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_Info_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetInfo()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "Info", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "Info", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetInfo()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "Info", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_TreeChecked_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetTreeChecked()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "TreeChecked", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "TreeChecked", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetTreeChecked()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "TreeChecked", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_Waitlisted_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetWaitlisted()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "Waitlisted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "Waitlisted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetWaitlisted()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "Waitlisted", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_AcquiredSubmitQueue_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetAcquiredSubmitQueue()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "AcquiredSubmitQueue", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "AcquiredSubmitQueue", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetAcquiredSubmitQueue()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "AcquiredSubmitQueue", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_ReleasedSubmitQueue_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetReleasedSubmitQueue()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "ReleasedSubmitQueue", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "ReleasedSubmitQueue", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetReleasedSubmitQueue()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "ReleasedSubmitQueue", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_ClSubmitted: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetClSubmitted()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "ClSubmitted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "ClSubmitted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetClSubmitted()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "ClSubmitted", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_SubmissionFailure_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetSubmissionFailure()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "SubmissionFailure", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "SubmissionFailure", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetSubmissionFailure()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "SubmissionFailure", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *LogEntry_RunEnded_: |
| if v == nil { |
| err := LogEntryValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetRunEnded()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "RunEnded", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntryValidationError{ |
| field: "RunEnded", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetRunEnded()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntryValidationError{ |
| field: "RunEnded", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| default: |
| _ = v // ensures v is used |
| } |
| |
| if len(errors) > 0 { |
| return LogEntryMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntryMultiError is an error wrapping multiple validation errors returned |
| // by LogEntry.ValidateAll() if the designated constraints aren't met. |
| type LogEntryMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntryMultiError) 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 LogEntryMultiError) AllErrors() []error { return m } |
| |
| // LogEntryValidationError is the validation error returned by |
| // LogEntry.Validate if the designated constraints aren't met. |
| type LogEntryValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntryValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntryValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntryValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntryValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntryValidationError) ErrorName() string { return "LogEntryValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntryValidationError) 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 %sLogEntry.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntryValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntryValidationError{} |
| |
| // Validate checks the field values on Tryjobs 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 *Tryjobs) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on Tryjobs 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 TryjobsMultiError, or nil if none found. |
| func (m *Tryjobs) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *Tryjobs) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if all { |
| switch v := interface{}(m.GetRequirement()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: "Requirement", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: "Requirement", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetRequirement()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return TryjobsValidationError{ |
| field: "Requirement", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| if all { |
| switch v := interface{}(m.GetStagingRequirement()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: "StagingRequirement", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: "StagingRequirement", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetStagingRequirement()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return TryjobsValidationError{ |
| field: "StagingRequirement", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| // no validation rules for RequirementVersion |
| |
| if all { |
| switch v := interface{}(m.GetRequirementComputedAt()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: "RequirementComputedAt", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: "RequirementComputedAt", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetRequirementComputedAt()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return TryjobsValidationError{ |
| field: "RequirementComputedAt", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| for idx, item := range m.GetTryjobs() { |
| _, _ = idx, item |
| |
| if all { |
| switch v := interface{}(item).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: fmt.Sprintf("Tryjobs[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: fmt.Sprintf("Tryjobs[%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 TryjobsValidationError{ |
| field: fmt.Sprintf("Tryjobs[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| } |
| |
| if all { |
| switch v := interface{}(m.GetCqdUpdateTime()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: "CqdUpdateTime", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: "CqdUpdateTime", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetCqdUpdateTime()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return TryjobsValidationError{ |
| field: "CqdUpdateTime", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| if all { |
| switch v := interface{}(m.GetState()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: "State", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TryjobsValidationError{ |
| field: "State", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetState()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return TryjobsValidationError{ |
| field: "State", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| if len(errors) > 0 { |
| return TryjobsMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // TryjobsMultiError is an error wrapping multiple validation errors returned |
| // by Tryjobs.ValidateAll() if the designated constraints aren't met. |
| type TryjobsMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m TryjobsMultiError) 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 TryjobsMultiError) AllErrors() []error { return m } |
| |
| // TryjobsValidationError is the validation error returned by Tryjobs.Validate |
| // if the designated constraints aren't met. |
| type TryjobsValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e TryjobsValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e TryjobsValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e TryjobsValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e TryjobsValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e TryjobsValidationError) ErrorName() string { return "TryjobsValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e TryjobsValidationError) 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 %sTryjobs.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = TryjobsValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = TryjobsValidationError{} |
| |
| // Validate checks the field values on Tryjob 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 *Tryjob) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on Tryjob 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 TryjobMultiError, or nil if none found. |
| func (m *Tryjob) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *Tryjob) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if all { |
| switch v := interface{}(m.GetDefinition()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TryjobValidationError{ |
| field: "Definition", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TryjobValidationError{ |
| field: "Definition", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetDefinition()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return TryjobValidationError{ |
| field: "Definition", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| // no validation rules for Id |
| |
| // no validation rules for Eversion |
| |
| // no validation rules for ExternalId |
| |
| // no validation rules for Status |
| |
| // no validation rules for Reused |
| |
| // no validation rules for Critical |
| |
| if all { |
| switch v := interface{}(m.GetResult()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, TryjobValidationError{ |
| field: "Result", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, TryjobValidationError{ |
| field: "Result", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetResult()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return TryjobValidationError{ |
| field: "Result", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| // no validation rules for CqdDerived |
| |
| if len(errors) > 0 { |
| return TryjobMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // TryjobMultiError is an error wrapping multiple validation errors returned by |
| // Tryjob.ValidateAll() if the designated constraints aren't met. |
| type TryjobMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m TryjobMultiError) 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 TryjobMultiError) AllErrors() []error { return m } |
| |
| // TryjobValidationError is the validation error returned by Tryjob.Validate if |
| // the designated constraints aren't met. |
| type TryjobValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e TryjobValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e TryjobValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e TryjobValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e TryjobValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e TryjobValidationError) ErrorName() string { return "TryjobValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e TryjobValidationError) 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 %sTryjob.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = TryjobValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = TryjobValidationError{} |
| |
| // Validate checks the field values on OngoingLongOps 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 *OngoingLongOps) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on OngoingLongOps 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 OngoingLongOpsMultiError, |
| // or nil if none found. |
| func (m *OngoingLongOps) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *OngoingLongOps) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| { |
| sorted_keys := make([]string, len(m.GetOps())) |
| i := 0 |
| for key := range m.GetOps() { |
| sorted_keys[i] = key |
| i++ |
| } |
| sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
| for _, key := range sorted_keys { |
| val := m.GetOps()[key] |
| _ = val |
| |
| // no validation rules for Ops[key] |
| |
| if all { |
| switch v := interface{}(val).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, OngoingLongOpsValidationError{ |
| field: fmt.Sprintf("Ops[%v]", key), |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, OngoingLongOpsValidationError{ |
| field: fmt.Sprintf("Ops[%v]", key), |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return OngoingLongOpsValidationError{ |
| field: fmt.Sprintf("Ops[%v]", key), |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| } |
| } |
| |
| if len(errors) > 0 { |
| return OngoingLongOpsMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // OngoingLongOpsMultiError is an error wrapping multiple validation errors |
| // returned by OngoingLongOps.ValidateAll() if the designated constraints |
| // aren't met. |
| type OngoingLongOpsMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m OngoingLongOpsMultiError) 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 OngoingLongOpsMultiError) AllErrors() []error { return m } |
| |
| // OngoingLongOpsValidationError is the validation error returned by |
| // OngoingLongOps.Validate if the designated constraints aren't met. |
| type OngoingLongOpsValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e OngoingLongOpsValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e OngoingLongOpsValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e OngoingLongOpsValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e OngoingLongOpsValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e OngoingLongOpsValidationError) ErrorName() string { return "OngoingLongOpsValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e OngoingLongOpsValidationError) 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 %sOngoingLongOps.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = OngoingLongOpsValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = OngoingLongOpsValidationError{} |
| |
| // Validate checks the field values on LogEntry_Created 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 *LogEntry_Created) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_Created 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 |
| // LogEntry_CreatedMultiError, or nil if none found. |
| func (m *LogEntry_Created) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_Created) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for ConfigGroupId |
| |
| if len(errors) > 0 { |
| return LogEntry_CreatedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_CreatedMultiError is an error wrapping multiple validation errors |
| // returned by LogEntry_Created.ValidateAll() if the designated constraints |
| // aren't met. |
| type LogEntry_CreatedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_CreatedMultiError) 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 LogEntry_CreatedMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_CreatedValidationError is the validation error returned by |
| // LogEntry_Created.Validate if the designated constraints aren't met. |
| type LogEntry_CreatedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_CreatedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_CreatedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_CreatedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_CreatedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_CreatedValidationError) ErrorName() string { return "LogEntry_CreatedValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_CreatedValidationError) 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 %sLogEntry_Created.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_CreatedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_CreatedValidationError{} |
| |
| // Validate checks the field values on LogEntry_Started 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 *LogEntry_Started) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_Started 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 |
| // LogEntry_StartedMultiError, or nil if none found. |
| func (m *LogEntry_Started) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_Started) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return LogEntry_StartedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_StartedMultiError is an error wrapping multiple validation errors |
| // returned by LogEntry_Started.ValidateAll() if the designated constraints |
| // aren't met. |
| type LogEntry_StartedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_StartedMultiError) 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 LogEntry_StartedMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_StartedValidationError is the validation error returned by |
| // LogEntry_Started.Validate if the designated constraints aren't met. |
| type LogEntry_StartedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_StartedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_StartedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_StartedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_StartedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_StartedValidationError) ErrorName() string { return "LogEntry_StartedValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_StartedValidationError) 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 %sLogEntry_Started.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_StartedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_StartedValidationError{} |
| |
| // Validate checks the field values on LogEntry_ConfigChanged 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 *LogEntry_ConfigChanged) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_ConfigChanged 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 |
| // LogEntry_ConfigChangedMultiError, or nil if none found. |
| func (m *LogEntry_ConfigChanged) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_ConfigChanged) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for ConfigGroupId |
| |
| if len(errors) > 0 { |
| return LogEntry_ConfigChangedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_ConfigChangedMultiError is an error wrapping multiple validation |
| // errors returned by LogEntry_ConfigChanged.ValidateAll() if the designated |
| // constraints aren't met. |
| type LogEntry_ConfigChangedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_ConfigChangedMultiError) 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 LogEntry_ConfigChangedMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_ConfigChangedValidationError is the validation error returned by |
| // LogEntry_ConfigChanged.Validate if the designated constraints aren't met. |
| type LogEntry_ConfigChangedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_ConfigChangedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_ConfigChangedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_ConfigChangedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_ConfigChangedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_ConfigChangedValidationError) ErrorName() string { |
| return "LogEntry_ConfigChangedValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_ConfigChangedValidationError) 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 %sLogEntry_ConfigChanged.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_ConfigChangedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_ConfigChangedValidationError{} |
| |
| // Validate checks the field values on LogEntry_TryjobsRequirementUpdated 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 *LogEntry_TryjobsRequirementUpdated) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_TryjobsRequirementUpdated |
| // 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 |
| // LogEntry_TryjobsRequirementUpdatedMultiError, or nil if none found. |
| func (m *LogEntry_TryjobsRequirementUpdated) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_TryjobsRequirementUpdated) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return LogEntry_TryjobsRequirementUpdatedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_TryjobsRequirementUpdatedMultiError is an error wrapping multiple |
| // validation errors returned by |
| // LogEntry_TryjobsRequirementUpdated.ValidateAll() if the designated |
| // constraints aren't met. |
| type LogEntry_TryjobsRequirementUpdatedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_TryjobsRequirementUpdatedMultiError) 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 LogEntry_TryjobsRequirementUpdatedMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_TryjobsRequirementUpdatedValidationError is the validation error |
| // returned by LogEntry_TryjobsRequirementUpdated.Validate if the designated |
| // constraints aren't met. |
| type LogEntry_TryjobsRequirementUpdatedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_TryjobsRequirementUpdatedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_TryjobsRequirementUpdatedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_TryjobsRequirementUpdatedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_TryjobsRequirementUpdatedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_TryjobsRequirementUpdatedValidationError) ErrorName() string { |
| return "LogEntry_TryjobsRequirementUpdatedValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_TryjobsRequirementUpdatedValidationError) 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 %sLogEntry_TryjobsRequirementUpdated.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_TryjobsRequirementUpdatedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_TryjobsRequirementUpdatedValidationError{} |
| |
| // Validate checks the field values on LogEntry_Info 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 *LogEntry_Info) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_Info 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 LogEntry_InfoMultiError, or |
| // nil if none found. |
| func (m *LogEntry_Info) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_Info) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for Label |
| |
| // no validation rules for Message |
| |
| if len(errors) > 0 { |
| return LogEntry_InfoMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_InfoMultiError is an error wrapping multiple validation errors |
| // returned by LogEntry_Info.ValidateAll() if the designated constraints |
| // aren't met. |
| type LogEntry_InfoMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_InfoMultiError) 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 LogEntry_InfoMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_InfoValidationError is the validation error returned by |
| // LogEntry_Info.Validate if the designated constraints aren't met. |
| type LogEntry_InfoValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_InfoValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_InfoValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_InfoValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_InfoValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_InfoValidationError) ErrorName() string { return "LogEntry_InfoValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_InfoValidationError) 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 %sLogEntry_Info.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_InfoValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_InfoValidationError{} |
| |
| // Validate checks the field values on LogEntry_TryjobsUpdated 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 *LogEntry_TryjobsUpdated) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_TryjobsUpdated 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 |
| // LogEntry_TryjobsUpdatedMultiError, or nil if none found. |
| func (m *LogEntry_TryjobsUpdated) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_TryjobsUpdated) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| for idx, item := range m.GetTryjobs() { |
| _, _ = idx, item |
| |
| if all { |
| switch v := interface{}(item).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntry_TryjobsUpdatedValidationError{ |
| field: fmt.Sprintf("Tryjobs[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntry_TryjobsUpdatedValidationError{ |
| field: fmt.Sprintf("Tryjobs[%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 LogEntry_TryjobsUpdatedValidationError{ |
| field: fmt.Sprintf("Tryjobs[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| } |
| |
| if len(errors) > 0 { |
| return LogEntry_TryjobsUpdatedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_TryjobsUpdatedMultiError is an error wrapping multiple validation |
| // errors returned by LogEntry_TryjobsUpdated.ValidateAll() if the designated |
| // constraints aren't met. |
| type LogEntry_TryjobsUpdatedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_TryjobsUpdatedMultiError) 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 LogEntry_TryjobsUpdatedMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_TryjobsUpdatedValidationError is the validation error returned by |
| // LogEntry_TryjobsUpdated.Validate if the designated constraints aren't met. |
| type LogEntry_TryjobsUpdatedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_TryjobsUpdatedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_TryjobsUpdatedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_TryjobsUpdatedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_TryjobsUpdatedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_TryjobsUpdatedValidationError) ErrorName() string { |
| return "LogEntry_TryjobsUpdatedValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_TryjobsUpdatedValidationError) 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 %sLogEntry_TryjobsUpdated.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_TryjobsUpdatedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_TryjobsUpdatedValidationError{} |
| |
| // Validate checks the field values on LogEntry_TreeChecked 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 *LogEntry_TreeChecked) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_TreeChecked 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 |
| // LogEntry_TreeCheckedMultiError, or nil if none found. |
| func (m *LogEntry_TreeChecked) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_TreeChecked) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for Open |
| |
| if len(errors) > 0 { |
| return LogEntry_TreeCheckedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_TreeCheckedMultiError is an error wrapping multiple validation |
| // errors returned by LogEntry_TreeChecked.ValidateAll() if the designated |
| // constraints aren't met. |
| type LogEntry_TreeCheckedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_TreeCheckedMultiError) 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 LogEntry_TreeCheckedMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_TreeCheckedValidationError is the validation error returned by |
| // LogEntry_TreeChecked.Validate if the designated constraints aren't met. |
| type LogEntry_TreeCheckedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_TreeCheckedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_TreeCheckedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_TreeCheckedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_TreeCheckedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_TreeCheckedValidationError) ErrorName() string { |
| return "LogEntry_TreeCheckedValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_TreeCheckedValidationError) 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 %sLogEntry_TreeChecked.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_TreeCheckedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_TreeCheckedValidationError{} |
| |
| // Validate checks the field values on LogEntry_Waitlisted 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 *LogEntry_Waitlisted) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_Waitlisted 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 |
| // LogEntry_WaitlistedMultiError, or nil if none found. |
| func (m *LogEntry_Waitlisted) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_Waitlisted) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return LogEntry_WaitlistedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_WaitlistedMultiError is an error wrapping multiple validation |
| // errors returned by LogEntry_Waitlisted.ValidateAll() if the designated |
| // constraints aren't met. |
| type LogEntry_WaitlistedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_WaitlistedMultiError) 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 LogEntry_WaitlistedMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_WaitlistedValidationError is the validation error returned by |
| // LogEntry_Waitlisted.Validate if the designated constraints aren't met. |
| type LogEntry_WaitlistedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_WaitlistedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_WaitlistedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_WaitlistedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_WaitlistedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_WaitlistedValidationError) ErrorName() string { |
| return "LogEntry_WaitlistedValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_WaitlistedValidationError) 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 %sLogEntry_Waitlisted.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_WaitlistedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_WaitlistedValidationError{} |
| |
| // Validate checks the field values on LogEntry_AcquiredSubmitQueue 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 *LogEntry_AcquiredSubmitQueue) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_AcquiredSubmitQueue 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 |
| // LogEntry_AcquiredSubmitQueueMultiError, or nil if none found. |
| func (m *LogEntry_AcquiredSubmitQueue) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_AcquiredSubmitQueue) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return LogEntry_AcquiredSubmitQueueMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_AcquiredSubmitQueueMultiError is an error wrapping multiple |
| // validation errors returned by LogEntry_AcquiredSubmitQueue.ValidateAll() if |
| // the designated constraints aren't met. |
| type LogEntry_AcquiredSubmitQueueMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_AcquiredSubmitQueueMultiError) 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 LogEntry_AcquiredSubmitQueueMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_AcquiredSubmitQueueValidationError is the validation error returned |
| // by LogEntry_AcquiredSubmitQueue.Validate if the designated constraints |
| // aren't met. |
| type LogEntry_AcquiredSubmitQueueValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_AcquiredSubmitQueueValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_AcquiredSubmitQueueValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_AcquiredSubmitQueueValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_AcquiredSubmitQueueValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_AcquiredSubmitQueueValidationError) ErrorName() string { |
| return "LogEntry_AcquiredSubmitQueueValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_AcquiredSubmitQueueValidationError) 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 %sLogEntry_AcquiredSubmitQueue.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_AcquiredSubmitQueueValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_AcquiredSubmitQueueValidationError{} |
| |
| // Validate checks the field values on LogEntry_ReleasedSubmitQueue 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 *LogEntry_ReleasedSubmitQueue) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_ReleasedSubmitQueue 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 |
| // LogEntry_ReleasedSubmitQueueMultiError, or nil if none found. |
| func (m *LogEntry_ReleasedSubmitQueue) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_ReleasedSubmitQueue) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return LogEntry_ReleasedSubmitQueueMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_ReleasedSubmitQueueMultiError is an error wrapping multiple |
| // validation errors returned by LogEntry_ReleasedSubmitQueue.ValidateAll() if |
| // the designated constraints aren't met. |
| type LogEntry_ReleasedSubmitQueueMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_ReleasedSubmitQueueMultiError) 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 LogEntry_ReleasedSubmitQueueMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_ReleasedSubmitQueueValidationError is the validation error returned |
| // by LogEntry_ReleasedSubmitQueue.Validate if the designated constraints |
| // aren't met. |
| type LogEntry_ReleasedSubmitQueueValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_ReleasedSubmitQueueValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_ReleasedSubmitQueueValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_ReleasedSubmitQueueValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_ReleasedSubmitQueueValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_ReleasedSubmitQueueValidationError) ErrorName() string { |
| return "LogEntry_ReleasedSubmitQueueValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_ReleasedSubmitQueueValidationError) 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 %sLogEntry_ReleasedSubmitQueue.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_ReleasedSubmitQueueValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_ReleasedSubmitQueueValidationError{} |
| |
| // Validate checks the field values on LogEntry_CLSubmitted 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 *LogEntry_CLSubmitted) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_CLSubmitted 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 |
| // LogEntry_CLSubmittedMultiError, or nil if none found. |
| func (m *LogEntry_CLSubmitted) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_CLSubmitted) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for TotalSubmitted |
| |
| if len(errors) > 0 { |
| return LogEntry_CLSubmittedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_CLSubmittedMultiError is an error wrapping multiple validation |
| // errors returned by LogEntry_CLSubmitted.ValidateAll() if the designated |
| // constraints aren't met. |
| type LogEntry_CLSubmittedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_CLSubmittedMultiError) 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 LogEntry_CLSubmittedMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_CLSubmittedValidationError is the validation error returned by |
| // LogEntry_CLSubmitted.Validate if the designated constraints aren't met. |
| type LogEntry_CLSubmittedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_CLSubmittedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_CLSubmittedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_CLSubmittedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_CLSubmittedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_CLSubmittedValidationError) ErrorName() string { |
| return "LogEntry_CLSubmittedValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_CLSubmittedValidationError) 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 %sLogEntry_CLSubmitted.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_CLSubmittedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_CLSubmittedValidationError{} |
| |
| // Validate checks the field values on LogEntry_SubmissionFailure 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 *LogEntry_SubmissionFailure) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_SubmissionFailure 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 |
| // LogEntry_SubmissionFailureMultiError, or nil if none found. |
| func (m *LogEntry_SubmissionFailure) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_SubmissionFailure) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if all { |
| switch v := interface{}(m.GetEvent()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, LogEntry_SubmissionFailureValidationError{ |
| field: "Event", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, LogEntry_SubmissionFailureValidationError{ |
| field: "Event", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetEvent()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return LogEntry_SubmissionFailureValidationError{ |
| field: "Event", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| if len(errors) > 0 { |
| return LogEntry_SubmissionFailureMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_SubmissionFailureMultiError is an error wrapping multiple |
| // validation errors returned by LogEntry_SubmissionFailure.ValidateAll() if |
| // the designated constraints aren't met. |
| type LogEntry_SubmissionFailureMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_SubmissionFailureMultiError) 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 LogEntry_SubmissionFailureMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_SubmissionFailureValidationError is the validation error returned |
| // by LogEntry_SubmissionFailure.Validate if the designated constraints aren't met. |
| type LogEntry_SubmissionFailureValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_SubmissionFailureValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_SubmissionFailureValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_SubmissionFailureValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_SubmissionFailureValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_SubmissionFailureValidationError) ErrorName() string { |
| return "LogEntry_SubmissionFailureValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_SubmissionFailureValidationError) 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 %sLogEntry_SubmissionFailure.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_SubmissionFailureValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_SubmissionFailureValidationError{} |
| |
| // Validate checks the field values on LogEntry_RunEnded 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 *LogEntry_RunEnded) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on LogEntry_RunEnded 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 |
| // LogEntry_RunEndedMultiError, or nil if none found. |
| func (m *LogEntry_RunEnded) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *LogEntry_RunEnded) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return LogEntry_RunEndedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // LogEntry_RunEndedMultiError is an error wrapping multiple validation errors |
| // returned by LogEntry_RunEnded.ValidateAll() if the designated constraints |
| // aren't met. |
| type LogEntry_RunEndedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m LogEntry_RunEndedMultiError) 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 LogEntry_RunEndedMultiError) AllErrors() []error { return m } |
| |
| // LogEntry_RunEndedValidationError is the validation error returned by |
| // LogEntry_RunEnded.Validate if the designated constraints aren't met. |
| type LogEntry_RunEndedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e LogEntry_RunEndedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e LogEntry_RunEndedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e LogEntry_RunEndedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e LogEntry_RunEndedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e LogEntry_RunEndedValidationError) ErrorName() string { |
| return "LogEntry_RunEndedValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e LogEntry_RunEndedValidationError) 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 %sLogEntry_RunEnded.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = LogEntry_RunEndedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = LogEntry_RunEndedValidationError{} |
| |
| // Validate checks the field values on OngoingLongOps_Op 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 *OngoingLongOps_Op) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on OngoingLongOps_Op 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 |
| // OngoingLongOps_OpMultiError, or nil if none found. |
| func (m *OngoingLongOps_Op) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *OngoingLongOps_Op) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if all { |
| switch v := interface{}(m.GetDeadline()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, OngoingLongOps_OpValidationError{ |
| field: "Deadline", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, OngoingLongOps_OpValidationError{ |
| field: "Deadline", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetDeadline()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return OngoingLongOps_OpValidationError{ |
| field: "Deadline", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| // no validation rules for CancelRequested |
| |
| switch v := m.Work.(type) { |
| case *OngoingLongOps_Op_PostStartMessage: |
| if v == nil { |
| err := OngoingLongOps_OpValidationError{ |
| field: "Work", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| // no validation rules for PostStartMessage |
| case *OngoingLongOps_Op_ResetTriggers_: |
| if v == nil { |
| err := OngoingLongOps_OpValidationError{ |
| field: "Work", |
| 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, OngoingLongOps_OpValidationError{ |
| field: "ResetTriggers", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, OngoingLongOps_OpValidationError{ |
| 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 OngoingLongOps_OpValidationError{ |
| field: "ResetTriggers", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *OngoingLongOps_Op_ExecuteTryjobs: |
| if v == nil { |
| err := OngoingLongOps_OpValidationError{ |
| field: "Work", |
| 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, OngoingLongOps_OpValidationError{ |
| field: "ExecuteTryjobs", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, OngoingLongOps_OpValidationError{ |
| 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 OngoingLongOps_OpValidationError{ |
| field: "ExecuteTryjobs", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *OngoingLongOps_Op_ExecutePostAction: |
| if v == nil { |
| err := OngoingLongOps_OpValidationError{ |
| field: "Work", |
| 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, OngoingLongOps_OpValidationError{ |
| field: "ExecutePostAction", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, OngoingLongOps_OpValidationError{ |
| 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 OngoingLongOps_OpValidationError{ |
| field: "ExecutePostAction", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *OngoingLongOps_Op_PostGerritMessage_: |
| if v == nil { |
| err := OngoingLongOps_OpValidationError{ |
| field: "Work", |
| 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, OngoingLongOps_OpValidationError{ |
| field: "PostGerritMessage", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, OngoingLongOps_OpValidationError{ |
| 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 OngoingLongOps_OpValidationError{ |
| field: "PostGerritMessage", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| default: |
| _ = v // ensures v is used |
| } |
| |
| if len(errors) > 0 { |
| return OngoingLongOps_OpMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // OngoingLongOps_OpMultiError is an error wrapping multiple validation errors |
| // returned by OngoingLongOps_Op.ValidateAll() if the designated constraints |
| // aren't met. |
| type OngoingLongOps_OpMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m OngoingLongOps_OpMultiError) 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 OngoingLongOps_OpMultiError) AllErrors() []error { return m } |
| |
| // OngoingLongOps_OpValidationError is the validation error returned by |
| // OngoingLongOps_Op.Validate if the designated constraints aren't met. |
| type OngoingLongOps_OpValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e OngoingLongOps_OpValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e OngoingLongOps_OpValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e OngoingLongOps_OpValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e OngoingLongOps_OpValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e OngoingLongOps_OpValidationError) ErrorName() string { |
| return "OngoingLongOps_OpValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e OngoingLongOps_OpValidationError) 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 %sOngoingLongOps_Op.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = OngoingLongOps_OpValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = OngoingLongOps_OpValidationError{} |
| |
| // Validate checks the field values on OngoingLongOps_Op_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 *OngoingLongOps_Op_ResetTriggers) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on OngoingLongOps_Op_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 |
| // OngoingLongOps_Op_ResetTriggersMultiError, or nil if none found. |
| func (m *OngoingLongOps_Op_ResetTriggers) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *OngoingLongOps_Op_ResetTriggers) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| for idx, item := range m.GetRequests() { |
| _, _ = idx, item |
| |
| if all { |
| switch v := interface{}(item).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, OngoingLongOps_Op_ResetTriggersValidationError{ |
| field: fmt.Sprintf("Requests[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, OngoingLongOps_Op_ResetTriggersValidationError{ |
| field: fmt.Sprintf("Requests[%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 OngoingLongOps_Op_ResetTriggersValidationError{ |
| field: fmt.Sprintf("Requests[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| } |
| |
| // no validation rules for RunStatusIfSucceeded |
| |
| if len(errors) > 0 { |
| return OngoingLongOps_Op_ResetTriggersMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // OngoingLongOps_Op_ResetTriggersMultiError is an error wrapping multiple |
| // validation errors returned by OngoingLongOps_Op_ResetTriggers.ValidateAll() |
| // if the designated constraints aren't met. |
| type OngoingLongOps_Op_ResetTriggersMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m OngoingLongOps_Op_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 OngoingLongOps_Op_ResetTriggersMultiError) AllErrors() []error { return m } |
| |
| // OngoingLongOps_Op_ResetTriggersValidationError is the validation error |
| // returned by OngoingLongOps_Op_ResetTriggers.Validate if the designated |
| // constraints aren't met. |
| type OngoingLongOps_Op_ResetTriggersValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e OngoingLongOps_Op_ResetTriggersValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e OngoingLongOps_Op_ResetTriggersValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e OngoingLongOps_Op_ResetTriggersValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e OngoingLongOps_Op_ResetTriggersValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e OngoingLongOps_Op_ResetTriggersValidationError) ErrorName() string { |
| return "OngoingLongOps_Op_ResetTriggersValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e OngoingLongOps_Op_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 %sOngoingLongOps_Op_ResetTriggers.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = OngoingLongOps_Op_ResetTriggersValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = OngoingLongOps_Op_ResetTriggersValidationError{} |
| |
| // Validate checks the field values on |
| // OngoingLongOps_Op_ExecutePostActionPayload 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 *OngoingLongOps_Op_ExecutePostActionPayload) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on |
| // OngoingLongOps_Op_ExecutePostActionPayload 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 |
| // OngoingLongOps_Op_ExecutePostActionPayloadMultiError, or nil if none found. |
| func (m *OngoingLongOps_Op_ExecutePostActionPayload) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *OngoingLongOps_Op_ExecutePostActionPayload) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for Name |
| |
| switch v := m.Kind.(type) { |
| case *OngoingLongOps_Op_ExecutePostActionPayload_ConfigAction: |
| if v == nil { |
| err := OngoingLongOps_Op_ExecutePostActionPayloadValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetConfigAction()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, OngoingLongOps_Op_ExecutePostActionPayloadValidationError{ |
| field: "ConfigAction", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, OngoingLongOps_Op_ExecutePostActionPayloadValidationError{ |
| field: "ConfigAction", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetConfigAction()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return OngoingLongOps_Op_ExecutePostActionPayloadValidationError{ |
| field: "ConfigAction", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuota_: |
| if v == nil { |
| err := OngoingLongOps_Op_ExecutePostActionPayloadValidationError{ |
| field: "Kind", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetCreditRunQuota()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, OngoingLongOps_Op_ExecutePostActionPayloadValidationError{ |
| field: "CreditRunQuota", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, OngoingLongOps_Op_ExecutePostActionPayloadValidationError{ |
| field: "CreditRunQuota", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetCreditRunQuota()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return OngoingLongOps_Op_ExecutePostActionPayloadValidationError{ |
| field: "CreditRunQuota", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| default: |
| _ = v // ensures v is used |
| } |
| |
| if len(errors) > 0 { |
| return OngoingLongOps_Op_ExecutePostActionPayloadMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // OngoingLongOps_Op_ExecutePostActionPayloadMultiError is an error wrapping |
| // multiple validation errors returned by |
| // OngoingLongOps_Op_ExecutePostActionPayload.ValidateAll() if the designated |
| // constraints aren't met. |
| type OngoingLongOps_Op_ExecutePostActionPayloadMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m OngoingLongOps_Op_ExecutePostActionPayloadMultiError) 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 OngoingLongOps_Op_ExecutePostActionPayloadMultiError) AllErrors() []error { return m } |
| |
| // OngoingLongOps_Op_ExecutePostActionPayloadValidationError is the validation |
| // error returned by OngoingLongOps_Op_ExecutePostActionPayload.Validate if |
| // the designated constraints aren't met. |
| type OngoingLongOps_Op_ExecutePostActionPayloadValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e OngoingLongOps_Op_ExecutePostActionPayloadValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e OngoingLongOps_Op_ExecutePostActionPayloadValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e OngoingLongOps_Op_ExecutePostActionPayloadValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e OngoingLongOps_Op_ExecutePostActionPayloadValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e OngoingLongOps_Op_ExecutePostActionPayloadValidationError) ErrorName() string { |
| return "OngoingLongOps_Op_ExecutePostActionPayloadValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e OngoingLongOps_Op_ExecutePostActionPayloadValidationError) 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 %sOngoingLongOps_Op_ExecutePostActionPayload.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = OngoingLongOps_Op_ExecutePostActionPayloadValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = OngoingLongOps_Op_ExecutePostActionPayloadValidationError{} |
| |
| // Validate checks the field values on OngoingLongOps_Op_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 *OngoingLongOps_Op_PostGerritMessage) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on OngoingLongOps_Op_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 |
| // OngoingLongOps_Op_PostGerritMessageMultiError, or nil if none found. |
| func (m *OngoingLongOps_Op_PostGerritMessage) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *OngoingLongOps_Op_PostGerritMessage) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for Message |
| |
| if len(errors) > 0 { |
| return OngoingLongOps_Op_PostGerritMessageMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // OngoingLongOps_Op_PostGerritMessageMultiError is an error wrapping multiple |
| // validation errors returned by |
| // OngoingLongOps_Op_PostGerritMessage.ValidateAll() if the designated |
| // constraints aren't met. |
| type OngoingLongOps_Op_PostGerritMessageMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m OngoingLongOps_Op_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 OngoingLongOps_Op_PostGerritMessageMultiError) AllErrors() []error { return m } |
| |
| // OngoingLongOps_Op_PostGerritMessageValidationError is the validation error |
| // returned by OngoingLongOps_Op_PostGerritMessage.Validate if the designated |
| // constraints aren't met. |
| type OngoingLongOps_Op_PostGerritMessageValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e OngoingLongOps_Op_PostGerritMessageValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e OngoingLongOps_Op_PostGerritMessageValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e OngoingLongOps_Op_PostGerritMessageValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e OngoingLongOps_Op_PostGerritMessageValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e OngoingLongOps_Op_PostGerritMessageValidationError) ErrorName() string { |
| return "OngoingLongOps_Op_PostGerritMessageValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e OngoingLongOps_Op_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 %sOngoingLongOps_Op_PostGerritMessage.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = OngoingLongOps_Op_PostGerritMessageValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = OngoingLongOps_Op_PostGerritMessageValidationError{} |
| |
| // Validate checks the field values on OngoingLongOps_Op_ResetTriggers_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 *OngoingLongOps_Op_ResetTriggers_Request) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on |
| // OngoingLongOps_Op_ResetTriggers_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 |
| // OngoingLongOps_Op_ResetTriggers_RequestMultiError, or nil if none found. |
| func (m *OngoingLongOps_Op_ResetTriggers_Request) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *OngoingLongOps_Op_ResetTriggers_Request) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for Clid |
| |
| // no validation rules for Message |
| |
| // no validation rules for AddToAttentionReason |
| |
| if len(errors) > 0 { |
| return OngoingLongOps_Op_ResetTriggers_RequestMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // OngoingLongOps_Op_ResetTriggers_RequestMultiError is an error wrapping |
| // multiple validation errors returned by |
| // OngoingLongOps_Op_ResetTriggers_Request.ValidateAll() if the designated |
| // constraints aren't met. |
| type OngoingLongOps_Op_ResetTriggers_RequestMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m OngoingLongOps_Op_ResetTriggers_RequestMultiError) Error() string { |
| var msgs []string |
| for _, err := range m { |
| msgs = append(msgs, err.Error()) |
| } |
| return strings.Join(msgs, "; ") |
| } |
| |
| // AllErrors returns a list of validation violation errors. |
| func (m OngoingLongOps_Op_ResetTriggers_RequestMultiError) AllErrors() []error { return m } |
| |
| // OngoingLongOps_Op_ResetTriggers_RequestValidationError is the validation |
| // error returned by OngoingLongOps_Op_ResetTriggers_Request.Validate if the |
| // designated constraints aren't met. |
| type OngoingLongOps_Op_ResetTriggers_RequestValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e OngoingLongOps_Op_ResetTriggers_RequestValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e OngoingLongOps_Op_ResetTriggers_RequestValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e OngoingLongOps_Op_ResetTriggers_RequestValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e OngoingLongOps_Op_ResetTriggers_RequestValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e OngoingLongOps_Op_ResetTriggers_RequestValidationError) ErrorName() string { |
| return "OngoingLongOps_Op_ResetTriggers_RequestValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e OngoingLongOps_Op_ResetTriggers_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 %sOngoingLongOps_Op_ResetTriggers_Request.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = OngoingLongOps_Op_ResetTriggers_RequestValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = OngoingLongOps_Op_ResetTriggers_RequestValidationError{} |
| |
| // Validate checks the field values on |
| // OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuota 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 *OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuota) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on |
| // OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuota 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 |
| // OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuotaMultiError, or nil |
| // if none found. |
| func (m *OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuota) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuota) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuotaMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuotaMultiError is an |
| // error wrapping multiple validation errors returned by |
| // OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuota.ValidateAll() if |
| // the designated constraints aren't met. |
| type OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuotaMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuotaMultiError) 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 OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuotaMultiError) AllErrors() []error { |
| return m |
| } |
| |
| // OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuotaValidationError is |
| // the validation error returned by |
| // OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuota.Validate if the |
| // designated constraints aren't met. |
| type OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuotaValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuotaValidationError) Field() string { |
| return e.field |
| } |
| |
| // Reason function returns reason value. |
| func (e OngoingLongOps_Op_ExecutePostActionPayload_CreditRunQuotaValidationError) Reason() string { |
| return e.reason | <