github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/client/v3/metric_descriptor/metric_descriptor_custom.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/monitoring/proto/v3/metric_descriptor_custom.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/v3/metric_descriptor" 24 project "github.com/cloudwan/edgelq-sdk/monitoring/resources/v3/project" 25 view "github.com/cloudwan/goten-sdk/types/view" 26 fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 27 ) 28 29 var ( 30 _ = bytes.Equal 31 _ = errors.New 32 _ = fmt.Errorf 33 _ = net.ParseIP 34 _ = regexp.Match 35 _ = strings.Split 36 _ = time.Now 37 _ = utf8.RuneCountInString 38 _ = url.Parse 39 _ = gotenvalidate.NewValidationError 40 ) 41 42 // make sure we're using proto imports 43 var ( 44 _ = &metric_descriptor.MetricDescriptor{} 45 _ = &project.Project{} 46 _ = &fieldmaskpb.FieldMask{} 47 _ = view.View(0) 48 ) 49 50 func (obj *ListMetricDescriptorsRequest) GotenValidate() error { 51 if obj == nil { 52 return nil 53 } 54 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 55 return cvobj.GotenCustomValidate() 56 } 57 return nil 58 } 59 func (obj *ListMetricDescriptorsResponse) GotenValidate() error { 60 if obj == nil { 61 return nil 62 } 63 for idx, elem := range obj.MetricDescriptors { 64 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 65 if err := subobj.GotenValidate(); err != nil { 66 return gotenvalidate.NewValidationError("ListMetricDescriptorsResponse", "metricDescriptors", obj.MetricDescriptors[idx], "nested object validation failed", err) 67 } 68 } 69 } 70 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 71 return cvobj.GotenCustomValidate() 72 } 73 return nil 74 } 75 func (obj *GetMetricDescriptorRequest) GotenValidate() error { 76 if obj == nil { 77 return nil 78 } 79 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 80 return cvobj.GotenCustomValidate() 81 } 82 return nil 83 } 84 func (obj *CreateMetricDescriptorRequest) GotenValidate() error { 85 if obj == nil { 86 return nil 87 } 88 if subobj, ok := interface{}(obj.MetricDescriptor).(gotenvalidate.Validator); ok { 89 if err := subobj.GotenValidate(); err != nil { 90 return gotenvalidate.NewValidationError("CreateMetricDescriptorRequest", "metricDescriptor", obj.MetricDescriptor, "nested object validation failed", err) 91 } 92 } 93 if subobj, ok := interface{}(obj.ResponseMask).(gotenvalidate.Validator); ok { 94 if err := subobj.GotenValidate(); err != nil { 95 return gotenvalidate.NewValidationError("CreateMetricDescriptorRequest", "responseMask", obj.ResponseMask, "nested object validation failed", err) 96 } 97 } 98 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 99 return cvobj.GotenCustomValidate() 100 } 101 return nil 102 } 103 func (obj *CreateMetricDescriptorRequest_ResponseMask) GotenValidate() error { 104 if obj == nil { 105 return nil 106 } 107 switch opt := obj.Masking.(type) { 108 case *CreateMetricDescriptorRequest_ResponseMask_SkipEntireResponseBody: 109 case *CreateMetricDescriptorRequest_ResponseMask_BodyMask: 110 default: 111 _ = opt 112 } 113 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 114 return cvobj.GotenCustomValidate() 115 } 116 return nil 117 } 118 func (obj *UpdateMetricDescriptorRequest) GotenValidate() error { 119 if obj == nil { 120 return nil 121 } 122 if obj.MetricDescriptor == nil { 123 return gotenvalidate.NewValidationError("UpdateMetricDescriptorRequest", "metricDescriptor", obj.MetricDescriptor, "field is required", nil) 124 } 125 if subobj, ok := interface{}(obj.MetricDescriptor).(gotenvalidate.Validator); ok { 126 if err := subobj.GotenValidate(); err != nil { 127 return gotenvalidate.NewValidationError("UpdateMetricDescriptorRequest", "metricDescriptor", obj.MetricDescriptor, "nested object validation failed", err) 128 } 129 } 130 if subobj, ok := interface{}(obj.Cas).(gotenvalidate.Validator); ok { 131 if err := subobj.GotenValidate(); err != nil { 132 return gotenvalidate.NewValidationError("UpdateMetricDescriptorRequest", "cas", obj.Cas, "nested object validation failed", err) 133 } 134 } 135 if subobj, ok := interface{}(obj.ResponseMask).(gotenvalidate.Validator); ok { 136 if err := subobj.GotenValidate(); err != nil { 137 return gotenvalidate.NewValidationError("UpdateMetricDescriptorRequest", "responseMask", obj.ResponseMask, "nested object validation failed", err) 138 } 139 } 140 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 141 return cvobj.GotenCustomValidate() 142 } 143 return nil 144 } 145 func (obj *UpdateMetricDescriptorRequest_CAS) GotenValidate() error { 146 if obj == nil { 147 return nil 148 } 149 if subobj, ok := interface{}(obj.ConditionalState).(gotenvalidate.Validator); ok { 150 if err := subobj.GotenValidate(); err != nil { 151 return gotenvalidate.NewValidationError("CAS", "conditionalState", obj.ConditionalState, "nested object validation failed", err) 152 } 153 } 154 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 155 return cvobj.GotenCustomValidate() 156 } 157 return nil 158 } 159 func (obj *UpdateMetricDescriptorRequest_ResponseMask) GotenValidate() error { 160 if obj == nil { 161 return nil 162 } 163 switch opt := obj.Masking.(type) { 164 case *UpdateMetricDescriptorRequest_ResponseMask_SkipEntireResponseBody: 165 case *UpdateMetricDescriptorRequest_ResponseMask_UpdatedFieldsOnly: 166 case *UpdateMetricDescriptorRequest_ResponseMask_BodyMask: 167 default: 168 _ = opt 169 } 170 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 171 return cvobj.GotenCustomValidate() 172 } 173 return nil 174 } 175 func (obj *DeleteMetricDescriptorRequest) GotenValidate() error { 176 if obj == nil { 177 return nil 178 } 179 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 180 return cvobj.GotenCustomValidate() 181 } 182 return nil 183 }