github.com/cloudwan/edgelq-sdk@v1.15.4/limits/resources/v1alpha2/plan_assignment/plan_assignment.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/limits/proto/v1alpha2/plan_assignment.proto 3 // DO NOT EDIT!!! 4 5 package plan_assignment 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 iam_organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/organization" 24 iam_project "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/project" 25 accepted_plan "github.com/cloudwan/edgelq-sdk/limits/resources/v1alpha2/accepted_plan" 26 common "github.com/cloudwan/edgelq-sdk/limits/resources/v1alpha2/common" 27 plan "github.com/cloudwan/edgelq-sdk/limits/resources/v1alpha2/plan" 28 meta_service "github.com/cloudwan/edgelq-sdk/meta/resources/v1alpha2/service" 29 meta "github.com/cloudwan/goten-sdk/types/meta" 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 _ = &iam_organization.Organization{} 48 _ = &iam_project.Project{} 49 _ = &accepted_plan.AcceptedPlan{} 50 _ = &common.Allowance{} 51 _ = &plan.Plan{} 52 _ = &meta_service.Service{} 53 _ = &meta.Meta{} 54 ) 55 56 func (obj *PlanAssignment) GotenValidate() error { 57 if obj == nil { 58 return nil 59 } 60 for idx, elem := range obj.Extensions { 61 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 62 if err := subobj.GotenValidate(); err != nil { 63 return gotenvalidate.NewValidationError("PlanAssignment", "extensions", obj.Extensions[idx], "nested object validation failed", err) 64 } 65 } 66 } 67 for idx, elem := range obj.RegionalDistributions { 68 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 69 if err := subobj.GotenValidate(); err != nil { 70 return gotenvalidate.NewValidationError("PlanAssignment", "regionalDistributions", obj.RegionalDistributions[idx], "nested object validation failed", err) 71 } 72 } 73 } 74 if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok { 75 if err := subobj.GotenValidate(); err != nil { 76 return gotenvalidate.NewValidationError("PlanAssignment", "metadata", obj.Metadata, "nested object validation failed", err) 77 } 78 } 79 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 80 return cvobj.GotenCustomValidate() 81 } 82 return nil 83 }