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

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: go.chromium.org/luci/cv/internal/run/eventpb/events.proto
     3  
     4  package eventpb
     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 Event with the rules defined in the
    39  // proto definition for this message. If any rules are violated, the first
    40  // error encountered is returned, or nil if there are no violations.
    41  func (m *Event) Validate() error {
    42  	return m.validate(false)
    43  }
    44  
    45  // ValidateAll checks the field values on Event with the rules defined in the
    46  // proto definition for this message. If any rules are violated, the result is
    47  // a list of violation errors wrapped in EventMultiError, or nil if none found.
    48  func (m *Event) ValidateAll() error {
    49  	return m.validate(true)
    50  }
    51  
    52  func (m *Event) validate(all bool) error {
    53  	if m == nil {
    54  		return nil
    55  	}
    56  
    57  	var errors []error
    58  
    59  	if all {
    60  		switch v := interface{}(m.GetProcessAfter()).(type) {
    61  		case interface{ ValidateAll() error }:
    62  			if err := v.ValidateAll(); err != nil {
    63  				errors = append(errors, EventValidationError{
    64  					field:  "ProcessAfter",
    65  					reason: "embedded message failed validation",
    66  					cause:  err,
    67  				})
    68  			}
    69  		case interface{ Validate() error }:
    70  			if err := v.Validate(); err != nil {
    71  				errors = append(errors, EventValidationError{
    72  					field:  "ProcessAfter",
    73  					reason: "embedded message failed validation",
    74  					cause:  err,
    75  				})
    76  			}
    77  		}
    78  	} else if v, ok := interface{}(m.GetProcessAfter()).(interface{ Validate() error }); ok {
    79  		if err := v.Validate(); err != nil {
    80  			return EventValidationError{
    81  				field:  "ProcessAfter",
    82  				reason: "embedded message failed validation",
    83  				cause:  err,
    84  			}
    85  		}
    86  	}
    87  
    88  	switch v := m.Event.(type) {
    89  	case *Event_Start:
    90  		if v == nil {
    91  			err := EventValidationError{
    92  				field:  "Event",
    93  				reason: "oneof value cannot be a typed-nil",
    94  			}
    95  			if !all {
    96  				return err
    97  			}
    98  			errors = append(errors, err)
    99  		}
   100  
   101  		if all {
   102  			switch v := interface{}(m.GetStart()).(type) {
   103  			case interface{ ValidateAll() error }:
   104  				if err := v.ValidateAll(); err != nil {
   105  					errors = append(errors, EventValidationError{
   106  						field:  "Start",
   107  						reason: "embedded message failed validation",
   108  						cause:  err,
   109  					})
   110  				}
   111  			case interface{ Validate() error }:
   112  				if err := v.Validate(); err != nil {
   113  					errors = append(errors, EventValidationError{
   114  						field:  "Start",
   115  						reason: "embedded message failed validation",
   116  						cause:  err,
   117  					})
   118  				}
   119  			}
   120  		} else if v, ok := interface{}(m.GetStart()).(interface{ Validate() error }); ok {
   121  			if err := v.Validate(); err != nil {
   122  				return EventValidationError{
   123  					field:  "Start",
   124  					reason: "embedded message failed validation",
   125  					cause:  err,
   126  				}
   127  			}
   128  		}
   129  
   130  	case *Event_Cancel:
   131  		if v == nil {
   132  			err := EventValidationError{
   133  				field:  "Event",
   134  				reason: "oneof value cannot be a typed-nil",
   135  			}
   136  			if !all {
   137  				return err
   138  			}
   139  			errors = append(errors, err)
   140  		}
   141  
   142  		if all {
   143  			switch v := interface{}(m.GetCancel()).(type) {
   144  			case interface{ ValidateAll() error }:
   145  				if err := v.ValidateAll(); err != nil {
   146  					errors = append(errors, EventValidationError{
   147  						field:  "Cancel",
   148  						reason: "embedded message failed validation",
   149  						cause:  err,
   150  					})
   151  				}
   152  			case interface{ Validate() error }:
   153  				if err := v.Validate(); err != nil {
   154  					errors = append(errors, EventValidationError{
   155  						field:  "Cancel",
   156  						reason: "embedded message failed validation",
   157  						cause:  err,
   158  					})
   159  				}
   160  			}
   161  		} else if v, ok := interface{}(m.GetCancel()).(interface{ Validate() error }); ok {
   162  			if err := v.Validate(); err != nil {
   163  				return EventValidationError{
   164  					field:  "Cancel",
   165  					reason: "embedded message failed validation",
   166  					cause:  err,
   167  				}
   168  			}
   169  		}
   170  
   171  	case *Event_Poke:
   172  		if v == nil {
   173  			err := EventValidationError{
   174  				field:  "Event",
   175  				reason: "oneof value cannot be a typed-nil",
   176  			}
   177  			if !all {
   178  				return err
   179  			}
   180  			errors = append(errors, err)
   181  		}
   182  
   183  		if all {
   184  			switch v := interface{}(m.GetPoke()).(type) {
   185  			case interface{ ValidateAll() error }:
   186  				if err := v.ValidateAll(); err != nil {
   187  					errors = append(errors, EventValidationError{
   188  						field:  "Poke",
   189  						reason: "embedded message failed validation",
   190  						cause:  err,
   191  					})
   192  				}
   193  			case interface{ Validate() error }:
   194  				if err := v.Validate(); err != nil {
   195  					errors = append(errors, EventValidationError{
   196  						field:  "Poke",
   197  						reason: "embedded message failed validation",
   198  						cause:  err,
   199  					})
   200  				}
   201  			}
   202  		} else if v, ok := interface{}(m.GetPoke()).(interface{ Validate() error }); ok {
   203  			if err := v.Validate(); err != nil {
   204  				return EventValidationError{
   205  					field:  "Poke",
   206  					reason: "embedded message failed validation",
   207  					cause:  err,
   208  				}
   209  			}
   210  		}
   211  
   212  	case *Event_NewConfig:
   213  		if v == nil {
   214  			err := EventValidationError{
   215  				field:  "Event",
   216  				reason: "oneof value cannot be a typed-nil",
   217  			}
   218  			if !all {
   219  				return err
   220  			}
   221  			errors = append(errors, err)
   222  		}
   223  
   224  		if all {
   225  			switch v := interface{}(m.GetNewConfig()).(type) {
   226  			case interface{ ValidateAll() error }:
   227  				if err := v.ValidateAll(); err != nil {
   228  					errors = append(errors, EventValidationError{
   229  						field:  "NewConfig",
   230  						reason: "embedded message failed validation",
   231  						cause:  err,
   232  					})
   233  				}
   234  			case interface{ Validate() error }:
   235  				if err := v.Validate(); err != nil {
   236  					errors = append(errors, EventValidationError{
   237  						field:  "NewConfig",
   238  						reason: "embedded message failed validation",
   239  						cause:  err,
   240  					})
   241  				}
   242  			}
   243  		} else if v, ok := interface{}(m.GetNewConfig()).(interface{ Validate() error }); ok {
   244  			if err := v.Validate(); err != nil {
   245  				return EventValidationError{
   246  					field:  "NewConfig",
   247  					reason: "embedded message failed validation",
   248  					cause:  err,
   249  				}
   250  			}
   251  		}
   252  
   253  	case *Event_ClsUpdated:
   254  		if v == nil {
   255  			err := EventValidationError{
   256  				field:  "Event",
   257  				reason: "oneof value cannot be a typed-nil",
   258  			}
   259  			if !all {
   260  				return err
   261  			}
   262  			errors = append(errors, err)
   263  		}
   264  
   265  		if all {
   266  			switch v := interface{}(m.GetClsUpdated()).(type) {
   267  			case interface{ ValidateAll() error }:
   268  				if err := v.ValidateAll(); err != nil {
   269  					errors = append(errors, EventValidationError{
   270  						field:  "ClsUpdated",
   271  						reason: "embedded message failed validation",
   272  						cause:  err,
   273  					})
   274  				}
   275  			case interface{ Validate() error }:
   276  				if err := v.Validate(); err != nil {
   277  					errors = append(errors, EventValidationError{
   278  						field:  "ClsUpdated",
   279  						reason: "embedded message failed validation",
   280  						cause:  err,
   281  					})
   282  				}
   283  			}
   284  		} else if v, ok := interface{}(m.GetClsUpdated()).(interface{ Validate() error }); ok {
   285  			if err := v.Validate(); err != nil {
   286  				return EventValidationError{
   287  					field:  "ClsUpdated",
   288  					reason: "embedded message failed validation",
   289  					cause:  err,
   290  				}
   291  			}
   292  		}
   293  
   294  	case *Event_ReadyForSubmission:
   295  		if v == nil {
   296  			err := EventValidationError{
   297  				field:  "Event",
   298  				reason: "oneof value cannot be a typed-nil",
   299  			}
   300  			if !all {
   301  				return err
   302  			}
   303  			errors = append(errors, err)
   304  		}
   305  
   306  		if all {
   307  			switch v := interface{}(m.GetReadyForSubmission()).(type) {
   308  			case interface{ ValidateAll() error }:
   309  				if err := v.ValidateAll(); err != nil {
   310  					errors = append(errors, EventValidationError{
   311  						field:  "ReadyForSubmission",
   312  						reason: "embedded message failed validation",
   313  						cause:  err,
   314  					})
   315  				}
   316  			case interface{ Validate() error }:
   317  				if err := v.Validate(); err != nil {
   318  					errors = append(errors, EventValidationError{
   319  						field:  "ReadyForSubmission",
   320  						reason: "embedded message failed validation",
   321  						cause:  err,
   322  					})
   323  				}
   324  			}
   325  		} else if v, ok := interface{}(m.GetReadyForSubmission()).(interface{ Validate() error }); ok {
   326  			if err := v.Validate(); err != nil {
   327  				return EventValidationError{
   328  					field:  "ReadyForSubmission",
   329  					reason: "embedded message failed validation",
   330  					cause:  err,
   331  				}
   332  			}
   333  		}
   334  
   335  	case *Event_ClsSubmitted:
   336  		if v == nil {
   337  			err := EventValidationError{
   338  				field:  "Event",
   339  				reason: "oneof value cannot be a typed-nil",
   340  			}
   341  			if !all {
   342  				return err
   343  			}
   344  			errors = append(errors, err)
   345  		}
   346  
   347  		if all {
   348  			switch v := interface{}(m.GetClsSubmitted()).(type) {
   349  			case interface{ ValidateAll() error }:
   350  				if err := v.ValidateAll(); err != nil {
   351  					errors = append(errors, EventValidationError{
   352  						field:  "ClsSubmitted",
   353  						reason: "embedded message failed validation",
   354  						cause:  err,
   355  					})
   356  				}
   357  			case interface{ Validate() error }:
   358  				if err := v.Validate(); err != nil {
   359  					errors = append(errors, EventValidationError{
   360  						field:  "ClsSubmitted",
   361  						reason: "embedded message failed validation",
   362  						cause:  err,
   363  					})
   364  				}
   365  			}
   366  		} else if v, ok := interface{}(m.GetClsSubmitted()).(interface{ Validate() error }); ok {
   367  			if err := v.Validate(); err != nil {
   368  				return EventValidationError{
   369  					field:  "ClsSubmitted",
   370  					reason: "embedded message failed validation",
   371  					cause:  err,
   372  				}
   373  			}
   374  		}
   375  
   376  	case *Event_SubmissionCompleted:
   377  		if v == nil {
   378  			err := EventValidationError{
   379  				field:  "Event",
   380  				reason: "oneof value cannot be a typed-nil",
   381  			}
   382  			if !all {
   383  				return err
   384  			}
   385  			errors = append(errors, err)
   386  		}
   387  
   388  		if all {
   389  			switch v := interface{}(m.GetSubmissionCompleted()).(type) {
   390  			case interface{ ValidateAll() error }:
   391  				if err := v.ValidateAll(); err != nil {
   392  					errors = append(errors, EventValidationError{
   393  						field:  "SubmissionCompleted",
   394  						reason: "embedded message failed validation",
   395  						cause:  err,
   396  					})
   397  				}
   398  			case interface{ Validate() error }:
   399  				if err := v.Validate(); err != nil {
   400  					errors = append(errors, EventValidationError{
   401  						field:  "SubmissionCompleted",
   402  						reason: "embedded message failed validation",
   403  						cause:  err,
   404  					})
   405  				}
   406  			}
   407  		} else if v, ok := interface{}(m.GetSubmissionCompleted()).(interface{ Validate() error }); ok {
   408  			if err := v.Validate(); err != nil {
   409  				return EventValidationError{
   410  					field:  "SubmissionCompleted",
   411  					reason: "embedded message failed validation",
   412  					cause:  err,
   413  				}
   414  			}
   415  		}
   416  
   417  	case *Event_LongOpCompleted:
   418  		if v == nil {
   419  			err := EventValidationError{
   420  				field:  "Event",
   421  				reason: "oneof value cannot be a typed-nil",
   422  			}
   423  			if !all {
   424  				return err
   425  			}
   426  			errors = append(errors, err)
   427  		}
   428  
   429  		if all {
   430  			switch v := interface{}(m.GetLongOpCompleted()).(type) {
   431  			case interface{ ValidateAll() error }:
   432  				if err := v.ValidateAll(); err != nil {
   433  					errors = append(errors, EventValidationError{
   434  						field:  "LongOpCompleted",
   435  						reason: "embedded message failed validation",
   436  						cause:  err,
   437  					})
   438  				}
   439  			case interface{ Validate() error }:
   440  				if err := v.Validate(); err != nil {
   441  					errors = append(errors, EventValidationError{
   442  						field:  "LongOpCompleted",
   443  						reason: "embedded message failed validation",
   444  						cause:  err,
   445  					})
   446  				}
   447  			}
   448  		} else if v, ok := interface{}(m.GetLongOpCompleted()).(interface{ Validate() error }); ok {
   449  			if err := v.Validate(); err != nil {
   450  				return EventValidationError{
   451  					field:  "LongOpCompleted",
   452  					reason: "embedded message failed validation",
   453  					cause:  err,
   454  				}
   455  			}
   456  		}
   457  
   458  	case *Event_TryjobsUpdated:
   459  		if v == nil {
   460  			err := EventValidationError{
   461  				field:  "Event",
   462  				reason: "oneof value cannot be a typed-nil",
   463  			}
   464  			if !all {
   465  				return err
   466  			}
   467  			errors = append(errors, err)
   468  		}
   469  
   470  		if all {
   471  			switch v := interface{}(m.GetTryjobsUpdated()).(type) {
   472  			case interface{ ValidateAll() error }:
   473  				if err := v.ValidateAll(); err != nil {
   474  					errors = append(errors, EventValidationError{
   475  						field:  "TryjobsUpdated",
   476  						reason: "embedded message failed validation",
   477  						cause:  err,
   478  					})
   479  				}
   480  			case interface{ Validate() error }:
   481  				if err := v.Validate(); err != nil {
   482  					errors = append(errors, EventValidationError{
   483  						field:  "TryjobsUpdated",
   484  						reason: "embedded message failed validation",
   485  						cause:  err,
   486  					})
   487  				}
   488  			}
   489  		} else if v, ok := interface{}(m.GetTryjobsUpdated()).(interface{ Validate() error }); ok {
   490  			if err := v.Validate(); err != nil {
   491  				return EventValidationError{
   492  					field:  "TryjobsUpdated",
   493  					reason: "embedded message failed validation",
   494  					cause:  err,
   495  				}
   496  			}
   497  		}
   498  
   499  	case *Event_ParentRunCompleted:
   500  		if v == nil {
   501  			err := EventValidationError{
   502  				field:  "Event",
   503  				reason: "oneof value cannot be a typed-nil",
   504  			}
   505  			if !all {
   506  				return err
   507  			}
   508  			errors = append(errors, err)
   509  		}
   510  
   511  		if all {
   512  			switch v := interface{}(m.GetParentRunCompleted()).(type) {
   513  			case interface{ ValidateAll() error }:
   514  				if err := v.ValidateAll(); err != nil {
   515  					errors = append(errors, EventValidationError{
   516  						field:  "ParentRunCompleted",
   517  						reason: "embedded message failed validation",
   518  						cause:  err,
   519  					})
   520  				}
   521  			case interface{ Validate() error }:
   522  				if err := v.Validate(); err != nil {
   523  					errors = append(errors, EventValidationError{
   524  						field:  "ParentRunCompleted",
   525  						reason: "embedded message failed validation",
   526  						cause:  err,
   527  					})
   528  				}
   529  			}
   530  		} else if v, ok := interface{}(m.GetParentRunCompleted()).(interface{ Validate() error }); ok {
   531  			if err := v.Validate(); err != nil {
   532  				return EventValidationError{
   533  					field:  "ParentRunCompleted",
   534  					reason: "embedded message failed validation",
   535  					cause:  err,
   536  				}
   537  			}
   538  		}
   539  
   540  	default:
   541  		_ = v // ensures v is used
   542  	}
   543  
   544  	if len(errors) > 0 {
   545  		return EventMultiError(errors)
   546  	}
   547  
   548  	return nil
   549  }
   550  
   551  // EventMultiError is an error wrapping multiple validation errors returned by
   552  // Event.ValidateAll() if the designated constraints aren't met.
   553  type EventMultiError []error
   554  
   555  // Error returns a concatenation of all the error messages it wraps.
   556  func (m EventMultiError) Error() string {
   557  	var msgs []string
   558  	for _, err := range m {
   559  		msgs = append(msgs, err.Error())
   560  	}
   561  	return strings.Join(msgs, "; ")
   562  }
   563  
   564  // AllErrors returns a list of validation violation errors.
   565  func (m EventMultiError) AllErrors() []error { return m }
   566  
   567  // EventValidationError is the validation error returned by Event.Validate if
   568  // the designated constraints aren't met.
   569  type EventValidationError struct {
   570  	field  string
   571  	reason string
   572  	cause  error
   573  	key    bool
   574  }
   575  
   576  // Field function returns field value.
   577  func (e EventValidationError) Field() string { return e.field }
   578  
   579  // Reason function returns reason value.
   580  func (e EventValidationError) Reason() string { return e.reason }
   581  
   582  // Cause function returns cause value.
   583  func (e EventValidationError) Cause() error { return e.cause }
   584  
   585  // Key function returns key value.
   586  func (e EventValidationError) Key() bool { return e.key }
   587  
   588  // ErrorName returns error name.
   589  func (e EventValidationError) ErrorName() string { return "EventValidationError" }
   590  
   591  // Error satisfies the builtin error interface
   592  func (e EventValidationError) Error() string {
   593  	cause := ""
   594  	if e.cause != nil {
   595  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   596  	}
   597  
   598  	key := ""
   599  	if e.key {
   600  		key = "key for "
   601  	}
   602  
   603  	return fmt.Sprintf(
   604  		"invalid %sEvent.%s: %s%s",
   605  		key,
   606  		e.field,
   607  		e.reason,
   608  		cause)
   609  }
   610  
   611  var _ error = EventValidationError{}
   612  
   613  var _ interface {
   614  	Field() string
   615  	Reason() string
   616  	Key() bool
   617  	Cause() error
   618  	ErrorName() string
   619  } = EventValidationError{}
   620  
   621  // Validate checks the field values on Start with the rules defined in the
   622  // proto definition for this message. If any rules are violated, the first
   623  // error encountered is returned, or nil if there are no violations.
   624  func (m *Start) Validate() error {
   625  	return m.validate(false)
   626  }
   627  
   628  // ValidateAll checks the field values on Start with the rules defined in the
   629  // proto definition for this message. If any rules are violated, the result is
   630  // a list of violation errors wrapped in StartMultiError, or nil if none found.
   631  func (m *Start) ValidateAll() error {
   632  	return m.validate(true)
   633  }
   634  
   635  func (m *Start) validate(all bool) error {
   636  	if m == nil {
   637  		return nil
   638  	}
   639  
   640  	var errors []error
   641  
   642  	if len(errors) > 0 {
   643  		return StartMultiError(errors)
   644  	}
   645  
   646  	return nil
   647  }
   648  
   649  // StartMultiError is an error wrapping multiple validation errors returned by
   650  // Start.ValidateAll() if the designated constraints aren't met.
   651  type StartMultiError []error
   652  
   653  // Error returns a concatenation of all the error messages it wraps.
   654  func (m StartMultiError) Error() string {
   655  	var msgs []string
   656  	for _, err := range m {
   657  		msgs = append(msgs, err.Error())
   658  	}
   659  	return strings.Join(msgs, "; ")
   660  }
   661  
   662  // AllErrors returns a list of validation violation errors.
   663  func (m StartMultiError) AllErrors() []error { return m }
   664  
   665  // StartValidationError is the validation error returned by Start.Validate if
   666  // the designated constraints aren't met.
   667  type StartValidationError struct {
   668  	field  string
   669  	reason string
   670  	cause  error
   671  	key    bool
   672  }
   673  
   674  // Field function returns field value.
   675  func (e StartValidationError) Field() string { return e.field }
   676  
   677  // Reason function returns reason value.
   678  func (e StartValidationError) Reason() string { return e.reason }
   679  
   680  // Cause function returns cause value.
   681  func (e StartValidationError) Cause() error { return e.cause }
   682  
   683  // Key function returns key value.
   684  func (e StartValidationError) Key() bool { return e.key }
   685  
   686  // ErrorName returns error name.
   687  func (e StartValidationError) ErrorName() string { return "StartValidationError" }
   688  
   689  // Error satisfies the builtin error interface
   690  func (e StartValidationError) Error() string {
   691  	cause := ""
   692  	if e.cause != nil {
   693  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   694  	}
   695  
   696  	key := ""
   697  	if e.key {
   698  		key = "key for "
   699  	}
   700  
   701  	return fmt.Sprintf(
   702  		"invalid %sStart.%s: %s%s",
   703  		key,
   704  		e.field,
   705  		e.reason,
   706  		cause)
   707  }
   708  
   709  var _ error = StartValidationError{}
   710  
   711  var _ interface {
   712  	Field() string
   713  	Reason() string
   714  	Key() bool
   715  	Cause() error
   716  	ErrorName() string
   717  } = StartValidationError{}
   718  
   719  // Validate checks the field values on Cancel with the rules defined in the
   720  // proto definition for this message. If any rules are violated, the first
   721  // error encountered is returned, or nil if there are no violations.
   722  func (m *Cancel) Validate() error {
   723  	return m.validate(false)
   724  }
   725  
   726  // ValidateAll checks the field values on Cancel with the rules defined in the
   727  // proto definition for this message. If any rules are violated, the result is
   728  // a list of violation errors wrapped in CancelMultiError, or nil if none found.
   729  func (m *Cancel) ValidateAll() error {
   730  	return m.validate(true)
   731  }
   732  
   733  func (m *Cancel) validate(all bool) error {
   734  	if m == nil {
   735  		return nil
   736  	}
   737  
   738  	var errors []error
   739  
   740  	// no validation rules for Reason
   741  
   742  	if len(errors) > 0 {
   743  		return CancelMultiError(errors)
   744  	}
   745  
   746  	return nil
   747  }
   748  
   749  // CancelMultiError is an error wrapping multiple validation errors returned by
   750  // Cancel.ValidateAll() if the designated constraints aren't met.
   751  type CancelMultiError []error
   752  
   753  // Error returns a concatenation of all the error messages it wraps.
   754  func (m CancelMultiError) Error() string {
   755  	var msgs []string
   756  	for _, err := range m {
   757  		msgs = append(msgs, err.Error())
   758  	}
   759  	return strings.Join(msgs, "; ")
   760  }
   761  
   762  // AllErrors returns a list of validation violation errors.
   763  func (m CancelMultiError) AllErrors() []error { return m }
   764  
   765  // CancelValidationError is the validation error returned by Cancel.Validate if
   766  // the designated constraints aren't met.
   767  type CancelValidationError struct {
   768  	field  string
   769  	reason string
   770  	cause  error
   771  	key    bool
   772  }
   773  
   774  // Field function returns field value.
   775  func (e CancelValidationError) Field() string { return e.field }
   776  
   777  // Reason function returns reason value.
   778  func (e CancelValidationError) Reason() string { return e.reason }
   779  
   780  // Cause function returns cause value.
   781  func (e CancelValidationError) Cause() error { return e.cause }
   782  
   783  // Key function returns key value.
   784  func (e CancelValidationError) Key() bool { return e.key }
   785  
   786  // ErrorName returns error name.
   787  func (e CancelValidationError) ErrorName() string { return "CancelValidationError" }
   788  
   789  // Error satisfies the builtin error interface
   790  func (e CancelValidationError) Error() string {
   791  	cause := ""
   792  	if e.cause != nil {
   793  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   794  	}
   795  
   796  	key := ""
   797  	if e.key {
   798  		key = "key for "
   799  	}
   800  
   801  	return fmt.Sprintf(
   802  		"invalid %sCancel.%s: %s%s",
   803  		key,
   804  		e.field,
   805  		e.reason,
   806  		cause)
   807  }
   808  
   809  var _ error = CancelValidationError{}
   810  
   811  var _ interface {
   812  	Field() string
   813  	Reason() string
   814  	Key() bool
   815  	Cause() error
   816  	ErrorName() string
   817  } = CancelValidationError{}
   818  
   819  // Validate checks the field values on Poke with the rules defined in the proto
   820  // definition for this message. If any rules are violated, the first error
   821  // encountered is returned, or nil if there are no violations.
   822  func (m *Poke) Validate() error {
   823  	return m.validate(false)
   824  }
   825  
   826  // ValidateAll checks the field values on Poke with the rules defined in the
   827  // proto definition for this message. If any rules are violated, the result is
   828  // a list of violation errors wrapped in PokeMultiError, or nil if none found.
   829  func (m *Poke) ValidateAll() error {
   830  	return m.validate(true)
   831  }
   832  
   833  func (m *Poke) validate(all bool) error {
   834  	if m == nil {
   835  		return nil
   836  	}
   837  
   838  	var errors []error
   839  
   840  	if len(errors) > 0 {
   841  		return PokeMultiError(errors)
   842  	}
   843  
   844  	return nil
   845  }
   846  
   847  // PokeMultiError is an error wrapping multiple validation errors returned by
   848  // Poke.ValidateAll() if the designated constraints aren't met.
   849  type PokeMultiError []error
   850  
   851  // Error returns a concatenation of all the error messages it wraps.
   852  func (m PokeMultiError) Error() string {
   853  	var msgs []string
   854  	for _, err := range m {
   855  		msgs = append(msgs, err.Error())
   856  	}
   857  	return strings.Join(msgs, "; ")
   858  }
   859  
   860  // AllErrors returns a list of validation violation errors.
   861  func (m PokeMultiError) AllErrors() []error { return m }
   862  
   863  // PokeValidationError is the validation error returned by Poke.Validate if the
   864  // designated constraints aren't met.
   865  type PokeValidationError struct {
   866  	field  string
   867  	reason string
   868  	cause  error
   869  	key    bool
   870  }
   871  
   872  // Field function returns field value.
   873  func (e PokeValidationError) Field() string { return e.field }
   874  
   875  // Reason function returns reason value.
   876  func (e PokeValidationError) Reason() string { return e.reason }
   877  
   878  // Cause function returns cause value.
   879  func (e PokeValidationError) Cause() error { return e.cause }
   880  
   881  // Key function returns key value.
   882  func (e PokeValidationError) Key() bool { return e.key }
   883  
   884  // ErrorName returns error name.
   885  func (e PokeValidationError) ErrorName() string { return "PokeValidationError" }
   886  
   887  // Error satisfies the builtin error interface
   888  func (e PokeValidationError) Error() string {
   889  	cause := ""
   890  	if e.cause != nil {
   891  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   892  	}
   893  
   894  	key := ""
   895  	if e.key {
   896  		key = "key for "
   897  	}
   898  
   899  	return fmt.Sprintf(
   900  		"invalid %sPoke.%s: %s%s",
   901  		key,
   902  		e.field,
   903  		e.reason,
   904  		cause)
   905  }
   906  
   907  var _ error = PokeValidationError{}
   908  
   909  var _ interface {
   910  	Field() string
   911  	Reason() string
   912  	Key() bool
   913  	Cause() error
   914  	ErrorName() string
   915  } = PokeValidationError{}
   916  
   917  // Validate checks the field values on NewConfig with the rules defined in the
   918  // proto definition for this message. If any rules are violated, the first
   919  // error encountered is returned, or nil if there are no violations.
   920  func (m *NewConfig) Validate() error {
   921  	return m.validate(false)
   922  }
   923  
   924  // ValidateAll checks the field values on NewConfig with the rules defined in
   925  // the proto definition for this message. If any rules are violated, the
   926  // result is a list of violation errors wrapped in NewConfigMultiError, or nil
   927  // if none found.
   928  func (m *NewConfig) ValidateAll() error {
   929  	return m.validate(true)
   930  }
   931  
   932  func (m *NewConfig) validate(all bool) error {
   933  	if m == nil {
   934  		return nil
   935  	}
   936  
   937  	var errors []error
   938  
   939  	// no validation rules for Hash
   940  
   941  	// no validation rules for Eversion
   942  
   943  	if len(errors) > 0 {
   944  		return NewConfigMultiError(errors)
   945  	}
   946  
   947  	return nil
   948  }
   949  
   950  // NewConfigMultiError is an error wrapping multiple validation errors returned
   951  // by NewConfig.ValidateAll() if the designated constraints aren't met.
   952  type NewConfigMultiError []error
   953  
   954  // Error returns a concatenation of all the error messages it wraps.
   955  func (m NewConfigMultiError) Error() string {
   956  	var msgs []string
   957  	for _, err := range m {
   958  		msgs = append(msgs, err.Error())
   959  	}
   960  	return strings.Join(msgs, "; ")
   961  }
   962  
   963  // AllErrors returns a list of validation violation errors.
   964  func (m NewConfigMultiError) AllErrors() []error { return m }
   965  
   966  // NewConfigValidationError is the validation error returned by
   967  // NewConfig.Validate if the designated constraints aren't met.
   968  type NewConfigValidationError struct {
   969  	field  string
   970  	reason string
   971  	cause  error
   972  	key    bool
   973  }
   974  
   975  // Field function returns field value.
   976  func (e NewConfigValidationError) Field() string { return e.field }
   977  
   978  // Reason function returns reason value.
   979  func (e NewConfigValidationError) Reason() string { return e.reason }
   980  
   981  // Cause function returns cause value.
   982  func (e NewConfigValidationError) Cause() error { return e.cause }
   983  
   984  // Key function returns key value.
   985  func (e NewConfigValidationError) Key() bool { return e.key }
   986  
   987  // ErrorName returns error name.
   988  func (e NewConfigValidationError) ErrorName() string { return "NewConfigValidationError" }
   989  
   990  // Error satisfies the builtin error interface
   991  func (e NewConfigValidationError) Error() string {
   992  	cause := ""
   993  	if e.cause != nil {
   994  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   995  	}
   996  
   997  	key := ""
   998  	if e.key {
   999  		key = "key for "
  1000  	}
  1001  
  1002  	return fmt.Sprintf(
  1003  		"invalid %sNewConfig.%s: %s%s",
  1004  		key,
  1005  		e.field,
  1006  		e.reason,
  1007  		cause)
  1008  }
  1009  
  1010  var _ error = NewConfigValidationError{}
  1011  
  1012  var _ interface {
  1013  	Field() string
  1014  	Reason() string
  1015  	Key() bool
  1016  	Cause() error
  1017  	ErrorName() string
  1018  } = NewConfigValidationError{}
  1019  
  1020  // Validate checks the field values on ReadyForSubmission with the rules
  1021  // defined in the proto definition for this message. If any rules are
  1022  // violated, the first error encountered is returned, or nil if there are no violations.
  1023  func (m *ReadyForSubmission) Validate() error {
  1024  	return m.validate(false)
  1025  }
  1026  
  1027  // ValidateAll checks the field values on ReadyForSubmission with the rules
  1028  // defined in the proto definition for this message. If any rules are
  1029  // violated, the result is a list of violation errors wrapped in
  1030  // ReadyForSubmissionMultiError, or nil if none found.
  1031  func (m *ReadyForSubmission) ValidateAll() error {
  1032  	return m.validate(true)
  1033  }
  1034  
  1035  func (m *ReadyForSubmission) validate(all bool) error {
  1036  	if m == nil {
  1037  		return nil
  1038  	}
  1039  
  1040  	var errors []error
  1041  
  1042  	if len(errors) > 0 {
  1043  		return ReadyForSubmissionMultiError(errors)
  1044  	}
  1045  
  1046  	return nil
  1047  }
  1048  
  1049  // ReadyForSubmissionMultiError is an error wrapping multiple validation errors
  1050  // returned by ReadyForSubmission.ValidateAll() if the designated constraints
  1051  // aren't met.
  1052  type ReadyForSubmissionMultiError []error
  1053  
  1054  // Error returns a concatenation of all the error messages it wraps.
  1055  func (m ReadyForSubmissionMultiError) Error() string {
  1056  	var msgs []string
  1057  	for _, err := range m {
  1058  		msgs = append(msgs, err.Error())
  1059  	}
  1060  	return strings.Join(msgs, "; ")
  1061  }
  1062  
  1063  // AllErrors returns a list of validation violation errors.
  1064  func (m ReadyForSubmissionMultiError) AllErrors() []error { return m }
  1065  
  1066  // ReadyForSubmissionValidationError is the validation error returned by
  1067  // ReadyForSubmission.Validate if the designated constraints aren't met.
  1068  type ReadyForSubmissionValidationError struct {
  1069  	field  string
  1070  	reason string
  1071  	cause  error
  1072  	key    bool
  1073  }
  1074  
  1075  // Field function returns field value.
  1076  func (e ReadyForSubmissionValidationError) Field() string { return e.field }
  1077  
  1078  // Reason function returns reason value.
  1079  func (e ReadyForSubmissionValidationError) Reason() string { return e.reason }
  1080  
  1081  // Cause function returns cause value.
  1082  func (e ReadyForSubmissionValidationError) Cause() error { return e.cause }
  1083  
  1084  // Key function returns key value.
  1085  func (e ReadyForSubmissionValidationError) Key() bool { return e.key }
  1086  
  1087  // ErrorName returns error name.
  1088  func (e ReadyForSubmissionValidationError) ErrorName() string {
  1089  	return "ReadyForSubmissionValidationError"
  1090  }
  1091  
  1092  // Error satisfies the builtin error interface
  1093  func (e ReadyForSubmissionValidationError) Error() string {
  1094  	cause := ""
  1095  	if e.cause != nil {
  1096  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1097  	}
  1098  
  1099  	key := ""
  1100  	if e.key {
  1101  		key = "key for "
  1102  	}
  1103  
  1104  	return fmt.Sprintf(
  1105  		"invalid %sReadyForSubmission.%s: %s%s",
  1106  		key,
  1107  		e.field,
  1108  		e.reason,
  1109  		cause)
  1110  }
  1111  
  1112  var _ error = ReadyForSubmissionValidationError{}
  1113  
  1114  var _ interface {
  1115  	Field() string
  1116  	Reason() string
  1117  	Key() bool
  1118  	Cause() error
  1119  	ErrorName() string
  1120  } = ReadyForSubmissionValidationError{}
  1121  
  1122  // Validate checks the field values on ParentRunCompleted with the rules
  1123  // defined in the proto definition for this message. If any rules are
  1124  // violated, the first error encountered is returned, or nil if there are no violations.
  1125  func (m *ParentRunCompleted) Validate() error {
  1126  	return m.validate(false)
  1127  }
  1128  
  1129  // ValidateAll checks the field values on ParentRunCompleted with the rules
  1130  // defined in the proto definition for this message. If any rules are
  1131  // violated, the result is a list of violation errors wrapped in
  1132  // ParentRunCompletedMultiError, or nil if none found.
  1133  func (m *ParentRunCompleted) ValidateAll() error {
  1134  	return m.validate(true)
  1135  }
  1136  
  1137  func (m *ParentRunCompleted) validate(all bool) error {
  1138  	if m == nil {
  1139  		return nil
  1140  	}
  1141  
  1142  	var errors []error
  1143  
  1144  	if len(errors) > 0 {
  1145  		return ParentRunCompletedMultiError(errors)
  1146  	}
  1147  
  1148  	return nil
  1149  }
  1150  
  1151  // ParentRunCompletedMultiError is an error wrapping multiple validation errors
  1152  // returned by ParentRunCompleted.ValidateAll() if the designated constraints
  1153  // aren't met.
  1154  type ParentRunCompletedMultiError []error
  1155  
  1156  // Error returns a concatenation of all the error messages it wraps.
  1157  func (m ParentRunCompletedMultiError) Error() string {
  1158  	var msgs []string
  1159  	for _, err := range m {
  1160  		msgs = append(msgs, err.Error())
  1161  	}
  1162  	return strings.Join(msgs, "; ")
  1163  }
  1164  
  1165  // AllErrors returns a list of validation violation errors.
  1166  func (m ParentRunCompletedMultiError) AllErrors() []error { return m }
  1167  
  1168  // ParentRunCompletedValidationError is the validation error returned by
  1169  // ParentRunCompleted.Validate if the designated constraints aren't met.
  1170  type ParentRunCompletedValidationError struct {
  1171  	field  string
  1172  	reason string
  1173  	cause  error
  1174  	key    bool
  1175  }
  1176  
  1177  // Field function returns field value.
  1178  func (e ParentRunCompletedValidationError) Field() string { return e.field }
  1179  
  1180  // Reason function returns reason value.
  1181  func (e ParentRunCompletedValidationError) Reason() string { return e.reason }
  1182  
  1183  // Cause function returns cause value.
  1184  func (e ParentRunCompletedValidationError) Cause() error { return e.cause }
  1185  
  1186  // Key function returns key value.
  1187  func (e ParentRunCompletedValidationError) Key() bool { return e.key }
  1188  
  1189  // ErrorName returns error name.
  1190  func (e ParentRunCompletedValidationError) ErrorName() string {
  1191  	return "ParentRunCompletedValidationError"
  1192  }
  1193  
  1194  // Error satisfies the builtin error interface
  1195  func (e ParentRunCompletedValidationError) Error() string {
  1196  	cause := ""
  1197  	if e.cause != nil {
  1198  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1199  	}
  1200  
  1201  	key := ""
  1202  	if e.key {
  1203  		key = "key for "
  1204  	}
  1205  
  1206  	return fmt.Sprintf(
  1207  		"invalid %sParentRunCompleted.%s: %s%s",
  1208  		key,
  1209  		e.field,
  1210  		e.reason,
  1211  		cause)
  1212  }
  1213  
  1214  var _ error = ParentRunCompletedValidationError{}
  1215  
  1216  var _ interface {
  1217  	Field() string
  1218  	Reason() string
  1219  	Key() bool
  1220  	Cause() error
  1221  	ErrorName() string
  1222  } = ParentRunCompletedValidationError{}
  1223  
  1224  // Validate checks the field values on CLsSubmitted with the rules defined in
  1225  // the proto definition for this message. If any rules are violated, the first
  1226  // error encountered is returned, or nil if there are no violations.
  1227  func (m *CLsSubmitted) Validate() error {
  1228  	return m.validate(false)
  1229  }
  1230  
  1231  // ValidateAll checks the field values on CLsSubmitted with the rules defined
  1232  // in the proto definition for this message. If any rules are violated, the
  1233  // result is a list of violation errors wrapped in CLsSubmittedMultiError, or
  1234  // nil if none found.
  1235  func (m *CLsSubmitted) ValidateAll() error {
  1236  	return m.validate(true)
  1237  }
  1238  
  1239  func (m *CLsSubmitted) validate(all bool) error {
  1240  	if m == nil {
  1241  		return nil
  1242  	}
  1243  
  1244  	var errors []error
  1245  
  1246  	if len(errors) > 0 {
  1247  		return CLsSubmittedMultiError(errors)
  1248  	}
  1249  
  1250  	return nil
  1251  }
  1252  
  1253  // CLsSubmittedMultiError is an error wrapping multiple validation errors
  1254  // returned by CLsSubmitted.ValidateAll() if the designated constraints aren't met.
  1255  type CLsSubmittedMultiError []error
  1256  
  1257  // Error returns a concatenation of all the error messages it wraps.
  1258  func (m CLsSubmittedMultiError) Error() string {
  1259  	var msgs []string
  1260  	for _, err := range m {
  1261  		msgs = append(msgs, err.Error())
  1262  	}
  1263  	return strings.Join(msgs, "; ")
  1264  }
  1265  
  1266  // AllErrors returns a list of validation violation errors.
  1267  func (m CLsSubmittedMultiError) AllErrors() []error { return m }
  1268  
  1269  // CLsSubmittedValidationError is the validation error returned by
  1270  // CLsSubmitted.Validate if the designated constraints aren't met.
  1271  type CLsSubmittedValidationError struct {
  1272  	field  string
  1273  	reason string
  1274  	cause  error
  1275  	key    bool
  1276  }
  1277  
  1278  // Field function returns field value.
  1279  func (e CLsSubmittedValidationError) Field() string { return e.field }
  1280  
  1281  // Reason function returns reason value.
  1282  func (e CLsSubmittedValidationError) Reason() string { return e.reason }
  1283  
  1284  // Cause function returns cause value.
  1285  func (e CLsSubmittedValidationError) Cause() error { return e.cause }
  1286  
  1287  // Key function returns key value.
  1288  func (e CLsSubmittedValidationError) Key() bool { return e.key }
  1289  
  1290  // ErrorName returns error name.
  1291  func (e CLsSubmittedValidationError) ErrorName() string { return "CLsSubmittedValidationError" }
  1292  
  1293  // Error satisfies the builtin error interface
  1294  func (e CLsSubmittedValidationError) Error() string {
  1295  	cause := ""
  1296  	if e.cause != nil {
  1297  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1298  	}
  1299  
  1300  	key := ""
  1301  	if e.key {
  1302  		key = "key for "
  1303  	}
  1304  
  1305  	return fmt.Sprintf(
  1306  		"invalid %sCLsSubmitted.%s: %s%s",
  1307  		key,
  1308  		e.field,
  1309  		e.reason,
  1310  		cause)
  1311  }
  1312  
  1313  var _ error = CLsSubmittedValidationError{}
  1314  
  1315  var _ interface {
  1316  	Field() string
  1317  	Reason() string
  1318  	Key() bool
  1319  	Cause() error
  1320  	ErrorName() string
  1321  } = CLsSubmittedValidationError{}