github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/time_serie/time_serie.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/monitoring/proto/v4/time_serie.proto
     3  // DO NOT EDIT!!!
     4  
     5  package time_serie
     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  	common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common"
    24  	metric_descriptor "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/metric_descriptor"
    25  )
    26  
    27  var (
    28  	_ = bytes.Equal
    29  	_ = errors.New
    30  	_ = fmt.Errorf
    31  	_ = net.ParseIP
    32  	_ = regexp.Match
    33  	_ = strings.Split
    34  	_ = time.Now
    35  	_ = utf8.RuneCountInString
    36  	_ = url.Parse
    37  	_ = gotenvalidate.NewValidationError
    38  )
    39  
    40  // make sure we're using proto imports
    41  var (
    42  	_ = &common.LabelDescriptor{}
    43  	_ = &metric_descriptor.MetricDescriptor{}
    44  )
    45  
    46  func (obj *Point) GotenValidate() error {
    47  	if obj == nil {
    48  		return nil
    49  	}
    50  	if subobj, ok := interface{}(obj.Interval).(gotenvalidate.Validator); ok {
    51  		if err := subobj.GotenValidate(); err != nil {
    52  			return gotenvalidate.NewValidationError("Point", "interval", obj.Interval, "nested object validation failed", err)
    53  		}
    54  	}
    55  	if subobj, ok := interface{}(obj.Value).(gotenvalidate.Validator); ok {
    56  		if err := subobj.GotenValidate(); err != nil {
    57  			return gotenvalidate.NewValidationError("Point", "value", obj.Value, "nested object validation failed", err)
    58  		}
    59  	}
    60  	if subobj, ok := interface{}(obj.Aggregation).(gotenvalidate.Validator); ok {
    61  		if err := subobj.GotenValidate(); err != nil {
    62  			return gotenvalidate.NewValidationError("Point", "aggregation", obj.Aggregation, "nested object validation failed", err)
    63  		}
    64  	}
    65  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    66  		return cvobj.GotenCustomValidate()
    67  	}
    68  	return nil
    69  }
    70  func (obj *TimeSerie) GotenValidate() error {
    71  	if obj == nil {
    72  		return nil
    73  	}
    74  	if subobj, ok := interface{}(obj.Metric).(gotenvalidate.Validator); ok {
    75  		if err := subobj.GotenValidate(); err != nil {
    76  			return gotenvalidate.NewValidationError("TimeSerie", "metric", obj.Metric, "nested object validation failed", err)
    77  		}
    78  	}
    79  	if subobj, ok := interface{}(obj.Resource).(gotenvalidate.Validator); ok {
    80  		if err := subobj.GotenValidate(); err != nil {
    81  			return gotenvalidate.NewValidationError("TimeSerie", "resource", obj.Resource, "nested object validation failed", err)
    82  		}
    83  	}
    84  	for idx, elem := range obj.Points {
    85  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    86  			if err := subobj.GotenValidate(); err != nil {
    87  				return gotenvalidate.NewValidationError("TimeSerie", "points", obj.Points[idx], "nested object validation failed", err)
    88  			}
    89  		}
    90  	}
    91  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    92  		return cvobj.GotenCustomValidate()
    93  	}
    94  	return nil
    95  }
    96  func (obj *BulkTimeSeries) GotenValidate() error {
    97  	if obj == nil {
    98  		return nil
    99  	}
   100  	for idx, elem := range obj.TimeSeries {
   101  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   102  			if err := subobj.GotenValidate(); err != nil {
   103  				return gotenvalidate.NewValidationError("BulkTimeSeries", "timeSeries", obj.TimeSeries[idx], "nested object validation failed", err)
   104  			}
   105  		}
   106  	}
   107  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   108  		return cvobj.GotenCustomValidate()
   109  	}
   110  	return nil
   111  }