github.com/cloudwan/edgelq-sdk@v1.15.4/devices/client/v1/device/device_custom.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/devices/proto/v1/device_custom.proto 3 // DO NOT EDIT!!! 4 5 package device_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 api "github.com/cloudwan/edgelq-sdk/common/api" 24 device "github.com/cloudwan/edgelq-sdk/devices/resources/v1/device" 25 project "github.com/cloudwan/edgelq-sdk/devices/resources/v1/project" 26 monitoring_time_serie "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/time_serie" 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 _ = &api.Account{} 47 _ = &device.Device{} 48 _ = &project.Project{} 49 _ = &monitoring_time_serie.Point{} 50 _ = &durationpb.Duration{} 51 _ = ×tamppb.Timestamp{} 52 ) 53 54 func (obj *GetDedicatedEndpointsRequest) GotenValidate() error { 55 if obj == nil { 56 return nil 57 } 58 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 59 return cvobj.GotenCustomValidate() 60 } 61 return nil 62 } 63 func (obj *GetDedicatedEndpointsResponse) GotenValidate() error { 64 if obj == nil { 65 return nil 66 } 67 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 68 return cvobj.GotenCustomValidate() 69 } 70 return nil 71 } 72 func (obj *ProvisionServiceAccountToDeviceRequest) GotenValidate() error { 73 if obj == nil { 74 return nil 75 } 76 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 77 return cvobj.GotenCustomValidate() 78 } 79 return nil 80 } 81 func (obj *ProvisionServiceAccountToDeviceResponse) GotenValidate() error { 82 if obj == nil { 83 return nil 84 } 85 if subobj, ok := interface{}(obj.ServiceAccount).(gotenvalidate.Validator); ok { 86 if err := subobj.GotenValidate(); err != nil { 87 return gotenvalidate.NewValidationError("ProvisionServiceAccountToDeviceResponse", "serviceAccount", obj.ServiceAccount, "nested object validation failed", err) 88 } 89 } 90 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 91 return cvobj.GotenCustomValidate() 92 } 93 return nil 94 } 95 func (obj *RemoveServiceAccountFromDeviceRequest) GotenValidate() error { 96 if obj == nil { 97 return nil 98 } 99 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 100 return cvobj.GotenCustomValidate() 101 } 102 return nil 103 } 104 func (obj *RemoveServiceAccountFromDeviceResponse) GotenValidate() error { 105 if obj == nil { 106 return nil 107 } 108 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 109 return cvobj.GotenCustomValidate() 110 } 111 return nil 112 } 113 func (obj *HeartbeatMsg) GotenValidate() error { 114 if obj == nil { 115 return nil 116 } 117 switch opt := obj.Msg.(type) { 118 case *HeartbeatMsg_Register_: 119 if subobj, ok := interface{}(opt.Register).(gotenvalidate.Validator); ok { 120 if err := subobj.GotenValidate(); err != nil { 121 return gotenvalidate.NewValidationError("HeartbeatMsg", "register", opt.Register, "nested object validation failed", err) 122 } 123 } 124 case *HeartbeatMsg_Heartbeat_: 125 if subobj, ok := interface{}(opt.Heartbeat).(gotenvalidate.Validator); ok { 126 if err := subobj.GotenValidate(); err != nil { 127 return gotenvalidate.NewValidationError("HeartbeatMsg", "heartbeat", opt.Heartbeat, "nested object validation failed", err) 128 } 129 } 130 default: 131 _ = opt 132 } 133 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 134 return cvobj.GotenCustomValidate() 135 } 136 return nil 137 } 138 func (obj *HeartbeatMsg_Register) GotenValidate() error { 139 if obj == nil { 140 return nil 141 } 142 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 143 return cvobj.GotenCustomValidate() 144 } 145 return nil 146 } 147 func (obj *HeartbeatMsg_Heartbeat) GotenValidate() error { 148 if obj == nil { 149 return nil 150 } 151 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 152 return cvobj.GotenCustomValidate() 153 } 154 return nil 155 } 156 func (obj *HeartbeatResponse) GotenValidate() error { 157 if obj == nil { 158 return nil 159 } 160 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 161 return cvobj.GotenCustomValidate() 162 } 163 return nil 164 } 165 func (obj *ReportDeviceMetricsRequest) GotenValidate() error { 166 if obj == nil { 167 return nil 168 } 169 if subobj, ok := interface{}(obj.DeviceMetrics).(gotenvalidate.Validator); ok { 170 if err := subobj.GotenValidate(); err != nil { 171 return gotenvalidate.NewValidationError("ReportDeviceMetricsRequest", "deviceMetrics", obj.DeviceMetrics, "nested object validation failed", err) 172 } 173 } 174 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 175 return cvobj.GotenCustomValidate() 176 } 177 return nil 178 } 179 func (obj *DeviceMetrics) GotenValidate() error { 180 if obj == nil { 181 return nil 182 } 183 if subobj, ok := interface{}(obj.MemoryStats).(gotenvalidate.Validator); ok { 184 if err := subobj.GotenValidate(); err != nil { 185 return gotenvalidate.NewValidationError("DeviceMetrics", "memoryStats", obj.MemoryStats, "nested object validation failed", err) 186 } 187 } 188 for idx, elem := range obj.CpuStats { 189 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 190 if err := subobj.GotenValidate(); err != nil { 191 return gotenvalidate.NewValidationError("DeviceMetrics", "cpuStats", obj.CpuStats[idx], "nested object validation failed", err) 192 } 193 } 194 } 195 for idx, elem := range obj.DiskMetrics { 196 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 197 if err := subobj.GotenValidate(); err != nil { 198 return gotenvalidate.NewValidationError("DeviceMetrics", "diskMetrics", obj.DiskMetrics[idx], "nested object validation failed", err) 199 } 200 } 201 } 202 for idx, elem := range obj.HardwareMetrics { 203 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 204 if err := subobj.GotenValidate(); err != nil { 205 return gotenvalidate.NewValidationError("DeviceMetrics", "hardwareMetrics", obj.HardwareMetrics[idx], "nested object validation failed", err) 206 } 207 } 208 } 209 if subobj, ok := interface{}(obj.PerAntennaSignal).(gotenvalidate.Validator); ok { 210 if err := subobj.GotenValidate(); err != nil { 211 return gotenvalidate.NewValidationError("DeviceMetrics", "perAntennaSignal", obj.PerAntennaSignal, "nested object validation failed", err) 212 } 213 } 214 for idx, elem := range obj.PodMetrics { 215 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 216 if err := subobj.GotenValidate(); err != nil { 217 return gotenvalidate.NewValidationError("DeviceMetrics", "podMetrics", obj.PodMetrics[idx], "nested object validation failed", err) 218 } 219 } 220 } 221 for idx, elem := range obj.DiskLabels { 222 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 223 if err := subobj.GotenValidate(); err != nil { 224 return gotenvalidate.NewValidationError("DeviceMetrics", "diskLabels", obj.DiskLabels[idx], "nested object validation failed", err) 225 } 226 } 227 } 228 for idx, elem := range obj.HardwareMetricsLabels { 229 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 230 if err := subobj.GotenValidate(); err != nil { 231 return gotenvalidate.NewValidationError("DeviceMetrics", "hardwareMetricsLabels", obj.HardwareMetricsLabels[idx], "nested object validation failed", err) 232 } 233 } 234 } 235 for idx, elem := range obj.ModemMetricsLabels { 236 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 237 if err := subobj.GotenValidate(); err != nil { 238 return gotenvalidate.NewValidationError("DeviceMetrics", "modemMetricsLabels", obj.ModemMetricsLabels[idx], "nested object validation failed", err) 239 } 240 } 241 } 242 for idx, elem := range obj.ContainerMetricsLabels { 243 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 244 if err := subobj.GotenValidate(); err != nil { 245 return gotenvalidate.NewValidationError("DeviceMetrics", "containerMetricsLabels", obj.ContainerMetricsLabels[idx], "nested object validation failed", err) 246 } 247 } 248 } 249 for idx, elem := range obj.PodMetricsLabels { 250 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 251 if err := subobj.GotenValidate(); err != nil { 252 return gotenvalidate.NewValidationError("DeviceMetrics", "podMetricsLabels", obj.PodMetricsLabels[idx], "nested object validation failed", err) 253 } 254 } 255 } 256 for idx, elem := range obj.HealthCheckMetricLabels { 257 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 258 if err := subobj.GotenValidate(); err != nil { 259 return gotenvalidate.NewValidationError("DeviceMetrics", "healthCheckMetricLabels", obj.HealthCheckMetricLabels[idx], "nested object validation failed", err) 260 } 261 } 262 } 263 for idx, elem := range obj.InterfaceCounterStartTime { 264 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 265 if err := subobj.GotenValidate(); err != nil { 266 return gotenvalidate.NewValidationError("DeviceMetrics", "interfaceCounterStartTime", obj.InterfaceCounterStartTime[idx], "nested object validation failed", err) 267 } 268 } 269 } 270 for idx, elem := range obj.InterfaceMetrics { 271 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 272 if err := subobj.GotenValidate(); err != nil { 273 return gotenvalidate.NewValidationError("DeviceMetrics", "interfaceMetrics", obj.InterfaceMetrics[idx], "nested object validation failed", err) 274 } 275 } 276 } 277 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 278 return cvobj.GotenCustomValidate() 279 } 280 return nil 281 } 282 func (obj *DeviceMetrics_MemoryStats) GotenValidate() error { 283 if obj == nil { 284 return nil 285 } 286 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 287 return cvobj.GotenCustomValidate() 288 } 289 return nil 290 } 291 func (obj *DeviceMetrics_CpuCoreStats) GotenValidate() error { 292 if obj == nil { 293 return nil 294 } 295 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 296 return cvobj.GotenCustomValidate() 297 } 298 return nil 299 } 300 func (obj *DeviceMetrics_DiskMetricsLabel) GotenValidate() error { 301 if obj == nil { 302 return nil 303 } 304 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 305 return cvobj.GotenCustomValidate() 306 } 307 return nil 308 } 309 func (obj *DeviceMetrics_HardwareMetricsLabel) GotenValidate() error { 310 if obj == nil { 311 return nil 312 } 313 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 314 return cvobj.GotenCustomValidate() 315 } 316 return nil 317 } 318 func (obj *DeviceMetrics_DiskMetric) GotenValidate() error { 319 if obj == nil { 320 return nil 321 } 322 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 323 return cvobj.GotenCustomValidate() 324 } 325 return nil 326 } 327 func (obj *DeviceMetrics_HardwareMetric) GotenValidate() error { 328 if obj == nil { 329 return nil 330 } 331 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 332 return cvobj.GotenCustomValidate() 333 } 334 return nil 335 } 336 func (obj *DeviceMetrics_ModemMetricLabel) GotenValidate() error { 337 if obj == nil { 338 return nil 339 } 340 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 341 return cvobj.GotenCustomValidate() 342 } 343 return nil 344 } 345 func (obj *DeviceMetrics_ModemMetric) GotenValidate() error { 346 if obj == nil { 347 return nil 348 } 349 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 350 return cvobj.GotenCustomValidate() 351 } 352 return nil 353 } 354 func (obj *DeviceMetrics_PerAntennaSignal) GotenValidate() error { 355 if obj == nil { 356 return nil 357 } 358 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 359 return cvobj.GotenCustomValidate() 360 } 361 return nil 362 } 363 func (obj *DeviceMetrics_ContainerMetricLabel) GotenValidate() error { 364 if obj == nil { 365 return nil 366 } 367 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 368 return cvobj.GotenCustomValidate() 369 } 370 return nil 371 } 372 func (obj *DeviceMetrics_ContainerMetric) GotenValidate() error { 373 if obj == nil { 374 return nil 375 } 376 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 377 return cvobj.GotenCustomValidate() 378 } 379 return nil 380 } 381 func (obj *DeviceMetrics_PodMetricLabel) GotenValidate() error { 382 if obj == nil { 383 return nil 384 } 385 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 386 return cvobj.GotenCustomValidate() 387 } 388 return nil 389 } 390 func (obj *DeviceMetrics_PodMetric) GotenValidate() error { 391 if obj == nil { 392 return nil 393 } 394 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 395 return cvobj.GotenCustomValidate() 396 } 397 return nil 398 } 399 func (obj *DeviceMetrics_HealthCheckMetricLabel) GotenValidate() error { 400 if obj == nil { 401 return nil 402 } 403 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 404 return cvobj.GotenCustomValidate() 405 } 406 return nil 407 } 408 func (obj *DeviceMetrics_HealthCheckMetric) GotenValidate() error { 409 if obj == nil { 410 return nil 411 } 412 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 413 return cvobj.GotenCustomValidate() 414 } 415 return nil 416 } 417 func (obj *DeviceMetrics_InterfaceMetric) GotenValidate() error { 418 if obj == nil { 419 return nil 420 } 421 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 422 return cvobj.GotenCustomValidate() 423 } 424 return nil 425 } 426 func (obj *ReportDeviceMetricsResponse) GotenValidate() error { 427 if obj == nil { 428 return nil 429 } 430 for idx, elem := range obj.NewTimeSeriesHeaders { 431 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 432 if err := subobj.GotenValidate(); err != nil { 433 return gotenvalidate.NewValidationError("ReportDeviceMetricsResponse", "newTimeSeriesHeaders", obj.NewTimeSeriesHeaders[idx], "nested object validation failed", err) 434 } 435 } 436 } 437 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 438 return cvobj.GotenCustomValidate() 439 } 440 return nil 441 }