github.com/cloudwan/edgelq-sdk@v1.15.4/alerting/resources/v1/ts_entry/ts_entry.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/alerting/proto/v1/ts_entry.proto
     3  // DO NOT EDIT!!!
     4  
     5  package ts_entry
     6  
     7  import (
     8  	"bytes"
     9  	"errors"
    10  	"fmt"
    11  	"net"
    12  	"net/url"
    13  	"regexp"
    14  	"strings"
    15  	"time"
    16  	"unicode/utf8"
    17  
    18  	gotenvalidate "github.com/cloudwan/goten-sdk/runtime/validate"
    19  )
    20  
    21  // proto imports
    22  import (
    23  	rcommon "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/common"
    24  	ts_condition "github.com/cloudwan/edgelq-sdk/alerting/resources/v1/ts_condition"
    25  	monitoring_common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common"
    26  	meta "github.com/cloudwan/goten-sdk/types/meta"
    27  	durationpb "google.golang.org/protobuf/types/known/durationpb"
    28  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
    29  )
    30  
    31  var (
    32  	_ = bytes.Equal
    33  	_ = errors.New
    34  	_ = fmt.Errorf
    35  	_ = net.ParseIP
    36  	_ = regexp.Match
    37  	_ = strings.Split
    38  	_ = time.Now
    39  	_ = utf8.RuneCountInString
    40  	_ = url.Parse
    41  	_ = gotenvalidate.NewValidationError
    42  )
    43  
    44  // make sure we're using proto imports
    45  var (
    46  	_ = &rcommon.LogCndSpec{}
    47  	_ = &ts_condition.TsCondition{}
    48  	_ = &monitoring_common.LabelDescriptor{}
    49  	_ = &durationpb.Duration{}
    50  	_ = &timestamppb.Timestamp{}
    51  	_ = &meta.Meta{}
    52  )
    53  
    54  func (obj *TsEntry) GotenValidate() error {
    55  	if obj == nil {
    56  		return nil
    57  	}
    58  	if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok {
    59  		if err := subobj.GotenValidate(); err != nil {
    60  			return gotenvalidate.NewValidationError("TsEntry", "metadata", obj.Metadata, "nested object validation failed", err)
    61  		}
    62  	}
    63  	if subobj, ok := interface{}(obj.Info).(gotenvalidate.Validator); ok {
    64  		if err := subobj.GotenValidate(); err != nil {
    65  			return gotenvalidate.NewValidationError("TsEntry", "info", obj.Info, "nested object validation failed", err)
    66  		}
    67  	}
    68  	if subobj, ok := interface{}(obj.State).(gotenvalidate.Validator); ok {
    69  		if err := subobj.GotenValidate(); err != nil {
    70  			return gotenvalidate.NewValidationError("TsEntry", "state", obj.State, "nested object validation failed", err)
    71  		}
    72  	}
    73  	if subobj, ok := interface{}(obj.Internal).(gotenvalidate.Validator); ok {
    74  		if err := subobj.GotenValidate(); err != nil {
    75  			return gotenvalidate.NewValidationError("TsEntry", "internal", obj.Internal, "nested object validation failed", err)
    76  		}
    77  	}
    78  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    79  		return cvobj.GotenCustomValidate()
    80  	}
    81  	return nil
    82  }
    83  func (obj *TsEntry_Info) GotenValidate() error {
    84  	if obj == nil {
    85  		return nil
    86  	}
    87  	if subobj, ok := interface{}(obj.AlertingResource).(gotenvalidate.Validator); ok {
    88  		if err := subobj.GotenValidate(); err != nil {
    89  			return gotenvalidate.NewValidationError("Info", "alertingResource", obj.AlertingResource, "nested object validation failed", err)
    90  		}
    91  	}
    92  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    93  		return cvobj.GotenCustomValidate()
    94  	}
    95  	return nil
    96  }
    97  func (obj *TsEntry_State) GotenValidate() error {
    98  	if obj == nil {
    99  		return nil
   100  	}
   101  	for idx, elem := range obj.Models {
   102  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   103  			if err := subobj.GotenValidate(); err != nil {
   104  				return gotenvalidate.NewValidationError("State", "models", obj.Models[idx], "nested object validation failed", err)
   105  			}
   106  		}
   107  	}
   108  	for idx, elem := range obj.Thresholds {
   109  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   110  			if err := subobj.GotenValidate(); err != nil {
   111  				return gotenvalidate.NewValidationError("State", "thresholds", obj.Thresholds[idx], "nested object validation failed", err)
   112  			}
   113  		}
   114  	}
   115  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   116  		return cvobj.GotenCustomValidate()
   117  	}
   118  	return nil
   119  }
   120  func (obj *TsEntry_Internal) GotenValidate() error {
   121  	if obj == nil {
   122  		return nil
   123  	}
   124  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   125  		return cvobj.GotenCustomValidate()
   126  	}
   127  	return nil
   128  }
   129  func (obj *TsEntry_State_AnomalyModelData) GotenValidate() error {
   130  	if obj == nil {
   131  		return nil
   132  	}
   133  	if subobj, ok := interface{}(obj.TrainingPeriod).(gotenvalidate.Validator); ok {
   134  		if err := subobj.GotenValidate(); err != nil {
   135  			return gotenvalidate.NewValidationError("AnomalyModelData", "trainingPeriod", obj.TrainingPeriod, "nested object validation failed", err)
   136  		}
   137  	}
   138  	for idx, elem := range obj.Sensitiveness {
   139  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   140  			if err := subobj.GotenValidate(); err != nil {
   141  				return gotenvalidate.NewValidationError("AnomalyModelData", "sensitiveness", obj.Sensitiveness[idx], "nested object validation failed", err)
   142  			}
   143  		}
   144  	}
   145  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   146  		return cvobj.GotenCustomValidate()
   147  	}
   148  	return nil
   149  }
   150  func (obj *TsEntry_State_AnomalyModelSensitiveness) GotenValidate() error {
   151  	if obj == nil {
   152  		return nil
   153  	}
   154  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   155  		return cvobj.GotenCustomValidate()
   156  	}
   157  	return nil
   158  }
   159  func (obj *TsEntry_State_AdaptiveThresholdInfo) GotenValidate() error {
   160  	if obj == nil {
   161  		return nil
   162  	}
   163  	if subobj, ok := interface{}(obj.Lower).(gotenvalidate.Validator); ok {
   164  		if err := subobj.GotenValidate(); err != nil {
   165  			return gotenvalidate.NewValidationError("AdaptiveThresholdInfo", "lower", obj.Lower, "nested object validation failed", err)
   166  		}
   167  	}
   168  	if subobj, ok := interface{}(obj.Upper).(gotenvalidate.Validator); ok {
   169  		if err := subobj.GotenValidate(); err != nil {
   170  			return gotenvalidate.NewValidationError("AdaptiveThresholdInfo", "upper", obj.Upper, "nested object validation failed", err)
   171  		}
   172  	}
   173  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   174  		return cvobj.GotenCustomValidate()
   175  	}
   176  	return nil
   177  }