github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/client/v4/metric_descriptor/metric_descriptor_service.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/monitoring/proto/v4/metric_descriptor_service.proto
     3  // DO NOT EDIT!!!
     4  
     5  package metric_descriptor_client
     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  	metric_descriptor "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/metric_descriptor"
    24  	project "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/project"
    25  	view "github.com/cloudwan/goten-sdk/types/view"
    26  	watch_type "github.com/cloudwan/goten-sdk/types/watch_type"
    27  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    28  	fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
    29  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
    30  )
    31  
    32  var (
    33  	_ = bytes.Equal
    34  	_ = errors.New
    35  	_ = fmt.Errorf
    36  	_ = net.ParseIP
    37  	_ = regexp.Match
    38  	_ = strings.Split
    39  	_ = time.Now
    40  	_ = utf8.RuneCountInString
    41  	_ = url.Parse
    42  	_ = gotenvalidate.NewValidationError
    43  )
    44  
    45  // make sure we're using proto imports
    46  var (
    47  	_ = &metric_descriptor.MetricDescriptor{}
    48  	_ = &project.Project{}
    49  	_ = &emptypb.Empty{}
    50  	_ = &fieldmaskpb.FieldMask{}
    51  	_ = &timestamppb.Timestamp{}
    52  	_ = view.View(0)
    53  	_ = watch_type.WatchType(0)
    54  )
    55  
    56  func (obj *BatchGetMetricDescriptorsRequest) GotenValidate() error {
    57  	if obj == nil {
    58  		return nil
    59  	}
    60  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    61  		return cvobj.GotenCustomValidate()
    62  	}
    63  	return nil
    64  }
    65  func (obj *BatchGetMetricDescriptorsResponse) GotenValidate() error {
    66  	if obj == nil {
    67  		return nil
    68  	}
    69  	for idx, elem := range obj.MetricDescriptors {
    70  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    71  			if err := subobj.GotenValidate(); err != nil {
    72  				return gotenvalidate.NewValidationError("BatchGetMetricDescriptorsResponse", "metricDescriptors", obj.MetricDescriptors[idx], "nested object validation failed", err)
    73  			}
    74  		}
    75  	}
    76  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    77  		return cvobj.GotenCustomValidate()
    78  	}
    79  	return nil
    80  }
    81  func (obj *WatchMetricDescriptorRequest) GotenValidate() error {
    82  	if obj == nil {
    83  		return nil
    84  	}
    85  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    86  		return cvobj.GotenCustomValidate()
    87  	}
    88  	return nil
    89  }
    90  func (obj *WatchMetricDescriptorResponse) GotenValidate() error {
    91  	if obj == nil {
    92  		return nil
    93  	}
    94  	if subobj, ok := interface{}(obj.Change).(gotenvalidate.Validator); ok {
    95  		if err := subobj.GotenValidate(); err != nil {
    96  			return gotenvalidate.NewValidationError("WatchMetricDescriptorResponse", "change", obj.Change, "nested object validation failed", err)
    97  		}
    98  	}
    99  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   100  		return cvobj.GotenCustomValidate()
   101  	}
   102  	return nil
   103  }
   104  func (obj *WatchMetricDescriptorsRequest) GotenValidate() error {
   105  	if obj == nil {
   106  		return nil
   107  	}
   108  	if !(obj.PageSize >= 0) {
   109  		return gotenvalidate.NewValidationError("WatchMetricDescriptorsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
   110  	}
   111  	if !(obj.MaxChunkSize >= 0 && obj.MaxChunkSize <= 100) {
   112  		return gotenvalidate.NewValidationError("WatchMetricDescriptorsRequest", "maxChunkSize", obj.MaxChunkSize, "field must be in range [0, 100]", nil)
   113  	}
   114  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   115  		return cvobj.GotenCustomValidate()
   116  	}
   117  	return nil
   118  }
   119  func (obj *WatchMetricDescriptorsResponse) GotenValidate() error {
   120  	if obj == nil {
   121  		return nil
   122  	}
   123  	for idx, elem := range obj.MetricDescriptorChanges {
   124  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   125  			if err := subobj.GotenValidate(); err != nil {
   126  				return gotenvalidate.NewValidationError("WatchMetricDescriptorsResponse", "metricDescriptorChanges", obj.MetricDescriptorChanges[idx], "nested object validation failed", err)
   127  			}
   128  		}
   129  	}
   130  	if subobj, ok := interface{}(obj.PageTokenChange).(gotenvalidate.Validator); ok {
   131  		if err := subobj.GotenValidate(); err != nil {
   132  			return gotenvalidate.NewValidationError("WatchMetricDescriptorsResponse", "pageTokenChange", obj.PageTokenChange, "nested object validation failed", err)
   133  		}
   134  	}
   135  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   136  		return cvobj.GotenCustomValidate()
   137  	}
   138  	return nil
   139  }
   140  func (obj *WatchMetricDescriptorsResponse_PageTokenChange) GotenValidate() error {
   141  	if obj == nil {
   142  		return nil
   143  	}
   144  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   145  		return cvobj.GotenCustomValidate()
   146  	}
   147  	return nil
   148  }