| // Code generated by protoc-gen-validate. DO NOT EDIT. |
| // source: go.chromium.org/luci/cv/api/v0/service_runs.proto |
| |
| package cvpb |
| |
| 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 GetRunRequest 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 *GetRunRequest) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on GetRunRequest 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 GetRunRequestMultiError, or |
| // nil if none found. |
| func (m *GetRunRequest) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *GetRunRequest) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for Id |
| |
| if len(errors) > 0 { |
| return GetRunRequestMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // GetRunRequestMultiError is an error wrapping multiple validation errors |
| // returned by GetRunRequest.ValidateAll() if the designated constraints |
| // aren't met. |
| type GetRunRequestMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m GetRunRequestMultiError) 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 GetRunRequestMultiError) AllErrors() []error { return m } |
| |
| // GetRunRequestValidationError is the validation error returned by |
| // GetRunRequest.Validate if the designated constraints aren't met. |
| type GetRunRequestValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e GetRunRequestValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e GetRunRequestValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e GetRunRequestValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e GetRunRequestValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e GetRunRequestValidationError) ErrorName() string { return "GetRunRequestValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e GetRunRequestValidationError) 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 %sGetRunRequest.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = GetRunRequestValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = GetRunRequestValidationError{} |
| |
| // Validate checks the field values on SearchRunsRequest 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 *SearchRunsRequest) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on SearchRunsRequest 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 |
| // SearchRunsRequestMultiError, or nil if none found. |
| func (m *SearchRunsRequest) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *SearchRunsRequest) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| if all { |
| switch v := interface{}(m.GetPredicate()).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, SearchRunsRequestValidationError{ |
| field: "Predicate", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, SearchRunsRequestValidationError{ |
| field: "Predicate", |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| } |
| } else if v, ok := interface{}(m.GetPredicate()).(interface{ Validate() error }); ok { |
| if err := v.Validate(); err != nil { |
| return SearchRunsRequestValidationError{ |
| field: "Predicate", |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| // no validation rules for PageSize |
| |
| // no validation rules for PageToken |
| |
| if len(errors) > 0 { |
| return SearchRunsRequestMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // SearchRunsRequestMultiError is an error wrapping multiple validation errors |
| // returned by SearchRunsRequest.ValidateAll() if the designated constraints |
| // aren't met. |
| type SearchRunsRequestMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m SearchRunsRequestMultiError) 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 SearchRunsRequestMultiError) AllErrors() []error { return m } |
| |
| // SearchRunsRequestValidationError is the validation error returned by |
| // SearchRunsRequest.Validate if the designated constraints aren't met. |
| type SearchRunsRequestValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e SearchRunsRequestValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e SearchRunsRequestValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e SearchRunsRequestValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e SearchRunsRequestValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e SearchRunsRequestValidationError) ErrorName() string { |
| return "SearchRunsRequestValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e SearchRunsRequestValidationError) 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 %sSearchRunsRequest.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = SearchRunsRequestValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = SearchRunsRequestValidationError{} |
| |
| // Validate checks the field values on SearchRunsResponse 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 *SearchRunsResponse) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on SearchRunsResponse 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 |
| // SearchRunsResponseMultiError, or nil if none found. |
| func (m *SearchRunsResponse) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *SearchRunsResponse) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| for idx, item := range m.GetRuns() { |
| _, _ = idx, item |
| |
| if all { |
| switch v := interface{}(item).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, SearchRunsResponseValidationError{ |
| field: fmt.Sprintf("Runs[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, SearchRunsResponseValidationError{ |
| field: fmt.Sprintf("Runs[%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 SearchRunsResponseValidationError{ |
| field: fmt.Sprintf("Runs[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| } |
| |
| // no validation rules for NextPageToken |
| |
| if len(errors) > 0 { |
| return SearchRunsResponseMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // SearchRunsResponseMultiError is an error wrapping multiple validation errors |
| // returned by SearchRunsResponse.ValidateAll() if the designated constraints |
| // aren't met. |
| type SearchRunsResponseMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m SearchRunsResponseMultiError) 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 SearchRunsResponseMultiError) AllErrors() []error { return m } |
| |
| // SearchRunsResponseValidationError is the validation error returned by |
| // SearchRunsResponse.Validate if the designated constraints aren't met. |
| type SearchRunsResponseValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e SearchRunsResponseValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e SearchRunsResponseValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e SearchRunsResponseValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e SearchRunsResponseValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e SearchRunsResponseValidationError) ErrorName() string { |
| return "SearchRunsResponseValidationError" |
| } |
| |
| // Error satisfies the builtin error interface |
| func (e SearchRunsResponseValidationError) 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 %sSearchRunsResponse.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = SearchRunsResponseValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = SearchRunsResponseValidationError{} |
| |
| // Validate checks the field values on RunPredicate 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 *RunPredicate) Validate() error { |
| return m.validate(false) |
| } |
| |
| // ValidateAll checks the field values on RunPredicate 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 RunPredicateMultiError, or |
| // nil if none found. |
| func (m *RunPredicate) ValidateAll() error { |
| return m.validate(true) |
| } |
| |
| func (m *RunPredicate) validate(all bool) error { |
| if m == nil { |
| return nil |
| } |
| |
| var errors []error |
| |
| // no validation rules for Project |
| |
| for idx, item := range m.GetGerritChanges() { |
| _, _ = idx, item |
| |
| if all { |
| switch v := interface{}(item).(type) { |
| case interface{ ValidateAll() error }: |
| if err := v.ValidateAll(); err != nil { |
| errors = append(errors, RunPredicateValidationError{ |
| field: fmt.Sprintf("GerritChanges[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| }) |
| } |
| case interface{ Validate() error }: |
| if err := v.Validate(); err != nil { |
| errors = append(errors, RunPredicateValidationError{ |
| field: fmt.Sprintf("GerritChanges[%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 RunPredicateValidationError{ |
| field: fmt.Sprintf("GerritChanges[%v]", idx), |
| reason: "embedded message failed validation", |
| cause: err, |
| } |
| } |
| } |
| |
| } |
| |
| if len(errors) > 0 { |
| return RunPredicateMultiError(errors) |
| } |
| |
| return nil |
| } |
| |
| // RunPredicateMultiError is an error wrapping multiple validation errors |
| // returned by RunPredicate.ValidateAll() if the designated constraints aren't met. |
| type RunPredicateMultiError []error |
| |
| // Error returns a concatenation of all the error messages it wraps. |
| func (m RunPredicateMultiError) 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 RunPredicateMultiError) AllErrors() []error { return m } |
| |
| // RunPredicateValidationError is the validation error returned by |
| // RunPredicate.Validate if the designated constraints aren't met. |
| type RunPredicateValidationError struct { |
| field string |
| reason string |
| cause error |
| key bool |
| } |
| |
| // Field function returns field value. |
| func (e RunPredicateValidationError) Field() string { return e.field } |
| |
| // Reason function returns reason value. |
| func (e RunPredicateValidationError) Reason() string { return e.reason } |
| |
| // Cause function returns cause value. |
| func (e RunPredicateValidationError) Cause() error { return e.cause } |
| |
| // Key function returns key value. |
| func (e RunPredicateValidationError) Key() bool { return e.key } |
| |
| // ErrorName returns error name. |
| func (e RunPredicateValidationError) ErrorName() string { return "RunPredicateValidationError" } |
| |
| // Error satisfies the builtin error interface |
| func (e RunPredicateValidationError) 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 %sRunPredicate.%s: %s%s", |
| key, |
| e.field, |
| e.reason, |
| cause) |
| } |
| |
| var _ error = RunPredicateValidationError{} |
| |
| var _ interface { |
| Field() string |
| Reason() string |
| Key() bool |
| Cause() error |
| ErrorName() string |
| } = RunPredicateValidationError{} |