go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/cv/internal/tryjob/task.pb.validate.go (about)

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: go.chromium.org/luci/cv/internal/tryjob/task.proto
     3  
     4  package tryjob
     5  
     6  import (
     7  	"bytes"
     8  	"errors"
     9  	"fmt"
    10  	"net"
    11  	"net/mail"
    12  	"net/url"
    13  	"regexp"
    14  	"sort"
    15  	"strings"
    16  	"time"
    17  	"unicode/utf8"
    18  
    19  	"google.golang.org/protobuf/types/known/anypb"
    20  )
    21  
    22  // ensure the imports are used
    23  var (
    24  	_ = bytes.MinRead
    25  	_ = errors.New("")
    26  	_ = fmt.Print
    27  	_ = utf8.UTFMax
    28  	_ = (*regexp.Regexp)(nil)
    29  	_ = (*strings.Reader)(nil)
    30  	_ = net.IPv4len
    31  	_ = time.Duration(0)
    32  	_ = (*url.URL)(nil)
    33  	_ = (*mail.Address)(nil)
    34  	_ = anypb.Any{}
    35  	_ = sort.Sort
    36  )
    37  
    38  // Validate checks the field values on UpdateTryjobTask with the rules defined
    39  // in the proto definition for this message. If any rules are violated, the
    40  // first error encountered is returned, or nil if there are no violations.
    41  func (m *UpdateTryjobTask) Validate() error {
    42  	return m.validate(false)
    43  }
    44  
    45  // ValidateAll checks the field values on UpdateTryjobTask with the rules
    46  // defined in the proto definition for this message. If any rules are
    47  // violated, the result is a list of violation errors wrapped in
    48  // UpdateTryjobTaskMultiError, or nil if none found.
    49  func (m *UpdateTryjobTask) ValidateAll() error {
    50  	return m.validate(true)
    51  }
    52  
    53  func (m *UpdateTryjobTask) validate(all bool) error {
    54  	if m == nil {
    55  		return nil
    56  	}
    57  
    58  	var errors []error
    59  
    60  	// no validation rules for Id
    61  
    62  	// no validation rules for ExternalId
    63  
    64  	if len(errors) > 0 {
    65  		return UpdateTryjobTaskMultiError(errors)
    66  	}
    67  
    68  	return nil
    69  }
    70  
    71  // UpdateTryjobTaskMultiError is an error wrapping multiple validation errors
    72  // returned by UpdateTryjobTask.ValidateAll() if the designated constraints
    73  // aren't met.
    74  type UpdateTryjobTaskMultiError []error
    75  
    76  // Error returns a concatenation of all the error messages it wraps.
    77  func (m UpdateTryjobTaskMultiError) Error() string {
    78  	var msgs []string
    79  	for _, err := range m {
    80  		msgs = append(msgs, err.Error())
    81  	}
    82  	return strings.Join(msgs, "; ")
    83  }
    84  
    85  // AllErrors returns a list of validation violation errors.
    86  func (m UpdateTryjobTaskMultiError) AllErrors() []error { return m }
    87  
    88  // UpdateTryjobTaskValidationError is the validation error returned by
    89  // UpdateTryjobTask.Validate if the designated constraints aren't met.
    90  type UpdateTryjobTaskValidationError struct {
    91  	field  string
    92  	reason string
    93  	cause  error
    94  	key    bool
    95  }
    96  
    97  // Field function returns field value.
    98  func (e UpdateTryjobTaskValidationError) Field() string { return e.field }
    99  
   100  // Reason function returns reason value.
   101  func (e UpdateTryjobTaskValidationError) Reason() string { return e.reason }
   102  
   103  // Cause function returns cause value.
   104  func (e UpdateTryjobTaskValidationError) Cause() error { return e.cause }
   105  
   106  // Key function returns key value.
   107  func (e UpdateTryjobTaskValidationError) Key() bool { return e.key }
   108  
   109  // ErrorName returns error name.
   110  func (e UpdateTryjobTaskValidationError) ErrorName() string { return "UpdateTryjobTaskValidationError" }
   111  
   112  // Error satisfies the builtin error interface
   113  func (e UpdateTryjobTaskValidationError) Error() string {
   114  	cause := ""
   115  	if e.cause != nil {
   116  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   117  	}
   118  
   119  	key := ""
   120  	if e.key {
   121  		key = "key for "
   122  	}
   123  
   124  	return fmt.Sprintf(
   125  		"invalid %sUpdateTryjobTask.%s: %s%s",
   126  		key,
   127  		e.field,
   128  		e.reason,
   129  		cause)
   130  }
   131  
   132  var _ error = UpdateTryjobTaskValidationError{}
   133  
   134  var _ interface {
   135  	Field() string
   136  	Reason() string
   137  	Key() bool
   138  	Cause() error
   139  	ErrorName() string
   140  } = UpdateTryjobTaskValidationError{}
   141  
   142  // Validate checks the field values on CancelStaleTryjobsTask with the rules
   143  // defined in the proto definition for this message. If any rules are
   144  // violated, the first error encountered is returned, or nil if there are no violations.
   145  func (m *CancelStaleTryjobsTask) Validate() error {
   146  	return m.validate(false)
   147  }
   148  
   149  // ValidateAll checks the field values on CancelStaleTryjobsTask with the rules
   150  // defined in the proto definition for this message. If any rules are
   151  // violated, the result is a list of violation errors wrapped in
   152  // CancelStaleTryjobsTaskMultiError, or nil if none found.
   153  func (m *CancelStaleTryjobsTask) ValidateAll() error {
   154  	return m.validate(true)
   155  }
   156  
   157  func (m *CancelStaleTryjobsTask) validate(all bool) error {
   158  	if m == nil {
   159  		return nil
   160  	}
   161  
   162  	var errors []error
   163  
   164  	// no validation rules for Clid
   165  
   166  	// no validation rules for PreviousMinEquivPatchset
   167  
   168  	// no validation rules for CurrentMinEquivPatchset
   169  
   170  	if len(errors) > 0 {
   171  		return CancelStaleTryjobsTaskMultiError(errors)
   172  	}
   173  
   174  	return nil
   175  }
   176  
   177  // CancelStaleTryjobsTaskMultiError is an error wrapping multiple validation
   178  // errors returned by CancelStaleTryjobsTask.ValidateAll() if the designated
   179  // constraints aren't met.
   180  type CancelStaleTryjobsTaskMultiError []error
   181  
   182  // Error returns a concatenation of all the error messages it wraps.
   183  func (m CancelStaleTryjobsTaskMultiError) Error() string {
   184  	var msgs []string
   185  	for _, err := range m {
   186  		msgs = append(msgs, err.Error())
   187  	}
   188  	return strings.Join(msgs, "; ")
   189  }
   190  
   191  // AllErrors returns a list of validation violation errors.
   192  func (m CancelStaleTryjobsTaskMultiError) AllErrors() []error { return m }
   193  
   194  // CancelStaleTryjobsTaskValidationError is the validation error returned by
   195  // CancelStaleTryjobsTask.Validate if the designated constraints aren't met.
   196  type CancelStaleTryjobsTaskValidationError struct {
   197  	field  string
   198  	reason string
   199  	cause  error
   200  	key    bool
   201  }
   202  
   203  // Field function returns field value.
   204  func (e CancelStaleTryjobsTaskValidationError) Field() string { return e.field }
   205  
   206  // Reason function returns reason value.
   207  func (e CancelStaleTryjobsTaskValidationError) Reason() string { return e.reason }
   208  
   209  // Cause function returns cause value.
   210  func (e CancelStaleTryjobsTaskValidationError) Cause() error { return e.cause }
   211  
   212  // Key function returns key value.
   213  func (e CancelStaleTryjobsTaskValidationError) Key() bool { return e.key }
   214  
   215  // ErrorName returns error name.
   216  func (e CancelStaleTryjobsTaskValidationError) ErrorName() string {
   217  	return "CancelStaleTryjobsTaskValidationError"
   218  }
   219  
   220  // Error satisfies the builtin error interface
   221  func (e CancelStaleTryjobsTaskValidationError) Error() string {
   222  	cause := ""
   223  	if e.cause != nil {
   224  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   225  	}
   226  
   227  	key := ""
   228  	if e.key {
   229  		key = "key for "
   230  	}
   231  
   232  	return fmt.Sprintf(
   233  		"invalid %sCancelStaleTryjobsTask.%s: %s%s",
   234  		key,
   235  		e.field,
   236  		e.reason,
   237  		cause)
   238  }
   239  
   240  var _ error = CancelStaleTryjobsTaskValidationError{}
   241  
   242  var _ interface {
   243  	Field() string
   244  	Reason() string
   245  	Key() bool
   246  	Cause() error
   247  	ErrorName() string
   248  } = CancelStaleTryjobsTaskValidationError{}
   249  
   250  // Validate checks the field values on ExecuteTryjobsPayload with the rules
   251  // defined in the proto definition for this message. If any rules are
   252  // violated, the first error encountered is returned, or nil if there are no violations.
   253  func (m *ExecuteTryjobsPayload) Validate() error {
   254  	return m.validate(false)
   255  }
   256  
   257  // ValidateAll checks the field values on ExecuteTryjobsPayload with the rules
   258  // defined in the proto definition for this message. If any rules are
   259  // violated, the result is a list of violation errors wrapped in
   260  // ExecuteTryjobsPayloadMultiError, or nil if none found.
   261  func (m *ExecuteTryjobsPayload) ValidateAll() error {
   262  	return m.validate(true)
   263  }
   264  
   265  func (m *ExecuteTryjobsPayload) validate(all bool) error {
   266  	if m == nil {
   267  		return nil
   268  	}
   269  
   270  	var errors []error
   271  
   272  	// no validation rules for RequirementChanged
   273  
   274  	if len(errors) > 0 {
   275  		return ExecuteTryjobsPayloadMultiError(errors)
   276  	}
   277  
   278  	return nil
   279  }
   280  
   281  // ExecuteTryjobsPayloadMultiError is an error wrapping multiple validation
   282  // errors returned by ExecuteTryjobsPayload.ValidateAll() if the designated
   283  // constraints aren't met.
   284  type ExecuteTryjobsPayloadMultiError []error
   285  
   286  // Error returns a concatenation of all the error messages it wraps.
   287  func (m ExecuteTryjobsPayloadMultiError) Error() string {
   288  	var msgs []string
   289  	for _, err := range m {
   290  		msgs = append(msgs, err.Error())
   291  	}
   292  	return strings.Join(msgs, "; ")
   293  }
   294  
   295  // AllErrors returns a list of validation violation errors.
   296  func (m ExecuteTryjobsPayloadMultiError) AllErrors() []error { return m }
   297  
   298  // ExecuteTryjobsPayloadValidationError is the validation error returned by
   299  // ExecuteTryjobsPayload.Validate if the designated constraints aren't met.
   300  type ExecuteTryjobsPayloadValidationError struct {
   301  	field  string
   302  	reason string
   303  	cause  error
   304  	key    bool
   305  }
   306  
   307  // Field function returns field value.
   308  func (e ExecuteTryjobsPayloadValidationError) Field() string { return e.field }
   309  
   310  // Reason function returns reason value.
   311  func (e ExecuteTryjobsPayloadValidationError) Reason() string { return e.reason }
   312  
   313  // Cause function returns cause value.
   314  func (e ExecuteTryjobsPayloadValidationError) Cause() error { return e.cause }
   315  
   316  // Key function returns key value.
   317  func (e ExecuteTryjobsPayloadValidationError) Key() bool { return e.key }
   318  
   319  // ErrorName returns error name.
   320  func (e ExecuteTryjobsPayloadValidationError) ErrorName() string {
   321  	return "ExecuteTryjobsPayloadValidationError"
   322  }
   323  
   324  // Error satisfies the builtin error interface
   325  func (e ExecuteTryjobsPayloadValidationError) Error() string {
   326  	cause := ""
   327  	if e.cause != nil {
   328  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   329  	}
   330  
   331  	key := ""
   332  	if e.key {
   333  		key = "key for "
   334  	}
   335  
   336  	return fmt.Sprintf(
   337  		"invalid %sExecuteTryjobsPayload.%s: %s%s",
   338  		key,
   339  		e.field,
   340  		e.reason,
   341  		cause)
   342  }
   343  
   344  var _ error = ExecuteTryjobsPayloadValidationError{}
   345  
   346  var _ interface {
   347  	Field() string
   348  	Reason() string
   349  	Key() bool
   350  	Cause() error
   351  	ErrorName() string
   352  } = ExecuteTryjobsPayloadValidationError{}
   353  
   354  // Validate checks the field values on ExecuteTryjobsResult with the rules
   355  // defined in the proto definition for this message. If any rules are
   356  // violated, the first error encountered is returned, or nil if there are no violations.
   357  func (m *ExecuteTryjobsResult) Validate() error {
   358  	return m.validate(false)
   359  }
   360  
   361  // ValidateAll checks the field values on ExecuteTryjobsResult with the rules
   362  // defined in the proto definition for this message. If any rules are
   363  // violated, the result is a list of violation errors wrapped in
   364  // ExecuteTryjobsResultMultiError, or nil if none found.
   365  func (m *ExecuteTryjobsResult) ValidateAll() error {
   366  	return m.validate(true)
   367  }
   368  
   369  func (m *ExecuteTryjobsResult) validate(all bool) error {
   370  	if m == nil {
   371  		return nil
   372  	}
   373  
   374  	var errors []error
   375  
   376  	if len(errors) > 0 {
   377  		return ExecuteTryjobsResultMultiError(errors)
   378  	}
   379  
   380  	return nil
   381  }
   382  
   383  // ExecuteTryjobsResultMultiError is an error wrapping multiple validation
   384  // errors returned by ExecuteTryjobsResult.ValidateAll() if the designated
   385  // constraints aren't met.
   386  type ExecuteTryjobsResultMultiError []error
   387  
   388  // Error returns a concatenation of all the error messages it wraps.
   389  func (m ExecuteTryjobsResultMultiError) Error() string {
   390  	var msgs []string
   391  	for _, err := range m {
   392  		msgs = append(msgs, err.Error())
   393  	}
   394  	return strings.Join(msgs, "; ")
   395  }
   396  
   397  // AllErrors returns a list of validation violation errors.
   398  func (m ExecuteTryjobsResultMultiError) AllErrors() []error { return m }
   399  
   400  // ExecuteTryjobsResultValidationError is the validation error returned by
   401  // ExecuteTryjobsResult.Validate if the designated constraints aren't met.
   402  type ExecuteTryjobsResultValidationError struct {
   403  	field  string
   404  	reason string
   405  	cause  error
   406  	key    bool
   407  }
   408  
   409  // Field function returns field value.
   410  func (e ExecuteTryjobsResultValidationError) Field() string { return e.field }
   411  
   412  // Reason function returns reason value.
   413  func (e ExecuteTryjobsResultValidationError) Reason() string { return e.reason }
   414  
   415  // Cause function returns cause value.
   416  func (e ExecuteTryjobsResultValidationError) Cause() error { return e.cause }
   417  
   418  // Key function returns key value.
   419  func (e ExecuteTryjobsResultValidationError) Key() bool { return e.key }
   420  
   421  // ErrorName returns error name.
   422  func (e ExecuteTryjobsResultValidationError) ErrorName() string {
   423  	return "ExecuteTryjobsResultValidationError"
   424  }
   425  
   426  // Error satisfies the builtin error interface
   427  func (e ExecuteTryjobsResultValidationError) Error() string {
   428  	cause := ""
   429  	if e.cause != nil {
   430  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   431  	}
   432  
   433  	key := ""
   434  	if e.key {
   435  		key = "key for "
   436  	}
   437  
   438  	return fmt.Sprintf(
   439  		"invalid %sExecuteTryjobsResult.%s: %s%s",
   440  		key,
   441  		e.field,
   442  		e.reason,
   443  		cause)
   444  }
   445  
   446  var _ error = ExecuteTryjobsResultValidationError{}
   447  
   448  var _ interface {
   449  	Field() string
   450  	Reason() string
   451  	Key() bool
   452  	Cause() error
   453  	ErrorName() string
   454  } = ExecuteTryjobsResultValidationError{}