| // Code generated by protoc-gen-validate. DO NOT EDIT. |
| // source: go.chromium.org/luci/cv/internal/run/eventpb/events.proto |
| |
| package eventpb |
| |
| import ( |
| "bytes" |
| "errors" |
| "fmt" |
| "net" |
| "net/mail" |
| "net/url" |
| "regexp" |
| "sort" |
| "strings" |
| "time" |
| "unicode/utf8" |
| |
| "google.golang.org/protobuf/types/known/anypb" |
| ) |
| |
| // ensure the imports are used |
| var ( |
| _ = bytes.MinRead |
| _ = errors.New("") |
| _ = fmt.Print |
| _ = utf8.UTFMax |
| _ = (*regexp.Regexp)(nil) |
| _ = (*strings.Reader)(nil) |
| _ = net.IPv4len |
| _ = time.Duration(0) |
| _ = (*url.URL)(nil) |
| _ = (*mail.Address)(nil) |
| _ = anypb.Any{} |
| _ = sort.Sort |
| ) |
| |
| // Validate checks the field values on Event 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 *Event) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on Event 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 EventMultiError, or nil if none found. |
| func (m *Event) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *Event) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if all { |
| switch v := interface{}(m.GetProcessAfter()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "ProcessAfter", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "ProcessAfter", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetProcessAfter()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "ProcessAfter", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| switch v := m.Event.(type) { |
| case *Event_Start: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetStart()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "Start", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "Start", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetStart()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "Start", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *Event_Cancel: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetCancel()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "Cancel", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "Cancel", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetCancel()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "Cancel", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *Event_Poke: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetPoke()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "Poke", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "Poke", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetPoke()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "Poke", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *Event_NewConfig: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetNewConfig()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "NewConfig", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "NewConfig", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetNewConfig()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "NewConfig", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *Event_ClsUpdated: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetClsUpdated()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "ClsUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "ClsUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetClsUpdated()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "ClsUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *Event_ReadyForSubmission: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetReadyForSubmission()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "ReadyForSubmission", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "ReadyForSubmission", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetReadyForSubmission()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "ReadyForSubmission", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *Event_ClsSubmitted: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetClsSubmitted()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "ClsSubmitted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "ClsSubmitted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetClsSubmitted()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "ClsSubmitted", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *Event_SubmissionCompleted: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetSubmissionCompleted()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "SubmissionCompleted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "SubmissionCompleted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetSubmissionCompleted()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "SubmissionCompleted", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *Event_LongOpCompleted: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetLongOpCompleted()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "LongOpCompleted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "LongOpCompleted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetLongOpCompleted()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "LongOpCompleted", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *Event_TryjobsUpdated: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| 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, EventValidationError{ |
| field: "TryjobsUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| 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 EventValidationError{ |
| field: "TryjobsUpdated", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| case *Event_ParentRunCompleted: |
| if v == nil { |
| err := EventValidationError{ |
| field: "Event", |
| reason: "oneof value cannot be a typed-nil", |
| } |
| if !all { |
| return err |
| } |
| errors = append(errors, err) |
| } |
| |
| if all { |
| switch v := interface{}(m.GetParentRunCompleted()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "ParentRunCompleted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, EventValidationError{ |
| field: "ParentRunCompleted", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetParentRunCompleted()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return EventValidationError{ |
| field: "ParentRunCompleted", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| default: |
| _ = v // ensures v is used |
| } |
| |
| if len(errors) > 0 { |
| return EventMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // EventMultiError is an error wrapping multiple validation errors returned by |
| // Event.ValidateAll() if the designated constraints aren't met. |
| type EventMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m EventMultiError) 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 EventMultiError) AllErrors() []error { return m } |
| |
| // EventValidationError is the validation error returned by Event.Validate if |
| // the designated constraints aren't met. |
| type EventValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e EventValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e EventValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e EventValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e EventValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e EventValidationError) ErrorName() string { return "EventValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e EventValidationError) 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 %sEvent.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = EventValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = EventValidationError{} |
| |
| // Validate checks the field values on Start 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 *Start) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on Start 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 StartMultiError, or nil if none found. |
| func (m *Start) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *Start) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return StartMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // StartMultiError is an error wrapping multiple validation errors returned by |
| // Start.ValidateAll() if the designated constraints aren't met. |
| type StartMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m StartMultiError) 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 StartMultiError) AllErrors() []error { return m } |
| |
| // StartValidationError is the validation error returned by Start.Validate if |
| // the designated constraints aren't met. |
| type StartValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e StartValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e StartValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e StartValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e StartValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e StartValidationError) ErrorName() string { return "StartValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e StartValidationError) 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 %sStart.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = StartValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = StartValidationError{} |
| |
| // Validate checks the field values on Cancel 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 *Cancel) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on Cancel 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 CancelMultiError, or nil if none found. |
| func (m *Cancel) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *Cancel) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for Reason |
| |
| if len(errors) > 0 { |
| return CancelMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // CancelMultiError is an error wrapping multiple validation errors returned by |
| // Cancel.ValidateAll() if the designated constraints aren't met. |
| type CancelMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m CancelMultiError) 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 CancelMultiError) AllErrors() []error { return m } |
| |
| // CancelValidationError is the validation error returned by Cancel.Validate if |
| // the designated constraints aren't met. |
| type CancelValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e CancelValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e CancelValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e CancelValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e CancelValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e CancelValidationError) ErrorName() string { return "CancelValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e CancelValidationError) 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 %sCancel.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = CancelValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = CancelValidationError{} |
| |
| // Validate checks the field values on Poke 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 *Poke) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on Poke 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 PokeMultiError, or nil if none found. |
| func (m *Poke) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *Poke) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return PokeMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // PokeMultiError is an error wrapping multiple validation errors returned by |
| // Poke.ValidateAll() if the designated constraints aren't met. |
| type PokeMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m PokeMultiError) 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 PokeMultiError) AllErrors() []error { return m } |
| |
| // PokeValidationError is the validation error returned by Poke.Validate if the |
| // designated constraints aren't met. |
| type PokeValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e PokeValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e PokeValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e PokeValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e PokeValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e PokeValidationError) ErrorName() string { return "PokeValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e PokeValidationError) 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 %sPoke.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = PokeValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = PokeValidationError{} |
| |
| // Validate checks the field values on NewConfig 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 *NewConfig) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on NewConfig 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 NewConfigMultiError, or nil |
| // if none found. |
| func (m *NewConfig) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *NewConfig) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for Hash |
| |
| // no validation rules for Eversion |
| |
| if len(errors) > 0 { |
| return NewConfigMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // NewConfigMultiError is an error wrapping multiple validation errors returned |
| // by NewConfig.ValidateAll() if the designated constraints aren't met. |
| type NewConfigMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m NewConfigMultiError) 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 NewConfigMultiError) AllErrors() []error { return m } |
| |
| // NewConfigValidationError is the validation error returned by |
| // NewConfig.Validate if the designated constraints aren't met. |
| type NewConfigValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e NewConfigValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e NewConfigValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e NewConfigValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e NewConfigValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e NewConfigValidationError) ErrorName() string { return "NewConfigValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e NewConfigValidationError) 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 %sNewConfig.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = NewConfigValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = NewConfigValidationError{} |
| |
| // Validate checks the field values on ReadyForSubmission 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 *ReadyForSubmission) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on ReadyForSubmission 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 |
| // ReadyForSubmissionMultiError, or nil if none found. |
| func (m *ReadyForSubmission) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *ReadyForSubmission) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return ReadyForSubmissionMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // ReadyForSubmissionMultiError is an error wrapping multiple validation errors |
| // returned by ReadyForSubmission.ValidateAll() if the designated constraints |
| // aren't met. |
| type ReadyForSubmissionMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m ReadyForSubmissionMultiError) 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 ReadyForSubmissionMultiError) AllErrors() []error { return m } |
| |
| // ReadyForSubmissionValidationError is the validation error returned by |
| // ReadyForSubmission.Validate if the designated constraints aren't met. |
| type ReadyForSubmissionValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e ReadyForSubmissionValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e ReadyForSubmissionValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e ReadyForSubmissionValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e ReadyForSubmissionValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e ReadyForSubmissionValidationError) ErrorName() string { |
| return "ReadyForSubmissionValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e ReadyForSubmissionValidationError) 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 %sReadyForSubmission.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = ReadyForSubmissionValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = ReadyForSubmissionValidationError{} |
| |
| // Validate checks the field values on ParentRunCompleted 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 *ParentRunCompleted) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on ParentRunCompleted 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 |
| // ParentRunCompletedMultiError, or nil if none found. |
| func (m *ParentRunCompleted) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *ParentRunCompleted) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return ParentRunCompletedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // ParentRunCompletedMultiError is an error wrapping multiple validation errors |
| // returned by ParentRunCompleted.ValidateAll() if the designated constraints |
| // aren't met. |
| type ParentRunCompletedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m ParentRunCompletedMultiError) 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 ParentRunCompletedMultiError) AllErrors() []error { return m } |
| |
| // ParentRunCompletedValidationError is the validation error returned by |
| // ParentRunCompleted.Validate if the designated constraints aren't met. |
| type ParentRunCompletedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e ParentRunCompletedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e ParentRunCompletedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e ParentRunCompletedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e ParentRunCompletedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e ParentRunCompletedValidationError) ErrorName() string { |
| return "ParentRunCompletedValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e ParentRunCompletedValidationError) 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 %sParentRunCompleted.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = ParentRunCompletedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = ParentRunCompletedValidationError{} |
| |
| // Validate checks the field values on CLsSubmitted 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 *CLsSubmitted) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on CLsSubmitted 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 CLsSubmittedMultiError, or |
| // nil if none found. |
| func (m *CLsSubmitted) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *CLsSubmitted) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if len(errors) > 0 { |
| return CLsSubmittedMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // CLsSubmittedMultiError is an error wrapping multiple validation errors |
| // returned by CLsSubmitted.ValidateAll() if the designated constraints aren't met. |
| type CLsSubmittedMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m CLsSubmittedMultiError) 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 CLsSubmittedMultiError) AllErrors() []error { return m } |
| |
| // CLsSubmittedValidationError is the validation error returned by |
| // CLsSubmitted.Validate if the designated constraints aren't met. |
| type CLsSubmittedValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e CLsSubmittedValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e CLsSubmittedValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e CLsSubmittedValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e CLsSubmittedValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e CLsSubmittedValidationError) ErrorName() string { return "CLsSubmittedValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e CLsSubmittedValidationError) 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 %sCLsSubmitted.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = CLsSubmittedValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = CLsSubmittedValidationError{} |